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_objectAbstract 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_indicesholds absolute molecular-orbital indices, drawn from the same index universe asOrbitals.active_indices().The returned Hamiltonian is expressed over
Pand must satisfy:its orbitals have
active_indices()equal top_indices;its orbitals classify fully occupied orbitals of \(Q = W \setminus P\) as inactive and unoccupied orbitals of
Qas 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
Qis added to the constant (zero-body) energy term, and the remainingQcontribution 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
EffectiveHamiltonianConstructorinstance.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
Pindices within the reference wavefunction’s active space.
- Returns:
16-character hex content hash.
- Return type:
- name(self: qdk_chemistry.algorithms.EffectiveHamiltonianConstructor) str
The algorithm’s name.
- Returns:
The name of the algorithm
- Return type:
- 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:
- type_name(self: qdk_chemistry.algorithms.EffectiveHamiltonianConstructor) str
The algorithm’s type name.
- Returns:
The type name of the algorithm
- Return type: