Netket

Latest version: v3.12.1

Safety actively analyzes 636669 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 6

3.11

This release supports Python 3.12 through the latest release of Numba, introduces several new jax-compatible operators and adds a new experimental way to distribute calculations among multiple GPUs without using MPI.

We have a few breaking changes as well: deprecations that were issued more than 18 months ago have now been finalized, most notable the `dtype` argument to several models and layers, some keywords to GCNN and setting the number of chains of exact samplers.

New Features

* Recurrent neural networks and layers have been added to `nkx.models` and `nkx.nn` [1305](https://github.com/netket/netket/pull/1305).
* Added experimental support for running NetKet on multiple jax devices (as an alternative to MPI). It is enabled by setting the environment variable/configuration flag `NETKET_EXPERIMENTAL_SHARDING=1`. Parallelization is achieved by distributing the Markov chains / samples equally across all available devices utilizing [`jax.Array` sharding](https://jax.readthedocs.io/en/latest/notebooks/Distributed_arrays_and_automatic_parallelization.html). On GPU multi-node setups are supported via [jax.distribued](https://jax.readthedocs.io/en/latest/multi_process.html), whereas on CPU it is limited to a single process but several threads can be used by setting `XLA_FLAGS='--xla_force_host_platform_device_count=XX'` [#1511](https://github.com/netket/netket/pull/1511).
* {class}`netket.experimental.operator.FermionOperator2nd` is a new Jax-compatible implementation of fermionic operators. It can also be constructed starting from a standard fermionic operator by calling `operator.to_jax_operator()`, or used in combination with `pyscf` converters[1675](https://github.com/netket/netket/pull/1675),[#1684](https://github.com/netket/netket/pull/1684).
* {class}`netket.operator.LocalOperatorJax` is a new Jax-compatible implementation of local operators. It can also be constructed starting from a standard operator by calling `operator.to_jax_operator()` [1654](https://github.com/netket/netket/pull/1654).
* The logger interface has been formalised and documented in the abstract base class {class}`netket.logging.AbstractLog` [1665](https://github.com/netket/netket/pull/1665).
* The {class}`~netket.experimental.sampler.ParticleExchange` sampler and corresponding rule {class}`~netket.experimental.sampler.rules.ParticleExchangeRule` has been added, which special cases {class}`~netket.sampler.ExchangeSampler` to fermionic spaces in order to avoid proposing moves where the two site exchanged have the same population [1683](https://github.com/netket/netket/issues/1683).

Breaking Changes

* The {class}`netket.models.Jastrow` wave-function now only has {math}`N (N-1)` variational parameters, instead of the {math}`N^2` redundant ones it had before. Saving and loading format has now changed and won't be compatible with previous versions[1664](https://github.com/netket/netket/pull/1664).
* Finalize deprecations of some old methods in `nk.sampler` namespace (see original commit [1f77ad8267e16fe8b2b2641d1d48a0e7ae94832e](https://github.com/netket/netket/commit/1f77ad8267e16fe8b2b2641d1d48a0e7ae94832e))
* Finalize deprecations of 2D input to DenseSymm layers, which now turn into error and `extra_bias` option of Equivariant Networks/GCNNs (see original commit [c61ea542e9d0f3e899d87a7471dea96d4f6b152d](https://github.com/netket/netket/commit/c61ea542e9d0f3e899d87a7471dea96d4f6b152d))
* Finalize deprecations of very old input/properties to Lattices [0f6f520da9cb6afcd2361dd6fd029e7ad6a2693e](https://github.com/netket/netket/commit/0f6f520da9cb6afcd2361dd6fd029e7ad6a2693e))
* Finalie the deprecation for `dtype=` attribute of several modules in `nk.nn` and `nk.models`, which has been printing an error since April 2022. You should update usages of `dtype=` to `param_dtype=` [1724](https://github.com/netket/netket/issues/1724)


Deprecations

* `MetropolisSampler.n_sweeps` has been renamed to {attr}`~netket.sampler.MetropolisSampler.MetropolisSampler.sweep_size` for clarity. Using `n_sweeps` when constructing the sampler now throws a deprecation warning; `sweep_size` should be used instead going forward [1657](https://github.com/netket/netket/issues/1657).
* Samplers and metropolis rules defined as {func}`netket.utils.struct.dataclass` are deprecated because the base class is now a {class}`netket.utils.struct.Pytree`. The only change needed is to remove the dataclass decorator and define a standard init method [1653](https://github.com/netket/netket/issues/1653).
* The `out` keyword of Discrete Hilbert indexing methods (`all_states`, `numbers_to_states` and `states_to_numbers`) is deprecated and will be removed in the next release. Plan ahead and remove usages to avoid breaking your code 3 months from now [1725](https://github.com/netket/netket/issues/1725)!

Internal changes
* A new class {class}`netket.utils.struct.Pytree`, can be used to create Pytrees for which inheritance autoamtically works and for which it is possible to define `__init__`. Several structures such as samplers and rules have been transitioned to this new interface instead of old style `struct.dataclass` [1653](https://github.com/netket/netket/issues/1653).
* The {class}`~netket.experimental.operator.FermionOperator2nd` and related classes now store the constant diagonal shift as another term instead of a completely special cased scalar value. The same operators now also respect the `cutoff` keyword argument more strictly [1686](https://github.com/netket/netket/issues/1686).
* Dtypes of the matrix elements of operators are now handled more correctly, and fewer warnings are raised when running NetKet in X32 mode. Moreover, operators like Ising now default to floating point dtype even if the coefficients are integers [1697](https://github.com/netket/netket/issues/1697).

Bug Fixes
* Support multiplication of Discrete Operators by Sparse arrays [1661](https://github.com/netket/netket/issues/1661).

3.10.2

Bug Fixes

* Fixed a bug where it was not possible to recompile functions using two identical but different instances of PauliStringJax [1647](https://github.com/netket/netket/pull/1647).
* Fixed a minor bug where chunking was never actually used inside of {meth}`~netket.vqs.MCState.local_estimators`. This will turn on chunking for some other drivers such as {class}`netket.experimental.driver.VMC_SRt` and {class}`netket.experimental.driver.TDVPSchmitt`) [1650](https://github.com/netket/netket/pull/1650).
* {class}`netket.operator.Ising` now throws an error when it is constructed using a non-{class}`netket.hilbert.Spin` hilbert space [1648](https://github.com/netket/netket/pull/1648).

3.10.1

Bug Fixes
* Added support for neural networks with complex parameters to {class}`netket.experimental.driver.VMC_SRt`, which was just crashing with unreadable errors before [1644](https://github.com/netket/netket/pull/1644).

3.10

The highlights of this version are a new experimental driver to optimise networks with millions of parameters using SR, and introduces new utility functions to convert a pyscf molecule to a netket Hamiltonian.

Read below for a more detailed changelog

New Features

* Added new {class}`netket.experimental.driver.VMC_SRt` driver, which leads in identical parameter updates as the standard Stochastic Reconfiguration with diagonal shift regularization. Therefore, it is essentially equivalent to using the standard {class}`netket.driver.VMC` with the {class}`netket.optimizer.SR` preconditioner. The advantage of this method is that it requires the inversion of a matrix with side number of samples instead of number of parameters, making this formulation particularly useful in typical deep learning scenarios [1623](https://github.com/netket/netket/pull/1623).
* Added a new function {func}`netket.experimental.operator.from_pyscf_molecule` to construct the electronic hamiltonian of a given molecule specified through pyscf. This is accompanied by {func}`netket.experimental.operator.pyscf.TV_from_pyscf_molecule` to compute the T and V tensors of a pyscf molecule [1602](https://github.com/netket/netket/pull/1602).
* Added the operator computing the Rényi2 entanglement entropy on Hilbert spaces with discrete dofs [1591](https://github.com/netket/netket/pull/1591).
* It is now possible to disable netket's double precision default activation and force all calculations to be performed using single precision by setting the environment variable/configuration flag `NETKET_ENABLE_X64=0`, which also sets `JAX_ENABLE_X64=0`. When running with this flag, the number of warnings printed by jax is considerably reduced as well [1544](https://github.com/netket/netket/pull/1544).
* Added new shortcuts to build the identity operator as {func}`netket.operator.spin.identity` and {func}`netket.operator.boson.identity` [1601](https://github.com/netket/netket/pull/1601).
* Added new {class}`netket.hilbert.Particle` constructor that only takes as input the number of dimensions of the system [1577](https://github.com/netket/netket/pull/1577).
* Added new {class}`netket.experimental.models.Slater2nd` model implementing a Slater ansatz [1622](https://github.com/netket/netket/pull/1622).
* Added new {func}`netket.jax.logdet_cmplx` function to compute the complex log-determinant of a batch of matrices [1622](https://github.com/netket/netket/pull/1622).

Breaking changes

* {class}`netket.experimental.hilbert.SpinOrbitalFermions` attributes have been changed: {attr}`~netket.experimental.hilbert.SpinOrbitalFermions.n_fermions` now always returns an integer with the total number of fermions in the system (if specified). A new attribute {attr}`~netket.experimental.hilbert.SpinOrbitalFermions.n_fermions_per_spin` has been introduced that returns the same tuple of fermion number per spin subsector as before. A few fields are now marked as read-only as modifications where ignored [1622](https://github.com/netket/netket/pull/1622).
* The {class}`netket.nn.blocks.SymmExpSum` layer is now normalised by the number of elements in the symmetry group in order to maintain a reasonable normalisation [1624](https://github.com/netket/netket/pull/1624).
* The labelling of spin sectors in {func}`netket.experimental.operator.fermion.create` and similar operators has now changed from the eigenvalue of the spin operator ({math}`\pm 1/2` and so on) to the eigenvalue of the Pauli matrices ({math}`\pm 1` and so on) [1637](https://github.com/netket/netket/pull/1637).
* The connected elements and expectation values of all non-simmetric fermionic operators is now changed in order to be correct [1640](https://github.com/netket/netket/pull/1640).

Improvements

* Considerably reduced the memory consumption of {class}`~netket.operator.LocalOperator`, especially in the case of large local hilbert spaces. Also leveraged sparsity in the terms to speed up compilation (`_setup`) in the same cases [1558](https://github.com/netket/netket/pull/1558).
* {class}`netket.nn.blocks.SymmExpSum` now works with inputs of arbitrary dimensions, while previously it errored for all inputs that were not 2D [1616](https://github.com/netket/netket/pull/1616)
* Stop using `FrozenDict` from `flax` and instead return standard dictionaries for the variational parameters from the variational state. This makes it much easier to edit parameters [1547](https://github.com/netket/netket/pull/1547).
* Vastly improved, finally readable documentation of all Flax modules and neural network architectures [1641](https://github.com/netket/netket/pull/1641).

Bug Fixes

* Fixed minor bug where {class}`netket.operator.LocalOperator` could not be built with `np.matrix` object obtained by converting scipy sparse matrices to dense [1597](https://github.com/netket/netket/pull/1597).
* Raise correct error instead of unintelligible one when multiplying {class}`netket.experimental.operator.FermionOperator2nd` with other operators [1599](https://github.com/netket/netket/pull/1599).
* Do not rescale the output of {func}`netket.jax.jacobian` by the square root of number of samples. Previously, when specifying `center=True` we were incorrectly rescaling the output [1614](https://github.com/netket/netket/pull/1614).
* Fix bug in {class}`netket.operator.PauliStrings` that caused the dtype to get out of sync with the dtype of the internal arrays, causing errors when manipulating them symbolically [1619](https://github.com/netket/netket/pull/1619).
* Fix bug that prevented the use of {class}`netket.operator.DiscreteJaxOperator` as observables with all drivers [1625](https://github.com/netket/netket/pull/1625).
* Fermionic operator `get_conn` method was returning values as if the operator was transposed, and has now been fixed. This will break the expectation value of non-simmetric fermionic operators, but hopefully nobody was looking into them [1640](https://github.com/netket/netket/pull/1640).

3.9.2

This release requires at least Python 3.9 and Jax 0.4.

Bug Fixes

* Fix a bug introduced in version 3.9 for {class}`netket.experimental.driver.TDVPSchmitt` which resulted in the wrong dynamics [1551](https://github.com/netket/netket/pull/1551).

3.9.1

Bug Fixes

* Fix a bug in the construction of {class}`netket.operator.PauliStringsJax` in some cases [1539](https://github.com/netket/netket/pull/1539).

Page 2 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.