qdk_chemistry.algorithms.effective_hamiltonian_constructor module

Public entry point for the effective-Hamiltonian construction algorithms.

This module re-exports the core EffectiveHamiltonianConstructor and concrete implementations so that consumers can import them directly from qdk_chemistry.algorithms without depending on internal package paths.

class qdk_chemistry.algorithms.effective_hamiltonian_constructor.EffectiveHamiltonianConstructor

Bases: pybind11_object

Abstract base class for effective-Hamiltonian construction.

Concrete implementations construct an effective Hamiltonian from a reference wavefunction and an input Hamiltonian in the explicitly specified P-space.

p_indices holds absolute molecular-orbital indices, drawn from the same index universe as Orbitals.active_indices().

The returned Hamiltonian is expressed over P and must satisfy:

  • its orbitals have active_indices() equal to p_indices;

  • its orbitals classify fully occupied orbitals of \(Q = W \setminus P\) as inactive and unoccupied orbitals of Q as virtual, while preserving the input Hamiltonian’s inactive orbitals;

  • its inactive Fock matrix, when present, is consistent with the output inactive orbitals and may therefore differ from the input Hamiltonian’s inactive Fock matrix;

  • the scalar shift from folding in Q is added to the constant (zero-body) energy term, and the remaining Q contribution is folded into the integrals.

Input validation is opt-in. run() does not validate its arguments; concrete implementations decide whether to call _validate_inputs.

Examples

>>> import qdk_chemistry.algorithms as alg
>>> constructor = alg.create("effective_hamiltonian_constructor", "algorithm_name")
>>> effective_hamiltonian = constructor.run(reference, hamiltonian, p_indices)
__init__(self: qdk_chemistry.algorithms.EffectiveHamiltonianConstructor) None

Create an EffectiveHamiltonianConstructor instance.

Default constructor for the abstract base class; typically called via super().__init__() from a derived class.

hash(self: qdk_chemistry.algorithms.EffectiveHamiltonianConstructor, reference: qdk_chemistry.data.Wavefunction, hamiltonian: qdk_chemistry.data.Hamiltonian, p_indices: qdk_chemistry.data.symmetry.SymmetryBlockedIndexSet) str

Compute a deterministic content hash for a run with these inputs.

Parameters:
  • reference – Reference wavefunction providing the reference state.

  • hamiltonian – Input Hamiltonian built over the whole window \(W = P \cup Q\).

  • p_indices – Target P indices within the reference wavefunction’s active space.

Returns:

16-character hex content hash.

Return type:

str

name(self: qdk_chemistry.algorithms.EffectiveHamiltonianConstructor) str

The algorithm’s name.

Returns:

The name of the algorithm

Return type:

str

run(self: qdk_chemistry.algorithms.EffectiveHamiltonianConstructor, reference: qdk_chemistry.data.Wavefunction, hamiltonian: qdk_chemistry.data.Hamiltonian, p_indices: qdk_chemistry.data.symmetry.SymmetryBlockedIndexSet) qdk_chemistry.data.Hamiltonian

Construct the effective Hamiltonian acting on the target space P.

Parameters:
  • reference – Reference wavefunction providing the reference state.

  • hamiltonian – Input Hamiltonian built over the whole window \(W = P \cup Q\).

  • p_indices – Absolute molecular-orbital indices of the target space P, which must lie within the reference wavefunction’s active space.

Returns:

The effective Hamiltonian acting on P, following the output contract documented on this class.

settings(self: qdk_chemistry.algorithms.EffectiveHamiltonianConstructor) qdk_chemistry.data.Settings

Access the constructor’s configuration settings.

Returns:

Reference to the settings object.

Return type:

qdk_chemistry.data.Settings

type_name(self: qdk_chemistry.algorithms.EffectiveHamiltonianConstructor) str

The algorithm’s type name.

Returns:

The type name of the algorithm

Return type:

str