neuralqx.operators package

This module contains the implementation of different operators used in different gravitational models such as holonomies, n-point functions, etc.

holonomy(H, site, adjoint=0, o_type='creation')

A method to create a NetKet operator that acts as the holonomy operator in U(1) theory on a given vertex. It can either be a creation or annihilation holonomy as well as an adjoint.

Parameters:
  • H (AbstractHilbertInterface) – the Hilbert space the operator acts on

  • site (int) – (int): the vertex it acts on in the graph

  • adjoint (int) – (int): an identifier to check if the adjoint of the operator is requested

  • o_type (str) – (String): an identifier to check the operation type (annihilation or creation)

  • is_4d – a flag to check if we are working in 4 spacetime dimensions

Return type:

LocalOperatorJax

Returns:

(netket.operator.LocalOperator): the holonomy operator on the given vertex

get_quantum_number(H, site, is_complex=False, complex_gc=False, is_4d=False)

A function to return the quantum number at the given site. Essentially, it acts like a number operator which is just a diagonal matrix where the diagonal is composed of the allowed quantum numbers

Parameters:
  • H (AbstractHilbertInterface) – the Hilbert space the operator acts on

  • site (int) – (int): the vertex on which the operator should act

Return type:

Union[LocalOperatorJax, FunctionalLocalOperator]

Returns:

(netket.operator.LocalOperator): the operator returning the quantum number on the given site

shifted_get_quantum_number(H, site, shift_dict, graph_level, comp_idx, direction, is_complex=False, complex_gc=False, is_4d=False)

A function to return the shifted quantum number at the given site. Essentially, it acts like a number operator which is just a diagonal matrix where the diagonal is composed of the allowed quantum numbers. The shift is introduced by adding as many deltas as there are in the h sub-dict of the shift_dict and subtracting as many deltas as there are in the ha sub-dict.

Parameters:
  • complex_gc (bool) – a flag to determine whether we want complex valued operators to be used in the Gauss constraint

  • is_complex (bool) – a flag to determine whether we want complex valued operators

  • comp_idx (int) – the current component graph level being computed in the triple-scalar-product

  • graph_level (int) – the current graph level we are in

  • shift_dict (dict) – the dict containing all the shifts

  • is_4d (bool) – a flag to determine whether we work in 4-spacetime dimensions

  • H (AbstractHilbertInterface) – the Hilbert space the operator acts on

  • site (int) – the vertex on which the operator should act

  • direction (str) – the direction of the shift

Return type:

Union[LocalOperatorJax, FunctionalLocalOperator]

Returns:

(netket.operator.LocalOperator): the operator returning the quantum number on the given site

charge_coloring(H, site, charge)

A local operator which acts on the given edge and is always zero unless the edge has the specified charge

Parameters:
coloring(H, site, charge_vector)

A local operator which acts on the given edge and is always zero unless the edge has the specified charge vector

Parameters:
  • H (AbstractHilbertInterface) – the Hilbert space it acts on

  • site (int) – the edge it acts on (this should be on the first level graph for an N-dim gauge group

  • charge_vector (tuple[int, ...]) – the charge vector specified

n_point_function(H, operator, edges, charge_vectors)

A function which returns the N-point function of a given operator. Here, “N” is determined by the number of edges passed onto the function. Hence, for 2 edges being specified you get the 2-point function of the specified operator.

Parameters:
  • H (AbstractHilbertInterface) – the Hilbert space it acts on

  • operator (Callable) – the operator requested, this should be a callable, not a LocalOperator

  • edges (tuple[int, ...]) – the list of edges it acts on

  • charge_vectors (tuple[tuple[int, ...], ...]) – the list of charge vectors, each corresponding to the edge and the same index in the edges param

class PenaltyCost(op, factor)

Bases: PenaltyCost

A wrapper lazily representing a penalty term to be added to the cost function such that:

cost = <C> + factor * <P>

The penalty term operator term can be any discrete operator, but should always have an attribute factor, which will then be used to weight the penalty being applied to the cost function

class InverseExpectationCost(op, factor, alpha)

Bases: InverseExpectationCost

A wrapper lazily representing a penalty term to be added to the cost function such that:

cost = <C> + factor / (alpha + <V>)^2

The penalty term operator term can be any discrete operator, but should always have an attribute factor, which will then be used to weight the penalty being applied to the cost function and an attribute alpha, which will be in the denominator of the inverse volume computation

Subpackages

Submodules