Comments (12)
I agree with both proposals, they would improve code readability
from netket.
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!
from netket.
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…)
from netket.
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?
from netket.
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 Particle
also for the lattice, and have a unified interface:
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
from netket.
@dalin27 you are our best hope here
from netket.
I think implementing Geometry. Cell
and Geometry.FreeSpace
shouldn't be too complicated to start with , this will give us also an idea on the abstract interface of Geometry
objects
from netket.
Hierarchy wise I think that abstract Graph
should be inherited from the abstract Geometry
or, we should have the constructors above accept both Graphs and Geometries (a bit less elegant), what do you think @PhilipVinc ?
from netket.
I think they have not much to do with each other
from netket.
so we make Particle
accept both Geometry
and Graph
? makes sense, it's just that a Graph however is a special form of Geometry ...
from netket.
Regarding @PhilipVinc's second point about adding a distance
method to the Particle
Hilbert space, should the method return a distance function (min_imag_conv
) like this:
def distance(self):
pbc = np.array(self._pbc)
L = np.array(self._extent)
if np.all(pbc):
def min_imag_conv(x: Array):
"""Compute distances between particles using the minimum image convention"""
x = x.reshape(self._N, self._D) # not batched!
distances = x[None,:,:] - x[:,None,:]
distances = distances[jnp.triu_indices(self._N, 1)] # upper triangular part of the matrix
distances = jnp.remainder(distances + L/2.0, L) - L/2.0 # shape=(N(N-1)/2,D)
distances = jnp.linalg.norm(distances, axis=-1)
return distances
return min_imag_conv
elif np.all(pbc == False):
raise ValueError(
" Not yet implemented. "
)
else:
raise ValueError(
" Not yet implemented. "
)
or instead return the evaluated distance values? The code above also requires adding the line self._D = len(L) if D is None else D
in the __init__
method
from netket.
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 __hash__
and __eq__
so that it plays nice with jax, as Hilbert spaces do.
from netket.
Related Issues (20)
- MinSR regularisation HOT 8
- `vs.sample(n_samples=X, chain_length=Y)` does not error and silently ignores one argument
- vmap for modules HOT 3
- Sharding errors in sampler when using `reset_chains` in multi-node setting HOT 5
- Bug in hilbert space indexing with MPI HOT 4
- Adaptive time step fails if t0 is an integer HOT 2
- Conjugation of fermionic operators is wrong HOT 2
- Examples of observables/density operator for netket.experimental.TDVP
- TDVP not implemented for Squared LocalLiouvillian operators HOT 4
- Issue with shapes when using parallel tempering sampler on MPI HOT 6
- Generalized Hartree fock HOT 4
- TDVP convergence issues in multi-process execution HOT 4
- `operator.spin.sigmax` interplay with fermionic spaces
- LocalOperatorJax tracer leak (MetropolisHamiltonianJax breaks) HOT 1
- Changing default `n_chains` on GPUs and `n_discard_per_chain` to something more reasonable HOT 4
- Bug in MinSR code HOT 1
- Updating the installation documentation HOT 1
- VMC_SRt support for steady states HOT 2
- Serialisation under sharding is broken in jax 0.4.29
- Getting very different results than in the tutorials HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netket.