ProjectionList — Class for representing a list of orbitals. Results of several analysis objects can be projected onto this limited set of orbitals.
Constructor of the ProjectionList class that keeps track of which projection orbitals are used in analysis objects such as the MolecularEnergySpectrum.
List of integers specifying the atom indices to include in the projection list
Type: Any sequence of non negative integers
Default:
All
List of elements to include in the projection list
Type: Any sequence of PeriodicTable Elements
Default:
All
List of angular momenta, specified as integers (0=s, 1=p, ..), to include in the projection list
Type: Any sequence of non negative integers
Default:
All
A ProjectionList object provides the following methods:
angularMomenta(): Query for the angular momenta which are included in the projection list
atoms(): Query for the atom indices which are included in the projection list
elements(): Query for the elements which are included in the projection list
includeAll(): Query for if we include all orbitals as targets or not
Calculate the Nitrogen s level within an ammonia molecule.
# 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])