-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #141 from NLESC-JCER/paper
Paper
- Loading branch information
Showing
115 changed files
with
3,898 additions
and
1,322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
on: [push] | ||
|
||
jobs: | ||
paper: | ||
runs-on: ubuntu-latest | ||
name: Paper Draft | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Build draft PDF | ||
uses: openjournals/openjournals-draft-action@master | ||
with: | ||
journal: joss | ||
# This should be the path to the paper within your repo. | ||
paper-path: paper/paper.md | ||
- name: Upload | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: paper | ||
# This is the output path where Pandoc will write the compiled | ||
# PDF. Note, this should be the same directory as the input | ||
# paper.md | ||
path: paper/paper.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"cells":[{"attachments":{},"cell_type":"markdown","metadata":{"colab_type":"text","id":"PA9WOB4zJfCu"},"source":["# Installation on Google Collab\n","To install `QMCTorch` copy the code from one of the 3 text cells below in a code cell and run that cell. "]},{"cell_type":"markdown","metadata":{"colab_type":"text","id":"6KLOhN_dGQ11"},"source":["## Install QMCTorch from Pypi Package manager\n","\n","```\n","! pip install qmctorch\n","```\n","\n"]},{"cell_type":"markdown","metadata":{"colab_type":"text","id":"Eb9wI3eOGfz1"},"source":["## Install QMCTorch from GitHub\n","```\n","from google.colab import drive\n","drive.mount('/content/gdrive')\n","% cd gdrive/My Drive/\n","! git clone https://github.com/NLESC-JCER/QMCTorch\n","% cd QMCTorch\n","! pip install -e .\n","% cd ../\n","```"]},{"cell_type":"markdown","metadata":{"colab_type":"text","id":"_VNw5sAeHC7M"},"source":["## Pull latest code from Github\n","```\n","from google.colab import drive\n","drive.mount('/content/gdrive')\n","% cd gdrive/My Drive/QMCTorch\n","! git pull origin master\n","! pip install -e .\n","% cd ../\n","```"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":671},"colab_type":"code","executionInfo":{"elapsed":9770,"status":"ok","timestamp":1588617088336,"user":{"displayName":"Nicolas Renaud","photoUrl":"","userId":"07120063468244602126"},"user_tz":-120},"id":"khGd1-ewHZWF","outputId":"674fbe9e-7817-4e11-cc91-cd508bda8107","vscode":{"languageId":"python"}},"outputs":[],"source":["# from google.colab import drive\n","# drive.mount('/content/gdrive')\n","# % cd gdrive/My Drive/QMCTorch\n","# ! git pull origin master\n","# ! pip install -e .\n","# % cd .."]},{"cell_type":"markdown","metadata":{"colab_type":"text","id":"MGNu_L-OJ-7u"},"source":["# Using QMCTorch"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":52},"colab_type":"code","executionInfo":{"elapsed":11632,"status":"ok","timestamp":1588617090211,"user":{"displayName":"Nicolas Renaud","photoUrl":"","userId":"07120063468244602126"},"user_tz":-120},"id":"p7qEQTV2HB4h","outputId":"52c2bbce-3775-442c-95de-d18bd432c2e3","vscode":{"languageId":"python"}},"outputs":[],"source":["import torch\n","from torch import optim\n","from qmctorch.scf import Molecule\n","from qmctorch.wavefunction import SlaterJastrow\n","from qmctorch.solver import Solver\n","from qmctorch.sampler import Metropolis\n","from qmctorch.utils import set_torch_double_precision\n","from qmctorch.utils import plot_energy, plot_data"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{},"colab_type":"code","id":"x-s06JyaHUdN","vscode":{"languageId":"python"}},"outputs":[],"source":["use_gpu = torch.cuda.is_available()\n","set_torch_double_precision()"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":52},"colab_type":"code","executionInfo":{"elapsed":11608,"status":"ok","timestamp":1588617090213,"user":{"displayName":"Nicolas Renaud","photoUrl":"","userId":"07120063468244602126"},"user_tz":-120},"id":"7HO4cNaAID-F","outputId":"a1f652aa-9bcb-4e9b-c038-833b29da2eae","vscode":{"languageId":"python"}},"outputs":[],"source":["mol = Molecule(atom='H 0 0 0.69; H 0 0 -0.69', unit='bohr', \\\n"," calculator='pyscf', basis='sto-3g')"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{},"colab_type":"code","id":"hFZg-XanIOeY","vscode":{"languageId":"python"}},"outputs":[],"source":["wf = SlaterJastrow(mol, configs='cas(2,2)', cuda=use_gpu)"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{},"colab_type":"code","id":"Mqlk1N3tIVXN","vscode":{"languageId":"python"}},"outputs":[],"source":["sampler = Metropolis(nwalkers=2000, nstep=2000, step_size=0.2, \\\n"," ntherm=-1, ndecor=100, nelec=wf.nelec, \\\n"," init=mol.domain('atomic'), \\\n"," move={'type':'all-elec', 'proba':'normal'},\n"," cuda=use_gpu)"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{},"colab_type":"code","id":"5-I7abLxI5qG","vscode":{"languageId":"python"}},"outputs":[],"source":["lr_dict = [{'params': wf.jastrow.parameters(), 'lr': 3E-3},\n"," {'params': wf.ao.parameters(), 'lr': 1E-6},\n"," {'params': wf.mo.parameters(), 'lr': 1E-3},\n"," {'params': wf.fc.parameters(), 'lr': 2E-3}]\n","opt = optim.Adam(lr_dict, lr=1E-3)"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{},"colab_type":"code","id":"xgXSp8JwJIr9","vscode":{"languageId":"python"}},"outputs":[],"source":["scheduler = optim.lr_scheduler.StepLR(opt, step_size=100, gamma=0.90)"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{},"colab_type":"code","id":"g6TE--nNJL1H","vscode":{"languageId":"python"}},"outputs":[],"source":["solver = Solver(wf=wf, sampler=sampler,\n"," optimizer=opt, scheduler=scheduler)"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":87},"colab_type":"code","executionInfo":{"elapsed":26805,"status":"ok","timestamp":1588617105475,"user":{"displayName":"Nicolas Renaud","photoUrl":"","userId":"07120063468244602126"},"user_tz":-120},"id":"Y5MPLiv2JTCy","outputId":"ef067f86-11b3-48e0-9dac-dc8ff5784905","vscode":{"languageId":"python"}},"outputs":[],"source":["# obs = solver.single_point()"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{},"colab_type":"code","id":"yfx4g1Luz9Z-","vscode":{"languageId":"python"}},"outputs":[],"source":["# solver.configure(freeze=['ao', 'mo'], loss='energy', grad='manual')\n","# solver.track_observable(['local_energy'])\n","\n","# solver.configure_resampling(mode='update',\n","# resample_every=1,\n","# nstep_update=50)\n","# solver.ortho_mo = False"]},{"cell_type":"code","execution_count":null,"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":1000},"colab_type":"code","executionInfo":{"elapsed":52595,"status":"ok","timestamp":1588617131289,"user":{"displayName":"Nicolas Renaud","photoUrl":"","userId":"07120063468244602126"},"user_tz":-120},"id":"VtrVSk620A1A","outputId":"32ad9904-40e5-4efa-bcee-27145e04cfd4","vscode":{"languageId":"python"}},"outputs":[],"source":["# obs = solver.run(50)"]}],"metadata":{"accelerator":"GPU","colab":{"authorship_tag":"ABX9TyMr6DKmNBGlyg+0pzpuupgz","name":"qmctorch.ipynb","provenance":[]},"kernelspec":{"display_name":"Python 3","name":"python3"}},"nbformat":4,"nbformat_minor":0} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from qmctorch.scf import Molecule | ||
|
||
# Select the SCF calculator | ||
calc = ['pyscf', # pyscf | ||
'adf', # adf 2019 | ||
'adf2019' # adf 2020+ | ||
][1] | ||
|
||
# select an appropriate basis | ||
basis = { | ||
'pyscf' : 'sto-6g', | ||
'adf' : 'VB1', | ||
'adf2019': 'dz' | ||
}[calc] | ||
|
||
# do the scf calculation | ||
mol = Molecule(atom='H 0 0 -0.69; H 0 0 0.69', | ||
calculator=calc, | ||
basis=basis, | ||
unit='bohr') | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.