ofex.hamiltonian¶
This module provides implementations of various quantum physics and chemistry models.
The module includes: - Functions for defining 1D Pauli Hamiltonian models (zz_1d, heisenberg_1d, and heisenberg_1d_ring). - A class PolyacenePPP for representing and working with polyacene molecules using the Pariser-Parr-Pople (PPP) model.
- ofex.hamiltonian.zz_1d(num_qubits: int) QubitOperator[source]¶
Generate the Z-Z interaction Hamiltonian for a 1D chain of qubits.
- Parameters:
num_qubits (int) – The number of qubits in the system.
- Returns:
The QubitOperator representing the Z-Z Hamiltonian.
- Return type:
of.QubitOperator
- ofex.hamiltonian.heisenberg_1d(num_qubits) QubitOperator[source]¶
Generate the Heisenberg Hamiltonian for a 1D open chain of spins.
- Parameters:
num_qubits (int) – The number of qubits in the system.
- Returns:
The QubitOperator representing the Heisenberg Hamiltonian.
- Return type:
of.QubitOperator
- ofex.hamiltonian.heisenberg_1d_ring(num_qubits) QubitOperator[source]¶
Generate the Heisenberg Hamiltonian for a 1D closed ring of spins.
- Parameters:
num_qubits (int) – The number of qubits in the system.
- Returns:
The QubitOperator representing the Heisenberg Hamiltonian on a closed ring.
- Return type:
of.QubitOperator
- class ofex.hamiltonian.PolyacenePPP(n_ring: int, param_type: str = 'standard', t0: float = 0.08819833952795732, t_: float = 0.08819833952795732, bond_length: float = 1.4)[source]¶
The PolyacenePPP class represents a linear polyacene molecule described using the Pariser-Parr-Pople (PPP) model for quantum chemistry calculations. It provides methods for computing molecular Hamiltonians, electron-electron repulsion, hopping terms, and other properties based on the PPP approximation.
- Reference:
Chakraborty, H., & Shukla, A. (2013). Pariser–Parr–Pople Model Based Investigation of Ground and Low-Lying Excited States of Long Acenes. The Journal of Physical Chemistry A, 117(51), 14220–14229. doi:10.1021/jp408535u
- n_ring¶
The number of aromatic rings in the polyacene molecule.
- Type:
int
- t0¶
Hopping strength value for horizontal bonds.
- Type:
float
- t_¶
Hopping strength value for vertical bonds.
- Type:
float
- bond_length¶
The bond length between adjacent carbon atoms (in Angstroms).
- Type:
float
- atom_dist(i: str, j: str) float[source]
Calculates the Euclidean distance between two atoms based on their coordinates.
- Parameters:
i (str) – The label of the first atom (e.g., “U0” or “L1”).
j (str) – The label of the second atom (e.g., “U1” or “L0”).
- Returns:
The Euclidean distance between the two atoms in Angstroms.
- Return type:
float
- property atom_name: List[str]
Returns: List[str]: A list of atom names in the polyacene molecule.
- ee_repulsion() FermionOperator[source]
Constructs the electron-electron repulsion operator, including on-site and Ohno interaction terms.
- Returns:
The total electron-electron repulsion operator.
- Return type:
FermionOperator
- fermion_hamiltonian() FermionOperator[source]
Constructs the full fermionic Hamiltonian of the molecule, which includes contributions from horizontal hopping, vertical bridge hopping, and electron-electron repulsion.
- Returns:
The full fermionic Hamiltonian of the molecule.
- Return type:
FermionOperator
- fermion_symmetries() List[List[Tuple[int, int]]][source]
Generates symmetry transformations for the fermionic orbitals in the system based on spatial symmetry operations.
- Returns:
- A list of symmetry transformations,
where each transformation is represented as a list of tuples. Each tuple defines a permutation of two orbitals (given by their indices). The transformations included are: - σ(x): Reflection across the x-axis. - σ(y): Reflection across the y-axis.
- Return type:
List[List[Tuple[int, int]]]
- get_molecular_hamiltonian()[source]
Retrieves the molecular Hamiltonian for the polyacene molecule.
- Returns:
The fermionic Hamiltonian of the molecule.
- Return type:
FermionOperator
- hf_state(parity: bool = True)[source]
Constructs a Hartree-Fock (HF) state for the molecule based on a given parity.
- Parameters:
parity (bool) – Determines whether the alternating occupation starts with the 0th orbital or the 1st orbital. If True, the occupation starts from the 1st orbital; if False, the occupation starts from the 0th orbital.
- Returns:
- The Hartree-Fock state as a dictionary where the key is the
BinaryFockVector representing the state and the value is its coefficient.
- Return type:
Dict[BinaryFockVector, float]
- hopping_bridge() FermionOperator[source]
Constructs the hopping operator for vertical bonds between the upper and lower parts of the molecule.
- Returns:
The bridge hopping operator scaled by -self.t_.
- Return type:
FermionOperator
- hopping_lower() FermionOperator[source]
Constructs the hopping operator for horizontal bonds in the lower part of the molecule.
- Returns:
The lower horizontal hopping operator scaled by -t0.
- Return type:
FermionOperator
- hopping_upper() FermionOperator[source]
Constructs the hopping operator for horizontal bonds in the upper part of the molecule.
- Returns:
The upper horizontal hopping operator scaled by -t0.
- Return type:
FermionOperator
- inv_spatial_idx(i: int) str[source]
Converts a given spin-orbital index into its corresponding spatial atom label.
- Parameters:
i (int) – The index of the spin-orbital.
- Returns:
- The atom label corresponding to the provided spin-orbital index.
This is in the form “U<num>” for upper atoms or “L<num>” for lower atoms, where <num> is the atom number.
- Return type:
str
- kappa(i: str, j: str)[source]
Computes the screening parameter based on the parameter type.
- Parameters:
i (str) – Label for the first atom.
j (str) – Label for the second atom.
- Returns:
The screening parameter value.
- Return type:
float
- Raises:
ValueError – If the parameter type is invalid.
- property n_electrons: int
- property n_qubits: int
- property num_spin_orbitals: int
Returns: int: The total number of spin-orbitals in the polyacene molecule.
- ref_state()[source]
Constructs the reference (singlet) state as a superposition of Hartree-Fock states with even and odd parities.
- Returns:
- The reference state as a dictionary of BinaryFockVector
to their respective coefficients.
- Return type:
Dict[BinaryFockVector, float]
- spin_idx(atom: str, spin: bool | int)[source]
Calculates the index of the spin orbital associated with a given atom and spin.
- Parameters:
atom (str) – The label of the atom, where “U” represents an upper atom and “L” represents a lower atom, followed by a numerical index. Example: “U0”, “L1”.
spin (Union[bool, int]) – The spin designation for the orbital. Acceptable values are either: - 0 or False for SPIN_DOWN - 1 or True for SPIN_UP
- Returns:
- The index of the spin orbital corresponding to the specified atom
and spin.
- Return type:
int
- Raises:
ValueError – If the atom label does not start with “L” or “U”.
- u()[source]
Computes the on-site repulsion term based on the parameter type.
- Returns:
The on-site electron-electron repulsion in Hartree.
- Return type:
float
- Raises:
ValueError – If the parameter type is invalid.
- v(i: str, j: str)[source]
Computes the Coulomb interaction between two atomic sites.
- Parameters:
i (str) – Label for the first atom.
j (str) – Label for the second atom.
- Returns:
The Coulomb interaction value in Hartree, accounting for screening and distance-dependent effects between the atoms.
- Return type:
float