netket icon indicating copy to clipboard operation
netket copied to clipboard

Complex_wf_and_spin

Open gpescia opened this issue 2 years ago • 4 comments

This PR makes it possible to compute the local energy of complex-valued wf. Additionally the hilbert now indicates the spin of the particles and the random state for periodic systems is changed a bit.

gpescia avatar Jul 21 '22 09:07 gpescia

Codecov Report

Merging #1273 (0446c36) into master (35a7bd5) will increase coverage by 0.22%. The diff coverage is 92.00%.

@@            Coverage Diff             @@
##           master    #1273      +/-   ##
==========================================
+ Coverage   82.85%   83.08%   +0.22%     
==========================================
  Files         214      214              
  Lines       12841    12868      +27     
  Branches     1979     1981       +2     
==========================================
+ Hits        10640    10691      +51     
+ Misses       1719     1695      -24     
  Partials      482      482              
Impacted Files Coverage Δ
netket/operator/_sumoperators.py 95.34% <ø> (+5.98%) :arrow_up:
netket/hilbert/particle.py 96.66% <85.71%> (-3.34%) :arrow_down:
netket/operator/_kinetic.py 94.11% <88.00%> (-5.89%) :arrow_down:
netket/hilbert/random/particle.py 100.00% <100.00%> (ø)
netket/operator/_potential.py 95.83% <100.00%> (ø)
netket/vqs/mc/mc_state/expect.py 96.36% <100.00%> (ø)
netket/tools/_cpu_info.py 63.63% <0.00%> (+25.25%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Jul 21 '22 10:07 codecov[bot]

I would actually make sure that we can still choose the different methods to compute the kinetic energy. Some are more memory efficient than others. Methods I can think of:

  • the original version we had, works for real functions
  • the same as the original one, but with jax.lax.map instead of vmap, such that the memory doesn't blow up (I need that, and FermiNet has something similar implemented with scan, so I guess they needed it as well)
  • now this jacrev and jacfwd approach.
  • Jackson-Feenberg
  • ... But there are others. The default should be the more general case based on jacrev and jacfwd that you have now, but I think we should create a 'method' kwarg.

jwnys avatar Jul 21 '22 12:07 jwnys

I would actually make sure that we can still choose the different methods to compute the kinetic energy. Some are more memory efficient than others. Methods I can think of:

We could have 5 different operators KineticOperator implementing the different methods?

PhilipVinc avatar Jul 21 '22 13:07 PhilipVinc

We could have 5 different operators KineticOperator implementing the different methods?

Wait, does that involve using multiple dispatch?!?! :) I vote for Jannes' proposal to create a method kwarg

gcarleo avatar Jul 21 '22 13:07 gcarleo