Skip to main content

Schrodinet

Build Status Codacy Badge

Quantum Monte-Carlo Simulations of one-dimensional problem using Radial Basis Functions Neural Networks.

Installation

Clone the repo and pip insatll the code

git clone https://github.com/NLESC-JCER/Schrodinet/
cd Schrodinet
pip install .

Harmonic Oscillator in 1D

The script below illustrates how to optimize the wave function of the one-dimensional harmonic oscillator.

import torch
from torch import optim

from schrodinet.sampler.metropolis import Metropolis
from schrodinet.wavefunction.wf_potential import Potential
from schrodinet.solver.solver_potential import SolverPotential
from schrodinet.solver.plot_potential import plot_results_1d, plotter1d

def pot_func(pos):
    '''Potential function desired.'''
    return 0.5*pos**2


def ho1d_sol(pos):
    '''Analytical solution of the 1D harmonic oscillator.'''
    return torch.exp(-0.5*pos**2)

# Define the domain and the number of RBFs

# wavefunction
wf = Potential(pot_func, domain, ncenter, fcinit='random', nelec=1, sigma=0.5)

# sampler
sampler = Metropolis(nwalkers=1000, nstep=2000,
                     step_size=1., nelec=wf.nelec,
                     ndim=wf.ndim, init={'min': -5, 'max': 5})

# optimizer
opt = optim.Adam(wf.parameters(), lr=0.05)
scheduler = optim.lr_scheduler.StepLR(opt, step_size=100, gamma=0.75)

# Solver
solver = SolverPotential(wf=wf, sampler=sampler,
                         optimizer=opt, scheduler=scheduler)

# Train the wave function
plotter = plotter1d(wf, domain, 100, sol=ho1d_sol)
solver.run(300, loss='variance', plot=plotter, save='model.pth')

# Plot the final wave function
plot_results_1d(solver, domain, 100, ho1d_sol, e0=0.5, load='model.pth')

After otpimization the following trajectory can easily be generated :

The same procedure can be done on different potentials. The figure below shows the performace of the method on the harmonic oscillator and the morse potential.

Metadata

Release files for schrodinet 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for schrodinet 0.1.2
File Size Uploaded Provenance Actions
schrodinet-0.1.2.tar.gz 23.6 kB Without provenance Details for schrodinet-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for schrodinet 0.1.2
File Interpreter ABI Platform Actions
schrodinet-0.1.2-py3-none-any.whl Python 3 none any Details for schrodinet-0.1.2-py3-none-any.whl

Total release size: 52.3 kB

Release files / schrodinet-0.1.2.tar.gz

Download URL schrodinet-0.1.2.tar.gz
Size 23.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9eb95a73ffc3aa49c3c1d0f28ef40a6a9a75afc4a5cb30efa2004b4a47fecb29
BLAKE2b-256 checksum
How to use checksums
f48aa60d3d1c7ddafa38858076aa9e1f389a089ee19ce028e83ca8492bf4c364
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.0

Release files / schrodinet-0.1.2-py3-none-any.whl

Download URL schrodinet-0.1.2-py3-none-any.whl
Size 28.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f40f000ea7a8a99bbab12d9ee588cad9624f902429c442874b00409aa4f2fa3
BLAKE2b-256 checksum
How to use checksums
6534f0d0586d95b401b968c3523ce85321e61321c58a01abbe144b7546c5c7d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.0

Security for schrodinet 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page