#! /usr/bin/env python from nexus import settings, job, run_project, obj from nexus import generate_physical_system from nexus import generate_gamess settings(pseudo_dir='./pseudopotentials', results='', status_only=0, generate_only=0, sleep=3, machine='ws16', ericfmt='/your/path/to/ericfmt.dat') gms_job = job(cores=16, app='gamess.x') h2o = generate_physical_system( # full atomic/electronic structure elem=['O', 'H', 'H'], pos=[[0.000000, 0.000000, 0.000000], [0.000000, -0.757160, 0.586260], [0.000000, 0.757160, 0.586260]], units='A', # Angstroms net_spin=0, # multiplicity=1, nup-ndown=0 O=6, # Zeff=6 for BFD ECP H=1, # Zeff=1 for BFD ECP # C2v symmetry structure folded_elem=['O', 'H'], folded_pos=[[0.000000, 0.000000, 0.000000], [0.000000, 0.757160, 0.586260]], )
#! /usr/bin/env python from nexus import settings,job,run_project,obj from nexus import generate_physical_system from nexus import generate_pyscf settings( results = '', sleep = 3, machine = 'ws16', ) system = generate_physical_system( structure = 'H2O.xyz', ) scf = generate_pyscf( identifier = 'scf', # log output goes to scf.out path = 'h2o_ae_hf', # directory to run in job = job(serial=True), # pyscf must run serially template = './scf_template.py', # pyscf template file system = system, mole = obj( # used to make Mole() inputs basis = 'ccpvtz', symmetry = True, ), ) run_project()
#! /usr/bin/env python 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 settings( pseudo_dir='./pseudopotentials', results='', status_only=0, generate_only=0, sleep=3, machine='ws16', #machine = 'eos', #account = 'mat151', ) on_desktop = settings.machine == 'ws16' on_cluster = settings.machine == 'eos' if on_desktop: scf_job = job(cores=16, app='pw.x') conv_job = job(cores=1, app='pw2qmcpack.x') qmc_job = job(cores=1) # fake/placeholder job elif on_cluster: scf_job = job(nodes=1) # fake/placeholder job conv_job = job(nodes=1) # fake/placeholder job modules = ''' source $MODULESHOME/init/bash
#! /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,loop,linear,vmc settings( pseudo_dir = './pseudopotentials', results = '', runs = 'diamond_runs', 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]], use_prim = True, # Use SeeK-path library to identify prim cell tiling = [3,1,3], # Tile the cell kgrid = (1,1,1),
import numpy as np import os from nexus import settings, Job, run_project, obj from nexus import Structure, PhysicalSystem from nexus import generate_physical_system from nexus import generate_pwscf from nexus import generate_pw2qmcpack, read_structure from nexus import generate_qmcpack, vmc, loop, linear, dmc from structure import optimal_tilematrix # General Settings (Directories For I/O, Machine Type, etc.) settings(pseudo_dir='../pseudopotentials', runs='runs', results='results', sleep=5, generate_only=0, status_only=1, machine='cades', account='qmc') #CHANGE_HERE_ONLY# ###################################################################### ########################## Change here only ##########################` #STRUCTURE prim = read_structure('POSCAR') prim.frozen = None ph = generate_physical_system(structure=prim.copy(), Li=1,
def apply_machine_settings(machine, run_dir, account='', nk=1, **kwargs): """ apply default machines settings for hydrogen simulations return a dictionary of jobs for ['dft','p2q','opt','dmc'] Args: machine (str): one of ['golub','titan','ws4','ws8',...]. 'ws' stands for workstation. run_dir (str): directory to run the jobs in. account (str,optional): default is to depend on the machine's default in nexus. nk (int,optional): the npool option in pw.x, default is 1 because it always runs. For large number of kpoints, set nk to be as large as possible for speed. kwargs (dict): extra keyword arguments to be passed to nexus.settings. Returns: dict: jobs, a dictionary of nexus.obj objects for ['dft','p2q','opt','dmc'], each can be passed to create nexus.Job objects using Job(**jobs['dft']), for example. """ if (machine not in ['golub', 'titan', 'eos', 'bluewaters_xe' ]) and (not machine.startswith('ws')): raise NotImplementedError('cannot handle machine=%s yet' % machine) # end if from nexus import settings, obj if machine == 'titan': account = 'mat158' pseudo_dir = '/ccs/home/yyang173/scratch/hsolid/pseudo' vdw_table = '/ccs/home/yyang173/scratch/hsolid/vdw/vdW_kernel_table' qedir = '~/soft/espresso-5.3.0/bin' ccdir = '~/soft/qmcpack-espresso-5.3.0/bin' qmcdir = '~/soft/kylin_qmcpack' elif machine == 'eos': account = 'mat158' pseudo_dir = '/ccs/home/yyang173/scratch/hsolid/pseudo' vdw_table = '/ccs/home/yyang173/scratch/hsolid/vdw/vdW_kernel_table' qedir = '~/soft/espresso-5.3.0/bin' ccdir = '~/soft/qmcpack-espresso-5.3.0/bin' qmcdir = '~/soft/intel_kylin_qmcpack' elif machine == 'bluewaters_xe': pseudo_dir = '/u/sciteam/yang5/scratch/hsolid/pseudo' vdw_table = '/u/sciteam/yang5/scratch/hsolid/vdw/vdW_kernel_table' qedir = '~/soft/espresso-5.3.0/bin' ccdir = '~/soft/qmcpack-espresso-5.3.0/bin' qmcdir = '~/soft/kylin_qmcpack' elif machine == 'golub': pseudo_dir = '/home/yyang173/scratch/hsolid/pseudo' vdw_table = '/home/yyang173/scratch/hsolid/vdw/vdW_kernel_table' qedir = '/projects/physics/yyang/soft/espresso-5.3.0/bin' ccdir = '/projects/physics/yyang/soft/qmcpack-espresso-5.3.0/bin' qmcdir = '~/soft/kylin_qmcpack' else: # workstation, defaults should do pseudo_dir = '/home/yyang173/Desktop/hsolid/pseudo' vdw_table = '/home/yyang173/Desktop/hsolid/vdw/vdW_kernel_table' qedir = '~/soft/espresso-5.3.0/bin' ccdir = '~/soft/qmcpack-espresso-5.3.0/bin' qmcdir = '~/soft/kylin_qmcpack' # end if settings(runs=run_dir, machine=machine, account=account, pseudo_dir=pseudo_dir, vdw_table=vdw_table, **kwargs) pw_bin = os.path.join(qedir, 'pw.x') cc_bin = os.path.join(ccdir, 'pw2qmcpack.x') qmc_bin = os.path.join(qmcdir, "qmcpack_cpu_real") tabc_bin = os.path.join(qmcdir, "qmcpack_cpu_comp") # assign jobs if machine == 'titan': dft_job = obj(nodes=1, minutes=10, app_options="-nk %d" % nk, app=pw_bin) p2q_job = obj(nodes=1, serial=True, minutes=30, app=cc_bin) opt_job = obj(nodes=4, threads=8, hours=2, app=qmc_bin) dmc_job = obj(nodes=8, threads=8, hours=2, app=qmc_bin) elif machine == 'eos': dft_job = obj(nodes=1, minutes=10, app_options="-nk %d" % nk, app=pw_bin) p2q_job = obj(nodes=1, serial=True, minutes=30, app=cc_bin) opt_job = obj(nodes=4, threads=8, hours=2, app=qmc_bin) dmc_job = obj(nodes=8, threads=8, hours=2, app=qmc_bin) elif machine == 'bluewaters_xe': dft_job = obj(nodes=1, minutes=10, app_options="-nk %d" % nk, app=pw_bin) p2q_job = obj(nodes=1, serial=True, minutes=30, app=cc_bin) opt_job = obj(nodes=4, threads=8, hours=2, app=qmc_bin) dmc_job = obj(nodes=8, threads=8, hours=2, app=qmc_bin) for job in [dft_job, p2q_job, opt_job, dmc_job]: job['user_env'] = False # the -V option is deprecated # end for elif machine == 'golub': dft_job = obj(nodes=1, hours=4, app=pw_bin, app_options='-nk %d' % nk) p2q_job = obj(nodes=1, serial=True, minutes=30, app=cc_bin) opt_job = obj(nodes=1, threads=8, hours=4, app=qmc_bin) dmc_job = obj(nodes=1, threads=8, hours=4, app=qmc_bin) else: dft_job = obj(app_options='-nk %d' % nk, app=pw_bin) p2q_job = obj(serial=True, app=cc_bin) opt_job = obj(app=qmc_bin, threads=8) dmc_job = obj(app=qmc_bin, threads=8) # end if tabc_job = dmc_job.copy() tabc_job.app = tabc_bin jobs = { 'dft': dft_job, 'p2q': p2q_job, 'opt': opt_job, 'dmc': dmc_job, 'tabc': tabc_job } return jobs
#! /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]],
#! /usr/bin/env python import numpy as np # ======= setup machine and jobs ======= from nexus import settings,Job,obj machine_settings = obj( runs = 'grid', # default to 'runs' generate_only = 0, status_only = 0, sleep = 1, machine = 'ws1', ericfmt = '/opt/intel14/gamess-2014R1/auxdata/ericfmt.dat' ) settings(**machine_settings) gms_job = Job(serial=True,app="rungms",cores=1) # ======= structure ======= from nexus import generate_physical_system, Structure from nexus import generate_gamess CH = 1.0655 # ang CN = 1.1538 # ang basis = 'ccd' # ======= simulations ======= ''' MODERN BASIS SET FAMILIES (CCN, PCN, MCP_NZP, IMCP) ARE INTENDED FOR USE ONLY AS SPHERICAL HARMONIC BASIS SETS. PLEASE SET ISPHER=1 IN THE $CONTRL GROUP IN ORDER TO USE GBASIS=ACCT '''
#! /usr/bin/env python from nexus import settings from nexus import Structure,PhysicalSystem from nexus import generate_pwscf,Job from nexus import run_project # set global parameters of nexus settings( pseudo_dir = '../pseudopotentials',# directory with pseudopotentials generate_only = 0, # only generate input files, T/F status_only = 0, # only show run status, T/F machine = 'ws16' # local machine is 16 core workstation ) # describe the physical system T_structure = Structure() # empty structure T_structure.read_xyz('./Ge_T_16.xyz') # read in Ge T interstitial structure T_structure.reset_axes([ # specify cell axes (in Angstrom) [ 5.66, 5.66, 0. ], [ 0. , 5.66, 5.66], [ 5.66, 0. , 5.66] ]) T_system = PhysicalSystem( # make the physical system structure = T_structure, # out of the T interstitial structure
def test_settings(): # test full imports import os from nexus import settings, Settings, obj from nexus_base import nexus_core, nexus_core_defaults from nexus_base import nexus_noncore, nexus_noncore_defaults from nexus_base import nexus_core_noncore, nexus_core_noncore_defaults from pseudopotential import Pseudopotentials from basisset import BasisSets from machines import Job, Workstation from project_manager import ProjectManager from gamess import Gamess from pwscf import Pwscf from quantum_package import QuantumPackage testing.check_final_state() tpath = testing.setup_unit_test_output_directory('settings', 'test_settings') # divert logging function divert_nexus() def aux_defaults(): # check that Job and ProjectManager settings are at default values assert (Job.machine is None) assert (ProjectManager.machine is None) # check that Gamess, Pwscf, and Quantum Package settings are at default values assert (Gamess.ericfmt is None) assert (Gamess.mcppath is None) assert (Pwscf.vdw_table is None) assert (QuantumPackage.qprc is None) #end def aux_defaults def check_settings_core_noncore(): nckeys_check = set([ 'command_line', 'debug', 'dependent_modes', 'emulate', 'file_locations', 'generate_only', 'graph_sims', 'indent', 'load_images', 'local_directory', 'mode', 'modes', 'monitor', 'primary_modes', 'progress_tty', 'pseudo_dir', 'pseudopotentials', 'remote_directory', 'results', 'runs', 'skip_submit', 'sleep', 'stages', 'stages_set', 'status', 'status_modes', 'status_only', 'trace', 'verbose' ]) nnckeys_check = set( ['basis_dir', 'basissets', 'pseudo_dir', 'pseudopotentials']) setkeys_check = set([ 'command_line', 'basis_dir', 'basissets', 'debug', 'dependent_modes', 'emulate', 'file_locations', 'generate_only', 'graph_sims', 'indent', 'load_images', 'local_directory', 'mode', 'modes', 'monitor', 'primary_modes', 'progress_tty', 'pseudo_dir', 'pseudopotentials', 'remote_directory', 'results', 'runs', 'skip_submit', 'sleep', 'stages', 'stages_set', 'status', 'status_modes', 'status_only', 'trace', 'verbose' ]) setkeys_allowed = setkeys_check | Settings.allowed_vars nckeys = set(nexus_core.keys()) nnckeys = set(nexus_noncore.keys()) setkeys = set(settings.keys()) assert (nckeys == nckeys_check) assert (nnckeys == nnckeys_check) assert (setkeys >= setkeys_check) assert (setkeys <= setkeys_allowed) pairs = [(settings, nexus_core), (settings, nexus_noncore), (nexus_core, nexus_noncore)] for o1, o2 in pairs: shared_keys = set(o1.keys()) & set(o2.keys()) for k in shared_keys: v1 = o1[k] v2 = o2[k] if isinstance(v1, obj): assert (object_eq(v1, v2)) else: assert (value_eq(v1, v2)) #end if #end for #end for #end check_settings_core_noncore def check_empty_settings(): settings(command_line=False, ) settings.command_line = True nexus_core.command_line = True check_settings_core_noncore() # nexus core sets basic run stages and Pseudopotentials object assert (nexus_core.stages_set == set( nexus_core_defaults.primary_modes)) assert (isinstance(nexus_core.pseudopotentials, Pseudopotentials)) assert (len(nexus_core.pseudopotentials) == 0) nexus_core.stages_set = set() nexus_core.stages = [] nexus_core.pseudopotentials = None assert (object_eq(nexus_core, nexus_core_defaults)) # nexus noncore sets Pseudopotentials and BasisSets objects assert (isinstance(nexus_noncore.pseudopotentials, Pseudopotentials)) assert (len(nexus_noncore.pseudopotentials) == 0) assert (isinstance(nexus_noncore.basissets, BasisSets)) assert (len(nexus_noncore.basissets) == 0) nnc_defaults = obj(nexus_noncore_defaults, nexus_core_noncore_defaults) nexus_noncore.pseudopotentials = None nexus_noncore.basissets = None assert (object_eq(nexus_noncore, nnc_defaults)) # other settings objects should be at default also aux_defaults() #end def_check_empty_settings # check that core settings are at default values assert (object_eq(nexus_core, nexus_core_defaults)) assert (object_eq(nexus_noncore, nexus_noncore_defaults)) assert (object_eq(nexus_core_noncore, nexus_core_noncore_defaults)) aux_defaults() # core settings remain almost at default with empty settings check_empty_settings() # check that a few basic user settings are applied appropriately cwd = os.getcwd() os.chdir(tpath) dft_pseudos = ['Ni.opt.upf', 'O.opt.upf'] qmc_pseudos = ['Ni.opt.xml', 'O.opt.xml'] pseudos = dft_pseudos + qmc_pseudos pseudo_path = './pseudopotentials' if not os.path.exists(pseudo_path): os.makedirs(pseudo_path) for file in pseudos: filepath = os.path.join(pseudo_path, file) if not os.path.exists(filepath): open(filepath, 'w').close() #end if #end for #end if settings( pseudo_dir=pseudo_path, status_only=0, generate_only=1, machine='ws16', command_line=False, ) check_settings_core_noncore() assert (nexus_core.status_only == 0) assert (nexus_core.generate_only == 1) assert (nexus_core.pseudo_dir == './pseudopotentials') assert (len(nexus_core.pseudopotentials) == 4) assert (set(nexus_core.pseudopotentials.keys()) == set(pseudos)) assert (settings.machine == 'ws16') assert (Job.machine == 'ws16') assert (isinstance(ProjectManager.machine, Workstation)) assert (ProjectManager.machine.name == 'ws16') os.chdir(cwd) # check that a new empty settings works following basic check_empty_settings() # restore logging function restore_nexus()
#! /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, dmc from machine_configs import get_puhti_configs from optim_params import * settings( pseudo_dir='./pseudopotentials', status_only=0, generate_only=1, sleep=3, machine='', account='', ) jobs = get_puhti_configs() # The 4 commented lines below are as before in the vmc diamond case (Problem 3) #dia16 = generate_physical_system() #scf = generate_pwscf() #conv = generate_pw2qmcpack() #qmc = generate_qmcpack() # Look into the needed imports and other settings when modifying your workflow scritps # this loads some optimization parameters from optim_params optims = getOptims()
from nexus import generate_pwscf from nexus import generate_projwfc from nexus import generate_pw2qmcpack from nexus import generate_qmcpack from nexus import vmc from structure import * from qmcpack_input import dm1b from qmcpack_input import sposet settings( pseudo_dir = '../../pseudopotentials', runs = 'runs_spin', results = '', status_only = 0, generate_only = 0, skip_submit = 0, sleep = 3, machine = 'ws4' ) dia16 = 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]], tiling = (1,1,1), C = 4
#! /usr/bin/env python from nexus import settings,job,run_project from nexus import read_structure,get_machine from nexus import generate_physical_system from nexus import generate_pwscf b = '\n'+40*'='+'\n' settings( pseudo_dir = './pseudopotentials', machine = 'ws16' #machine = 'titan', #account = 'XYZ123', ) if settings.machine=='ws16': scf_job = job(cores=16,app='pw.x') elif settings.machine=='titan': titan = get_machine('titan') titan.queue_size = 2 scf_job = job(nodes=1,hours=1,app='pw.x') else: print 'no jobs for machine!' #end if s = read_structure('d16bulk.POSCAR') s.remove([[0.8925,0.8925,0.8925]]) print b+'structure w/ vacancy\n',s s.write('d16vac.xsf')
#! /usr/bin/env python import numpy as np # ======= setup machine and jobs ======= from nexus import settings, Job, obj machine_settings = obj( runs='grid', # default to 'runs' generate_only=0, status_only=0, sleep=1, machine='ws1', ericfmt='/opt/intel14/gamess-2014R1/auxdata/ericfmt.dat') settings(**machine_settings) gms_job = Job(serial=True, app="rungms", cores=1) # ======= structure ======= from nexus import generate_physical_system, Structure from nexus import generate_gamess CH = 1.0655 # ang CN = 1.1538 # ang basis = 'ccd' # ======= simulations ======= ''' MODERN BASIS SET FAMILIES (CCN, PCN, MCP_NZP, IMCP) ARE INTENDED FOR USE ONLY AS SPHERICAL HARMONIC BASIS SETS. PLEASE SET ISPHER=1 IN THE $CONTRL GROUP IN ORDER TO USE GBASIS=ACCT ''' rhf_runs = []
#! /usr/bin/env python from nexus import settings settings( generate_only = True, # only write input files, do not run sleep = 3, # check on jobs every 3 seconds pseudo_dir = './pseudopotentials', # path to PP file collection machine = 'node8' # local machine is an 8 core workstation ) settings( status_only = True, # only write job status, do not run generate_only = True, # only write input files, do not run sleep = 3, # check on jobs every 3 seconds pseudo_dir = './pseudopotentials', # path to PP file collection local_directory = './' # base path for runs and results runs = 'runs', # runs directory results = 'results', # results directory machine = 'titan', # local machine is Titan account = 'MAT123', # allocation account on Titan machine_info = dict( oic5 = dict( local_directory = '/home/your_id', ), kraken = dict( local_directory = '/nics/b/home/your_id' )
#! /usr/bin/env python 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 settings( pseudo_dir = '../../pseudopotentials', results = '', sleep = 3, machine = 'ws16', ) system = generate_physical_system( units = 'A', axes = '''1.785 1.785 0.000 0.000 1.785 1.785 1.785 0.000 1.785''', elem_pos = ''' C 0.0000 0.0000 0.0000 C 0.8925 0.8925 0.8925 ''', tiling = [[ 1, -1, 1], [ 1, 1, -1], [-1, 1, 1]], kgrid = (1,1,1), kshift = (0,0,0), C = 4, )
#! /usr/bin/env python3 from nexus import settings,job,run_project,obj from nexus import generate_physical_system from nexus import generate_pyscf from nexus import generate_convert4qmc from nexus import generate_qmcpack,loop,linear,vmc,dmc settings( pseudo_dir = '/global/homes/h/haihan/Research/BeH2/instability/QZqmcT/001/pseudo', results = '.', runs = 'runs', status_only = 0, generate_only = 0, sleep = 10, # In seconds machine = 'cori', # Use lowercase letters account = 'm2113', # QMCPACK user = '******' ) scf_presub = ''' export HDF5_USE_FILE_LOCKING=FALSE module unload cray-libsci module load cray-hdf5 #module load python/3.7-anaconda-2019.10 source activate myenv module list ''' system = generate_physical_system( structure = 'geom.xyz',
#! /usr/bin/env python # LiH crystal with Quantum ESPRESSO orbitals 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,loop,linear,dmc # General Settings (Directories For I/O, Machine Type, etc.) settings( pseudo_dir = 'pseudopotentials', runs = 'runs', results = 'results', sleep = 3, generate_only = 0, status_only = 0, machine = 'ws1', ) # Executables (Indicate Path If Needed) pwscf = 'pw.x' pw2qmcpack = 'pw2qmcpack.x' qmcpack = 'qmcpack' # Pseudopotentials dft_pps = ['Li.TN-DF.upf','H.TN-DF.upf'] qmc_pps = ['Li.pp.data','H.pp.data'] # job Definitions (MPI Tasks, MP Threading, PBS Queue, Time, etc.) scf_job = job(app=pwscf,serial=True)
#! /usr/bin/env python from nexus import settings,ProjectManager,Job from nexus import Structure,PhysicalSystem from nexus import loop,linear,vmc,dmc from qmcpack_calculations import basic_qmc #general settings for nexus settings( pseudo_dir = './pseudopotentials',# directory with all pseudopotentials sleep = 3, # check on runs every 'sleep' seconds generate_only = 0, # only make input files status_only = 0, # only show status of runs machine = 'node16', # local machine is 16 core workstation ) #generate the C20 physical system # specify the xyz file structure_file = 'c20.cage.xyz' # make an empty structure object structure = Structure() # read in the xyz file structure.read_xyz(structure_file) # place a bounding box around the structure structure.bounding_box( box = 'cubic', # cube shaped cell scale = 1.5 # 50% extra space )
#! /usr/bin/env python from nexus import settings, ProjectManager, Job from nexus import Structure, PhysicalSystem from nexus import loop, linear, vmc, dmc from qmcpack_calculations import basic_qmc #general settings for nexus settings( pseudo_dir='./pseudopotentials', # directory with all pseudopotentials sleep=3, # check on runs every 'sleep' seconds generate_only=0, # only make input files status_only=0, # only show status of runs machine='node16', # local machine is 16 core workstation ) #generate the C20 physical system # specify the xyz file structure_file = 'c20.cage.xyz' # make an empty structure object structure = Structure() # read in the xyz file structure.read_xyz(structure_file) # place a bounding box around the structure structure.bounding_box( box='cubic', # cube shaped cell scale=1.5 # 50% extra space ) # make it a gamma point cell structure.add_kmesh( kgrid=(1, 1, 1), # Monkhorst-Pack grid
#! /usr/bin/env python # imports from nexus and numpy from numpy import arange, loadtxt from nexus import settings, job, run_project, obj from nexus import generate_physical_system from nexus import generate_vasp from nexus import graph_sims # nexus settings settings(pseudo_dir='./pseudopotentials', results='', status_only=0, generate_only=0, sleep=3, machine='oic5') # vasp job information modules = ''' module () { eval `/opt/modules/3.1.6/bin/modulecmd bash $*` } module purge module load composerxe/2011.10.319 module load mpi/openmpi-1.4.5-intel ''' vasp = '/home/j1k/apps/vasp/vasp53/5.3.3/vasp.oic_opt' vjob = job(nodes=2, hours=2, presub=modules, user_env=False, app=vasp) # vasp inputs used by all runs
#! /usr/bin/env python3 # import Nexus functions from nexus import settings, job, get_machine, run_project from nexus import generate_physical_system from nexus import generate_pwscf, generate_pw2qmcpack from nexus import generate_qmcpack, loop, linear, vmc, dmc # Nexus settings settings( pseudo_dir='./pseudopotentials', runs='', results='', status_only=0, generate_only=0, sleep=3, #machine = 'ws4', machine='vesta', account='QMCPACK-Training', ) # specify job details if settings.machine.startswith('ws'): # running on workstation dftjob = job(cores=4, app='pw.x') p2qjob = job(cores=1, app='pw2qmcpack.x') qmcjob = job(cores=4, app='qmcpack') else: # running on Vesta appdir = '/soft/applications/qmcpack/Binaries/' dftjob = job(nodes=32, threads=1, queue='qmcpack',
#! /usr/bin/env python from nexus import settings from nexus import Structure, PhysicalSystem from nexus import generate_pwscf, Job from nexus import ProjectManager # set global parameters of nexus settings( pseudo_dir='./pseudopotentials', # directory with pseudopotentials generate_only=0, # only generate input files, T/F status_only=0, # only show run status, T/F machine='node16' # local machine is 16 core workstation ) # describe the physical system T_structure = Structure() # empty structure T_structure.read_xyz('./Ge_T_16.xyz') # read in Ge T interstitial structure T_structure.reset_axes([ # specify cell axes (in Angstrom) [5.66, 5.66, 0.], [0., 5.66, 5.66], [5.66, 0., 5.66] ]) T_system = PhysicalSystem( # make the physical system structure=T_structure, # out of the T interstitial structure Ge=4 # pseudo-Ge has 4 valence electrons ) # specify MP k-point grids for successive relaxations supercell_kgrids = [ (1, 1, 1), # 1 k-point
#! /usr/bin/env python3 from nexus import settings, job, run_project from nexus import generate_physical_system from nexus import generate_quantum_package from nexus import generate_convert4qmc from nexus import generate_cusp_correction from nexus import generate_qmcpack # note: you must source the QP config file before running this script # source /your/path/to/quantum_package.rc settings( results='', status_only=0, generate_only=0, sleep=3, machine='ws16', qprc='/your/path/to/quantum_package.rc', ) # define run details qp_job = job(cores=16, threads=16) c4q_job = job(cores=1) qmc_job = job(cores=16, threads=16) # read in structure for oxygen dimer dimer = generate_physical_system( structure='./O2.xyz', net_spin=2, ) # path, job, system details are shared across runs
#! /usr/bin/env python 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 settings(pseudo_dir='./pseudopotentials', status_only=0, generate_only=0, sleep=3, machine='ws16') dia16 = 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]], tiling=(2, 2, 2), kgrid=(1, 1, 1), kshift=(0, 0, 0), C=4) scf = generate_pwscf( skip_submit=True, identifier='scf', path='diamond/scf', job=job(cores=16, app='pw.x'), input_type='generic', calculation='scf',
#! /usr/bin/env python 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 from nexus import loop, linear, vmc, dmc # general settings for nexus settings( pseudo_dir='../pseudopotentials', # directory with all pseudopotentials sleep=3, # check on runs every 'sleep' seconds #generate_only = False, # Complicated setting only so examples can be run in test harness. # For real runs, use the plain setting of 'generate_only' above. generate_only=globals().get('override_generate_only_setting', False), status_only=0, # only show status of runs machine='ws16', # local machine is 16 core workstation ) # generate the graphene physical system graphene = generate_physical_system( lattice='hexagonal', # hexagonal cell shape cell='primitive', # primitive cell centering='P', # primitive basis centering constants=(2.462, 10.0), # a,c constants units='A', # in Angstrom atoms=('C', 'C'), # C primitive atoms basis=[ [0, 0, 0], # basis vectors
#! /usr/bin/env python from nexus import settings, job, run_project from nexus import generate_physical_system from nexus import generate_quantum_package # note: you must source the QP config file before running this script # source /your/path/to/quantum_package.rc settings( results = '', status_only = 0, generate_only = 0, sleep = 3, machine = 'ws16', qprc = \ '/home/j1k/apps/quantum_package/qp2-2.0.0-beta/quantum_package.rc', ) scf_job = job(cores=16, threads=16) system = generate_physical_system(structure='H2O.xyz', ) scf = generate_quantum_package( identifier='hf', # log output goes to hf.out path='h2o_ae_hf', # directory to run in job=scf_job, system=system, prefix='h2o', # create/use h2o.ezfio run_type='scf', # qprun scf h2o.ezfio ao_basis='cc-pvtz', # use cc-pvtz basis
from nexus import settings, job, run_project from nexus import generate_physical_system from nexus import generate_quantum_package from nexus import generate_convert4qmc from nexus import generate_cusp_correction from nexus import generate_qmcpack # note: you must source the QP config file before running this script # source /home/ubuntu/apps/qp2/quantum_package.rc settings( results = '', status_only = 0, generate_only = 0, sleep = 3, machine = 'ws16', qprc = \ '/home/ubuntu/apps/qp2/quantum_package.rc', ) scf_job = job(cores=16, threads=16) c4q_job = job(cores=1) qmc_job = job(cores=16, threads=16) system = generate_physical_system(structure='H2O.xyz', ) # perform Hartree-Fock scf = generate_quantum_package( identifier='hf', # log output goes to hf.out path='H2O/hf', # directory to run in
# import nexus functions from nexus import settings,Job,get_machine,run_project from nexus import generate_physical_system from nexus import generate_pwscf from nexus import generate_pw2qmcpack from nexus import generate_qmcpack from nexus import loop,linear,vmc,dmc # nexus settings settings( pseudo_dir = '../pseudopotentials', runs = '', results = '', status_only = 0, #generate_only = False, # Complicated setting only so examples can be run in test harness. # For real runs, use the plain setting of 'generate_only' above. generate_only = globals().get('override_generate_only_setting',False), sleep = 3, machine = 'ws16', ) # specify optimization parameters linopt1 = linear( energy = 0.0, unreweightedvariance = 1.0, reweightedvariance = 0.0, timestep = 0.4, samples = 5120, # opt w/ 5120 samples warmupsteps = 50,
#! /usr/bin/env python 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 settings( pseudo_dir = '../pseudopotentials', status_only = 0, generate_only = 0, sleep = 3, machine = 'ws16' ) dia16 = 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]], tiling = (2,2,2), kgrid = (1,1,1), kshift = (0,0,0), C = 4 ) scf = generate_pwscf(
#! /usr/bin/env python from nexus import settings from nexus import Structure, PhysicalSystem from nexus import generate_pwscf, Job from nexus import run_project # set global parameters of nexus settings( pseudo_dir='../pseudopotentials', # directory with pseudopotentials #generate_only = False, # Complicated setting only so examples can be run in test harness. # For real runs, use the plain setting of 'generate_only' above. generate_only=globals().get('override_generate_only_setting', False), status_only=0, # only show run status, T/F machine='ws16' # local machine is 16 core workstation ) # describe the physical system T_structure = Structure() # empty structure T_structure.read_xyz('./Ge_T_16.xyz') # read in Ge T interstitial structure T_structure.reset_axes([ # specify cell axes (in Angstrom) [5.66, 5.66, 0.], [0., 5.66, 5.66], [5.66, 0., 5.66] ]) T_system = PhysicalSystem( # make the physical system structure=T_structure, # out of the T interstitial structure Ge=4 # pseudo-Ge has 4 valence electrons )