-
Notifications
You must be signed in to change notification settings - Fork 174
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
Improvements to continuous space #1575
Comments
I agree with both proposals, they would improve code readability |
Concerning long-range potentials, they should be implemented as well, I agree, also taking into account that computing the sum over periodic images can be tricky, so we want to have this implemented once for all! |
I also agree with both. Though do you think it makes sense to put the second proposal into nk.utils? I‘m not sure it belongs to hilbert and like this, other functionality can be added as well such as Ewald or radial distribution etc. (or maybe these actually belong in operator…) |
The main issue is that in continuous space we are not using Graph or similar as we do on the lattice, so this means that all the geometry info (pbc etc) that should be contained in the geometry is instead contained only in hilbert. In theory, I agree with you that the distance shouldn't be in hilbert, it should be in some Geometry class that you pass to Hilbert. Geometry could also take into account specific things such as Ewald, returning reciprocal vectors etc. For the observables, I am not sure... I think we should just consider them as operators? |
so a more complete proposal is something like: geo=Cell(d=3, L=1, pbc=True)
hi = Particle(N=N, geometry=geo)
...
geo.distance(R1,R2) notice that I would also add to Particle the possibility of specifying other quantum numbers for each particle, for example the spin: geo_fermions=Cell(d=3, L=1, pbc=True)
geo_bosons=FreeSpace(d=2)
#mixture of fermions and bosons where bosons are confined in 2D
hi = Particle(N=N1, spin=1/2, geometry=geo_fermions) + Particle(N=N2, spin=0, geometry=geo_bosons)
...
geo.distance(R1,R2) in theory, this allows to use lattice=Square(L=3)
hi = Particle(N=N,geometry=lattice,spin=1/2)
#equivalent to
hi = SpinOrbitalFermions(n_orbitals=lattice.n_nodes,n_fermions=N)
#similarly for Particle(N=N,geometry=lattice,spin=0) calling Fock(...) internally |
As discussed in the first point of #1575 . adds the following constructor ```python hi1 = nk.hilbert.Particle(N=5, L=(np.inf, np.inf), pbc=False) hi2 = nk.hilbert.Particle(N=5, D=2) assert hi1 == hi2 ``` as well as a default value for `pbc` when a dimension is infinite. ```python hi1 = nk.hilbert.Particle(N=5, L=(np.inf, np.inf)) hi2 = nk.hilbert.Particle(N=5, D=2) assert hi1 == hi2 ```
@dalin27 you are our best hope here |
I think implementing |
Hierarchy wise I think that abstract |
I think they have not much to do with each other |
so we make |
Regarding @PhilipVinc's second point about adding a
or instead return the evaluated distance values? The code above also requires adding the line |
I think it should be a function class AbstractGeometry:
def min_imag_convention(self, x: Array) -> Array:
....
return min image An important thing that we should keep in mind is how to handle the composed space of two different geometries. (Aka, imagine you have two sublattices each with a different set of fermions, for example.. Also, Is there anything else that would be useful to compute something? Also, the AbstractGeometry should define |
Things that come to my mind, by reading @gpescia 's tutorial:
Particle
. To avoid having to specify the annoyingjnp.inf
we could have some default arguments:WDYT? Internally, there will be still those
jnp.infty
(I know people don't like them. I'm happy if a pr gets rid of them but dunno how)Second thing:
It seems to me one often has to define a minimal image distance to use inter particle potentials.
I propose adding a
distance
function to the Particle Hilbert space that returns the distance according to the minimum distance convention (or not, if the bounding box is infinite)so that we can use that a bit everywhere instead of re-coding it every time, to make life easier for users.
Also we could add a new class
TwoBodyPotential
that automatically evaluates the potential among particles, to make it easier to implement this kind of potential.It would be just a wrapper around
Potential. We could then add some standard potentials ourselves (
Aziz,
Coulomb`...)Mainly I would like feedback from the people that use the continuous space stuff to know if this makes sense. For example, do you always use minimum image or do you sometimes need some different, weird distance functions? Would a
TwoBodyPotential
function be helpful? Is there some pain point that is missing?The text was updated successfully, but these errors were encountered: