Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nexus: Extend excitations to allow 'lowest' gap #3628

Merged
merged 41 commits into from
Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
3134435
First, fix small bug
mcbennet Nov 19, 2021
e91ed3a
small change
mcbennet Nov 19, 2021
6de45e6
small change
mcbennet Nov 19, 2021
5af39ef
Adding prints for exploration reasons
Nov 22, 2021
2decee4
Adding excitation checks to post_analyze
Nov 22, 2021
37d59db
Merge remote-tracking branch 'origin/develop' into nxs_excitations
Nov 22, 2021
c9d8f69
Near final
Nov 23, 2021
22cba6c
Merge remote-tracking branch 'origin/develop' into nxs_excitations
Nov 23, 2021
485795d
Cleaning up string definitions
mcbennet Nov 23, 2021
e875730
Merge remote-tracking branch 'origin/develop' into nxs_excitations
mcbennet Nov 23, 2021
e30fe9b
Small mod
mcbennet Nov 23, 2021
ac39210
Add last format
mcbennet Nov 23, 2021
e9c44e2
Typo
mcbennet Nov 23, 2021
5366254
Small change
mcbennet Nov 23, 2021
c93bdda
Test
mcbennet Nov 23, 2021
fe87a92
Small change
mcbennet Nov 23, 2021
b9052d1
Small change
mcbennet Nov 23, 2021
a8db912
Small change
mcbennet Nov 23, 2021
5b6dfc0
Small change
mcbennet Nov 23, 2021
cccfb5c
Small change
mcbennet Nov 23, 2021
f06fd71
Yet Another Small change
mcbennet Nov 23, 2021
5a9b6bc
Wrap up last check
mcbennet Nov 23, 2021
60658be
Ready to submit
mcbennet Nov 23, 2021
f3cf5ca
Merge branch 'develop' into nxs_excitations
ye-luo Nov 24, 2021
e256efe
Add excitation alternatives examples
mcbennet Nov 29, 2021
ea1f36d
CHecking .rst rendering
mcbennet Nov 29, 2021
6f48b8e
Checking .rst rendering
mcbennet Nov 29, 2021
2869889
Add function to check excitation format
mcbennet Nov 29, 2021
be96436
Small change
mcbennet Nov 29, 2021
cd8d460
Nearly finished
mcbennet Nov 29, 2021
df87ea0
Small typo
mcbennet Nov 29, 2021
c5c0bf4
Small typo
mcbennet Nov 29, 2021
39b8f58
Small error
mcbennet Nov 29, 2021
f236fa0
Adding get_electron_particle_sets function
mcbennet Nov 29, 2021
d22e78c
Merge remote-tracking branch 'origin/develop' into nxs_excitations
mcbennet Nov 29, 2021
879c0ff
Ready for review
mcbennet Nov 29, 2021
ea1d786
Remove print
mcbennet Nov 29, 2021
2dfcbb4
Add additional changes for review
mcbennet Dec 2, 2021
6942d51
Merge remote-tracking branch 'origin/develop' into nxs_excitations
mcbennet Dec 2, 2021
f39330c
Additional review items
mcbennet Dec 2, 2021
35b7207
Additional review items
mcbennet Dec 2, 2021
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,355 @@
#! /usr/bin/env python3

from nexus import settings,job,run_project
from nexus import generate_physical_system
from nexus import generate_pwscf
from nexus import generate_pw2qmcpack
from nexus import generate_qmcpack,vmc
from structure import *

'''
This nexus example shows a variety of ways that excitations can be specified.
'''

settings(
pseudo_dir = '../../pseudopotentials',
runs = './runs_excitation_alternatives'
status_only = 0,
generate_only = 0,
sleep = 3,
machine = 'ws16'
)

#Input structure
dia = generate_physical_system(
units = 'A',
axes = [[ 1.785, 1.785, 0. ],
[ 0. , 1.785, 1.785],
[ 1.785, 0. , 1.785]],
elem = ['C','C'],
pos = [[ 0. , 0. , 0. ],
[ 0.8925, 0.8925, 0.8925]],
C = 4
)

kg = dia.structure.kgrid_from_kspacing(0.3) # Get SCF kmesh from k-spacing

scf = generate_pwscf(
identifier = 'scf',
path = 'diamond/scf',
job = job(nodes=1,app='pw.x',hours=1),
input_type = 'generic',
calculation = 'scf',
nspin = 2,
input_dft = 'lda',
ecutwfc = 200,
conv_thr = 1e-8,
nosym = False,
wf_collect = False,
system = dia,
tot_magnetization = 0,
kgrid = kg,
kshift = (0,0,0),
pseudos = ['C.BFD.upf'],
)

nscf = generate_pwscf(
identifier = 'nscf',
path = 'diamond/nscf',
job = job(nodes=1,app='pw.x',hours=1),
input_type = 'generic',
calculation = 'nscf',
input_dft = 'lda',
ecutwfc = 200,
nspin = 2,
conv_thr = 1e-8,
nosym = True,
wf_collect = True,
system = dia,
nbnd = 8, #a sensible nbnd value can be given
verbosity = 'high', #verbosity must be set to high
pseudos = ['C.BFD.upf'],
dependencies = (scf,'charge_density'),
)

conv = generate_pw2qmcpack(
identifier = 'conv',
path = 'diamond/nscf',
job = job(cores=1,app='pw2qmcpack.x', hours = 1),
write_psir = False,
dependencies = (nscf,'orbitals'),
)

opt = generate_qmcpack(
identifier = 'opt',
path = 'diamond/opt',
job = job(cores=16,threads=16,app='qmcpack', hours = 1),
input_type = 'basic',
system = dia,
pseudos = ['C.BFD.xml'],
twistnum = 0,
J2 = True, # Add a 2-body B-spline Jastrow
spin_polarized = True,
qmc = 'opt', # Do a wavefunction optimization
minmethod = 'oneshift', # Optimization algorithm (assumes energy minimization)
init_cycles = 4, # First 4 iterations allow large parameter changes
cycles = 10, # 8 subsequent iterations with smaller parameter changes
warmupsteps = 8, # First 8 steps are not recorded
blocks = 100, # Number of blocks to write in the .scalar.dat file
timestep = 0.4, # MC step size (nothing to do with time for VMC)
init_minwalkers = 0.01, # Smaller values -> bigger parameter change
minwalkers = 0.5, #
samples = 5000, # VMC samples per iteration
use_nonlocalpp_deriv = False,
dependencies = (conv,'orbitals'),
)

################################################################################
############ Ground State at Gamma #############################################
################################################################################
qmc_ground = generate_qmcpack(
det_format = 'old',
identifier = 'vmc',
path = 'diamond/vmc_ground',
job = job(cores=16,threads=16,app='qmcpack', hours = 1),
input_type = 'basic',
spin_polarized = True,
twistnum = 0,
system = dia,
pseudos = ['C.BFD.xml'],
jastrows = [],
calculations = [
vmc(
warmupsteps = 20,
blocks = 2400,
steps = 25,
substeps = 2,
timestep = .4,
)
],
dependencies = [(conv,'orbitals'),
(opt,'jastrow')],
)

################################################################################
############ Single Determinant Excitations ####################################
################################################################################

jtkrogel marked this conversation as resolved.
Show resolved Hide resolved
# up channel, gamma vb gamma cb
qmc_optical = generate_qmcpack(
det_format = 'old',
identifier = 'vmc',
path = 'diamond/vmc_optical_up_g-vb-g-cb',
job = job(cores=16,threads=16,app='qmcpack', hours = 1),
input_type = 'basic',
spin_polarized = True,
system = dia,
twistnum = 0,
excitation = ['up', 'gamma vb gamma cb'],
pseudos = ['C.BFD.xml'],
jastrows = [],
calculations = [
vmc(
warmupsteps = 20,
blocks = 2400,
steps = 25,
substeps = 2,
timestep = .4,
)
],
dependencies = [(conv,'orbitals'),
(opt,'jastrow')],
)

# up channel, band index
qmc_optical = generate_qmcpack(
det_format = 'old',
identifier = 'vmc',
path = 'diamond/vmc_optical_up_band-index',
job = job(cores=16,threads=16,app='qmcpack', hours = 1),
input_type = 'basic',
spin_polarized = True,
system = dia,
twistnum = 0,
excitation = ['up', '0 3 0 4'],
pseudos = ['C.BFD.xml'],
jastrows = [],
calculations = [
vmc(
warmupsteps = 20,
blocks = 2400,
steps = 25,
substeps = 2,
timestep = .4,
)
],
dependencies = [(conv,'orbitals'),
(opt,'jastrow')],
)

