Name

MolecularEnergySpectrum — Class for calculating the molecular energy spectrum for a configuration

Synopsis

Namespace: NanoLanguage
MolecularEnergySpectrum(
configuration,
energy_zero_parameter,
projection_list
)

Description

Constructor for the MolecularEnergySpectrum object.

MolecularEnergySpectrum Arguments

configuration

The configuration the molecular energy spectrum should be calculated for.

Type: MoleculeConfiguration | BulkConfiguration | DeviceConfiguration.

energy_zero_parameter

Specifies the choice for the energy zero.

Type: FermiLevel | AbsoluteEnergy.

Default: FermiLevel.
projection_list

Specifies the orbitals within the configuration to include in the calculation.

Type: ProjectionList.

Default: All atoms included : ProjectionList(All)

MolecularEnergySpectrum Methods

A MolecularEnergySpectrum object provides the following methods:

  • degeneracy(): Return the degeneracy in this molecular energy spectrum

  • energyZero(): Return the energy zero used for the energy scale in this molecular energy spectrum

  • evaluate(): Return the molecular energy spectrum

  • fermiLevel(): Return the Fermi level in absolute energies used in this molecular energy spectrum

  • fermiTemperature(): Return the Fermi_temperatures used in this molecular energy spectrum

  • nlprint(stream): Print a string containing an ASCII table useful for plotting the molecular energy spectrum.

    stream

    The stream the molecular energy spectrum should be written to.

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

    Default: sys.stdout
  • occupation(): Method for calculating the occupation for these eigenstates.

  • projectionList(): Return the ProjectionList object used in this molecular energy spectrum

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()
molecule_configuration.setCalculator(calculator)

# Calculate and save the molecular energy spectrum
molecular_energy_spectrum = MolecularEnergySpectrum(
    configuration=molecule_configuration,
    energy_zero_parameter=AbsoluteEnergy,
    projection_list=ProjectionList(elements=[Nitrogen], angular_momenta = [0])
    )
nlsave('molecular.nc', molecular_energy_spectrum)

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

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

nh3.py

Notes

  • To export the data of a molecular energy spectrum, use the method nlprint.

  • The MolecularEnergySpectrum can be visualized with VNL, when saved with nlsave.