Configuration Options#
NetKet exposes a few configuration options which can be set through environment variables by doing something like
# without exporting it
NETKET_DEBUG=1 python ...
# by exporting it
export NETKET_DEBUG=1
python ...
# by setting it within python
python
>>> import os
>>> os.environ["NETKET_DEBUG"] = "1"
>>> import netket as nk
>>> print(netket.config.netket_debug)
True
Some configuration options can also be changed at runtime by setting it as:
>>> import netket as nk
>>> nk.config.netket_debug = True
>>> ...
You can always query the value of an option by accessing the nk.config
module:
>>> import netket as nk
>>> print(nk.config.netket_debug)
False
>>> nk.config.netket_debug = True
>>> print(nk.config.netket_debug)
True
Please note that not all configurations can be set at runtime, and some will raise an error.
Options are used to activate experimental or debug functionalities or to disable some parts of netket. Please keep in mind that all options related to experimental or internal functionalities might be removed in a future release.
List of configuration options#
Name |
Values [default] |
Changeable |
Description |
---|---|---|---|
|
True/[False] |
yes |
Enable debug logging in many netket functions. |
|
[True]/False |
yes |
Enable (or disable) double precision in NetKet and jax. |
|
True/[False] |
yes |
Enable experimental features such as gradients of non-hermitian operators. |
|
[True]/False |
no |
Raise a warning when running python under MPI without mpi4py and other mpi dependencies installed. |
|
[True]/False |
no |
When true, NetKet will always attempt to load (and initialize) MPI. If this flag is |
|
[True]/False |
yes |
By default, NetKet uses the split-RÌ‚ Gelman-Rubin diagnostic in |
|
True/[False] |
yes |
The integrated autocorrelation time \(\tau_c\) is computed separately for each chain \(c\).
To summarize it for the user, |
|
True/[False] |
yes |
Disables the jitting of the whole ode solver, mainly used within TDVP solvers. The jitting is sometimes incompatible with GPU-based calculations, and on large calculations it gives negligible speedups so it might be beneficial to disable it. |
|
True/[False] |
no |
Set to True when building documentation with Sphinx. Disables some decorators. This is for internal use only. |
|
True/[False] |
no |
Flag to turn on experimental support for multiple jax devices. When True, NetKet will distribute the markov chains/samples uniformly across all available jax devices and utilize them for computations. |
|
integer |
no |
Convenience helper to set the flag `XLA_FLAGS=’–xla_force_host_platform_device_count=XX’, forcing jax to use multiple threads as separate cpu devices. |
|
[True]/False |
yes |
Raise a warning when the highly experimental wrapper for numba operators applied to sharded arrays is used. |