Skip to content

PrincetonLIPS/spinornet

Repository files navigation

Installation

Can either install all required packages onto your env or use a singularity image (directions below Using Singularity (Build) and Slurm with singularity). If installing into your env, use the following command and run using Run Example

pip install -e .

Run Example

run the h3.py config for 300 QMC steps

spinornet --config='./spinornet/configs/h3.py' --config.optim.iterations=300

Using Singularity (Build)

We need to first build the image on a machine where docker and singualrity are both available. root permission is not required, but typically you need to be added to a docker user group by your cluster admin to be able to build a docker image (see here and here).

The first step is to run a Docker container registry that sets up a local docker image registry at localhost:5000:

docker run -d -p 5000:5000 --restart=always --name registry registry:2

Then, build the docker image from Dockerfile. Log outputs are available at docker_build.log:

docker build -t localhost:5000/spinornet --progress=plain  . &> docker_build.log

Push the image to localhost:5000.

docker push localhost:5000/spinornet

To test your docker

docker run --name spinornet_test -dt --gpus all --mount type=bind,source=./,target=/home/spinornet localhost:5000/spinornet
docker exec -it spinornet_test /bin/bash

The next step builds the singularity image. The singularity image is pretty large (~6G) so it is recommended that you build it at a non-backed-up folder on the cluster, typically some kind of scratch folder.

SINGULARITY_NOHTTPS=true singularity build spinornet.sif docker://localhost:5000/spinornet:latest

We can now safely remove the registry container.

docker container stop registry && docker container rm registry

Slurm with singularity

singularity exec --no-home --nv --bind .:/home/spinornet --pwd /home/spinornet $SCRATCH/spinornet.sif /bin/bash -c \
&& 'python run_spinornet.py --config=./spinornet/configs/h3.py --config.optim.iterations=300'

Testing / vscode with singularity

For testing/analysis, can open a vscode remote with singularity. Suggest to follow the instructions here: here. When that is setup, you can open an ipynb, click Select Kernel. For the first time "selecting kernel", will need to "install suggested extensions Python + Jupyter". After installation, click on "select kernel" again and should be able to select the singularity python.

Cite

This repository contains code for the paper https://pubs.acs.org/doi/abs/10.1021/acs.jctc.5c01243. If you find this code useful, please cite the paper:

@article{zhan-2025-expres-deter,
  author =	 {Ni Zhan and William A. Wheeler and Gil Goldshlager
                  and Elif Ertekin and Ryan P. Adams and Lucas
                  K. Wagner},
  title =	 {Expressivity of Determinantal Ansatzes for Neural
                  Network Wave Functions},
  journal =	 {Journal of Chemical Theory and Computation},
  volume =	 21,
  number =	 19,
  pages =	 {9612-9619},
  year =	 2025,
  doi =		 {10.1021/acs.jctc.5c01243},
  url =		 {http://dx.doi.org/10.1021/acs.jctc.5c01243},
}

About

Code for paper "Expressivity of determinantal ansatzes for neural network wave functions"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages