MolecularEnergySpectrum — Class for calculating the molecular energy spectrum for a configuration
Constructor for the MolecularEnergySpectrum object.
The configuration the molecular energy spectrum should be calculated for.
Type: MoleculeConfiguration | BulkConfiguration | DeviceConfiguration.
Specifies the choice for the energy zero.
Type: FermiLevel | AbsoluteEnergy.
Default:
FermiLevel.
Specifies the orbitals within the configuration to include in the calculation.
Type: ProjectionList.
Default:
All atoms included : ProjectionList(All)
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.
occupation(): Method for calculating the occupation for these eigenstates.
projectionList(): Return the ProjectionList object used in this molecular energy spectrum
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])