You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For Renyi entropy calculation and a few other things it might be useful to have an utility function to check if a configuration )vector) is within the computational space.
This could be implemented very neatly by leveraging __contains__ to use it as
hi=nk.hilbert.Spin(0.5, 10)
xs=hi.all_states() # 2^N x N valid=xsinhi# bool vector 2^N
(2) numbers in the interval of valid values (ie for spin 1/2, between -1 and 1) but not check that it is exactly one of those values
(3) do the exact check, meaning that the value is a correct integer
Of course, doing the full check is more expensive and often we don't need to check it, as it's kind-of-guaranteed by our sampling.
However, sometimes we might want to do the full check
Possibly, we could have a keyword argument Hilbert.contains(x, *, fast=True/False)which defaults to False, in which case it does not check (3) but only (1) or (2), or even only (1)...
What makes sense to do?
Ps: once agreed upon, it would be neat to have a PR by someone!
The text was updated successfully, but these errors were encountered:
Related to this: in my opinion the MCState should initialize from a hilbert space sample, not a set of zeros that is often outside of the hilbert space (this is especially very annoying with fermions):
For Renyi entropy calculation and a few other things it might be useful to have an utility function to check if a configuration )vector) is within the computational space.
This could be implemented very neatly by leveraging
__contains__
to use it asor a more traditional
The main question is: we can check three things
Of course, doing the full check is more expensive and often we don't need to check it, as it's kind-of-guaranteed by our sampling.
However, sometimes we might want to do the full check
Possibly, we could have a keyword argument
Hilbert.contains(x, *, fast=True/False)
which defaults toFalse
, in which case it does not check (3) but only (1) or (2), or even only (1)...What makes sense to do?
Ps: once agreed upon, it would be neat to have a PR by someone!
The text was updated successfully, but these errors were encountered: