class MolecularEnergySpectrum(configuration=None, energy_zero_parameter=None, projection_list=None)

Class for calculating the molecular energy spectrum for a configuration.

  • configuration (MoleculeConfiguration | BulkConfiguration | DeviceConfiguration | SurfaceConfiguration) – The configuration the molecular energy spectrum should be calculated for.
  • energy_zero_parameter (FermiLevel | AbsoluteEnergy) – Specifies the choice for the energy zero.
    Default: FermiLevel
  • projection_list (ProjectionList) – Specifies the orbitals within the configuration to include in the calculation.
    Default: ProjectionList(All) - All atoms included.
Returns:The spin degeneracy for the spectrum. That is, 2 for Unpolarized spin type, else 1.
Return type:float

Return the energy zero used for the energy scale in this molecular energy spectrum.

Returns:The energy zero used for the energy scale in this molecular energy spectrum.
Return type:PhysicalQuantity or type energy

Return the molecular energy spectrum.

Parameters:spin (Spin.Up | Spin.Down | Spin.All) – The spin for which the spectrum should be returned. For noncollinear and spin-orbit calculations, this must be Spin.All.
Default: Spin.Up for unpolarized calculations, else Spin.All
Returns:The molecular energy spectrum as a PhysicalQuantity with one entry for each molecular eigenstate.
Return type:PhysicalQuantity of type energy
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.Up
Returns:The Fermi level in absolute energy.
Return type:PhysicalQuantity of type energy

Return the Fermi temperature used in this molecular energy spectrum.

Returns:The Fermi temperature.
Return type:PhysicalQuantity or type temperature
Returns:The metatext of the object or None if no metatext is present.
Return type:str | unicode | 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()

Method for calculating the occupation for these eigenstates.

Returns:The occupation for each orbital.
Return type:list of float

Return the ProjectionList object used in this molecular energy spectrum.

Returns:The ProjectionList object.
Return type:ProjectionList

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.

Usage Examples

Calculate the molecular energy spectrum of an ammonia molecule and print out the energy levels and occupations:

# Set up configuration
molecule_configuration = MoleculeConfiguration(
    elements=[Nitrogen, Hydrogen, Hydrogen, Hydrogen],
    cartesian_coordinates= [[ 0.      ,  0.      ,  0.124001],
                         [ 0.      ,  0.941173, -0.289336],
                         [ 0.81508 , -0.470587, -0.289336],
                         [-0.81508 , -0.470587, -0.289336]]*Angstrom )

# Define the calculator
calculator = HuckelCalculator()

# Calculate and save the molecular energy spectrum
molecular_energy_spectrum = MolecularEnergySpectrum(
nlsave('molecular.hdf5', molecular_energy_spectrum)

# Extract the energies and occupations
energy = molecular_energy_spectrum.evaluate()
occ = molecular_energy_spectrum.occupation()

# ... and print them out
print("level   energy(eV)    occupation")
for i in numpy.arange(len(energy)):
    print('  %d  %12.4f  %12.4f  ' % (i, energy[i].inUnitsOf(eV),occ[0][i]))