Skip to content

How to use MetropolisSamplerNumpy #1160

Answered by PhilipVinc
whatisspin asked this question in Q&A
Discussion options

You must be logged in to vote

The documentation of MetropolisSamplerNumpy says that this sampler is executed through Numpy instead of Jax that is the standard throught netket.

Therefore, it requires the transition kernels to be written in NumPy instead of Jax. Admittedly this is not mentioned anywhere, and we could improve the documentation. To write a NumPy Kernel, start from one of the existing numpy kernels for inspiration such as LocalRuleNumpy or HamiltonianNumpy or the very generic CustomNumpy.

The reason for the existence of this numpy sampler is that when we started the rewrite of NetKet 3 in Jax, we could not write some transition rules in Jax efficiently (in particular HamiltonianRule and Custom) and therefo…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@PhilipVinc
Comment options

Answer selected by whatisspin
Comment options

You must be logged in to vote
2 replies
@PhilipVinc
Comment options

@PhilipVinc
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants