qdk_chemistry.utils.model_hamiltonians module

Model Hamiltonian utilities.

qdk_chemistry.utils.model_hamiltonians.create_heisenberg_hamiltonian(graph, jx, jy, jz, hx=0.0, hy=0.0, hz=0.0)[source]

Create the anisotropic Heisenberg model Hamiltonian on a lattice.

\[H = \sum_{\langle i,j \rangle} w_{ij}\,\bigl[ J_x^{ij}\,\sigma_i^x \sigma_j^x + J_y^{ij}\,\sigma_i^y \sigma_j^y + J_z^{ij}\,\sigma_i^z \sigma_j^z \bigr] + \sum_i \bigl[ h_x^{i}\,\sigma_i^x + h_y^{i}\,\sigma_i^y + h_z^{i}\,\sigma_i^z \bigr]\]

where \(w_{ij}\) is the edge weight from the lattice adjacency matrix.

Each qubit corresponds to a lattice site.

Parameters:
  • graph (LatticeGraph) – Lattice graph defining the connectivity.

  • jx (ndarray | float) – Coupling constant for XX interactions. Scalar (uniform) or (n, n) array for per-pair values.

  • jy (ndarray | float) – Coupling constant for YY interactions (same format as jx).

  • jz (ndarray | float) – Coupling constant for ZZ interactions (same format as jx).

  • hx (ndarray | float) – External magnetic field in the x direction. Scalar or length-n array. Defaults to 0.

  • hy (ndarray | float) – External magnetic field in the y direction. Defaults to 0.

  • hz (ndarray | float) – External magnetic field in the z direction. Defaults to 0.

Returns:

The Heisenberg model as a qubit Hamiltonian.

Return type:

QubitHamiltonian

Return type:

QubitHamiltonian

qdk_chemistry.utils.model_hamiltonians.create_hubbard_hamiltonian(lattice: qdk_chemistry.data.LatticeGraph, epsilon: object, t: object, U: object) qdk_chemistry.data.Hamiltonian

Create a Hubbard model Hamiltonian.

Extends the Hückel model with on-site Coulomb repulsion H = H_huckel + U sum_i n_{i,up} n_{i,down}.

Parameters:
Returns:

Hubbard model Hamiltonian.

Return type:

Hamiltonian

qdk_chemistry.utils.model_hamiltonians.create_huckel_hamiltonian(lattice: qdk_chemistry.data.LatticeGraph, epsilon: object, t: object) qdk_chemistry.data.Hamiltonian

Create a Hückel model Hamiltonian.

Builds the one-body Hamiltonian H = sum_i eps_i n_i - sum_{<i,j>} t_ij (a†_i a_j + h.c.) and wraps it in a ready-to-use Hamiltonian.

Parameters:
Returns:

Hückel model Hamiltonian.

Return type:

Hamiltonian

qdk_chemistry.utils.model_hamiltonians.create_ising_hamiltonian(graph, j, h=0.0)[source]

Create the Ising model Hamiltonian on a lattice.

\[H = \sum_{\langle i,j \rangle} w_{ij}\,J^{ij}\,\sigma_i^z \sigma_j^z + \sum_i h^{i}\,\sigma_i^x\]

where \(w_{ij}\) is the edge weight from the lattice adjacency matrix.

Parameters:
  • graph (LatticeGraph) – Lattice graph defining the connectivity.

  • j (ndarray | float) – Coupling constant for ZZ interactions. Scalar or (n, n) array.

  • h (ndarray | float) – Transverse field strength (x direction). Scalar or length-n array. Defaults to 0.

Returns:

The Ising model as a qubit Hamiltonian.

Return type:

QubitHamiltonian

Return type:

QubitHamiltonian

qdk_chemistry.utils.model_hamiltonians.create_ppp_hamiltonian(lattice: qdk_chemistry.data.LatticeGraph, epsilon: object, t: object, U: object, V: object, z: object) qdk_chemistry.data.Hamiltonian

Create a Pariser-Parr-Pople (PPP) model Hamiltonian.

Extends the Hubbard model with long-range intersite Coulomb interactions H = H_hubbard + 1/2 sum_{i!=j} V_ij (n_i - z_i)(n_j - z_j).

Note: The stored two-body integrals do not include the 1/2 prefactor.

Parameters:
Returns:

PPP model Hamiltonian.

Return type:

Hamiltonian

qdk_chemistry.utils.model_hamiltonians.mataga_nishimoto_potential(lattice: qdk_chemistry.data.LatticeGraph, U: object, R: object, epsilon_r: SupportsFloat | SupportsIndex = 1.0, nearest_neighbor_only: bool = False) Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]']

Compute the Mataga-Nishimoto intersite potential matrix.

V_ij = U_ij / (1 + U_ij * epsilon_r * R_ij)

where U_ij = sqrt(U_i * U_j) is the geometric mean of on-site parameters.

All parameters should be in atomic units (Hartree for U, Bohr for R).

Parameters:
  • lattice (LatticeGraph) – Lattice graph (used for the number of sites).

  • U (float or numpy.ndarray) – On-site Coulomb parameter(s) in Hartree.

  • R (float or numpy.ndarray) – Intersite distance(s) in Bohr.

  • epsilon_r (float, optional) – Relative permittivity. Defaults to 1.0.

  • nearest_neighbor_only (bool, optional) – If True, restrict to lattice-connected pairs. Defaults to False.

Returns:

Symmetric potential matrix [n x n].

Return type:

numpy.ndarray

qdk_chemistry.utils.model_hamiltonians.ohno_potential(lattice: qdk_chemistry.data.LatticeGraph, U: object, R: object, epsilon_r: SupportsFloat | SupportsIndex = 1.0, nearest_neighbor_only: bool = False) Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]']

Compute the Ohno intersite potential matrix.

V_ij = U_ij / sqrt(1 + (U_ij * epsilon_r * R_ij)^2)

where U_ij = sqrt(U_i * U_j) is the geometric mean of on-site parameters.

All parameters should be in atomic units (Hartree for U, Bohr for R).

Parameters:
  • lattice (LatticeGraph) – Lattice graph (used for the number of sites).

  • U (float or numpy.ndarray) – On-site Coulomb parameter(s) in Hartree.

  • R (float or numpy.ndarray) – Intersite distance(s) in Bohr.

  • epsilon_r (float, optional) – Relative permittivity. Defaults to 1.0.

  • nearest_neighbor_only (bool, optional) – If True, restrict to lattice-connected pairs. Defaults to False.

Returns:

Symmetric potential matrix [n x n].

Return type:

numpy.ndarray

qdk_chemistry.utils.model_hamiltonians.pairwise_potential(lattice: qdk_chemistry.data.LatticeGraph, U: object, R: object, func: collections.abc.Callable[[SupportsInt | SupportsIndex, SupportsInt | SupportsIndex, SupportsFloat | SupportsIndex, SupportsFloat | SupportsIndex], float], nearest_neighbor_only: bool = False) Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]']

Compute a symmetric pairwise potential matrix from a user-supplied formula.

For each unique pair (i < j), computes U_ij = sqrt(U_i * U_j), reads R_ij, and evaluates func(i, j, U_ij, R_ij).

Parameters:
Returns:

Symmetric potential matrix [n x n].

Return type:

numpy.ndarray