path=my_project_name, job=p2qjob, write_psir=False, dependencies=(scf, 'orbitals')) sims.append(p2q) # vmc run with qmcpack qmc = generate_qmcpack(identifier='vmc', path=my_project_name, job=qmcjob, input_type='basic', system=my_system, bconds=my_bconds, pseudos=my_qmc_pps, jastrows=[('J1', 'bspline', 8, 4.0), ('J2', 'bspline', 8)], calculations=[ vmc(walkers=1, warmupsteps=20, blocks=200, steps=10, substeps=2, timestep=.4) ], dependencies=(p2q, 'orbitals')) sims.append(qmc) # write input files and submit jobs run_project(sims) ## additional runs for optimization and DMC ##
conv = generate_pw2qmcpack( identifier='conv', path='diamond/nscf', job=job(cores=16, app='pw2qmcpack.x'), write_psir=False, dependencies=(nscf, 'orbitals'), ) opt = generate_qmcpack( identifier='opt', path='diamond/optJ2', job=job(cores=16, threads=4, app='qmcpack'), input_type='basic', system=system, pseudos=['C.BFD.xml'], J2=True, qmc='opt', cycles=6, samples=51200, dependencies=(conv, 'orbitals'), ) qmc = generate_qmcpack( identifier='dmc', path='diamond/dmc', job=job(cores=16, threads=4, app='qmcpack'), input_type='basic', system=system, pseudos=['C.BFD.xml'], J2=True,
opt = generate_qmcpack( # nexus inputs identifier = 'opt', # identifier/file prefix path = 'graphene/opt', # directory for opt run job = job(cores=16,app='qmcpack'), pseudos = ['C.BFD.xml'], # qmcpack PP file system = graphene, # run graphene # input format selector input_type = 'basic', # qmcpack input parameters corrections = [], jastrows = [('J1','bspline',8), # 1 body bspline jastrow ('J2','bspline',8)], # 2 body bspline jastrow calculations = [ loop(max = 6, # No. of loop iterations qmc = linear( # linearized optimization method energy = 0.0, # cost function unreweightedvariance = 1.0, # is all unreweighted variance reweightedvariance = 0.0, # no energy or r.w. var. timestep = 0.5, # vmc timestep (1/Ha) warmupsteps = 100, # MC steps before data collected samples = 16000,# samples used for cost function stepsbetweensamples = 10, # steps between uncorr. samples blocks = 10, # ignore this minwalkers = 0.1,# and this bigchange = 15.0,# and this alloweddifference = 1e-4 # and this, for now ) ) ], # workflow dependencies dependencies = (p2q_opt,'orbitals'), )
mole=obj( # used to make Mole() inputs verbose=5, basis='ccpvtz', symmetry=True, ), save_qmc=True, # save wfn data for qmcpack ) c4q = generate_convert4qmc( identifier='c4q', path='h2o_ae_hf', job=job(cores=1), no_jastrow=True, dependencies=(scf, 'orbitals'), ) qmc = generate_qmcpack( identifier='vmc', path='h2o_ae_hf', job=job(cores=10), system=system, input_type='basic', jastrows=[], qmc='vmc', blocks=8000, steps=100, dependencies=(c4q, 'orbitals'), ) run_project()
basis = 'bfd-vdz', ecp = 'bfd', drop_exponent = 0.1, verbose = 5, ), save_qmc = True, # save wfn data for qmcpack ) c4q = generate_convert4qmc( identifier = 'c4q', path = 'diamond_pp_dft_gamma', job = job(cores=1), no_jastrow = True, dependencies = (scf,'orbitals'), ) qmc = generate_qmcpack( identifier = 'vmc', path = 'diamond_pp_dft_gamma', job = job(cores=16), system = system, pseudos = ['C.BFD.xml'], input_type = 'basic', jastrows = [], corrections = [], qmc = 'vmc', dependencies = (c4q,'orbitals'), ) run_project()
identifier='cusp', path='H2O/cuspcorr', job=qmc_job, system=system, dependencies=(c4q, 'orbitals'), ) # optimize 2-body Jastrow optJ2 = generate_qmcpack( block=True, identifier='opt', path='H2O/optJ2', job=qmc_job, system=system, J2=True, J2_rcut=8.0, qmc='opt', # use opt defaults minmethod='oneshiftonly', # adjust for oneshift init_cycles=3, init_minwalkers=0.1, cycles=3, samples=25600, dependencies=[(c4q, 'orbitals'), (cc, 'cuspcorr')], ) # optimize 3-body Jastrow optJ3 = generate_qmcpack( block=True, identifier='opt', path='H2O/optJ3', job=qmc_job, system=system,
identifier = 'cusp', path = 'O_dimer/cuspcorr', job = qmc_job, system = dimer, dependencies = (c4q,'orbitals'), ) # optimize 2-body Jastrow optJ2 = generate_qmcpack( block = True, identifier = 'opt', path = 'O_dimer/optJ2', job = qmc_job, system = dimer, J2 = True, qmc = 'opt', minmethod = 'oneshiftonly', init_cycles = 3, init_minwalkers = 0.1, cycles = 3, samples = 25600, dependencies = [(c4q,'orbitals'), (cc,'cuspcorr')], ) # optimize 3-body Jastrow optJ3 = generate_qmcpack( block = True, identifier = 'opt', path = 'O_dimer/optJ3', job = qmc_job, system = dimer,
linopt3.minwalkers = 0.30 linopt3.samples = linopt2.samples*2 linopt4 = linopt3.copy() linopt4.minwalkers = 0.85 # 0.5 linopt4.samples = linopt3.samples*4 #### optimize 12-body Jastrow optJ12 = generate_qmcpack( identifier = 'optJ12', path = 'optJ12', job = job(nodes=1, queue='debug', hours=0.5, constraint='knl', presub=scf_presub), #job = job(nodes=1, threads=4), system = system, J2 = True, # 2-body B-spline Jastrow J1_rcut = 5.0, # 4 Bohr cutoff for J1 J2_rcut = 5.0, # 7 Bohr cutoff for J2 pseudos = ['Be.ccECP.xml', 'H.ccECP.xml'], calculations = [ loop(max=3, qmc=linopt1), loop(max=3, qmc=linopt2), loop(max=3, qmc=linopt3), ], dependencies = orbdeps, ) sims.append(optJ12) ##### optimize 3-body Jastrow optJ123 = generate_qmcpack( identifier = 'optJ123', path = 'optJ123', job = job(nodes=1, queue='debug', hours=0.5, constraint='knl', presub=scf_presub),
conv = generate_pw2qmcpack( identifier='conv', path='diamond/nscf_twist', job=job(cores=16, app='pw2qmcpack.x'), write_psir=False, dependencies=(nscf, 'orbitals'), ) opt = generate_qmcpack( identifier='opt', path='diamond/optJ2', job=job(cores=16, threads=4, app='qmcpack'), input_type='basic', system=system, pseudos=['C.BFD.xml'], twistnum=0, J2=True, qmc='opt', cycles=6, samples=51200, dependencies=(conv, 'orbitals'), ) qmc = generate_qmcpack( identifier='vmc', path='diamond/vmc_twist', job=job(cores=16, threads=2, app='qmcpack'), input_type='basic', system=system, pseudos=['C.BFD.xml'], J2=True,
opt = generate_qmcpack( # nexus inputs identifier = 'opt', # identifier/file prefix path = 'c20/opt', # directory for opt run job = Job(cores=16,app='qmcapp'), pseudos = ['C.BFD.xml'], # qmcpack PP file system = c20, # run c20 # input format selector input_type = 'basic', # qmcpack input parameters corrections = [], jastrows = [('J1','bspline',8,6), # 1 body bspline jastrow ('J2','bspline',8,8)], # 2 body bspline jastrow calculations = [ loop(max = 6, # No. of loop iterations qmc = linear( # linearized optimization method energy = 0.0, # cost function unreweightedvariance = 1.0, # is all unreweighted variance reweightedvariance = 0.0, # no energy or r.w. var. timestep = 0.5, # vmc timestep (1/Ha) warmupsteps = 100, # MC steps before data collected samples = 16000,# samples used for cost function stepsbetweensamples = 10, # steps between uncorr. samples blocks = 10, # ignore this minwalkers = 0.1,# and this bigchange = 15.0,# and this alloweddifference = 1e-4 # and this, for now ) ) ], # workflow dependencies dependencies = (p2q,'orbitals') )
alloweddifference=1e-4, stepsize=0.2, stabilizerscale=1.0, nstabilizers=3) linopt2 = linopt1.copy() linopt2.samples = 16384 # optimization run opt = generate_qmcpack( identifier='opt', path=directory + '/opt', job=qmc_job, input_type='basic', system=bcc_Be, twistnum=0, bconds='ppp', pseudos=qmc_pps, jastrows=[('J1', 'bspline', 8), ('J2', 'bspline', 8)], calculations=[loop(max=4, qmc=linopt1), loop(max=4, qmc=linopt2)], dependencies=(p2q, 'orbitals')) sims.append(opt) #end if # DMC run ntwists = kgrid[0] * kgrid[1] * kgrid[2] qmc = generate_qmcpack(identifier='dmc', path=directory + '/dmc_' + ks, job=job(nodes=ntwists, hours=2,
identifier = 'p2q', path = directory, job = Job(cores=1), write_psir = False, dependencies = (scf,'orbitals') ) sims.append(p2q) # describe optimization run opt = generate_qmcpack( identifier = 'opt', path = directory, system = dimer, job = Job(cores=16,app='qmcapp'), input_type = 'basic', pseudos = ['O.BFD.xml'], bconds = 'nnn', jastrows = [('J1','bspline',8,4.5), # 1 & 2 body Jastrows ('J2','pade',0.5,0.5)], calculations = opt_calcs, dependencies = (p2q,'orbitals') ) sims.append(opt) # describe DMC run qmc = generate_qmcpack( identifier = 'qmc', path = directory, system = dimer, job = Job(cores=16,app='qmcapp'), input_type = 'basic',
gs_qmc = generate_qmcpack( identifier='gs_qmc', path='gs_qmc', job=job(nodes=NODES, queue='regular', hours=4.0, constraint='knl', presub=scf_presub), #job = job(nodes=1, threads=4), system=system, pseudos=['C.ccECP.xml', 'H.ccECP.xml'], jastrows=[], calculations=[ vmc( walkers=int(4096.0 / (NODES * 8)), # Per MPI #walkers = 1, warmupsteps=20, blocks=100, steps=20, substeps=2, timestep=1.0, ), dmc( targetwalkers=4096, # Total walkers timestep=0.02, warmupsteps=int(1.0 / 0.02), blocks=20, steps=int(1.0 / 0.02), nonlocalmoves='yes', checkpoint=5), dmc( targetwalkers=4096, # Total walkers timestep=0.01, warmupsteps=int(0.5 / 0.01), blocks=20, steps=int(1.0 / 0.01), nonlocalmoves='yes', checkpoint=5), dmc( targetwalkers=4096, # Total walkers timestep=0.005, warmupsteps=int(0.5 / 0.005), blocks=20, steps=int(1.0 / 0.005), nonlocalmoves='yes', checkpoint=5), dmc( targetwalkers=4096, # Total walkers timestep=0.001, warmupsteps=int(0.5 / 0.001), blocks=20, steps=int(1.0 / 0.001), nonlocalmoves='yes', checkpoint=5), ], dependencies=[(qmcdump, 'jastrow')], )
dependencies = (c4q,'orbitals'), ) # collect dependencies relating to orbitals orbdeps = [(c4q,'particles'), # pyscf changes particle positions (c4q,'orbitals' ), (cc ,'cuspcorr' )] # optimize 2-body Jastrow optJ2 = generate_qmcpack( block = True, identifier = 'opt', path = 'H2O/optJ2', job = job(cores=16), system = system, J2 = True, # 2-body B-spline Jastrow J1_rcut = 4.0, # 4 Bohr cutoff for J1 J2_rcut = 7.0, # 7 Bohr cutoff for J2 qmc = 'opt', # quartic variance optimization cycles = 6, # loop max of 6 alloweddifference = 1e-3, # increase allowed energy difference dependencies = orbdeps, ) # optimize 3-body Jastrow optJ3 = generate_qmcpack( block = True, identifier = 'opt', path = 'H2O/optJ3', job = job(cores=16), system = system, J3 = True, # 3-body polynomial Jastrow
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 ############################################# ################################################################################
scf = generate_pyscf( identifier = 'scf', path = 'rhf', job = job(serial=True), template = './scf_template.py', system = system, mole = obj( verbose = 4, basis = 'aug-cc-pvdz', ), checkpoint = True, ) p2a = generate_pyscf_to_afqmc( identifier = 'p2a', path = 'rhf', job = job(serial=True), cholesky_threshold = 1e-5, dependencies = (scf,'wavefunction'), ) qmc = generate_qmcpack( identifier = 'qmc', path = 'afqmc', job = job(cores=1,app='qmcpack'), input_type = 'basic_afqmc', dependencies = (p2a,'wavefunction'), ) run_project()
opt = generate_qmcpack( identifier='opt', path=directory, job=qmcjob, system=dimer, input_type='basic', pseudos=['O.BFD.xml'], bconds='nnn', jastrows=[ ('J1', 'bspline', 8, 5.0), # 1 & 2 body Jastrows ('J2', 'bspline', 8, 10.0) ], calculations=[ loop(max=12, qmc=linear( energy=0.0, unreweightedvariance=1.0, reweightedvariance=0.0, timestep=0.3, samples=61440, warmupsteps=50, blocks=200, substeps=1, nonlocalpp=True, usebuffer=True, walkers=1, minwalkers=0.5, maxweight=1e9, usedrift=False, minmethod='quartic', beta=0.025, exp0=-16, bigchange=15.0, alloweddifference=1e-4, stepsize=0.2, stabilizerscale=1.0, nstabilizers=3, )) ], dependencies=(p2q, 'orbitals'), )
identifier='conv', path='diamond/scf', job=job(cores=1, app='pw2qmcpack.x'), write_psir=False, dependencies=(scf, 'orbitals'), ) qmc = generate_qmcpack( identifier='vmc', path='diamond/vmc', job=job(cores=12, threads=2, app='qmcpack_cpu_comp_SoA'), input_type='basic', system=dia16, pseudos=['C.BFD.xml'], jastrows=[], calculations=[ vmc(walkers=1, warmupsteps=20, blocks=200, steps=10, substeps=2, timestep=.4) ], dependencies=(conv, 'orbitals'), ) optims = getOptims() optJ2 = generate_qmcpack(path='diamond/optJ2', spin_polarized=False, identifier='opt', job=job(cores=12, threads=2,
conv = generate_pw2qmcpack( identifier = 'conv', path = 'diamond/scf', job = Job(cores=1,app='pw2qmcpack.x'), write_psir = False, dependencies = (scf,'orbitals') ) qmc = generate_qmcpack( identifier = 'vmc', path = 'diamond/vmc', job = Job(cores=16,threads=4,app='qmcapp'), input_type = 'basic', system = dia16, pseudos = ['C.BFD.xml'], jastrows = [], calculations = [ vmc( walkers = 1, warmupsteps = 20, blocks = 200, steps = 10, substeps = 2, timestep = .4 ) ], dependencies = (conv,'orbitals') ) run_project(scf,conv,qmc)
pseudo='gth-pade', mesh=[25, 25, 25], verbose=5, ), checkpoint=True, ) p2a = generate_pyscf_to_afqmc( identifier='p2a', path='rhf', job=job(serial=True), cholesky_threshold=1e-5, ao=True, kpoint=True, verbose=True, dependencies=(scf, 'wavefunction'), ) qmc = generate_qmcpack( identifier='qmc', path='afqmc', job=job(cores=1, app='qmcpack'), system=system, input_type='basic_afqmc', blocks=100, timestep=0.01, dependencies=(p2a, 'wavefunction'), ) run_project()
p2a = generate_pyscf_to_afqmc( identifier='p2a', path='rhf', job=job(serial=True), cholesky_threshold=1e-5, verbose=True, dependencies=(scf, 'wavefunction'), ) qmc = generate_qmcpack( identifier='qmc', path='afqmc', job=job(cores=1, app='qmcpack'), system=system, input_type='basic_afqmc', blocks=1000, timestep=0.01, estimators=[ back_propagation( ortho=1, naverages=4, block_size=2, nsteps=200, onerdm=onerdm(), ) ], dependencies=(p2a, 'wavefunction'), ) run_project()
alloweddifference=1e-4, stepsize=0.2, stabilizerscale=1.0, nstabilizers=3) linopt2 = linopt1.copy() linopt2.samples = 20000 # optimization run opt = generate_qmcpack( identifier='opt', path=directory + '/opt', job=qmc_job, input_type='basic', system=graphene, bconds='ppn', pseudos=qmc_pps, jastrows=[('J1', 'bspline', 8), ('J2', 'bspline', 8, 'coeff', [8 * [0], 8 * [0]])], calculations=[loop(max=8, qmc=linopt1), loop(max=4, qmc=linopt2)], dependencies=(p2q, 'orbitals')) sims.append(opt) # DMC run qmc1 = generate_qmcpack(identifier='dmc', path=directory + '/dmc-smallmem', job=qmc_job, input_type='basic', system=graphene, bconds='ppn',
path = 'diamond/scf', job = job(cores=1), no_jastrow = True, hdf5 = True, # use hdf5 format dependencies = (scf,'orbitals'), ) opt = generate_qmcpack( #block = True, identifier = 'opt', path = 'diamond/optJ2', job = job(cores=16,threads=4,app='qmcpack'), input_type = 'basic', system = system, pseudos = ['C.BFD.xml'], corrections = [], J2 = True, qmc = 'opt', minmethod = 'oneshiftonly', # adjust for oneshift init_cycles = 3, init_minwalkers = 0.1, cycles = 3, samples = 25600, dependencies = (c4q,'orbitals'), ) qmc = generate_qmcpack( #block = True, identifier = 'vmc', path = 'diamond/vmc', job = job(cores=16,threads=4,app='qmcpack'), input_type = 'basic',
alloweddifference=1e-4, stepsize=0.2, stabilizerscale=1.0, nstabilizers=3) linopt2 = linopt1.copy() linopt2.samples = 20000 # optimization run opt = generate_qmcpack( identifier='opt', path=directory + '/opt', job=qmc_job, input_type='basic', system=graphene, bconds='ppn', pseudos=qmc_pps, jastrows=[('J1', 'bspline', 8), ('J2', 'bspline', 8, 'coeff', [8 * [0], 8 * [0]])], calculations=[loop(max=8, qmc=linopt1), loop(max=4, qmc=linopt2)], dependencies=(p2q, 'orbitals')) sims.append(opt) # VMC run factors = [0.6, 0.7, 0.8, 0.9] for factor in factors: fc = '{0:.2f}'.format(factor) qmc = generate_qmcpack(identifier='vmc', path=directory + '/vmc-factor-' + fc,
identifier = 'conv', path = 'diamond/scf', job = conv_job, write_psir = False, dependencies = (scf,'other'), ) qmc = generate_qmcpack( identifier = 'vmc', path = 'diamond/vmc', job = qmc_job, input_type = 'basic', system = dia16, pseudos = ['C.BFD.xml'], orbitals_h5 = '../scf/pwscf_output/pwscf.pwscf.h5', jastrows = [], calculations = [ vmc( walkers = 1, warmupsteps = 20, blocks = 200, steps = 10, substeps = 2, timestep = .4 ) ], dependencies = (conv,'other'), ) run_project()
path=basepath + '/scf', job=conv_job, write_psir=False, dependencies=(scf, 'orbitals'), ) qmc = generate_qmcpack( block=not on_cluster, identifier='vmc', path=basepath + '/vmc', job=qmc_job, input_type='basic', system=dia16, pseudos=['C.BFD.xml'], jastrows=[], calculations=[ vmc(walkers=1, warmupsteps=20, blocks=200, steps=10, substeps=2, timestep=.4) ], dependencies=(conv, 'orbitals'), ) qmc_runs.append(qmc) #end for if on_cluster:
nstabilizers = 3, ) # QMC Optimization Parameters - Finer Sampling Set linopt2 = linopt1.copy() linopt2.samples = 16384 # QMC Optimization opt = generate_qmcpack( identifier = 'opt', path = '.', job = opt_job, input_type = 'basic', system = rocksalt_LiH, twistnum = 0, bconds = 'ppp', pseudos = qmc_pps, jastrows = [('J1','bspline',8), ('J2','bspline',8)], calculations = [loop(max=4,qmc=linopt1), loop(max=4,qmc=linopt2)], dependencies = (p2q,'orbitals'), ) pp = opt.input.get('pseudos') pp.Li.set( format = 'casino', l_local = 's', nrule = 2, lmax = 2, cutoff = 2.19, )
qmcapp='qmcpack_cades_cpu_comp_SoA' opt = generate_qmcpack( det_format = 'old', identifier = 'opt', path = 'opt', job = job(cores=16,threads=16,app=qmcapp), input_type = 'basic', spin_polarized = True, system = dia, pseudos = ['C.BFD.xml'], jastrows = [('J1','bspline',8),('J2','bspline',8)], calculations = [ loop(max=4, qmc = linear( minmethod = 'OneShiftOnly', minwalkers = 0.5, samples = 5000, walkers = 1, warmupsteps = 20, blocks = 25, substeps = 5, timestep = .4, ), ), ], dependencies = (conv,'orbitals'), ) qmc_ground = generate_qmcpack( det_format = 'old',
def mworkflow(shared_qe, params, sims): for i in params_defaults.keys(): if i not in params: setattr(params, i, params_defaults[i]) #end if #end if if params.j3: if params.code == 'gpu': print "GPU code and j3 not possible yet" exit() #end if #end if if params.excitation is not None: params.twistnum = 0 ######################## #DMC and VMC parameters# ######################## samples = 25600 #25600 vmcblocks = 100 dmcblocks = 300 dmceqblocks = 200 dmcwalkers = 1024 # For cades it is multiplied by 2 vmcdt = 0.3 if params.vmc: vmcblocks = 9000 vmcdt = 0.3 dmcblocks = 1 dmceqblocks = 1 #end if ############################# # Machine specific variables# ############################# if params.machine == 'cades': minnodes = 1 scf_nodes = 2 scf_hours = 48 p2q_nodes = scf_nodes p2q_hours = 1 qeapp = 'pw.x -npool 4 ' if params.dft_grid == (1, 1, 1): scf_nodes = 1 qeapp = 'pw.x' #end if qe_presub = 'module purge; module load PE-intel/3.0; module load hdf5_parallel/1.10.3' opt_nodes = 4 opt_hours = 12 dmcnodespertwist = 0.5 dmc_hours = 24 qmc_threads = 18 walkers = qmc_threads blocks = samples / (walkers * opt_nodes) params.code = 'cpu' qmcapp = ' qmcpack_cades_cpu_comp_SoA' qmc_presub = 'module purge; module load PE-intel' opt_job = Job(nodes=opt_nodes, hours=opt_hours, threads=qmc_threads, app=qmcapp, presub=qmc_presub) elif params.machine == 'titan' or params.machine == 'eos': minnodes = 1 dmcwalkers *= 2 scf_nodes = 8 scf_hours = 2 p2q_nodes = scf_nodes p2q_hours = 1 qeapp = 'pw.x -npool 4 ' qe_presub = '' if params.machine == 'eos': opt_nodes = 16 opt_hours = 2 qmc_threads = 16 walkers = qmc_threads blocks = samples / (walkers * opt_nodes) params.code = 'cpu' qmcapp = '/ccs/home/kayahan/SOFTWARE/qmcpack/eos/qmcpack/qmcpack_eos_cpu_comp_SoA' qmc_presub = '' params.rundmc = False elif params.machine == 'titan': if params.code == 'cpu': dmcwalkers *= 2 vmcblocks = 50 opt_nodes = 16 opt_hours = 2 dmcnodespertwist = 32 dmc_hours = 6 qmc_threads = 16 walkers = qmc_threads blocks = samples / (walkers * opt_nodes) qmcapp = '/ccs/home/kayahan/SOFTWARE/qmcpack/titan/qmcpack/qmcpack_titan_cpu_comp_SoA' qmc_presub = '' params.rundmc = True elif params.code == 'gpu': dmcwalkers *= 8 opt_nodes = 4 opt_hours = 4 dmcnodespertwist = 8 dmc_hours = 1.5 qmc_threads = 16 walkers = qmc_threads blocks = samples / (walkers * opt_nodes) qmcapp = '/ccs/home/kayahan/SOFTWARE/qmcpack/titan/qmcpack/qmcpack_titan_gpu_comp_SoA' qmc_presub = 'module load cudatoolkit' #end if #end if opt_job = Job(nodes=opt_nodes, hours=opt_hours, threads=qmc_threads, app=qmcapp, presub=qmc_presub) elif params.machine == 'cetus' or params.machine == 'mira': if params.machine == 'cetus': minnodes = 128 opt_hours = 1 dmc_hours = 1 elif params.machine == 'mira': minnodes = 128 dmc_hours = 1 dmc_hours = 1 #end if scf_nodes = 128 scf_hours = 1 p2q_nodes = 128 p2q_hours = 1 qeapp = 'pw.x' qe_presub = '' opt_nodes = 128.0 opt_nodes = np.round(opt_nodes / minnodes) * minnodes dmcnodespertwist = 18 qmc_threads = 16 walkers = qmc_threads qmc_processes_per_node = 16 blocks = samples / (walkers * opt_nodes) params.code = 'cpu' qmcapp = 'qmcpack' qmc_presub = '' opt_job = Job(nodes=opt_nodes, hours=opt_hours, threads=qmc_threads, processes_per_node=qmc_processes_per_node, app=qmcapp, presub=qmc_presub) elif params.machine == 'summit': dmcwalkers *= 8 minnodes = 1 scf_nodes = 2 scf_hours = 24 p2q_nodes = 2 p2q_hours = 1 qeapp = 'pw.x -npool 4 ' if params.dft_grid == (1, 1, 1): scf_nodes = 1 qeapp = 'pw.x' #end if qe_presub = 'module purge; module load PE-intel/3.0' opt_nodes = 4 opt_hours = 4 dmcnodespertwist = 8 dmc_hours = 6 qmc_threads = 42 walkers = qmc_threads blocks = samples / (walkers * opt_nodes) qmcapp = '/ccs/home/kayahan/SOFTWARE/qmcpack/summit/qmcpack/build_summit_comp/bin/qmcpack' else: print "Machine is not defined!" exit() #end if scf_job = Job(nodes=scf_nodes, hours=scf_hours, app=qeapp, presub=qe_presub) p2q_job = Job(nodes=p2q_nodes, hours=p2q_hours, app='pw2qmcpack.x -npool 4 ', presub=qe_presub) if params.big or params.qp: dmcblocks *= 4 dmcnodespertwist *= 1 dmc_hours *= 2 dmcwalkers *= 2 #end if shared_qe.wf_collect = False shared_qe.nosym = True shared_qe.job = scf_job shared_qe.pseudos = params.dft_pps if params.tot_mag is not None: shared_qe.tot_magnetization = params.tot_mag #end if if params.two_u: ulist = [params.ulist[0]] else: ulist = params.ulist #end if shared_relax = shared_qe.copy() # qmcs list to possibly bundle all DMC calculations qmcs = [] scf_ks_energy = 0 for u in ulist: if u != 0.: shared_qe.hubbard_u = obj() shared_relax.hubbard_u = obj() for inum, i in enumerate(params.uatoms): if params.two_u: setattr(shared_qe.hubbard_u, i, params.ulist[inum]) else: setattr(shared_qe.hubbard_u, i, u) setattr(shared_relax.hubbard_u, i, params.relax_u) #end if #end for #end if scf_inf = None scf_path = './scf-u-' + str(u) + '-inf' if params.relax: shared_relax = shared_qe.copy() shared_relax['ion_dynamics'] = 'bfgs' shared_relax['cell_dynamics'] = 'bfgs' shared_relax['calculation'] = 'vc-relax' shared_relax['conv_thr'] = 10e-6 shared_relax['forc_conv_thr'] = 0.001 shared_relax['input_DFT'] = params.relax_functional shared_relax.nosym = True coarse_relax = generate_pwscf( identifier='scf', path='./coarse_relax-u-' + str(params.relax_u) + '-inf', electron_maxstep=params.electron_maxstep, nogamma=True, system=params.system, kgrid=params.dft_grid, **shared_relax) sims.append(coarse_relax) shared_relax['conv_thr'] = 10e-8 shared_relax['forc_conv_thr'] = 0.001 fine_relax = generate_pwscf( identifier='scf', path='./fine_relax-u-' + str(params.relax_u) + '-inf', electron_maxstep=params.electron_maxstep, nogamma=True, system=params.system, kgrid=params.dft_grid, dependencies=(coarse_relax, 'structure'), **shared_relax) sims.append(fine_relax) scf_inf = generate_pwscf( identifier='scf', path=scf_path, electron_maxstep=params.electron_maxstep, nogamma=True, system=params.system, #nosym = True, kgrid=params.dft_grid, calculation='scf', dependencies=(fine_relax, 'structure'), **shared_qe) #pdb.set_trace() else: scf_inf = generate_pwscf( identifier='scf', path=scf_path, electron_maxstep=params.electron_maxstep, nogamma=True, system=params.system, #nosym = True, kgrid=params.dft_grid, calculation='scf', **shared_qe) sims.append(scf_inf) if params.nscf_only is True: params.tilings = [] params.vmc_opt = False params.qmc = False if params.print_ke_corr: scf_dir = scf_inf.remdir pwscf_output = scf_inf.input.control.outdir datafile_xml = scf_dir + '/' + pwscf_output + '/pwscf.save/data-file-schema.xml' if os.path.isfile(datafile_xml): xmltree = minidom.parse(datafile_xml) ks_energies = xmltree.getElementsByTagName("ks_energies") eig_tot = 0 for kpt in ks_energies: w = float( kpt.getElementsByTagName('k_point')[0].getAttribute( 'weight')) eigs = np.array(kpt.getElementsByTagName('eigenvalues') [0].firstChild.nodeValue.split(' '), dtype='f') occs = np.array( kpt.getElementsByTagName( 'occupations')[0].firstChild.nodeValue.split(' '), dtype='f') #Non-integer occupations from DFT eig_tot += w * sum( eigs * occs) / 2 #Divide by two for both spins #end for print scf_dir, "e_tot eigenvalues in Ha ", eig_tot / 2 if scf_ks_energy == 0: scf_ks_energy = eig_tot / 2 #end if #end if for tl_num, tl in enumerate(params.tilings): for k in params.qmc_grids: knum = k[1] * k[2] * k[0] if params.relax: relax = fine_relax #prim = scf_inf.load_analyzer_image().input_structure.copy() print 'Make sure the previous run is loaded to results!' #scf_inf.system.structure else: relax = scf_inf prim = params.system.structure.copy() #system = params.system prim.clear_kpoints() super = prim.tile(tl) tl_np = np.array(tl) tl_det = int(np.abs(np.linalg.det(tl_np)) + 0.001) if params.natoms is not None: natoms = tl_det * params.natoms else: natoms = len(super.elem) #end if if params.rcut: rcut = params.rcut[tl_num] else: rcut = super.rwigner() - 0.00001 #end if if params.tot_mag is not None and params.qp is False: system = generate_physical_system( structure=prim, tiling=tl, kgrid=k, kshift=params.kshift, #(0, 0, 0), net_charge=params.charge, net_spin=params.tot_mag, use_prim=False, **params.system.valency) elif params.qp is False: system = generate_physical_system( structure=prim, tiling=tl, kgrid=k, shift=params.kshift, #(0, 0, 0), net_charge=params.charge, **params.system.valency) else: system = generate_physical_system( structure=prim, tiling=tl, kgrid=k, kshift=params.kshift, #(0, 0, 0), use_prim=False, **params.system.valency) #end if # DFT NSCF To Generate Wave Function At Specified K-points if params.dft_grid == params.qmc_grids[0] and len( params.qmc_grids) == 1: params.nscf_skip = True if not params.nscf_skip: if params.relax: nscf_dep = [(scf_inf, 'charge_density'), (relax, 'structure')] else: nscf_dep = [(scf_inf, 'charge_density')] #end if nscf_path = './nscf-u-' + str(u) + '-' + str( knum) + '-' + str(natoms) p2q_path = nscf_path nscf = generate_pwscf( identifier='nscf', path=nscf_path, system=system, #nosym = True, nogamma=True, dependencies=nscf_dep, calculation='nscf', **shared_qe) sims.append(nscf) if params.relax: p2q_dep = [(nscf, 'orbitals'), (relax, 'structure')] else: p2q_dep = [(nscf, 'orbitals')] #end if else: p2q_path = scf_path if params.relax: p2q_dep = [(scf_inf, 'orbitals'), (relax, 'structure')] else: p2q_dep = [(scf_inf, 'orbitals')] #end if #end if # Convert DFT Wavefunction Into HDF5 File For QMCPACK p2q = generate_pw2qmcpack( identifier='p2q', path=p2q_path, job=p2q_job, write_psir=False, dependencies=p2q_dep, ) sims.append(p2q) if params.print_ke_corr and not params.nscf_skip: import h5py nscf_dir = nscf.remdir pwscf_output = nscf.input.control.outdir h5_file = nscf_dir + '/' + pwscf_output + '/pwscf.pwscf.h5' #Assume equal weight for all k-points eig_tot = 0 nkpts = 0 if os.path.isfile(h5_file): f = h5py.File(h5_file, 'r+') nelect = f['electrons']['number_of_electrons'][:] for group_e in f['electrons'].keys(): if group_e.startswith('kpoint'): nkpts += 1 f_temp = f['electrons'][group_e] for group_k in f_temp.keys(): k_s_eig = [0] w = 0 if group_k.startswith('spin_0'): k_s_eig = f_temp[group_k][ 'eigenvalues'][:] k_s_eig = k_s_eig[0:nelect[ 0]] #fixed occupations from the number of electrons w = f_temp['weight'][0] elif group_k.startswith('spin_1'): k_s_eig = f_temp[group_k][ 'eigenvalues'][:] k_s_eig = k_s_eig[0:nelect[1]] w = f_temp['weight'][0] #pdb.set_trace() #end if eig_tot += sum(k_s_eig) * w / 2 #end for #end if #end fof print nscf_dir, "e_tot eigenvalues in Ha", eig_tot / 2 - scf_ks_energy, "wigner " + str( system['structure'].rwigner()) #end if #end if # DFT is complete, rest is QMC # change here for other AFM atoms system.rename(Co1='Co', Co2='Co', Co3='Co', folded=False) system.rename(Ni1='Ni', Ni2='Ni', Ni3='Ni', folded=False) # VMC Optimization linopt1 = linear( energy=0.0, # 0.95 unreweightedvariance=1.0, reweightedvariance=0.0, # 0.05 timestep=0.3, samples=samples, walkers=walkers, warmupsteps=10, blocks=blocks, steps=1, substeps=10, maxweight=1e9, gpu=True, minmethod='OneShiftOnly', minwalkers=0.01, usebuffer=True, exp0=-6, bigchange=10.0, alloweddifference=1e-04, stepsize=0.15, nstabilizers=1, ) # Quasiparticle calculation if params.qp: etot = system.particles.down_electron.count + system.particles.up_electron.count upe = (etot + params.tot_mag * tl_det) / 2 - params.charge downe = etot - params.charge - upe system.particles.down_electron.count = downe system.particles.up_electron.count = upe #end if # 1. VMC optimization is requested # 2. VMC optimization is done on the first element uf ulist # 3. VMC optimization is done on the first element of qmc_grids if params.vmc_opt and u == params.ulist[ 0] and k == params.qmc_grids[0]: # VMC Variance minimization opt_varmin = generate_qmcpack( identifier='opt-varmin', path='./opt-u-' + str(u) + '-' + str(natoms) + '-varmin-' + str(params.j), job=opt_job, input_type='basic', system=system, spin_polarized=True, # jtk: needs this meshfactor=1.0, hybrid_rcut=params.hybrid_rcut, hybrid_lmax=params.hybrid_lmax, #spline_radius = params.spline_radius, twistnum=params.twistnum, #bconds = 'ppp', pseudos=params.qmc_pps, jastrows=[('J1', 'bspline', params.j, rcut), ('J2', 'bspline', params.j, rcut, 'init', 'zero')], calculations=[ loop(max=6, qmc=linopt1), loop(max=6, qmc=linopt1) ], dependencies=(p2q, 'orbitals')) sims.append(opt_varmin) # QMC Optimization Parameters - Finer Sampling Set -- Energy Minimization linopt2 = linopt1.copy() linopt2.minwalkers = 0.5 linopt2.energy = 0.95 linopt2.unreweightedvariance = 0.0 linopt2.reweightedvariance = 0.05 linopt3 = linopt2.copy() linopt3.minwalkers = 0.5 ## emin_dep = [] # Use preliminary optimization step made of two steps if not params.nopre: preopt_emin = generate_qmcpack( identifier='opt-emin', path='./preopt-u-' + str(u) + '-' + str(natoms) + '-emin-' + str(params.j), job=opt_job, input_type='basic', system=system, spin_polarized=True, # jtk: needs this meshfactor=params.meshfactor, hybrid_rcut=params.hybrid_rcut, hybrid_lmax=params.hybrid_lmax, #spline_radius = params.spline_radius, twistnum=params.twistnum, #bconds = 'ppp', pseudos=params.qmc_pps, jastrows=[], calculations=[loop(max=2, qmc=linopt2)], dependencies=[(p2q, 'orbitals'), (opt_varmin, 'jastrow')]) sims.append(preopt_emin) emin_dep = preopt_emin else: emin_dep = opt_varmin #end if opt_emin = generate_qmcpack( identifier='opt-emin', path='./opt-u-' + str(u) + '-' + str(natoms) + '-emin-' + str(params.j), job=opt_job, input_type='basic', system=system, spin_polarized=True, # jtk: needs this meshfactor=params.meshfactor, hybrid_rcut=params.hybrid_rcut, hybrid_lmax=params.hybrid_lmax, #spline_radius = params.spline_radius, twistnum=params.twistnum, #bconds = 'ppp', pseudos=params.qmc_pps, jastrows=[], calculations=[ loop(max=4, qmc=linopt2), loop(max=4, qmc=linopt3) ], dependencies=[(p2q, 'orbitals'), (emin_dep, 'jastrow')]) sims.append(opt_emin) # 3-body jastrows if params.j3: j3_dep = [] linopt2.walkers = 16 linopt2.blocks = linopt2.blocks * 2 linopt2.samples = linopt1.samples * 2 j3_rcut = min(system['structure'].rwigner() - 0.0001, 4.0) if not params.nopre: preopt_emin_J3 = generate_qmcpack( identifier='opt-emin-J3', path='./preopt-u-' + str(u) + '-' + str(natoms) + '-emin-J3-' + str(params.j), job=opt_job, input_type='basic', system=system, spin_polarized=True, # jtk: needs this meshfactor=params.meshfactor, hybrid_rcut=params.hybrid_rcut, hybrid_lmax=params.hybrid_lmax, #spline_radius = params.spline_radius, twistnum=params.twistnum, #bconds = 'ppp', pseudos=params.qmc_pps, jastrows=[('J3', 'polynomial', 3, 3, j3_rcut)], calculations=[loop(max=2, qmc=linopt2)], dependencies=[(p2q, 'orbitals'), (opt_emin, 'jastrow')]) sims.append(preopt_emin_J3) j3_dep = preopt_emin_J3 else: j3_dep = opt_emin #end if opt_emin_J3 = generate_qmcpack( identifier='opt-emin-J3', path='./opt-u-' + str(u) + '-' + str(natoms) + '-emin-J3-' + str(params.j), job=opt_job, input_type='basic', system=system, spin_polarized=True, # jtk: needs this meshfactor=params.meshfactor, hybrid_rcut=params.hybrid_rcut, hybrid_lmax=params.hybrid_lmax, #spline_radius = params.spline_radius, twistnum=params.twistnum, #bconds = 'ppp', pseudos=params.qmc_pps, jastrows=[('J3', 'polynomial', 3, 3, j3_rcut)], calculations=[ loop(max=4, qmc=linopt2), loop(max=4, qmc=linopt2) ], dependencies=[(p2q, 'orbitals'), (j3_dep, 'jastrow')]) sims.append(opt_emin_J3) #end if #end if # VMC is complete, run DMC dmc_nodes = np.round( np.ceil(knum * dmcnodespertwist) / minnodes) * minnodes dmc_job = Job(nodes=int(dmc_nodes), hours=dmc_hours, threads=qmc_threads, app=qmcapp, presub=qmc_presub) # Add any future estimators here from qmcpack_input import spindensity, skall, density if params.density is not None: est = [spindensity(grid=params.density)] else: est = None #end if #Initial VMC calculation to generate walkers for DMC calculations = [ vmc( warmupsteps=25, blocks=vmcblocks, steps=1, stepsbetweensamples=1, walkers=walkers, timestep=vmcdt, substeps=4, samplesperthread=int(dmcwalkers / (dmcnodespertwist * walkers)), ), # dmc( # warmupsteps =0, # blocks =dmceqblocks/4, # steps =5, # timestep =0.04, # nonlocalmoves=params.tmoves, # ), # dmc( # warmupsteps =0, # blocks =dmceqblocks/4, # steps =5, # timestep =0.02, # nonlocalmoves=params.tmoves, # ), ] # Scan over timesteps if params.timesteps is None: params.timesteps = [0.01] #end if for t in params.timesteps: calculations.append( dmc( warmupsteps=dmceqblocks / 2, blocks=int(dmcblocks / (np.sqrt(t) * 10)), steps=10, timestep=t, nonlocalmoves=params.tmoves, )) #end for # Prepanding name for the path pathpre = 'dmc' if params.vmc: pathpre = 'vmc' #end if deps = [(p2q, 'orbitals')] has_jastrow = False # 3-body jastrow calculation with VMC or DMC if params.j3: has_jastrow = True # add j3 dependenciies if params.vmc_opt: deps.append((opt_emin_J3, 'jastrow')) #end if if params.tmoves: path = './' + pathpre + '-j3-tm-u-' + str( u) + '-' + str(knum) + '-' + str(natoms) else: path = './' + pathpre + '-j3-nl-u-' + str( u) + '-' + str(knum) + '-' + str(natoms) #end if #end if # 2-body jastrow calculation with VMC or DMC if params.j2: has_jastrow = True #add j2 dependencies if params.vmc_opt: deps.append((opt_emin, 'jastrow')) #end if if params.tmoves: path = './' + pathpre + '-j2-tm-u-' + str( u) + '-' + str(knum) + '-' + str(natoms) else: path = './' + pathpre + '-j2-nl-u-' + str( u) + '-' + str(knum) + '-' + str(natoms) #end if #end if # No jastrow calculation with VMC or DMC if not has_jastrow: if params.tmoves: path = './' + pathpre + '-j0-tm-u-' + str( u) + '-' + str(knum) + '-' + str(natoms) else: path = './' + pathpre + '-j0-nl-u-' + str( u) + '-' + str(knum) + '-' + str(natoms) #end if #end if det_format = 'new' # Optical excitation if params.excitation is not None: path += '_' + params.excitation[ 0] + '_' + params.excitation[1].replace(" ", "_") det_format = 'old' #end if # Charged cell if params.charge != 0: path += '_' + str(params.charge) #end if if params.qmc: qmc = generate_qmcpack(seed=params.seed, skip_submit=params.qmc_skip_submit, det_format=det_format, identifier=pathpre, path=path, job=dmc_job, input_type='basic', system=system, estimators=est, meshfactor=params.meshfactor, hybrid_rcut=params.hybrid_rcut, hybrid_lmax=params.hybrid_lmax, excitation=params.excitation, pseudos=params.qmc_pps, jastrows=[], spin_polarized=True, calculations=calculations, dependencies=deps) qmcs.append(qmc) #end if #end if #end for #end for if params.bundle: from bundle import bundle qmcb = bundle(qmcs) sims.append(qmcb) else: sims = sims + qmcs return sims
path='diamond/nscf', job=job(cores=1, app='pw2qmcpack.x', hours=1), write_psir=False, dependencies=(nscf, 'orbitals'), ) qmc = generate_qmcpack( det_format='old', identifier='vmc', path='diamond/vmc', job=job(cores=16, threads=16, app='qmcpack', hours=1), input_type='basic', spin_polarized=True, system=dia2, pseudos=['C.BFD.xml'], jastrows=[], calculations=[ vmc(walkers=16, warmupsteps=20, blocks=1000, steps=10, substeps=2, timestep=.4) ], dependencies=(conv, 'orbitals'), ) qmc_optical = generate_qmcpack( det_format='old', identifier='vmc', path='diamond/vmc_optical', job=job(cores=16, threads=16, app='qmcpack', hours=1),
center = (0,0,0), check_overlap = False, ) qmc = generate_qmcpack( identifier = 'vmc_1rdm_noJ', path = 'vmc_1rdm_noJ', job = job(cores=3,app='qmcpack_complex',hours=1), input_type = 'basic', system = dia16, pseudos = ['C.BFD.xml'], estimators = [dm_estimator], jastrows = [], calculations = [ vmc( walkers = 1, warmupsteps = 20, blocks = 200, steps = 10, substeps = 2, timestep = .4 ) ], dependencies = (conv,'orbitals'), ) qmc = generate_qmcpack( identifier = 'vmc_1rdm_down_noJ', path = 'vmc_1rdm_down_noJ', job = job(cores=3,app='qmcpack_complex',hours=1),