quantax.optimizer.MARCH#
- class quantax.optimizer.MARCH#
Bases:
SRMARCH optimizer. This is a variant of SR with first and second order momentum (like Adam). When using the default value of
mu=0.95andbeta=0.995, the learning rate should be roughly 1/5 of the one in SR.- __init__(state: Variational, hamiltonian: Operator, imag_time: bool = True, solver: Callable | None = None, mu: float = 0.95, beta: float = 0.995, file: None | str | Path | BinaryIO = None)#
Initialize the MARCH optimizer.
- Parameters:
state – Variational state to be optimized.
hamiltonian – The Hamiltonian for the evolution.
imag_time – Whether to use imaginary-time evolution.
solver – The numerical solver for the matrix inverse, default to
auto_pinv_eig.mu – The first order momentum factor.
beta – The second order momentum factor.
- solve(Obar: Array, Ebar: Array) Array#
Solve the MARCH optimization step.
- save(file: str | Path | BinaryIO) None#
Save the optimizer internal quantities to a file.
- property VarE: float | None#
Energy variance \(\left< (H - E)^2 \right>\) of the current step.
- property energy: float | None#
Energy of the current step.
- get_Ebar(samples: Samples) 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>)\).
- get_Obar(samples: Samples) Array#
Calculate \(\bar O = \frac{1}{\sqrt{N_s}}(\frac{1}{\psi} \frac{\partial \psi}{\partial \theta} - \left< \frac{1}{\psi} \frac{\partial \psi}{\partial \theta} \right>)\) for given samples.
- get_step(samples: Samples) Array#
Obtain the optimization step by solving the equation \(\bar O \dot \theta = \bar \epsilon\) for given samples.
- property holomorphic: bool#
Whether the state is holomorphic.
- property imag_time: bool#
Whether to use imaginary-time evolution.
- property state: Variational#
Variational state to be optimized.