quantax.optimizer.EnergyGrad#

class quantax.optimizer.EnergyGrad#

Energy gradient source defining \(\bar \epsilon\) from the local energies of a Hamiltonian, used for ground-state search and time evolution.

__init__(hamiltonian: Operator)#
Parameters:

hamiltonian – The Hamiltonian for the evolution.

property hamiltonian: Operator#

The Hamiltonian for the evolution.

property energy: Array | ndarray | bool | number | bool | int | float | complex | None#

Energy of the current step.

property VarE: Array | ndarray | bool | number | bool | int | float | complex | None#

Energy variance \(\left< (H - E)^2 \right>\) of the current step.

ebar(state: Variational, samples: Samples | Array) Array#

Compute \(\bar \epsilon\) for given samples. The local energy is \(E_{loc, s} = \sum_{s'} \frac{\psi_{s'}}{\psi_s} \left< s|H|s' \right>\), and \(\bar \epsilon\) is defined as \(\bar \epsilon = \frac{1}{\sqrt{N_s}} (E_{loc, s} - \left<E_{loc, s}\right>)\).

ebar_dense(psi: Array, symm: Symmetry, Ns: int) Array#

Compute \(\bar \epsilon = (H - E) \psi\) for the normalized wave function psi given in the full Hilbert space of symm, whose first Ns entries are the physical amplitudes.