# up channel, energy index
qmc_optical = generate_qmcpack(
det_format = 'old',
identifier = 'vmc',
path = 'diamond/vmc_optical_up_energy-index',
job = job(cores=16,threads=16,app='qmcpack', hours = 1),
input_type = 'basic',
spin_polarized = True,
system = dia,
twistnum = 0,
excitation = ['up', '-4 +5'],
pseudos = ['C.BFD.xml'],
jastrows = [],
calculations = [
vmc(
warmupsteps = 20,
blocks = 2400,
steps = 25,
substeps = 2,
timestep = .4,
)
],
dependencies = [(conv,'orbitals'),
(opt,'jastrow')],
)

# up channel, lowest index
qmc_optical = generate_qmcpack(
skip_submit = 0,
det_format = 'old',
identifier = 'vmc',
path = 'diamond/vmc_optical_up_lowest',
job = job(cores=16,threads=16,app='qmcpack', hours = 1),
input_type = 'basic',
spin_polarized = True,
system = dia,
twistnum = 0,
excitation = ['up', 'lowest'],
pseudos = ['C.BFD.xml'],
jastrows = [],
calculations = [
vmc(
warmupsteps = 20,
blocks = 2400,
steps = 25,
substeps = 2,
timestep = .4,
)
],
dependencies = [(conv,'orbitals'),
(opt,'jastrow')],
)

################################################################################
############ Triplet Excitations ###############################################
################################################################################

# triplet, energy index
qmc_optical = generate_qmcpack(
det_format = 'old',
identifier = 'vmc',
path = 'diamond/vmc_optical_triplet_energy-index',
job = job(cores=16,threads=16,app='qmcpack', hours = 1),
input_type = 'basic',
spin_polarized = True,
system = dia,
twistnum = 0,
excitation = ['triplet', '-4 +5'],
pseudos = ['C.BFD.xml'],
jastrows = [],
calculations = [
vmc(
warmupsteps = 20,
blocks = 2400,
steps = 25,
substeps = 2,
timestep = .4,
)
],
dependencies = [(conv,'orbitals'),
(opt,'jastrow')],
)

# triplet, lowest
qmc_optical = generate_qmcpack(
det_format = 'old',
identifier = 'vmc',
path = 'diamond/vmc_optical_triplet_lowest',
job = job(cores=16,threads=16,app='qmcpack', hours = 1),
input_type = 'basic',
spin_polarized = True,
system = dia,
twistnum = 0,
excitation = ['triplet', 'lowest'],
pseudos = ['C.BFD.xml'],
jastrows = [],
calculations = [
vmc(
warmupsteps = 20,
blocks = 2400,
steps = 25,
substeps = 2,
timestep = .4,
)
],
dependencies = [(conv,'orbitals'),
(opt,'jastrow')],
)

################################################################################
############ Singlet Excitations ###############################################
################################################################################

# singlet, energy index
qmc_optical = generate_qmcpack(
det_format = 'old',
identifier = 'vmc',
path = 'diamond/vmc_optical_singlet_energy-index',
job = job(cores=16,threads=16,app='qmcpack', hours = 1),
input_type = 'basic',
spin_polarized = True,
system = dia,
twistnum = 0,
excitation = ['singlet', '-4 +5'],
pseudos = ['C.BFD.xml'],
jastrows = [],
calculations = [
vmc(
warmupsteps = 20,
blocks = 2400,
steps = 25,
substeps = 2,
timestep = .4,
)
],
dependencies = [(conv,'orbitals'),
(opt,'jastrow')],
)

# singlet, lowest
qmc_optical = generate_qmcpack(
det_format = 'old',
identifier = 'vmc',
path = 'diamond/vmc_optical_singlet_lowest',
job = job(cores=16,threads=16,app='qmcpack', hours = 1),
input_type = 'basic',
spin_polarized = True,
system = dia,
twistnum = 0,
excitation = ['singlet', 'lowest'],
pseudos = ['C.BFD.xml'],
jastrows = [],
calculations = [
vmc(
warmupsteps = 20,
blocks = 2400,
steps = 25,
substeps = 2,
timestep = .4,
)
],
dependencies = [(conv,'orbitals'),
(opt,'jastrow')],
)

run_project()
Loading