netket_foundation.FoundationalQuantumState

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.

Parameters:
  • hilbert – The hilbert space upon which this state is defined.

  • sampler (Sampler)

  • model (Any)

  • parameter_space (ParameterSpace)

  • n_samples (int)

  • seed (int | Any | None)

  • sampler_seed (int | Any | None)

  • n_discard_per_chain (int | None)

  • chunk_size (int | None)

  • n_replicas (int | None)

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_length

Length of the markov chain used for sampling configurations.

chunk_size

Suggested maximum size of the chunks used in forward and backward evaluations of the Neural Network model.

hilbert

The descriptor of the Hilbert space on which this variational state is defined.

hilbert_physical

The physical hilbert space of the variational state.

model_state

The optional PyTree with the mutable state of the model, which is not optimized.

n_discard_per_chain

Number of discarded samples at the beginning of the markov chain.

n_parameters

The total number of parameters in the model.

n_replicas

n_samples

The total number of samples generated at every sampling step.

n_samples_per_rank

The number of samples generated on every jax device at every sampling step.

parameter_array

parameters

The pytree of the parameters of the model.

sampler

The Monte Carlo sampler used by this Monte Carlo variational state.

samples

Returns the set of cached samples.

variables

The PyTree containing the parameters and state of the model, used when evaluating it.

sampler_state

The current state of the sampler.

mutable

Specifies which collections in the model_state should be treated as mutable.