quantax.optimizer.MinSR_Structured#

class quantax.optimizer.MinSR_Structured(state: Variational, hamiltonian: Operator, solver: Callable | None = None)#

MinSR optimization, specifically designed for Sequential networks. The optimization utilizes gradient checkpointing method and structured derivatives to reduce the memory cost. See MinSR paper for details.

__init__(state: Variational, hamiltonian: Operator, solver: Callable | None = None)#
Parameters:
  • state – Variational state to be optimized.

  • hamiltonian – The Hamiltonian for the evolution.

  • solver – The numerical solver for the matrix inverse, default to minsr_pinv_eig.

…warning:

The model must be `~quantax.nn.Sequential`, otherwise one should use
`~quantax.optimizer.TDVP`.

The vs_type of the variational state should be ``real_or_holomorphic`` or
``real_to_complex``. In the latter case, the complex neurons are only allowed
in the last few unparametrized layers.

Methods

Ohvp(samples, vec)

Compute \(\bar O^† v\).

__init__(state, hamiltonian[, solver])

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_Tmat(samples)

Compute the \(T\) matrix in MinSR

get_step(samples)

Obtain the MinSR step from given samples

solve(samples, Tmat, 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.