Skip to content

NeuralQXLab/Hubbard_NQS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

144 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hubbard HFDS

Introduction

This project implements the Neural-Network Jastrow-Backflow (NNJBF) and Hidden Fermion Determinant State (HFDS) parametrized by a vision transformer (ViT). It contains the code and the data used to produce this manuscript.

To get started, first make sure you have installed uv by running in your terminal

curl -LsSf https://astral.sh/uv/install.sh | sh

or visit this page

Then, clone the repo.

In the project root, run uv sync to install the dependencies.

HFDS

To run a HFDS simulation:

  • Enter you parameters in HFDS/params_dict_ViT.json. The dictionary keys take the form LxxLy_PBCx_PBCywhere Lx is the horizontal size of the square lattice Ly is the vertical size of the square lattice, and PBCx, PBCy are the boundary conditions. For example, 4x4_OBC_PBC is used to simulate a $4\times4$ square lattice with open boundary conditions in the horizontal direction and periodic boundary conditions in the vertical direction.

  • In the terminal, from the root, do cd HFDS then uv run main_ViT_HFDS.py "key" "suffix", where key is the dictionnary key from the previous step and suffix is used to add a suffix to end of log files. For no suffix, use "". For example, uv run main_ViT_HFDS.py "4x4_OBC_PBC" "".

  • At the end of the script, 3 files are produced: one ending with extras.log which contains the hyperparameters and the runtime, one with .log containing the energy, variance and mcmc quantities and one ending in .mpack which contains the saved variational parameters.

Backflow

To run a Backflow simulation:

  • Enter your parameters in BackFlow_ViT/params_dict_backflow.json. The keys use the same LxLy_PBCx_PBCy pattern as HFDS.

  • From the project root, run uv run BackFlow_ViT/main_Backflow.py "key" "suffix", where key selects the dictionary entry and suffix is appended to the output filename. For no suffix, use "". For example, uv run BackFlow_ViT/main_Backflow.py "4x4_PBC_PBC" "".

  • The script writes three kinds of outputs in BackFlow_ViT/results/<key>/: an extras.log file with hyperparameters and runtime, a .log file with NetKet training statistics, and a .mpack file with the saved variational parameters. If calculate_obs_at_end is true, it also saves the hole density, staggered spin, and spin-spin correlation arrays.

Some examples:

1 Unsymmetrized

uv run BackFlow_ViT/main_Backflow.py "4x4_PBC_PBC" "unsymmetrized" --update symmetry_strategy unsymmetrized --update n_epochs 500 calculate_obs_at_end true

2 Network-level translational invariance

uv run BackFlow_ViT/main_Backflow.py "4x4_PBC_PBC" "net_ti" --update symmetry_strategy network_translation --update n_epochs 500 calculate_obs_at_end true

3 Network + space-group trick (hybrid)

uv run BackFlow_ViT/main_Backflow.py "4x4_PBC_PBC" "sg_trick" --update symmetry_strategy network_space_group_trick --update n_epochs 500 calculate_obs_at_end true

4 Full space-group SymmExpSum projector (exact symmetry projection)

uv run BackFlow_ViT/main_Backflow.py "4x4_PBC_PBC" "full_sg" --update symmetry_strategy full_symmexp_space_group --update character_id 0 --update n_epochs 500 calculate_obs_at_end true

5 Spin-flip projected variant (either via strategy suffix or legacy flag)

uv run BackFlow_ViT/main_Backflow.py "4x4_PBC_PBC" "spinflip" --update symmetry_strategy network_translation_spin_flip --update n_epochs 500 calculate_obs_at_end true

or

uv run BackFlow_ViT/main_Backflow.py "4x4_PBC_PBC" "spinflip-legacy" --update translation_invariant true --update enforce_spin_flip true --update n_epochs 500 calculate_obs_at_end true

About

Studying the Hubbard model on the 2D square lattice using Neural Quantum States (NQS)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors