Utilities
- jVMC.util.util.ground_state_search(psi, ham, tdvpEquation, sampler, numSteps=200, varianceTol=1e-10, stepSize=0.01, observables=None, outp=None)
This function performs a ground state search by Stochastic Reconfiguration.
- Arguments:
psi: Variational wave function (jVMC.vqs.NQS)ham: Hamiltonian operatortdvpEquation: An instance ofjVMC.util.TDVPorjVMC.util.MinSRnumSteps: Maximal number of stepsvarianceTol: Stopping criterionstepSize: Update step size (learning rate)observables: Observables to be measured during ground state searchoutp:Noneor instance ofjVMC.util.OutputManager.
- jVMC.util.util.measure(observables, psi, sampler, numSamples=None)
This function measures expectation values of a given set of operators given a pure state.
- Arguments:
observables: Dictionary of the form with operator names as keys and (lists of) operators as values, e.g.:{ "op_name_1": [operator1, operator2], "op_name_2": operator3 }
If an operator takes additional positional arguments, a tuple of the operator together with the arguments has to be passed instead. For example, assuming that
operator3from above requires additional arguments*args:{ "op_name_1": [operator1, operator2], "op_name_2": [(operator3, *args)] }
psi: Variational wave function (instance ofjVMC.vqs.NQS)sampler: Instance ofjVMC.samplerused for sampling.numSamples: Number of samples (optional)
- Returns:
A dictionary holding expectation values, variances, and MC error estimates for each operator. E.g. for the exemplary operator input given in Arguments:
{ "op_name_1": { "mean": [mean1, mean2], "variance": [var1, var2], "MC_error": [err1, err2] }, "op_name_2": { "mean": [mean3], "variance": [var3], "MC_error": [err3] } }