Effective Hamiltonian construction ================================== The :class:`~qdk_chemistry.algorithms.EffectiveHamiltonianConstructor` algorithm in QDK/Chemistry defines a common interface for downfolding a Hamiltonian from a larger orbital window into a smaller target space. Following QDK/Chemistry's :doc:`algorithm design principles <../design/index>`, it takes a reference :class:`~qdk_chemistry.data.Wavefunction`, an input :class:`~qdk_chemistry.data.Hamiltonian`, and target-space orbital indices as input and produces an effective :class:`~qdk_chemistry.data.Hamiltonian` as output. The interface leaves the downfolding approximation and method-specific diagnostics to the concrete implementation. Overview -------- Let the orbital window :math:`W` be partitioned into a target space :math:`P` and an external space :math:`Q`: .. math:: W = P \cup Q, \qquad P \cap Q = \varnothing. Using :math:`\hat P` and :math:`\hat Q` for the corresponding projectors, the full-window Hamiltonian has the block structure .. math:: H_W = \begin{pmatrix} H_{PP} & H_{PQ} \\ H_{QP} & H_{QQ} \end{pmatrix}, \qquad H_{PP} = \hat P H_W \hat P. An implementation accounts for the influence of :math:`Q` while constructing an effective Hamiltonian that acts only in :math:`P`: .. math:: \mathcal{D}\!\left(\lvert \Psi_{\mathrm{ref}} \rangle, H_W, P\right) = H_{\mathrm{eff}}^{P}, \qquad H_{\mathrm{eff}}^{P} = \hat P H_{\mathrm{eff}}^{P} \hat P, where :math:`\mathcal{D}` denotes the selected downfolding implementation. The interface does not prescribe how the coupling blocks :math:`H_{PQ}` and :math:`H_{QP}` or the external block :math:`H_{QQ}` contribute to :math:`H_{\mathrm{eff}}^{P}`. Using the EffectiveHamiltonianConstructor ----------------------------------------- The ``run`` method takes a reference wavefunction, a full-window Hamiltonian, and the target-space indices and returns the effective Hamiltonian acting in :math:`P`. Input requirements ~~~~~~~~~~~~~~~~~~ The :class:`~qdk_chemistry.algorithms.EffectiveHamiltonianConstructor` requires the following inputs: Reference wavefunction A :class:`~qdk_chemistry.data.Wavefunction` that defines the reference state used by the downfolding method. Input Hamiltonian A :class:`~qdk_chemistry.data.Hamiltonian` expressed over the complete orbital window :math:`W`. Target-space indices A :class:`~qdk_chemistry.data.symmetry.SymmetryBlockedIndexSet` containing the indices of :math:`P`. These are absolute molecular-orbital indices, drawn from the same index universe as ``Orbitals.active_indices()``, and must lie within the active space of :math:`W`. Output contract ~~~~~~~~~~~~~~~ The returned :class:`~qdk_chemistry.data.Hamiltonian` is expressed over :math:`P` and satisfies: - its orbitals have ``active_indices()`` equal to the requested target-space indices; - its orbitals classify fully occupied orbitals of :math:`Q = W \setminus P` as inactive and unoccupied orbitals of :math:`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 :math:`Q` is added to the constant (zero-body) energy term, and the remaining :math:`Q` contribution is folded into the integrals. The occupied/virtual partition of :math:`Q` is method dependent and is determined by the concrete implementation from its reference state. Classifying an orbital of :math:`Q` as virtual describes its occupation in the output orbital metadata; it does not place that orbital in the effective active space. Consumers of an effective Hamiltonian should not attempt to re-correlate :math:`Q`, since its contribution is already folded in. Input validation is opt-in. The ``run`` method does not validate its arguments; each concrete implementation decides whether to check the nested-space contract :math:`P \subseteq W_{\mathrm{ref}} \subseteq W_H` before computing. The base interface defines no common settings. Concrete implementations can expose method-specific configuration through the ``settings()`` object. See :doc:`Settings ` for a general treatment of algorithm settings in QDK/Chemistry. Available implementations ------------------------- QDK/Chemistry currently provides the :class:`~qdk_chemistry.algorithms.EffectiveHamiltonianConstructor` interface but no concrete implementation or default factory choice. Creation, configuration, and execution examples will be added with the first concrete implementation. Related classes --------------- - :class:`~qdk_chemistry.data.Wavefunction`: Provides the reference state - :class:`~qdk_chemistry.data.Hamiltonian`: Represents the full-window input and target-space output Hamiltonians - :class:`~qdk_chemistry.data.symmetry.SymmetryBlockedIndexSet`: Identifies the target orbital space while preserving symmetry blocks - :doc:`HamiltonianConstructor `: Builds the input Hamiltonian over the orbital window Further reading --------------- - :doc:`ActiveSpaceSelector `: Identifies orbital subspaces for correlated calculations - :doc:`Settings `: Configures algorithm implementations - :doc:`Factory Pattern `: Discovers, registers, and creates algorithm implementations