Name

BlochState — Class for calculating a Bloch state

Synopsis

Namespace: NanoLanguage
BlochState(
configuration,
quantum_number,
spin,
k_point
)

Description

A class for calculating blochstates.

BlochState Arguments

configuration

The configuration for which the eigenstate should be calculated.

Type: A BulkConfiguration

quantum_number

The quantum number of the desired eigenstate.

Type: integer 0

Default: 0
spin

The spin to calculate the eigenstate for.

Type: Spin.Up | Spin.Down

Default: Spin.Up
k_point

The k-point in fractional coordinates that the Bloch state should be calculated for.

Type: A list containing three floats, e.g. [0.0, 0.5, -0.5].

Default: [0,0,0]

BlochState Methods

A BlochState object provides the following methods:

  • derivatives(x, y, z): Calculate the derivative in the point x,y,z.

    x

    The cartesian x coordinate.

    Type: physical quantity with type length.

    y

    The cartesian y coordinate.

    Type: physical quantity with type length.

    z

    The cartesian z coordinate.

    Type: physical quantity with type length.

  • evaluate(x, y, z): Evaluate in the point x,y,z

    x

    The cartesian x coordinate.

    Type: physical quantity with type length.

    y

    The cartesian y coordinate.

    Type: physical quantity with type length.

    z

    The cartesian z coordinate.

    Type: physical quantity with type length.

  • gridCoordinate(i, j, k): Return the coordinate for a given grid index.

    i

    The grid index in the A direction.

    Type: integer

    j

    The grid index in the B direction.

    Type: integer

    k

    The grid index in the C direction.

    Type: integer

  • nlprint(stream): Print a string containing an ASCII table useful for plotting the Bloch state.

    stream

    The stream the Bloch state should be written to.

    Type: A stream that supports strings being written to using 'write'.

    Default: sys.stdout
  • scale(scale): Scale the field with a double.

    scale

    The parameter to scale with.

    Type: float

  • shape(): Query function for getting the shape of the data.

  • spin(): Qurry function for the spin.

  • toArray(): Return the values of the grid as a numpy array slicing off any units.

  • unit(): Get the unit of the data in the grid.

  • unitCell(): Return the unit cell for the grid.

  • volumeElement(): Get the volume element of the grid.

Usage Examples

Calculate and save the Bloch state for a gold FCC crystal in a NetCDF file.

# Define lattice
lattice = FaceCenteredCubic(4.08*Angstrom)

# Define elements
elements = [Gold]

# Define coordinates
coordinates = [[2.0, 2.0, 2.0]]*Angstrom

# Set up configuration
bulk_configuration = BulkConfiguration(
    lattice,
    elements,
    coordinates
    )

# Define a a calculator
bulk_configuration.setCalculator(LCAOCalculator())

# Calculate and save the Bloch state with quantum number 0
bloch_state = BlochState(bulk_configuration, quantum_number=5,
                         k_point=[0.0, 0.5, 0.5])
nlsave('bloch_state.nc', bloch_state)

blochstate.py

For examples on how to average and handle 3-d grids, see the examples for ElectronDifferenceDensity and ElectrostaticDifferencePotential.

Notes