quantax.optimizer.TDVP#
- class quantax.optimizer.TDVP#
Bases:
QNGD
Time-dependent variational principle TDVP, or stochastic reconfiguration (SR).
- __init__(state: Variational, hamiltonian: Operator, imag_time: bool = True, solver: Callable | None = None, kazcmarz_mu: float = 0.0)#
- 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
.use_kazcmarz – Whether to use the kazcmarz scheme, default to False.
- property energy: float | None#
Energy of the current step.
- property VarE: float | None#
Energy variance \(\left< (H - E)^2 \right>\) 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.
- solve(Obar: Array, Ebar: Array) Array #
Solve the equation \(\bar O \dot \theta = \bar \epsilon\) for given \(\bar O\) and \(\bar \epsilon\).
- property state: Variational#
Variational state to be optimized.
- property vs_type: int#
The vs_type of the state.