# Eigenvalues¶

class Eigenvalues(configuration, kpoints=None, energy_zero_parameter=None, bands_above_fermi_level=None, enable_symmetry=None, processes_per_kpoint=None)

Class for calculating the eigenvalues for a configuration.

Parameters: configuration (BulkConfiguration | MoleculeConfiguration) – The configuration with an attached calculator for which to calculate the eigenvalues. kpoints – The k-points for which to calculate the eigenvalues. This can either be a class:~.MonkhorstPackGrid, RegularKpointGrid, or a list of 3-dimensional fractional k-points e.g. [[0.0, 0.0, 0.0], [0.0, 0.0, 0.1], ...]. Default: MonkhorstPackGrid(nx,ny,nz), where nx, ny, nz is the sampling used for the self-consistent calculation. energy_zero_parameter (FermiLevel | AbsoluteEnergy) – Specifies the choice for the energy zero. Default: FermiLevel bands_above_fermi_level (int | All) – The number of bands above the Fermi level per principal spin channel. Must be a non-negative integer. Default: All (All bands are included), except for calculators of type PlaneWaveCalculator; in this case the default is equal to the number of bands above the Fermi level set by the calculator. enable_symmetry (bool) – Enable or disable the use of symmetry Default: True processes_per_kpoint (int | None) – The number of processes to use per kpoint. If None the same number of processes per k-point as used in the SCF calculation will be used. The parameter is only used by the PlaneWaveCalculator. Default: None
densityOfStates()
Returns: A DensityOfStates object constructed from the calculated eigenvalues. This is only possible, if the kpoint used in this Eigenvalues object are of the type MonkhorstPackGrid or RegularKpointGrid. DensityOfStates
eigenvalues(spin=None)

Returns the calculated eigenvalues of the Hamiltonian.

Parameters: spin (Spin.All | Spin.Up | Spin.Down) – The spin of the eigenvalues. For Noncollinear caclulations, only Spin.All is valid. Default: Spin.All The eigenvalues. If spin is Spin.All the shape of the array is (n-spins, n-kpoints, n-bands) for Unpolarized and Polarized calculations, and (n-kpoints, n-bands) for Noncollinear calculations. When spin is Spin.Up or Spin.Down the shape is (n-kpoints, n-bands). PhysicalQuantity of type energy.
energyZero()
Returns: The energy zero. PhysicalQuantity of type energy.
evaluate(spin=None)

Returns the irreducible kpoints and the corresponding eigenvalues of the Hamiltonian.

Parameters: spin (Spin.All | Spin.Up | Spin.Down) – The spin of the eigenvalues. For Noncollinear caclulations, only Spin.All is valid. Default: Spin.All The irriducible kpoints and the corresponding eigenvalues. When spin is Spin.All the shape of the eigenvalues array is (n-spins, n-kpoints, n-bands) for Unpolarized and Polarized calculations, and (n-kpoints, n-bands) for Noncollinear calculations. When spin is Spin.Up or Spin.Down the shape is (n-kpoints, n-bands). numpy.ndarray, PhysicalQuantity of type energy.
fermiLevel(spin=None)
Parameters: spin (Spin.Up | Spin.Down | Spin.All) – The spin the Fermi level should be returned for. Must be either Spin.Up, Spin.Down, or Spin.All. Only when the band structure is calculated with a fixed spin moment will the Fermi level depend on spin. Default: Spin.All The Fermi level in absolute energy. PhysicalQuantity of type energy
irreducibleKpoints()
Returns: The irriducible kpoints for which the eigenvalues are calculated. numpy.ndarray
irreducibleWeights()

Get the weights of the irreducible k-points for which the eigenvalues are calculated.

Returns: The weights. numpy.ndarray
kpoints()
Returns: The kpoints given as input. class:~.MonkhorstPackGrid | RegularKpointGrid | numpy.ndarray
metatext()
Returns: The metatext of the object or None if no metatext is present. str | unicode | None
nlprint(stream=None)

Print a string containing an ASCII table useful for plotting the AnalysisSpin object.

Parameters: stream (python stream) – The stream the table should be written to. Default: NLPrintLogger()
setMetatext(metatext)

Set a given metatext string on the object.

Parameters: metatext (str | unicode | None) – The metatext string that should be set. A value of “None” can be given to remove the current metatext.
spins()
Returns: The spins associated to this analysis object. list of spin flags.

## Usage Examples¶

Calculate and save the eigenvalues for a bulk silicon configuration:

# Set up lattice
lattice = FaceCenteredCubic(5.4306 * Angstrom)

# Define elements
elements = [Silicon, Silicon]

# Define coordinates
fractional_coordinates = [[ 0.  ,  0.  ,  0.  ],
[ 0.25,  0.25,  0.25]]

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

# k-point sampling
k_point_sampling = MonkhorstPackGrid(
na=3,
nb=3,
nc=3,
)

numerical_accuracy_parameters = NumericalAccuracyParameters(
k_point_sampling=k_point_sampling,
)

# LCAO calculator
calculator = LCAOCalculator(
numerical_accuracy_parameters=numerical_accuracy_parameters,
)

bulk_configuration.setCalculator(calculator)
bulk_configuration.update()

# Calculate and save the eigenvalues
eigenvalues = Eigenvalues(bulk_configuration)
nlprint(eigenvalues)
nlsave('eigenvalues.hdf5', eigenvalues)


eigenvalues.py

By default the eigenvalues will be calculated for the same kpoints as used in the Calculator. It is, however, possible to calculate the eigenvalues at an arbitrary list of kpoints or MonkhorstPackGrid or RegularKpointGrid as:

# Calculate the eigenvalues at two selected k-points.
eigenvalues = Eigenvalues(
bulk_configuration,
kpoints=[[0.0, 0.0, 0.0], [0.1, 0.2, 0.3]])

# Calculate the eigenvalues using a MonkhorstPackGrid.
eigenvalues = Eigenvalues(
bulk_configuration,
kpoints=MonkhorstPackGrid(5, 5, 5))

# Calculate the eigenvalues using a RegularKpointGrid.
eigenvalues = Eigenvalues(
bulk_configuration,
kpoints=RegularKpointGrid(5, 5, 5))


If an Eigenvalues object has been calculated using either a MonkhorstPackGrid or RegularKpointGrid it is possible to construct a DensityOfStates object using the already calculated eigenvalues as:

# Calculate the eigenvalues using a MonkhorstPackGrid.
eigenvalues = Eigenvalues(
bulk_configuration,
kpoints=MonkhorstPackGrid(5, 5, 5))

# Calculate a DensityOfStates object.
density_of_states = eigenvalues.densityOfStates()