class netket.models.tensor_networks.MPSOpen[source]#

Bases: Module

An open Matrix Product State (MPS) for a quantum state of discrete degrees of freedom. The MPS is defined as

\[\Psi(s_1,\dots s_N) = \mathrm{Tr} \left[ A[s_1]\dots A[s_N] \right] ,\]

for arbitrary local quantum numbers \(s_i\), where \(A[s_{i}]\) are vectors of shape \((\text{bond_dim},)\) for \(i=1,N\) and matrices of shape \((\text{bond_dim}, \text{bond_dim})\) for \(i=2, \dots N-1\) , depending on the value of the local quantum number \(s_i\).

checkpoint: bool = True#

Whether to use jax.checkpoint on the scan function for memory efficiency.

unroll: int = 1#

the number of scan iterations to unroll within a single iteration of a loop.

hilbert: HomogeneousHilbert#

Hilbert space on which the state is defined.

bond_dim: int#

Bond dimension of the MPS tensors. See formula above.

kernel_init: Callable[[Any, Sequence[int], Any], Union[ndarray, Array]]#

the initializer for the MPS weights. This is added to an identity tensor.


Queries the tensor network for the input configurations x.


x – the input configuration


Internal function, used to contract the tensor network with some input tensor.


qn – The input tensor to be contracted with this MPS