Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
314 commits
Select commit Hold shift + click to select a range
3eb6965
change name of tests
NicoRenaud Aug 19, 2021
e4b0a29
remove unused var
NicoRenaud Oct 5, 2021
d762715
made plot not autoload
NicoRenaud Oct 5, 2021
31fb635
remove plot load from slaterjastrow
NicoRenaud Oct 5, 2021
0ba0d2e
correct path to plot routine
NicoRenaud Oct 5, 2021
01e230a
remove unused import of plot routine
NicoRenaud Oct 5, 2021
148828f
fix import of plot data
NicoRenaud Oct 7, 2021
37e2afd
fixed batch energy
NicoRenaud Oct 11, 2021
14b702c
remove sampler.walkers
NicoRenaud Oct 11, 2021
8a654aa
use only nwalkers even in resampling and increase the numner of points
NicoRenaud Oct 11, 2021
234284c
print number sampking points
NicoRenaud Oct 11, 2021
6477409
fix issue with reweighting sampling points
NicoRenaud Oct 14, 2021
aae8d42
Merge pull request #135 from NLESC-JCER/lean_sampler
NicoRenaud Oct 18, 2021
47acadc
batch single point
NicoRenaud Oct 18, 2021
c739ba2
grey value
NicoRenaud Oct 18, 2021
0ef9ea6
added simple metropolis
NicoRenaud Oct 18, 2021
7705e1a
jastrow cobined term kernels as modulelist
NicoRenaud Oct 19, 2021
9c1859d
added energy plotter bin
NicoRenaud Oct 20, 2021
afa39b0
simplified combining jastrows
NicoRenaud Oct 20, 2021
b7db7e1
added possiblity to have odd number of elec
NicoRenaud Oct 20, 2021
67ad02f
fixed orb conf cas
NicoRenaud Oct 20, 2021
307f857
charge and spin info correct in plamms
NicoRenaud Oct 21, 2021
07f9aba
Merge pull request #136 from NLESC-JCER/spin
NicoRenaud Oct 21, 2021
eca7464
fix dump of tuple of torch tensors
NicoRenaud Oct 21, 2021
4753081
added pints interface to samplers
NicoRenaud Oct 21, 2021
7256d13
added metropolis hasting with assymetric proposal
NicoRenaud Oct 26, 2021
9c2cfc7
added test for pints sampler
NicoRenaud Oct 27, 2021
7224608
added mh with assymetric distribution
NicoRenaud Oct 27, 2021
f59ea34
added pints to setup
NicoRenaud Oct 27, 2021
c1c42b8
added test for mh
NicoRenaud Oct 27, 2021
238c02e
clean up
NicoRenaud Oct 29, 2021
4e35c32
Merge pull request #134 from NLESC-JCER/unify_slaterjastrow
NicoRenaud Mar 11, 2022
91958c1
fix import issue
NicoRenaud Mar 14, 2022
6505080
fix some conflicts
NicoRenaud Nov 24, 2023
39093c8
fix typos
NicoRenaud Nov 24, 2023
64caa35
fix path and module
NicoRenaud Nov 24, 2023
2fd6155
Repalced SolverSalterJastrow by Solver
NicoRenaud Nov 25, 2023
8f41762
fix argument of SJ with orbital dependent Jastrow
NicoRenaud Nov 27, 2023
aa3b495
fix call to jastrow kernel
NicoRenaud Nov 27, 2023
fd5703f
fix arg
NicoRenaud Nov 28, 2023
fef6564
reformat black
NicoRenaud Nov 28, 2023
021b52f
Revert "reformat black"
NicoRenaud Nov 28, 2023
725a51f
black only src
NicoRenaud Nov 28, 2023
7581cf4
removed trash wf
NicoRenaud Nov 28, 2023
d54d958
removed unused import
NicoRenaud Nov 28, 2023
0fe3590
critical error
NicoRenaud Nov 28, 2023
9784ea1
unused import in test
NicoRenaud Nov 28, 2023
9ab7ae8
gradient no backflow
NicoRenaud Nov 28, 2023
218424f
Revert "removed unused import"
NicoRenaud Nov 28, 2023
87ca460
add charge and spin to adf
NicoRenaud Nov 29, 2023
2a0af70
fix test gradients no backflow
NicoRenaud Nov 29, 2023
eca0db0
fix callable jastrow args
NicoRenaud Nov 29, 2023
95fd44e
reverted gradient no backflow
NicoRenaud Nov 29, 2023
86f66d6
pylint unused module in baseimport
NicoRenaud Nov 29, 2023
3424c69
fix coday
NicoRenaud Nov 29, 2023
903c148
black formatting
NicoRenaud Nov 29, 2023
6085953
black formatting
NicoRenaud Nov 29, 2023
4c2a354
fix mcgn test
NicoRenaud Nov 29, 2023
a32e7e2
fix ao callable args
NicoRenaud Nov 29, 2023
d5bc69e
fix metropolis
NicoRenaud Nov 29, 2023
eea0091
remove backlfow from generic jastrow test
NicoRenaud Nov 29, 2023
51798b6
coday fix
NicoRenaud Nov 29, 2023
2905be8
codacy fix
NicoRenaud Nov 29, 2023
69dd17e
codacy fix
NicoRenaud Nov 29, 2023
bfa8894
exception in hdf5,py
NicoRenaud Nov 29, 2023
8039185
black src
NicoRenaud Nov 29, 2023
a799420
black test
NicoRenaud Nov 29, 2023
c8a04ac
Merge pull request #166 from NLESC-JCER/dev_black
NicoRenaud Nov 29, 2023
4ac815b
black badge + example fix
NicoRenaud Nov 29, 2023
7c31752
fix jastrow and backflow tutorials
NicoRenaud Nov 30, 2023
271cd33
add combine jastrow example
NicoRenaud Nov 30, 2023
5a06f7a
add test for orbital dependent jastrow
NicoRenaud Nov 30, 2023
b92f19f
default value for numorb for orbital dependent backflow
NicoRenaud Nov 30, 2023
7bb2a3a
nmo through calc
NicoRenaud Nov 30, 2023
f556604
fix nmo via basis
NicoRenaud Nov 30, 2023
c02b22e
nmo
NicoRenaud Nov 30, 2023
0a08ee0
test jastrow orb dependent skip a few
NicoRenaud Nov 30, 2023
327e07e
removed charge/spin from adf calculator
NicoRenaud Nov 30, 2023
2f4c361
clear up notenooks
NicoRenaud Dec 1, 2023
ece4225
clean notebooks
NicoRenaud Dec 4, 2023
5c0ae26
added doc on gh action
NicoRenaud Dec 4, 2023
4446122
added pandoc install
NicoRenaud Dec 4, 2023
64d48ea
add conda path
NicoRenaud Dec 4, 2023
43bb0f7
try without sphinx-action
NicoRenaud Dec 4, 2023
175c4c7
coverage
NicoRenaud Dec 4, 2023
66f22ab
fix yaml
NicoRenaud Dec 4, 2023
21fa673
revert to sphinx-action
NicoRenaud Dec 4, 2023
37bc31a
execute notebooks
NicoRenaud Dec 5, 2023
4579c48
removed h2 traj
NicoRenaud Dec 5, 2023
9b601d1
chagne nbexecute to never
NicoRenaud Dec 5, 2023
07e1442
added jupyter as dep
NicoRenaud Dec 5, 2023
fab56a9
introduce default jastrow as elec-elec pade jastrow
NicoRenaud Dec 5, 2023
e3900c9
default jastrow
NicoRenaud Dec 5, 2023
13ae24d
fix build file
NicoRenaud Dec 5, 2023
cc397de
updated rst in the doc
NicoRenaud Dec 5, 2023
6ebdd88
fix some docstrings
NicoRenaud Dec 5, 2023
7b9e026
fix foc
NicoRenaud Dec 5, 2023
a378c00
fix factorial2
NicoRenaud Dec 9, 2023
45f57ac
added 3.9 python in CI
NicoRenaud Dec 9, 2023
c85c62b
froze scipy
NicoRenaud Dec 9, 2023
53ff7e6
fix 2
NicoRenaud Dec 9, 2023
5c89bc7
Merge pull request #168 from NLESC-JCER/issue167
NicoRenaud Dec 11, 2023
bc50100
fux default jastrow on gpu
NicoRenaud Dec 11, 2023
46e191b
removed graph jastrow
NicoRenaud Dec 12, 2023
44648fa
removed graph jastrow test
NicoRenaud Dec 12, 2023
926a51e
Revert "removed graph jastrow test"
NicoRenaud Dec 12, 2023
43f466b
Revert "removed graph jastrow"
NicoRenaud Dec 12, 2023
af66f83
fix egnn
NicoRenaud Dec 4, 2024
f3fb795
fix merge conflicts
NicoRenaud Dec 20, 2024
5ab8a08
fix merg conflict
NicoRenaud Dec 20, 2024
dacd24c
fix last conflict
NicoRenaud Dec 20, 2024
1244a30
fx last comflic
NicoRenaud Dec 20, 2024
517dfce
remove graph jastrow
NicoRenaud Dec 20, 2024
860fcdb
remove dgl deps
NicoRenaud Dec 20, 2024
64fbff2
remove graph
NicoRenaud Dec 20, 2024
f85f1f2
fix test
NicoRenaud Dec 20, 2024
6b1149e
restrict to 3.8
NicoRenaud Dec 20, 2024
2c298ac
coday fix
NicoRenaud Dec 20, 2024
6dfa2a8
coday fix
NicoRenaud Dec 20, 2024
6432d04
Merge pull request #174 from NLESC-JCER/dev_update
NicoRenaud Dec 20, 2024
fb224ed
bug fix
NicoRenaud Jan 7, 2025
91b6486
log backflow
NicoRenaud Jan 7, 2025
d7469c7
unfreeze hvd
NicoRenaud Jan 7, 2025
ff69333
remove hvd install as it crashes
NicoRenaud Jan 7, 2025
9f449a4
unfreeze torch
NicoRenaud Jan 7, 2025
ff879d4
remove hvd as it still crashes
NicoRenaud Jan 8, 2025
920c82e
Merge pull request #176 from NLESC-JCER/issue175
NicoRenaud Jan 8, 2025
d64e8dc
orb withou projector
NicoRenaud Jan 14, 2025
c536004
add linetimer install
NicoRenaud Jan 14, 2025
683f2d5
remove unused code
NicoRenaud Jan 14, 2025
bba6e44
fix wfl
NicoRenaud Jan 14, 2025
3896558
precompute inverse of MO
NicoRenaud Jan 15, 2025
9bf0105
use unique configs for explicit dets and ops
NicoRenaud Jan 15, 2025
f8a6f0b
push tensor to device
NicoRenaud Jan 16, 2025
27d35aa
push tensor to device
NicoRenaud Jan 16, 2025
b5a0e8e
push tensor to device
NicoRenaud Jan 16, 2025
8bf837c
hdf5 dump tensor to cpu
NicoRenaud Jan 16, 2025
e2b75be
do not register backflow twice
NicoRenaud Jan 17, 2025
95bc6da
log init sampling
NicoRenaud Jan 17, 2025
6760106
regisger backflow in AO for consistency
NicoRenaud Jan 17, 2025
67a3eea
test batched single point and opt
NicoRenaud Jan 20, 2025
39c6be6
force explicit dets
NicoRenaud Jan 20, 2025
26bca75
freeze backflow
NicoRenaud Jan 23, 2025
cf75c7b
othogonalize mo mixer
NicoRenaud Jan 23, 2025
cb3ab49
dont ortho
NicoRenaud Jan 23, 2025
9812249
init weight of inverse transform
NicoRenaud Jan 23, 2025
c9abaa0
register param
NicoRenaud Jan 23, 2025
bdc1b48
dont register bf weight
NicoRenaud Jan 23, 2025
23c9e31
change ortho mo from loss to wf
NicoRenaud Jan 28, 2025
dfd65f5
fix ortho_mo declaration bug
NicoRenaud Jan 28, 2025
84fe0af
changed log to hdf5
NicoRenaud Jan 29, 2025
2d4902b
add tag to out and h5
NicoRenaud Jan 30, 2025
1c029a8
fix version
NicoRenaud Jan 30, 2025
611d72b
Update __init__.py
NicoRenaud Jan 30, 2025
4b0789e
fix provenance tag
NicoRenaud Jan 31, 2025
70599a4
fix provenance tag
NicoRenaud Jan 31, 2025
c60c0ea
fix adf calculator
NicoRenaud Feb 3, 2025
3e88570
clean up atom coord fix
NicoRenaud Feb 4, 2025
dd1b288
tf32 disbled
NicoRenaud Feb 4, 2025
8e5bac6
added rbf backflow kernel
NicoRenaud Feb 4, 2025
5beab8a
added rbf test
NicoRenaud Feb 4, 2025
07defc9
Merge pull request #177 from NLESC-JCER/refac_kinetic_backflow
NicoRenaud Feb 5, 2025
c59ff8c
started calc
NicoRenaud Feb 6, 2025
395d031
set up
NicoRenaud Feb 7, 2025
e68a459
add set up
NicoRenaud Feb 7, 2025
a20b3ef
add set up
NicoRenaud Feb 7, 2025
fa514fd
calc works
NicoRenaud Feb 10, 2025
4ba0246
geo opt runs
NicoRenaud Feb 10, 2025
e580c82
start every time
NicoRenaud Feb 10, 2025
70e2174
work on the calculator
NicoRenaud Feb 11, 2025
2dd6c48
validate options
NicoRenaud Feb 12, 2025
75cc320
validate options
NicoRenaud Feb 12, 2025
b755216
added ase example
NicoRenaud Feb 12, 2025
5995ed8
fix bugs
NicoRenaud Feb 14, 2025
4b2a9ad
fix other bug
NicoRenaud Feb 14, 2025
4fffb3a
ase optimizer with torch
NicoRenaud Feb 17, 2025
c7fe5fc
ase optimizer with torch
NicoRenaud Feb 17, 2025
d9f125d
removed internal geo opt
NicoRenaud Feb 18, 2025
c5fb94b
optimizer
NicoRenaud Feb 19, 2025
055deca
typhints
NicoRenaud Feb 21, 2025
8716ebd
upgrde python for test
NicoRenaud Feb 25, 2025
a9e4d1d
switched to miniconda
NicoRenaud Feb 25, 2025
7e70c51
pip install torch as conda not supported anymore
NicoRenaud Feb 25, 2025
aa7fb76
swtch from np.math to math cause of python 3.9
NicoRenaud Feb 25, 2025
07fa634
added ase test
NicoRenaud Feb 25, 2025
8365345
remove force consistent from opt
NicoRenaud Feb 25, 2025
4864a4c
clean up
NicoRenaud Feb 25, 2025
deef318
Merge pull request #178 from NLESC-JCER/qmctorch_ase_calc
NicoRenaud Feb 25, 2025
4c9a0be
checkout old files
NicoRenaud Feb 25, 2025
22b0547
fix
NicoRenaud Feb 25, 2025
a0849af
remvoed egnn
NicoRenaud Feb 26, 2025
1c36a20
clean up
NicoRenaud Feb 26, 2025
1c9e124
example
NicoRenaud Feb 26, 2025
aee8bcd
fix single point
NicoRenaud Feb 26, 2025
45cf3ca
refactor backflow test
NicoRenaud Feb 26, 2025
642cff6
backflow exp kernel
NicoRenaud Feb 26, 2025
382a553
Merge pull request #179 from NLESC-JCER/graph_jastrow_2025
NicoRenaud Feb 26, 2025
8a8be07
fix bf exp alpha value
NicoRenaud Feb 26, 2025
1c5f151
clip in plot energy
NicoRenaud Feb 28, 2025
7e0aec3
type hints added to ase and sampler
NicoRenaud Feb 28, 2025
6a608b6
type hints added scf
NicoRenaud Feb 28, 2025
5444555
added type hints to solver
NicoRenaud Feb 28, 2025
4d53541
added type hints to uils
NicoRenaud Feb 28, 2025
69333be
hints on wavefunction
NicoRenaud Feb 28, 2025
505d209
hints on ao
NicoRenaud Feb 28, 2025
f449f97
fix syntax issus
NicoRenaud Feb 28, 2025
a6a3ba8
fix pint bug
NicoRenaud Feb 28, 2025
55859b7
hins on slater
NicoRenaud Feb 28, 2025
642e7f4
fix syntax
NicoRenaud Feb 28, 2025
bd84655
hints on jastrow
NicoRenaud Feb 28, 2025
df5c086
hints for orbital dependent
NicoRenaud Feb 28, 2025
4620029
move Loss to Solver
NicoRenaud Feb 28, 2025
35370ad
black
NicoRenaud Feb 28, 2025
6fbb4af
ruff and black
NicoRenaud Feb 28, 2025
d75eb8c
fix clip loss
NicoRenaud Mar 3, 2025
e3cbde1
Merge pull request #181 from NLESC-JCER/clip_fix
NicoRenaud Mar 4, 2025
564ba6f
fix clip for grd manual
NicoRenaud Mar 4, 2025
17cb034
Merge pull request #182 from NLESC-JCER/fix_clipp_2
NicoRenaud Mar 4, 2025
cf8e2f6
Revert "ruff and black"
NicoRenaud Mar 4, 2025
65342db
Revert "black"
NicoRenaud Mar 4, 2025
39a8287
merge dev into typehints
NicoRenaud Mar 4, 2025
5a6c9cd
added log loss
NicoRenaud Mar 4, 2025
6dd312d
made log loss default
NicoRenaud Mar 4, 2025
d4d8c8d
Merge pull request #183 from NLESC-JCER/log_loss
NicoRenaud Mar 7, 2025
a76c86e
introduce symmetry
NicoRenaud Mar 11, 2025
228e7f3
new mo layer
NicoRenaud Mar 12, 2025
ec68656
added selected configs
NicoRenaud Mar 13, 2025
dabe124
add mo_scf tpo gpu
NicoRenaud Mar 13, 2025
c6bd7d0
refator
NicoRenaud Mar 14, 2025
c8504de
added dinfh ymm
NicoRenaud Mar 14, 2025
e12ad97
reize mo_modifier
NicoRenaud Mar 14, 2025
05038a1
remove symmetry and ortho
NicoRenaud Mar 24, 2025
ae451f2
added symmetry test
NicoRenaud Mar 24, 2025
78accf9
fix mo_scf bug in orbital dep slaer jastrow wf
NicoRenaud Mar 24, 2025
118320a
remove mo_scf from other files
NicoRenaud Mar 24, 2025
b8624a4
Merge pull request #185 from NLESC-JCER/symmetry
NicoRenaud Mar 26, 2025
f1a8db7
merge development into typehints
NicoRenaud Mar 26, 2025
b3c2c0b
fix Loss import bug
NicoRenaud Mar 26, 2025
56a8e20
added force calculator
NicoRenaud Mar 31, 2025
d98fc60
added stable esimator
NicoRenaud Apr 1, 2025
4b45997
force estimator
NicoRenaud Apr 7, 2025
fd02d6a
clip forces
NicoRenaud Apr 7, 2025
c2f2c87
fix clipping mask
NicoRenaud Apr 7, 2025
61ffa9f
sampling trj on gpu
NicoRenaud Apr 8, 2025
eb3598d
clean up force calc
NicoRenaud Apr 8, 2025
d51050a
Merge pull request #186 from NLESC-JCER/numerical_forces
NicoRenaud Apr 8, 2025
15702b6
fix ase
NicoRenaud Apr 8, 2025
39da688
Merge branch 'development' into typehints
NicoRenaud Apr 8, 2025
79bbfa1
typehints for force
NicoRenaud Apr 8, 2025
81a1aa3
Merge pull request #180 from NLESC-JCER/typehints
NicoRenaud Apr 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 20 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,48 @@
name: build

on: [push]
on:
push:
branches:
- master
- development
pull_request:
branches:
- master
- development

jobs:
build:
name: build and test
runs-on: ubuntu-latest

strategy:
fail-fast: false
fail-fast: true
matrix:
version: ['3.8', '3.10']
version: ['3.9']

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Setup conda
uses: s-weigand/setup-conda@v1
with:
update-conda: true
python-version: ${{ matrix.version }}
conda-channels: anaconda
- name: Install essential
run: |
sudo apt update
sudo apt install build-essential
- name: Install conda packages
sudo apt install build-essential pandoc
- name: Install specific packages
run: |
conda install -c anaconda cmake
conda install mpi4py h5py pytorch==2.0.0 torchvision==0.15.0 cpuonly -c pytorch -c conda-forge
conda install -c conda-forge libstdcxx-ng
conda install -c anaconda gxx_linux-64

python -m pip install torch==2.4.1 --index-url https://download.pytorch.org/whl/cpu
python -m pip install dgl -f https://data.dgl.ai/wheels/torch-2.4/repo.html
- name: Install the package
run: python -m pip install .[test,hpc]
run: python -m pip install .[test,doc]
env:
CONDA_PREFIX: /usr/share/miniconda

- name: Test with multithreading
env:
CONDA_PREFIX: /usr/share/miniconda
run: mpirun -np 2 coverage run -m pytest tests_hvd
# - name: Test with multithreading
# env:
# CONDA_PREFIX: /usr/share/miniconda
# run: mpirun -np 2 coverage run -m pytest tests_hvd

