Integral

class pydmqmc.systems.Integral(input_file, is_complex=False, reference=None, symmetry=None, orbital_eigenvalues=False)

Bases: System

System defined by a set of integral files.

Parameters:
input_filestr

Name of the integral file that defines the system.

is_complexbool, default True

Whether or not the integral is complex; controls the integral index symmetry.

Attributes

bitarrays

Array of bitarrays in the Hilbert space.

eigenvalues

System's single-particle eigenvalues.

excitation_matrix

An n_determinants-square matrix of excitations between i and j.

ground_state_pg

Ground state point-group of the system.

h0e

Core Hamiltonian.

h1e

The one-particle integrals.

h2e

The two-particle integrals.

hamiltonian

The system's Hamiltonian.

input_file

Filename for loaded Hamiltonian.

is_complex

Whether or not the Hamiltonain is complex.

max_symmetry

Maximum point-group symmetry contained by the system.

n_alpha

Number of alpha electrons.

n_beta

Number of beta electrons.

n_determinants

Size of the Hilbert space.

n_electrons

Total number of electrons.

n_orbitals

Number of spin orbitals.

n_virtual

Number of virtual orbitals.

orbital_pg_symmetry

Orbital point-group symmetries.

orbitals

All orbital indexes.

pg_mask

Mask used for point-group operations.

prob_double

Probability of generating a double excitation.

prob_single

Probability of generating a single excitation.

ref_determinant

Bitarray for the reference occupation.

ref_energy

Reference Hartree-Fock energy.

spin_polarization

Spin polarization of the system.

spin_polarizations

All possible spin polarization of the system(?).

symmetry

Point-group symmetry of the system.

unrestricted_HF

Does the system use unrestricted Hartree-Fock.

Methods

generate_determinant_bitarrays()

Generate all determinants as bitarrays.

generate_excitation_matrix()

Generate the matrix of excitations.

generate_hamiltonian()

Generate the Hamiltonian for the system.

generate_renorm_excitation(ba)

Generate an excitation from the given bitarray.

get_bitarray_integers()

Integer representations of system bitarrays.

get_virtual_orbitals(occ)

Given an occupied orbital array, get information on virtual orbitals.

print_eigenvalues([float_fmt, int_fmt])

Print eigenvalues.

print_report()

Print information about the system.

print_symmetry_table()

Write out the symmetry table for the system.

random_bitarray_symspace()

Generate a random determinant from the full space of all determinants.

zero_hamiltonian()

Subtract the Hartree-Fock energy from the Hamiltonian.

Other Parameters:
referencearray_like, optional

Specify the occupied spin orbitals for the system’s reference determinant. If None, assume the lowest energy orbitals are occupied. If orbital energies are not input_file we assume the first nel orbitals are occupied.

symmetryint, optional

Override the point-group symmetry of the system integrals in input_file. If None, defaults to the value of ISYM from the input_file.

orbital_eigenvaluesbool, default False

Calculate the orbital eigenvalues for the reference state. Useful if the input_file does not have energies for N 0 0 0 states where N is a positive integer.

Notes

Enabling orbital_eigenvalues using the following math from Szabo and Ostlund [1]:

\[e_a = <a|h|a> + \sum_{b \neq a}^{N} <ab|ab> - <ab|ba>\]

Note that, \(b \neq a\) only applies when :math`a` is occupied and \(b\) is always occupied.

References

[1]

Attila Szabo and Neil S. Ostlund, “Modern Quantum Chemistry: Introduction to Advanced Electronic Structure Theory,” Dover Books on Chemistry, 1996

generate_determinant_bitarrays()

Generate all determinants as bitarrays.

This function sets the n_determinants and bitarrays members. All determinints spanned by the system within the point-group symmetry will be generated.

A reference bitarry is first generated separately for each of the spin channels. Next, all unqiue combinations of 1’s & 0’s are generated for that reference. Finally, all the unique concatenations of the alpha & beta bitarrays are iterated over, checking that the point group symmetry of the concatenated bitarray falls within the system’s possible point groups. If the concatenated bitarray has an allowed point group symmetry, that determinant is stored.

Warning

This function will only have an effect the first time it is run. If members n_determinants and bitarrays are not None, this function will return without making any changes.

