quest-qmc

Description

According to the page of quest-qmc, QUantum Electron Simulation Toolbox (QUEST) is a Fortran 90/95 package that implements the Determinant Quantum Monte Carlo (DQMC) method for quantum electron simulations.

Available Versions

  • quest-qmc/1.4.9 (default)

Loading the Module

# Load quest-qmc
module load quest-qmc/1.4.9

# Verify installation
ls $QUEST_DIR

Job Submission

submit_quest.sh
#!/bin/bash
#SBATCH -J quest
#SBATCH -N 1
#SBATCH -n 1
#SBATCH -t 24:00:00
#SBATCH --mem=8G

export INPUT="input-test.in square.geom"
export OUTPUT="*.out *.dat"

module load quest-qmc/1.4.9

job-nanny ggeom input-test.in

Example Input File

input-test.in
Hubbard model on square lattice
 LATTICE = square
 L = 4
!! Site types and potentials
 SITE TYPES
 1
 SITE POTENTIALS
 0.0
!! Hopping terms
 HOPPING
 t    -1.0
 t'    0.0
!! Interaction
 U = 4.0
!! Filling
 NELECT = 8
!! Temperature
 BETA = 10.0
!! Number of sweeps
 NSWEEP = 10000
!! Measurements
 MEASUREMENTS
 G(1)
 G(2)
 CHI(1,1)
 CHI(2,2)

Geometry File

square.geom
# Geometry for square lattice L=4
# site x y z type
1 0.0 0.0 0.0 1
2 1.0 0.0 0.0 1
3 2.0 0.0 0.0 1
4 3.0 0.0 0.0 1
5 0.0 1.0 0.0 1
6 1.0 1.0 0.0 1
7 2.0 1.0 0.0 1
8 3.0 1.0 0.0 1
9 0.0 2.0 0.0 1
10 1.0 2.0 0.0 1
11 2.0 2.0 0.0 1
12 3.0 2.0 0.0 1
13 0.0 3.0 0.0 1
14 1.0 3.0 0.0 1
15 2.0 3.0 0.0 1
16 3.0 3.0 0.0 1

Job Array for Parameter Scan

submit_quest_array.sh
#!/bin/bash
#SBATCH -J quest_array
#SBATCH --array=1-5
#SBATCH -N 1
#SBATCH -n 1
#SBATCH -t 24:00:00
#SBATCH --mem=8G

U_VALUES=(2.0 3.0 4.0 5.0 6.0)
U=${U_VALUES[$SLURM_ARRAY_TASK_ID-1]}

export INPUT="template.in"
export OUTPUT="U_${U}/"

module load quest-qmc/1.4.9

mkdir -p U_${U}
cd U_${U}
cp ../square.geom .

# Modify U in input file
sed "s/U = .*/U = $U/" ../template.in > input.in

job-nanny ggeom input.in

Results Analysis

analyze_quest.sh
#!/bin/bash
#SBATCH -J analyze_quest
#SBATCH -N 1
#SBATCH -n 1
#SBATCH -t 01:00:00
#SBATCH --mem=2G

# Extract energy
grep "Energy" *.out > energies.txt

# Extract density
grep "Density" *.out > density.txt

# Extract magnetic susceptibility
grep "Magnetic susceptibility" *.out > chi_mag.txt

# Plot with Python
cat > plot.py << 'EOF'
import numpy as np
import matplotlib.pyplot as plt

# Energy vs U
data = np.loadtxt('energies.txt', usecols=(0,1))
plt.figure()
plt.plot(data[:,0], data[:,1], 'bo-')
plt.xlabel('U')
plt.ylabel('Energy')
plt.title('Energy vs U')
plt.grid(True)
plt.savefig('energy_vs_U.png')

# Density vs U
data2 = np.loadtxt('density.txt', usecols=(0,1))
plt.figure()
plt.plot(data2[:,0], data2[:,1], 'ro-')
plt.xlabel('U')
plt.ylabel('Density')
plt.title('Density vs U')
plt.grid(True)
plt.savefig('density_vs_U.png')
EOF

python plot.py

References

See also