Skip to main content

A NetKet extension for continuous space problems, with a focus on electronic structure

Project description

electroket

Electroket – electronic-structure library with neural wave functions

electroket is an experimental extension of [NetKet](https://www.netket.org/) that adds utilities for solving continuous space problems with a focus on electronic structure calculations. It reexports NetKet so it can be used as a drop‑in replacement while providing additional modules tailored for continuous degrees of freedom.

Installation

pip install electroket

Usage

import electroket as ek

print(ek.show_version())  # prints electroket's version

Library contents

electroket exposes several modules aimed at working with particles in continuous space:

  • hilbert – Hilbert spaces for particles and spinful particles in boxes or free space.
  • geometry – simulation cells supporting periodic and open boundary conditions.
  • molecule – helpers to define molecules and atomic properties including a small periodic table.
  • operator – kinetic, potential and interaction operators for continuous systems.
  • models – simple variational ansätze like Gaussian or Slater wave functions.
  • sampler – Metropolis samplers with rules suitable for continuous variables.
  • random – routines to generate random particle configurations.
  • pyscf_utils – utilities to interface with PySCF and obtain SCF orbitals.

These modules are imported in electroket.__init__ so they can be accessed directly from the top-level package.

Examples

Below is a minimal SR-VMC calculation for the H$_2$ molecule extracted from the Examples directory.

import netket as nk
import electroket as ek
from electroket.models import MolecularSlater

h2 = ek.Molecule(
    atoms=[
        ("H", [0.0, 0.0, -0.35]),
        ("H", [0.0, 0.0, 0.35]),
    ],
    units="angstrom",
)

ham = ek.operator.KineticEnergy(h2) + ek.operator.CoulombInteraction(h2)
model = MolecularSlater(h2)
sampler = ek.sampler.MetropolisSampler(
    h2,
    ek.sampler.GaussianRule(sigma=0.1),
)

vstate = nk.vqs.MCState(sampler, model, n_samples=500)

sr = nk.optimizer.SR(diag_shift=0.05)
opt = nk.optimizer.Sgd(learning_rate=0.01)

driver = nk.driver.VMC(
    hamiltonian=ham,
    optimizer=opt,
    variational_state=vstate,
    preconditioner=sr,
)

driver.run(n_iter=1000)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

electroket-0.1.0.tar.gz (34.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

electroket-0.1.0-py3-none-any.whl (38.1 kB view details)

Uploaded Python 3

File details

Details for the file electroket-0.1.0.tar.gz.

File metadata

  • Download URL: electroket-0.1.0.tar.gz
  • Upload date:
  • Size: 34.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for electroket-0.1.0.tar.gz
Algorithm Hash digest
SHA256 35fce632c4f3c7c90d82256370c7c2ad9963ade893262250460e2f795d1447f0
MD5 7c9721735d1610f813c9993de869c664
BLAKE2b-256 7ac9dcef54b1a0c492f4770fe6a339f5fc1bd23288fd5c46e0017cabca852d18

See more details on using hashes here.

File details

Details for the file electroket-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: electroket-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 38.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for electroket-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d633a1c3028a36f33c6f88023ee14a88c7e151054be32ae0b14e47bff41db7e6
MD5 388689ff1796a17d1966634d004aad60
BLAKE2b-256 9a59a52e1f39e68b66be0c37764d57ae930dd0283ed49a1778f2ac37c461f067

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page