qrunch.chemistry.hamiltonian_reweighting.epstein_nesbet_reweighter

Epstein-Nesbet (heat-bath) reweighting of the term-sampling weights of a second-quantized Hamiltonian.

Classes

EpsteinNesbetReweighter

Reweight term-sampling probabilities by the Epstein-Nesbet importance of the determinants they reach.

class EpsteinNesbetReweighter

Bases: SecondQuantizedHamiltonianReweighter

Reweight term-sampling probabilities by the Epstein-Nesbet importance of the determinants they reach.

The subspace \(\mathcal{S}\) discovered so far is diagonalized to give the ground-state energy \(E_0\) and configuration-interaction coefficients \(c_d\). Each term \(j\) is then scored by the second-order perturbative weight of the external determinants it reaches from the subspace,

\[s_j = \sum_{d \in \mathcal{S}} \sum_{a \notin \mathcal{S},\, a = T_j d} \frac{(c_d \bra{a} H \ket{d})^2}{\bra{a} H \ket{a} - E_0} ,\]

the metric that drives heat-bath configuration interaction. A term scores high exactly when it couples the current subspace to important new determinants.

The scores are blended with the original qDRIFT magnitudes under a weight \(\alpha\) picked anew at every rescoring. The picked \(\alpha\) is the one maximizing the predicted sum of (PT2) importance of the drawn terms; see _capture_maximizing_blending(). Shallow qDRIFT circuits draw far fewer terms than the Hamiltonian has, so repeats are unlikely and the capture keeps growing with \(\alpha\) right up to one, where the terms are sampled purely by Epstein-Nesbet importance and the purely diagonal ones – number and number-number operators, which reach no external determinant – stop being sampled at all. The weight only backs off once the draws between two rescorings become comparable to the inverse term probabilities, which is where spending them on more of the frontier beats spending them on the best of it. maximum_blending caps the weight below one for callers who would rather keep every term with a non-zero coefficient sampled throughout.

Scoring is exact by default. Setting minimum_determinant_weight trades that for speed by leaving the lightest determinants out of the sum, in the spirit of the \(\epsilon_1\) screening of heat-bath configuration interaction.

__init__(subspace_diagonalizer: SubspaceDiagonalizer, *, sample_budget: int, maximum_blending: float = 1.0, minimum_determinant_weight: float = 0.0) None

Initialize the Epstein-Nesbet reweighter.

Parameters:
  • subspace_diagonalizer (SubspaceDiagonalizer) – Subspace diagonalization strategy supplying the subspace ground state, the couplings to neighbouring determinants and their diagonal energies.

  • sample_budget (int) – The number of terms drawn from a reweighted Hamiltonian before the next reweighting, which sets how far the blend can be pushed towards the scores before the extra concentration only buys repeats.

  • maximum_blending (float) – The largest weight \(\alpha \in [0, 1]\) the scores may be given; 0.0 reproduces the unweighted qDRIFT distribution and 1.0 leaves the choice entirely to the capture criterion.

  • minimum_determinant_weight (float) – Subspace determinants carrying a weight \(c_d^2\) below this are left out of the scores; 0.0 expands every determinant and keeps the scores exact.

Return type:

None

reweight(hamiltonian: SecondQuantizedHamiltonian, determinants: list[int]) SecondQuantizedHamiltonian

Rescale the term coefficients by the Epstein-Nesbet importance of the determinants they reach.

The Hamiltonian is returned unchanged when no external determinant is reachable, which happens for a subspace that is already closed under the Hamiltonian.

Successive calls share a cache of _DeterminantFrontier, so every call must be given a Hamiltonian with the same terms in the same order.

Parameters:
  • hamiltonian (SecondQuantizedHamiltonian) – The original second-quantized Hamiltonian; passing back a previous result would compound the blending.

  • determinants (list[int]) – Determinants discovered so far, as computational-basis bitstring integers.

Return type:

SecondQuantizedHamiltonian