Move constrained logic to a special ConstrainedHilbertIndex class that can more easily be overridden
Created by: PhilipVinc
I believe there were a few requests for improvements of the hilbert spaces, but none of them would really benefit from jax afaik. In particular:
make restricted fock indexable in more cases (e.g. fixed particle number is small but we have a lot of sites). Implemented it here some time ago and can try to clean it up for a PR at some point. Only really useful for ED and exactState (will benefit @Jannes Nys and @Fan Yang)
restricted fock random_state going OOM if the local cuttoff is big and the local fock space is therefore not really indexable (according to @Zakari Denis)
I would change the default dtype of the discrete hilbert spaces to something more reasonable like int8/uint8 instead of double. I think it's cleaner to set it in hilbert already instead of later casting in the samplers. Also types are currently not consistent so you might get sth different from all_states and random_state
This is a draft to make it easy to implement point 2, essentially we could add some special HilbertIndexConstrained for what @z-denis wanted, I think. You could take this as a starting point.
We can probably further clean the interface, but I did not think much about it.
Then @inailuig step 1 could be achieved by jaxifying those classes.