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 onsite (
int) – (int): the vertex it acts on in the graphadjoint (
int) – (int): an identifier to check if the adjoint of the operator is requestedo_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:
- 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 onsite (
int) – (int): the vertex on which the operator should act
- Return type:
- 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 constraintis_complex (
bool) – a flag to determine whether we want complex valued operatorscomp_idx (
int) – the current component graph level being computed in the triple-scalar-productgraph_level (
int) – the current graph level we are inshift_dict (
dict) – the dict containing all the shiftsis_4d (
bool) – a flag to determine whether we work in 4-spacetime dimensionsH (
AbstractHilbertInterface) – the Hilbert space the operator acts onsite (
int) – the vertex on which the operator should actdirection (
str) – the direction of the shift
- Return type:
- 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:
H (
AbstractHilbertInterface) – the Hilbert space it acts onsite (
int) – the site it acts oncharge (
int) – the charge it looks for
- 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 onsite (
int) – the edge it acts on (this should be on the first level graph for an N-dim gauge groupcharge_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:
- 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
- penalty_expectation_gradient(operator, parent_expectation)¶
Evaluate the derivative of the penalty objective with respect to
<O>.
- penalty_expectation_value(operator, parent_expectation)¶
Evaluate the penalty objective from the wrapped operator expectation.
Custom subclasses can override
PenaltyCost.expectation_value()or register a more specific Plum implementation of this function.
- penalty_is_linear(operator)¶
Return whether a penalty wrapper can use the constant-scale fast path.
This is a Plum-dispatched extension point. Register a more specific implementation for custom wrappers that need different routing.
- Return type:
- penalty_linear_scale(operator)¶
Return the constant local-estimator scale for a linear penalty wrapper.
- penalty_local_value_coefficients(operator, parent_expectation)¶
Return affine local-estimator coefficients
(scale, shift).The local estimator is
scale * O_loc + shift. This is the only information the expectation, forces and gradient paths need for nonlinear expectation-level penalty objectives.
Subpackages¶
- neuralqx.operators.computational package
- neuralqx.operators.computational.Euclidean3d package
- neuralqx.operators.computational.Euclidean4d package
- neuralqx.operators.computational.Euclidean4d.jax package
- neuralqx.operators.computational.Euclidean4d.jax.area module
- neuralqx.operators.computational.Euclidean4d.jax.area_difference module
- neuralqx.operators.computational.Euclidean4d.jax.gauss module
- neuralqx.operators.computational.Euclidean4d.jax.vertex_TRC module
- neuralqx.operators.computational.Euclidean4d.jax.volume module
- neuralqx.operators.computational.Euclidean4d.numba package
- neuralqx.operators.computational.Euclidean4d.numba.area module
- neuralqx.operators.computational.Euclidean4d.numba.area_difference module
- neuralqx.operators.computational.Euclidean4d.numba.gauss module
- neuralqx.operators.computational.Euclidean4d.numba.vertex_TRC module
- neuralqx.operators.computational.Euclidean4d.numba.volume module
- neuralqx.operators.computational.Euclidean4d.dispatch module
- neuralqx.operators.computational.Euclidean4d.jax package
- neuralqx.operators.computational.misc package
- neuralqx.operators.computational.qr package
- neuralqx.operators.computational.qr.jax package
- neuralqx.operators.computational.qr.jax.annihilation module
- neuralqx.operators.computational.qr.jax.creation module
- neuralqx.operators.computational.qr.jax.euclidean_constraint module
- neuralqx.operators.computational.qr.jax.flux module
- neuralqx.operators.computational.qr.jax.lorentzian_constraint module
- neuralqx.operators.computational.qr.numba package
- neuralqx.operators.computational.qr.numba.annihilation module
- neuralqx.operators.computational.qr.numba.creation module
- neuralqx.operators.computational.qr.numba.euclidean_constraint module
- neuralqx.operators.computational.qr.numba.flux module
- neuralqx.operators.computational.qr.numba.lorentzian_constraint module
- neuralqx.operators.computational.qr.dispatch module
- neuralqx.operators.computational.qr.jax package
- neuralqx.operators.computational.spherical package
- neuralqx.operators.computational.wrappers package
- neuralqx.operators.types package
- neuralqx.operators.types.computational_operator package
- neuralqx.operators.types.functional_local_operator package
- neuralqx.operators.types.functional_local_operator.base module
- neuralqx.operators.types.functional_local_operator.compile_helpers module
- neuralqx.operators.types.functional_local_operator.convert module
- neuralqx.operators.types.functional_local_operator.helpers module
- neuralqx.operators.types.functional_local_operator.jax module
- neuralqx.operators.types.functional_local_operator.numba module