Notes

A bitarray is shorthand for an array of 1’s and 0’s. More traditionally referred to as “bitstrings,” these are used to represent Slater determinants. 1’s represent an occupied orbital and 0 an unoccupied orbital.

This function was originally called generate_bit_arrays and supported the use_symmetry_block boolean, which controls whether to use the symmetry reduced point group Hamiltonian (True) or whether the entire Hamiltonian containing all those point-group symmetries spanned by the system will be generated (False). Since in practice this parameter was always True and this function does not control Hamiltonian generation, this parameter has been removed from the function call and hardcoded to True within the function body.

generate_excitation_matrix()

Generate the matrix of excitations.

Sets the excitation_matrix member. Each matrix index i, j represents the transition between bitarrays i and j. This function will also generate the system determinants if they have not already been generated, thereby setting n_determinants and bitarrays.

Warning

This function will only have an effect the first time it is run. If the excitation_matrix member is not None, this function will return without making any changes.

generate_hamiltonian()

Generate the Hamiltonian for the system.

Sets the hamiltonian member. It will also generate the system determinants if they have not already been generated, thereby setting n_determinants and bitarrays.

Warning

This function will only have an effect the first time it is run. If the hamiltonian member is not None, this function will return without making any changes.

generate_renorm_excitation(ba)

Generate an excitation from the given bitarray.

Parameters:
baarray_like

Bitarray for generating the excitation.

get_bitarray_integers()

Integer representations of system bitarrays.

get_virtual_orbitals(occ)

Given an occupied orbital array, get information on virtual orbitals.

Parameters:
occarray_like

The occupied orbitals for the current determinant.

Returns:
unoccArray

The unoccupied orbital indexes in the current determinant.

virt_msArray

The corresponding spins of unocc.

virt_symArray

The corresponding symmetries of unocc.

nvirtArray

The number of unoccupied orbitals in each spin-symmetry as indexed by spin and symmetry.

Warning

There is a always an empty array corresponding to a spin of \(ms = 0\).

print_eigenvalues(float_fmt=' % 24.16E', int_fmt='%3i')

Print eigenvalues.

Parameters:
float_fmtstr

Format string for floats.

int_fmtstr

Format string for integers.

print_report()

Print information about the system.

print_symmetry_table()

Write out the symmetry table for the system.

Write out the general pg symmetry table from all combinations of point groups first. Then write out the resulting point group table from the cross product of the orbital point groups.

random_bitarray_symspace()

Generate a random determinant from the full space of all determinants.

Returns:
Array

The bitarray of the random determinant

zero_hamiltonian()

Subtract the Hartree-Fock energy from the Hamiltonian.

This will overwrite the existing Hamiltonian with the shifted version.

property bitarrays

Array of bitarrays in the Hilbert space.

property eigenvalues

System’s single-particle eigenvalues.

property excitation_matrix

An n_determinants-square matrix of excitations between i and j.

property ground_state_pg

Ground state point-group of the system.

property h0e

Core Hamiltonian.

property h1e

The one-particle integrals.

property h2e

The two-particle integrals.

property hamiltonian

The system’s Hamiltonian.

property input_file

Filename for loaded Hamiltonian.

property is_complex

Whether or not the Hamiltonain is complex.

property max_symmetry

Maximum point-group symmetry contained by the system.

property n_alpha

Number of alpha electrons.

property n_beta

Number of beta electrons.

property n_determinants

Size of the Hilbert space.

property n_electrons

Total number of electrons.

property n_orbitals

Number of spin orbitals.

property n_virtual

Number of virtual orbitals.

property orbital_pg_symmetry

Orbital point-group symmetries.

property orbitals

All orbital indexes.

property pg_mask

Mask used for point-group operations.

property prob_double

Probability of generating a double excitation.

property prob_single

Probability of generating a single excitation.

property ref_determinant

Bitarray for the reference occupation.

property ref_energy

Reference Hartree-Fock energy.

property spin_polarization

Spin polarization of the system.

property spin_polarizations

All possible spin polarization of the system(?).

property symmetry

Point-group symmetry of the system.

property unrestricted_HF

Does the system use unrestricted Hartree-Fock.