- name: Test with single thread
env:
Expand Down
1 change: 1 addition & 0 deletions .prospector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ pep257:
D212, # Multi-line docstring summary should start at the first line
D213, # Multi-line docstring summary should start at the second line
D404, # First word of the docstring should not be This
R0913, # too many arguments
]
26 changes: 26 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@
Change Log
##########


0.4.0 [Unreleased]
******************

Change
---------

* Change sugnature of Jastrow and Baclflow modules (#174)
* Limit testing to Python 3.8 (#174)


0.3.3 [Released]
******************

Change
-----------

* Fig bug in the AO norm (#172)

0.3.2 [Released]
******************

Change
----------
* Fix a minor OSX bug regarding torch type cast to int

0.3.1 [Released]
*****************

Expand Down
4 changes: 4 additions & 0 deletions H2.xyz
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
2
Properties=species:S:1:pos:R:3 pbc="F F F"
H 0.00000000 0.00000000 -0.35000000
H 0.00000000 0.00000000 0.35000000
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
Pytorch Implementation of Real Space Quantum Monte Carlo Simulations of Molecular Systems

[![PyPI version](https://badge.fury.io/py/qmctorch.svg)](https://badge.fury.io/py/qmctorch)
[![Build Status](https://github.com/NLESC-JCER/QMCTorch/workflows/build/badge.svg)](https://github.com/NLESC-JCER/QMCTorch/actions)
[![Build Status](https://github.com/NLESC-JCER/QMCTorch/workflows/build/badge.svg?branch=master)](https://github.com/NLESC-JCER/QMCTorch/actions)
[![Coverage Status](https://coveralls.io/repos/github/NLESC-JCER/QMCTorch/badge.svg?branch=master)](https://coveralls.io/github/NLESC-JCER/QMCTorch?branch=master)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/1c52407422a7428083968833341b5945)](https://app.codacy.com/gh/NLESC-JCER/QMCTorch/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3780094.svg)](https://doi.org/10.5281/zenodo.3780094)
[![DOI](https://joss.theoj.org/papers/10.21105/joss.05472/status.svg)](https://doi.org/10.21105/joss.05472)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

## Installation

Expand Down
55 changes: 55 additions & 0 deletions bin/qmctorch_energy_plotter
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/usr/bin/env python
import h5py
import matplotlib.pyplot as plt
import argparse


def get_energy(mol):
with h5py.File(mol, 'r') as f5:
data = f5['wf_opt']['energy'][()]
return data


def get_correlation_energy(e, e0, ehf):
return 1 - (e-e0)/(ehf-e0)


def plot_percent_correlation_energy(args):

nepoch = args.num_epoch
energy = []
percent_correlation_energy = []
for mol in args.filename:
e = get_energy(mol)[:nepoch]
print(e[-1])
energy.append(e)
percent_correlation_energy.append(
get_correlation_energy(e, args.exact_energy, args.hf_energy))

plt_fn = plt.plot
if args.semi_logy:
plt_fn = plt.semilogy

for ec in percent_correlation_energy:
plt_fn(ec)
plt.show()


if __name__ == "__main__":

parser = argparse.ArgumentParser()
parser.add_argument('filename', nargs='+',
help='name of the files')
parser.add_argument('-l', '--labels', nargs='+',
help='label of the data')
parser.add_argument('-ne', '--num_epoch', type=int,
default=-1, help='Number of epcoh to plot')
parser.add_argument('-e0', '--exact_energy', type=float,
default=None, help='True exact energy of thre system')
parser.add_argument('-ehf', '--hf_energy', type=float,
default=None, help='Hartree Fock energy of thre system')
parser.add_argument('-log', '--semi_logy', action='store_true',
help='plot on semilog y axis')
args = parser.parse_args()

plot_percent_correlation_energy(args)
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,5 @@

autoclass_content = 'init'
autodoc_member_order = 'bysource'
nbsphinx_allow_errors = True
nbsphinx_allow_errors = True
nbsphinx_execute = 'never'
4 changes: 4 additions & 0 deletions docs/example/ase/H2.xyz
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
2
Properties=species:S:1:pos:R:3 pbc="F F F"
H 0.00000000 0.00000000 -0.35000000
H 0.00000000 0.00000000 0.35000000
4 changes: 4 additions & 0 deletions docs/example/ase/HLi.xyz
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
2
Properties=species:S:1:pos:R:3 pbc="F F F"
Li 0.00000000 0.00000000 0.00000000
H 0.00000000 0.00000000 3.14000000
59 changes: 59 additions & 0 deletions docs/example/ase/h2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
from qmctorch.ase import QMCTorch
from qmctorch.ase.optimizer import TorchOptimizer
from qmctorch.sampler.symmetry import Cinfv, Dinfh
from ase import Atoms
from ase.optimize import GoodOldQuasiNewton, FIRE
from ase.io import write
import torch
import numpy as np
from qmctorch.utils.plot_data import plot_walkers_traj, plot_correlation_coefficient

torch.random.manual_seed(0)
np.random.seed(0)


configs = (torch.tensor([[0],[1]]), torch.tensor([[0],[1]]))

d = 0.70
h2 = Atoms('H2', positions=[(0, 0, -d/2), (0, 0, d/2)])

h2.calc = QMCTorch()

# SCF options
h2.calc.scf_options.calculator = 'adf'
h2.calc.scf_options.basis = 'dzp'

# WF options
# h2.calc.wf_options.configs = 'ground_state'
h2.calc.wf_options.configs = 'single_double(2,4)'
# h2.calc.wf_options.configs = configs
h2.calc.wf_options.mix_mo = False
h2.calc.wf_options.orthogonalize_mo = False
# h2.calc.wf_options.gto2sto = True
h2.calc.wf_options.jastrow.kernel_kwargs = {'w':1.0}

# sampler options
h2.calc.sampler_options.nwalkers = 10000
h2.calc.sampler_options.nstep = 500
h2.calc.sampler_options.step_size = 0.5
h2.calc.sampler_options.ntherm = -1
h2.calc.sampler_options.ndecor = 10
h2.calc.sampler_options.symmetry = Dinfh(axis='z')

# solver options
h2.calc.solver_options.freeze = []
h2.calc.solver_options.niter = 50
h2.calc.solver_options.tqdm = True
h2.calc.solver_options.grad = 'manual'

# options for the resampling
h2.calc.solver_options.resampling.mode = 'update'
h2.calc.solver_options.resampling.resample_every = 1
h2.calc.solver_options.resampling.ntherm_update = 100


# Optimize the wave function
h2.calc.initialize()

h2.get_potential_energy()

16 changes: 16 additions & 0 deletions docs/example/ase/h2_cc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from pyscf import gto, scf, cc
import numpy as np
import matplotlib.pyplot as plt

mol = gto.M(atom="H 0 0 0; H 0 0 0.74")
cc_scanner = cc.CCSD(scf.RHF(mol)).nuc_grad_method().as_scanner()

dist = np.linspace(0.25,1.5,15)
energies = []
for d in dist:
atom = 'H 0 0 0; H 0 0 %f' %d
e,g = cc_scanner(gto.M(atom=atom))
energies.append(e)

plt.plot(dist, energies)
plt.show()
59 changes: 59 additions & 0 deletions docs/example/ase/lih.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
from qmctorch.ase import QMCTorch
from qmctorch.ase.optimizer import TorchOptimizer
from qmctorch.sampler.symmetry import Cinfv, Dinfh
from ase import Atoms
from ase.optimize import GoodOldQuasiNewton, FIRE
from ase.io import write
import torch
import numpy as np
from qmctorch.utils.plot_data import plot_walkers_traj, plot_correlation_coefficient

torch.random.manual_seed(0)
np.random.seed(0)


configs = (torch.tensor([[0],[1]]), torch.tensor([[0],[1]]))

d = 0.70
h2 = Atoms('LiH', positions=[(0, 0, 0), (0, 0, 3.14)])

h2.calc = QMCTorch()

# SCF options
h2.calc.scf_options.calculator = 'adf'
h2.calc.scf_options.basis = 'dzp'

# WF options
# h2.calc.wf_options.configs = 'ground_state'
h2.calc.wf_options.configs = 'single_double(2,4)'
# h2.calc.wf_options.configs = configs
h2.calc.wf_options.mix_mo = False
h2.calc.wf_options.orthogonalize_mo = False
# h2.calc.wf_options.gto2sto = True
h2.calc.wf_options.jastrow.kernel_kwargs = {'w':1.0}

# sampler options
h2.calc.sampler_options.nwalkers = 10000
h2.calc.sampler_options.nstep = 500
h2.calc.sampler_options.step_size = 0.5
h2.calc.sampler_options.ntherm = -1
h2.calc.sampler_options.ndecor = 10
h2.calc.sampler_options.symmetry = None

# solver options
h2.calc.solver_options.freeze = []
h2.calc.solver_options.niter = 50
h2.calc.solver_options.tqdm = True
h2.calc.solver_options.grad = 'manual'

# options for the resampling
h2.calc.solver_options.resampling.mode = 'update'
h2.calc.solver_options.resampling.resample_every = 1
h2.calc.solver_options.resampling.ntherm_update = 100


# Optimize the wave function
h2.calc.initialize()

h2.get_potential_energy()

53 changes: 53 additions & 0 deletions docs/example/autocorrelation/h2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import torch
from torch import optim

from qmctorch.sampler import Metropolis
from qmctorch.scf import Molecule
from qmctorch.solver import Solver
from qmctorch.utils.plot_data import plot_correlation_coefficient, plot_integrated_autocorrelation_time
from qmctorch.wavefunction.slater_jastrow import SlaterJastrow
from qmctorch.wavefunction.jastrows.elec_elec import JastrowFactor, PadeJastrowKernel
torch.manual_seed(0)

# molecule
mol = Molecule(
atom='H 0 0 -0.69; H 0 0 0.69',
unit='bohr',
calculator='pyscf',
basis='sto-3g')


# jastrow
jastrow = JastrowFactor(mol, PadeJastrowKernel)

# wave funtion
wf = SlaterJastrow(mol, kinetic='auto',
jastrow=jastrow,
configs='single(2,2)')

# sampler
sampler = Metropolis(
nwalkers=10,
nstep=1000,
ntherm=0,
ndecor=1,
step_size=0.5,
ndim=wf.ndim,
nelec=wf.nelec,
init=mol.domain('normal'),
move={
'type': 'all-elec',
'proba': 'normal'})

opt = optim.Adam(wf.parameters(), lr=0.01)

solver = Solver(wf=wf, sampler=sampler, optimizer=opt)

pos = solver.sampler(wf.pdf)
obs = solver.sampling_traj(pos)

rho, tau = plot_correlation_coefficient(obs.local_energy)
print(f'fit exp(-x/tau), tau={tau}')
iat = plot_integrated_autocorrelation_time(
obs.local_energy, rho=rho, C=5)
print(f"integrated autocorrelation time: {iat}")
Loading
Loading