Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move fermions to stable netket #1797

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

PhilipVinc
Copy link
Member

This PR moves fermions to stable netket, raising deprecation warnings if using the experimental bindings.

Still has to update all the tests.

--

The only thing that I am still uncovinced and I would like to fix before moving everything to stable netket are:

  • The sampler. The MetropolisParticleExchangeand ParticleExchange rule is not very discoverable, and I saw quite a few people who did not realise it exists. Also the name is not very clear, because Particle is our continuous space Hilbert space, not the fermionic one...

Before this PR can be merged, I would like to explore the possibility of changing the name of the ParticleExchange rule (or not) and add more information in the docstrings of Hilbert explicitly pointing out to this sampling rule...

@gcarleo
Copy link
Member

gcarleo commented May 17, 2024

yes I agree this naming can be confusing, why not keeping only one MetropolisExchange that works for everything?

@PhilipVinc
Copy link
Member Author

Because the ExchangeRule is different from ParticleExchange: the first requires that you specify the graph of exchanges between all degrees of freedom, while the latter (which only works for fermions) will take the graph between the N fermionic modes, and assume that you can only exchange the sets of fermions with the same spins.

An alternative could be to allow to optionally pass the Hilbert space to ExchangeRule such that this is done automatically in that case, but keeping the old behaviour to be kept...

@gcarleo
Copy link
Member

gcarleo commented May 17, 2024

yes that might not be ideal uhm, I don't know... maybe let's just find an altenartive name then. I suggest "MetropolisHop"

@gcarleo
Copy link
Member

gcarleo commented May 17, 2024

essentially because you are doing a hopping of a particle on a lattice, which distinguishes enough with continuos space I guess

@gcarleo
Copy link
Member

gcarleo commented May 17, 2024

it would be ideal if MetropolisHop worked also for bosons, by the way!

@PhilipVinc
Copy link
Member Author

the problem is that we have a 'physical graph' and a 'degree of freedom graph'. ExchangeRule wants the 'degree of freedom graph' while ParticleExchange wants 'physical graph'.

@PhilipVinc
Copy link
Member Author

What would it do for bosons? we don't have spinful bosons atm...

@gcarleo
Copy link
Member

gcarleo commented May 17, 2024

I think this sampler should just take a random particle (whatever its spin) and move it in an empty site, so this is generalizable to all kind of particles on a lattice, including bosons

netket/operator/pyscf.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented May 21, 2024

Codecov Report

Attention: Patch coverage is 57.64706% with 36 lines in your changes are missing coverage. Please review.

Project coverage is 49.02%. Comparing base (4703968) to head (0a9b248).
Report is 5 commits behind head on master.

Current head 0a9b248 differs from pull request most recent head cfb59c0

Please upload reports for the commit cfb59c0 to get more accurate results.

Files Patch % Lines
netket/operator/fermion.py 40.00% 14 Missing and 4 partials ⚠️
netket/operator/_fermion2nd/__init__.py 0.00% 3 Missing ⚠️
netket/operator/_fermion2nd/numba.py 25.00% 3 Missing ⚠️
netket/operator/__init__.py 0.00% 2 Missing ⚠️
netket/operator/_fermion2nd/base.py 0.00% 2 Missing ⚠️
netket/operator/_fermion2nd/jax.py 33.33% 2 Missing ⚠️
netket/hilbert/__init__.py 0.00% 1 Missing ⚠️
netket/models/__init__.py 0.00% 1 Missing ⚠️
netket/models/slater.py 0.00% 1 Missing ⚠️
netket/sampler/metropolis.py 75.00% 1 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1797      +/-   ##
==========================================
- Coverage   50.62%   49.02%   -1.61%     
==========================================
  Files         312      313       +1     
  Lines       19050    19098      +48     
  Branches     2782     2786       +4     
==========================================
- Hits         9644     9362     -282     
- Misses       8699     9031     +332     
+ Partials      707      705       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants