quantax.optimizer.SPRING#
- class quantax.optimizer.SPRING(state: Variational, hamiltonian: Operator, imag_time: bool = True, solver: Callable | None = None, mu: float = 0.9, file: None | str | Path | BinaryIO = None)#
SPRING optimizer. This is a variant of SR with momentum. When using the default value of
mu=0.9
, 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.9, file: None | str | Path | BinaryIO = None)#
- Parameters:
state – Variational state to be optimized.
hamiltonian – The Hamiltonian for the evolution.
imag_time – Whether to use imaginary-time evolution, default to True.
solver – The numerical solver for the matrix inverse, default to
auto_pinv_eig
.
Methods
__init__
(state, hamiltonian[, imag_time, ...])get_Ebar
(samples)Compute \(\bar \epsilon\) for given samples.
get_Obar
(samples)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)Obtain the optimization step by solving the equation \(\bar O \dot \theta = \bar \epsilon\) for given samples.
save
(file)Save the optimizer internal quantities to a file.
solve
(Obar, Ebar)Solve the equation \(\bar O \dot \theta = \bar \epsilon\) for given \(\bar O\) and \(\bar \epsilon\).
Attributes
VarE
Energy variance \(\left< (H - E)^2 \right>\) of the current step.
energy
Energy of the current step.
hamiltonian
The Hamiltonian for the evolution.
holomorphic
Whether the state is holomorphic.
imag_time
Whether to use imaginary-time evolution.
state
Variational state to be optimized.
vs_type
The vs_type of the state.