netket.utils#

Generic functions#

Utility functions and classes.

is_probably_holomorphic

Check if a function \(\psi\) is likely to be holomorphic almost everywhere.

Dataclass and PyTree utilities#

struct.Pytree

Astract Base class for jaw-aware PyTree classes.

struct.field

Mark a field of a dataclass or PyTree to be:

struct.ShardedFieldSpec

Specification of a sharded field.

Utils#

Utility functions and classes.

HashableArray

This class wraps a numpy or jax array in order to make it hashable and equality comparable (which is necessary since a well-defined hashable object needs to satisfy obj1 == obj2 whenever hash(obj1) == hash(obj2).

StaticRange

An object representing a range similar to python's range, but that works with jax.jit.

numbers.StaticZero

A static representation of 0, which can be used in Jax and attempts to behave like a normal jax array.

Symmetry Group Manipulation#

group.Permutation

group.PermutationGroup

Collection of permutation operations acting on sequences of length degree.

group.FiniteGroup

Collection of Elements expected to satisfy group axioms.

group.PointGroup

Collection of point group symmetries acting on n-dimensional vectors.

Timing utils#

Use those utilities to coarsely profile some netket functions or scopes. The timer here can be nested and can be used in low-level library functions.

timing.Timer

Measures how much time was spent in a timer, with possible sub-timers.

timing.timed_scope

Context manager used to mark a scope to be timed individually by NetKet timers.

timing.timed

Marks the decorated function to be timed individually in NetKet timing scopes.