neuralqx.gauge_groups.abstract_gauge_group_interface module

Abstract interface for gauge groups in neuraLQX.

This module defines the AbstractGaugeGroup base class which standardizes how gauge groups expose their Gauss constraint operator, compatibility with a Hilbert space and graph, and key group properties such as name, dimension, and whether the group is abelian.

Concrete gauge group implementations must provide the group name, an abelian flag, and a method that constructs the Gauss constraint in one of several supported operator representations.

class AbstractGaugeGroup(H, *, lazy=True, computational=True, jax=False)

Bases: ABC

Abstract base class for gauge group implementations.

A gauge group implementation is responsible for - declaring compatibility with a given Hilbert space and its graph - exposing the group dimension in the representation used by the Hilbert space - constructing and caching the Gauss constraint operator

The Gauss constraint can be implemented as a NetKet LocalOperator, a neuraLQX ComputationalOperator, or a ComputationalJaxOperator. The class also supports switching operator backends by reinitialising the cached constraint.

Parameters:
  • H (AbstractHilbertInterface) – Hilbert space instance that defines graph, local degrees of freedom, and gauge group dimensionality.

  • lazy (Optional[bool]) – If True and a LocalOperator backend is requested, delay building the operator structure until needed.

  • computational (Optional[bool]) – If True, prefer neuraLQX computational operator backends.

  • jax (Optional[bool]) – If True and computational is True, request a JAX friendly computational operator backend.

Returns:

None.

property is_computational: bool

Report whether this instance is configured to use computational operator backends.

If True, the constraint is intended to be built as a neuraLQX computational operator type rather than a NetKet LocalOperator.

Returns:

True if computational operators are selected, otherwise False.

property is_jax: bool

Report whether this instance is configured to use the JAX computational backend.

If True, and if computational operators are enabled, the constraint is intended to be built as a ComputationalJaxOperator.

Returns:

True if JAX computational operators are selected, otherwise False.

property graph: AbstractGraph

Return the graph associated with the Hilbert space used by this gauge group.

Returns:

Graph instance that defines the combinatorial structure of the model.

property hilbert: AbstractHilbertInterface

Return the Hilbert space this gauge group is compatible with.

Returns:

Hilbert space interface instance used to configure this gauge group.

property dimensions: int

Return the dimension of the gauge group in the representation used by the Hilbert space.

Returns:

Gauge group dimension.

property constraint: LocalOperatorJax | ComputationalOperator | ComputationalJaxOperator

Return the cached Gauss constraint operator for this gauge group.

The returned operator type depends on how the constraint was initialised and can be a NetKet LocalOperator, a neuraLQX ComputationalOperator, or a ComputationalJaxOperator.

Returns:

Constraint operator instance.

abstract property name: str

Returns the name in string format of this gauge group.

abstract property is_abelian: bool

Returns True if this gauge group is abelian, otherwise False.

abstractmethod init_constraint(*, computational=True, jax=False, lazy=True)

Construct and return the Gauss constraint operator for this gauge group.

Implementations should create the constraint in one of the supported operator representations. By default, computational backends are preferred, and LocalOperator construction can optionally be deferred using the lazy flag.

Parameters:
  • computational (Optional[bool]) – If True, return a neuraLQX computational operator backend.

  • jax (Optional[bool]) – If True and computational is True, return a ComputationalJaxOperator.

  • lazy (Optional[bool]) – If True and a LocalOperator backend is requested, delay building the operator structure until needed.

Return type:

Union[LocalOperatorJax, ComputationalOperator, ComputationalJaxOperator]

Returns:

Gauss constraint operator instance.