BoothGroup/GPSKet

[Heads-up] Upcoming changes in NetKet

Closed this issue · 2 comments

Just an heads-up: the upcoming version 3.9 of netket to be released before august will have a slightly breaking change.

The first two axes in the output of the samplers have been swapped, samples are now of shape (n_chains, n_samples_per_chain, ...) consistent with netket.stats.statistics. Custom samplers need to be updated to return arrays of shape (n_chains, n_samples_per_chain, ...) instead of (n_samples_per_chain, n_chains, ...). netket/netket#1502

I think that this should not cause many problems, but in case let me know. (The reason we need to swap the axes is to support automatic parallelisation with jax internal mechanism, which we found works better than MPI on GPUs and will allow multi-gpu training without MPI. This feature will likely take a few extra months to be fully fleshed out but we are taking the preliminary steps to get this merged with as little breakage as possible).

Another possible breaking change is the following:

  • The constructor of {meth}~netket.optimizer.qgt.QGTOnTheFly now takes an optional boolean argument holomorphic : Optional[bool] in line with the other geometric tensor implementations. This flag does not affect the computation algorithm, but will be used to raise an error if the user attempts to call {meth}~netket.optimizer.qgt.QGTOnTheFly.to_dense() with a non-holomorphic ansatz. While this might break past code, the numerical results were incorrect.

in short, we long knew that calling QGTOnTheFly.to_dense() gives invalid results for non-holomorphic functions with complex parameters, but we never errored. We decided to start raising an error after seeing a few users being bitten by this issue.

This shouldn't cause much problems for you, as you reimplement the QGT but you might want to match the behaviour

Thanks for the heads-up, we'll match the behaviour for the samplers and QGT implementations.

If you look at the changes of the original PR you should see what is needed. It should really be just a few lines.
netket/netket#1502