Replies: 2 comments 6 replies
|
notice though that the molecule constructor and similar would fix those positions in the BO case, not Particle itself, so in this sense maybe we can just remove quantum as a keyword... then the Hamiltonian will work with those objects and know if it's BO or not |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Continuous-Space Hilbert API — design draft
This note proposes a small, self-contained layer for constructing NetKet Hilbert spaces that represent particles moving in continuous space. It is meant to cover molecules, electron gases, helium droplets, crystals, and other many-body systems without bringing in external quantum-chemistry packages. No Hamiltonians or operators are discussed here—only the Hilbert side.
1. Core data objects
ParticleSpeciesmass,charge, total spinS, optionallabelParticleParticleSpecies; optional positionposition: jax.Array | None(bohr).None⇒ coordinate is dynamical, otherwise fixed (Born–Oppenheimer). Optional spin projectionm_z(None⇒ spin dynamical).ParticleSet(sub-class ofnk.hilbert.TensorHilbert)Sequence[Particle]and optionalgeometry: nk.geometry.Cell | None; builds the tensor-product Hilbert in its constructor, so the instance is itself a Hilbert object. Also exposes stacked JAX arrays for positions, charges, masses, spin masks, etc.Arrays are stored in atomic units (bohr, electron-mass, elementary-charge); no unit objects appear in JIT-traced code.
2. Predefined species
Two constants cover the majority of use-cases:
Users can always define their own, e.g.
3. Turning particles into a Hilbert space
ContinuousSpace— unbounded ℝ site.FixedPosition— trivial continuos-space Hilbert peaked at a fixed coordinate (to be added).FixedSpin— trivial 1-dimensional Hilbert holding a constant spin eigenvalue (to be added).By delegating spin blocks to
nk.hilbert.Spinwe reuse its random-state and enumeration machinery unchanged.4. Helper builders (optional sugar)
Each helper returns a
ParticleSet, they serve as a convenient interface for commonly used cases, such as creating the Hilbert space for molecules or solids.These wrappers are thin; they do not hide the underlying Particle/ParticleSet objects.
5. Units
API accepts "bohr" (alias "au") and "angstrom" (alias "Å").
Positions are converted once to bohr; internal arrays stay unit-free.
ParticleSet.to_units("angstrom") is available for inspection/export.
6. Usage examples
7. Rationale
Small surface – three fundamental data classes plus syntax sugar.
Spin always tensor-producted — fixed projections reduce to 1-dim blocks.
Reuse, not rewrite – spin blocks rely on nk.hilbert.Spin.
JAX-friendly – positions & masks are plain JAX arrays
Model-agnostic – mechanism handles molecules, fluids, crystals, etc.;
helpers are convenience only.
8. Open questions
Default initial electron positions: always origin, or randomised near nuclei?
Is a built-in isotope table worth the complexity, or should users specify masses when needed?
All reactions