nn#
Modules#
|
A sequence of |
The layer that takes not only the output of the previous layer, but also the raw input basis state. |
|
|
The model that allows accelerated forward pass through local updates and internal quantities. |
Activation function#
\(f(x) = \sinh(x) + 1\). |
|
|
\(f(x) = \prod x\). |
|
\(f(x) = \exp(x)\). |
|
\(f(x) = \exp(x)\). |
|
Complex relu activation function \(f(x) = \mathrm{ReLU}(\mathrm{Re}\,x) + i\,\mathrm{ReLU}(\mathrm{Im}\,x)\). |
|
\(f(z) = \frac{1}{2}(1 + \cos\phi)\,z\), where \(\phi = \arg z\). |
|
\(f(x) = x_1 + i x_2\) , where \(x = (x_1, x_2)\). |
Initializers#
The functions below take an equinox.nn.Linear or equinox.nn.Conv layer, initialize its weight with the given scheme and set its bias to 0.
|
Apply the Lecun normal initializer. |
|
Apply the He normal initializer. |
|
Apply the Glorot normal initializer. |
Quantax also re-exports the JAX initializers with their axes fixed to the convention of
equinox.nn.Linear
and equinox.nn.Conv weights (in_axis=1, out_axis=0,
batch_axis=()), namely variance_scaling,
lecun_normal, lecun_uniform,
glorot_normal, glorot_uniform,
he_normal and he_uniform.
They are called as initializer(key, shape, dtype) and are useful when a weight
is generated directly instead of through an Equinox layer.
import jax.numpy as jnp
import quantax as qtx
W = qtx.nn.lecun_normal(qtx.get_subkeys(), (16, 8), jnp.float32)
Sign structures#
|
Compute a sign, phase, or cosine structure from a linear form of the spin configuration, |
Marshall sign rule for bipartite lattices. |
|
|
Stripe sign rule for bipartite lattices. |
120 degree Neel phase for triangular lattices. |
Conv layers#
|
Reshape the input to the shape suitable for convolutional layers. |
|
Convolution layer whose padding is determined by the lattice boundary. |
|
Symmetrize the output of a convolutional network by translations. |
|
Circular padding on all physical dimensions of a feature map. |
Embedding#
Convert a \(\pm 1\) configuration into a per-unit-cell state index. |
|
|
Learned positional encoding of a configuration onto the lattice grid. |
Fermions#
Get the indices of occupied fermion sites. |
|
Get the indices of the hopping fermions. |
|
Get the sign change due to fermion hopping. |
|
Usual fermion ordering goes from site 0 to site N-1, while QuSpin orders from site N-1 to site 0. |
|
Compute the sign difference between two fermionic orderings, one having channel dimension first, the other having channel dimension last. |