netket.utils#
Generic functions#
Utility functions and classes.
Check if a function \(\psi\) is likely to be holomorphic almost everywhere. |
Dataclass and PyTree utilities#
Astract Base class for jaw-aware PyTree classes. |
|
Mark a field of a dataclass or PyTree to be: |
|
Specification of a sharded field. |
Utils#
Utility functions and classes.
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 |
|
An object representing a range similar to python's range, but that works with jax.jit. |
|
A static representation of 0, which can be used in Jax and attempts to behave like a normal jax array. |
Tree traversal helpers#
NetKet logging backends share a path-aware tree walker implemented in
netket.utils.tree_walk.walk_tree_with_path.
Traverse a nested tree while threading a path to each leaf. |
It traverses nested dict, list, tuple, namedtuple, to_dict(), and
to_compound() structures while threading a path accumulator down to each leaf.
This helper is used internally by the HDF5 and TensorBoard loggers to keep their
tree traversal logic consistent without duplicating the walk itself.
The function docstring includes a minimal example showing how to define
visit_leaf, enter_node, and expand_node callbacks.
Symmetry Group Manipulation#
The group-manipulation API is documented under netket.symmetry.
The legacy netket.utils.group namespace re-exports the same public objects,
including Permutation,
PermutationGroup,
FiniteGroup, and
PointGroup.
History and time-series data#
Utilities for storing and managing time-series data, particularly useful for tracking optimization progress and simulation results.
A class to store a time-series of arbitrary data. |
|
A class that behaves like a dictionary, mapping strings to History instances or nested HistoryDict instances. |
|
Accumulate history data in nested tree structures. |
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.
Measures how much time was spent in a timer, with possible sub-timers. |
|
Context manager used to mark a scope to be timed individually by NetKet timers. |
|
Marks the decorated function to be timed individually in NetKet timing scopes. |