netket_foundation.FoundationalQuantumState#
- class netket_foundation.FoundationalQuantumState(sampler, model, parameter_space, n_samples=1024, seed=None, sampler_seed=None, n_discard_per_chain=None, chunk_size=None, n_replicas=None)[source]#
Variational state that jointly samples physical configurations and fixed parameter replicas.
- Parameters:
- __init__(sampler, model, parameter_space, n_samples=1024, seed=None, sampler_seed=None, n_discard_per_chain=None, chunk_size=None, n_replicas=None)[source]#
Initialize the Abstract base class of a Variational State defined on an hilbert space.
Methods
__init__(sampler, model, parameter_space[, ...])Initialize the Abstract base class of a Variational State defined on an hilbert space.
expect(O)Estimates the quantum expectation value for a given operator \(O\) or generic observable.
expect_and_forces(O, *[, mutable])Estimates the quantum expectation value and the corresponding force vector for a given operator O.
expect_and_grad(O, *[, mutable])Estimates the quantum expectation value and its gradient for a given operator \(O\).
get_state(parameters[, seed])Given a set of parameters, returns a standard MCState instance that corresponds to the foundational state with those parameters.
grad(Ô, *[, use_covariance, mutable])Estimates the gradient of the quantum expectation value of a given operator O.
init([seed, dtype])Initialises the variational parameters of the variational state.
init_parameters([init_fun, seed])Re-initializes all the parameters with the provided initialization function, defaulting to the normal distribution of standard deviation 0.01.
load(path[, new_seed])local_estimators(op, *[, chunk_size])log_value(σ)Evaluate the variational state for a batch of states and returns the logarithm of the amplitude of the quantum state.
qfi([parameters, seed])Compute the Quantum Fisher Information (fidelity susceptibility) matrix for the foundational state.
quantum_geometric_tensor(qgt_T)Computes an estimate of the quantum geometric tensor G_ij.
reset()Resets the sampled states.
sample(*[, chain_length, n_samples, ...])Sample a certain number of configurations.
save(fileobj)to_array([normalize])Returns the dense-vector representation of this state.
to_qobj()Convert the variational state to a qutip's ket Qobj.
Attributes
chain_lengthLength of the markov chain used for sampling configurations.
chunk_sizeSuggested maximum size of the chunks used in forward and backward evaluations of the Neural Network model.
hilbertThe descriptor of the Hilbert space on which this variational state is defined.
hilbert_physicalThe physical hilbert space of the variational state.
model_stateThe optional PyTree with the mutable state of the model, which is not optimized.
n_discard_per_chainNumber of discarded samples at the beginning of the markov chain.
n_parametersThe total number of parameters in the model.
n_replicasn_samplesThe total number of samples generated at every sampling step.
n_samples_per_rankThe number of samples generated on every jax device at every sampling step.
parameter_arrayparametersThe pytree of the parameters of the model.
samplerThe Monte Carlo sampler used by this Monte Carlo variational state.
samplesReturns the set of cached samples.
variablesThe PyTree containing the parameters and state of the model, used when evaluating it.
sampler_stateThe current state of the sampler.
mutableSpecifies which collections in the model_state should be treated as mutable.