netket.nn.blocks.SymmExpSum#
- class netket.nn.blocks.SymmExpSum[source]#
Bases:
Module
A wrapper module to symmetrise a variational wave function with respect to a permutation group \(G\) by summing over all permuted inputs.
Given the characters \(\chi_g\) of an irreducible representation (irrep) of \(G\), a variational state that transforms according to this irrep is given by the projection formula
\[\psi_\theta(\sigma) = \frac{1}{|G|}\sum_{g\in G} \chi_g \psi_\theta(T_{g}\sigma).\]Ground states usually transform according to the trivial irrep \(\chi_g=1 \forall g\in G\).
Examples
Symmetrise an netket.models.RBM with respect to the space group of a 2D netket.graph.Square lattice:
>>> import netket as nk >>> graph = nk.graph.Square(4) >>> group = graph.space_group() >>> print("Size of space group:", len(group)) Size of space group: 128 >>> # Construct the bare unsymmetrized machine >>> machine_no_symm = nk.models.RBM(alpha=2) >>> # Symmetrize the RBM over the space group >>> ma = nk.nn.blocks.SymmExpSum(module = machine_no_symm, symm_group=group)
Nontrivial irreps can be specified using momentum and point-group quantum numbers:
>>> from math import pi >>> print(group.little_group(pi, 0).character_table_readable()) (['1xId()', '1xRefl(0°)', '1xRefl(90°)', '1xRot(180°)'], array([[ 1., 1., 1., 1.], [ 1., 1., -1., -1.], [ 1., -1., 1., -1.], [ 1., -1., -1., 1.]])) >>> chi = group.space_group_irreps(pi, 0)[1] >>> ma = nk.nn.blocks.SymmExpSum(module = machine_no_symm, symm_group=group, characters=chi)
Convolutional networks are already invariant under translations, so they only need to be symmetrised with respect to the point group (e.g., mirrors and rotations).
>>> import netket as nk >>> graph = nk.graph.Square(4) >>> print("Size of the point group:", len(graph.point_group())) Size of the point group: 8 >>> # Construct a translation-invariant RBM >>> machine_trans = nk.models.RBMSymm(alpha=2, symmetries=graph.translation_group()) >>> # Symmetrize the RBM over the point group >>> ma = nk.nn.blocks.SymmExpSum(module = machine_trans, symm_group=graph.point_group())
- Attributes
-
character_id:
int
|None
= None# Index of the character to project onto in the character table of the symmetry group.
The characters are accessed as:
symm_group.character_table()[character_id]
Only one of characters and character_id may be specified. If neither is specified, the character is taken to be all 1, yielding a trivially symmetric state.
-
characters:
HashableArray
|None
= None# Characters \(\chi_g\) of the space group to project onto.
Only one of characters and character_id may be specified. If neither is specified, the character is taken to be all 1, yielding a trivially symmetric state.
-
module:
Module
# The unsymmetrised neural-network ansatz.
-
symm_group:
PermutationGroup
# The symmetry group to use. It should be a valid netket.utils.group.PermutationGroup object.
Can be extracted from a netket.graph.Lattice object by calling
point_group()
ortranslation_group()
.Alternatively, if you have a
netket.graph.Graph
object you can build it fromautomorphisms()
.graph = nk.graph.Square(3) symm_group = graph.point_group()
-
character_id: