Пример #1
0
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 *

settings(pseudo_dir='../../pseudopotentials',
         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)

#Standardized Primitive cell -- run rest of the calculations on this cell
dia2_structure = get_primitive_cell(structure=dia.structure)['structure']
dia2_kpath = get_kpath(structure=dia2_structure)
#get_band_tiling and get_kpath require "SeeK-path" python3 libraries

dia2 = generate_physical_system(
    structure=dia2_structure,
    kgrid=(4, 4, 4),
    kshift=(0, 0, 0),
    C=4,
)
Пример #2
0
    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       = '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
                 [2./3,1./3, 0]],
    tiling    = (2,2,1),          # tiling of primitive cell
    kgrid     = (1,1,1),          # Monkhorst-Pack grid
    kshift    = (.5,.5,.5),       # and shift
    C         = 4                 # C has 4 valence electrons
    ) 

# scf run produces charge density
scf = generate_pwscf(
    # nexus inputs
    identifier   = 'scf',           # identifier/file prefix
    path         = 'graphene/scf',  # directory for scf run
    job          = job(cores=16),   # run on 16 cores
    pseudos      = ['C.BFD.upf'],   # pwscf PP file
    system       = graphene,        # run graphene
Пример #3
0
from nexus import generate_pyscf
from nexus import generate_pyscf_to_afqmc
from nexus import generate_qmcpack
from qmcpack_input import back_propagation, onerdm

settings(
    results='',
    sleep=3,
    machine='ws16',
)

system = generate_physical_system(
    units='A',
    elem_pos='''
               C  0.00000000  0.00000000  0.00000000
               H  0.00000000  0.00000000  1.10850000
               H  1.04510382  0.00000000 -0.36950000
               H -0.52255191  0.90508646 -0.36950000
               H -0.52255191 -0.90508646 -0.36950000
               ''',
)

scf = generate_pyscf(
    identifier='scf',
    path='rhf',
    job=job(serial=True),
    template='./scf_template.py',
    system=system,
    mole=obj(basis='sto-3g', ),
    checkpoint=True,
)
Пример #4
0
    scf_job  = job(nodes=1,minutes=30,presub=pwscf_modules,app='pw.x')
    conv_job = job(cores=1,minutes=30,presub=pwscf_modules,app='pw2qmcpack.x')
    qmc_job  = job(nodes=1,threads=4,minutes=30,presub=qmcpack_modules,app='qmcpack')
else:
    print 'no jobs for machine!'
    exit()
#end if


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(
    identifier   = 'scf',
    path         = 'diamond/scf',
    job          = scf_job,
    input_type   = 'generic',
    calculation  = 'scf',
    input_dft    = 'lda', 
    ecutwfc      = 200,   
Пример #5
0
# specify k-point grids
kgrids = [(2, 2, 2), (3, 3, 3)]

sims = []
first = True
for kgrid in kgrids:
    ks = '{0}{1}{2}'.format(*kgrid)

    # create conventional cell tiled from primitive one
    bcc_Be = generate_physical_system(lattice='cubic',
                                      cell='primitive',
                                      centering='I',
                                      atoms='Be',
                                      constants=3.490,
                                      units='A',
                                      net_charge=0,
                                      net_spin=0,
                                      Be=2,
                                      tiling=[[a, b, c], [d, e, f], [g, h, i]],
                                      kgrid=kgrid,
                                      kshift=(.5, .5, .5))

    # scf run to generate converged charge density
    if first:
        scf = generate_pwscf(identifier='scf',
                             path=directory + '/scf',
                             job=dft_job,
                             input_type='scf',
                             system=bcc_Be,
                             spin_polarized=False,
                             pseudos=dft_pps,
Пример #6
0
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(
    identifier   = 'scf',
    path         = 'diamond/scf',
    job          = Job(cores=16,app='pw.x'),
    input_type   = 'generic',
    calculation  = 'scf',
    input_dft    = 'lda', 
    ecutwfc      = 200,   
Пример #7
0
scf_job = job(app=pwscf, serial=True)
p2q_job = job(app=pw2qmcpack, serial=True)
opt_job = job(threads=4, app=qmcpack, serial=True)
dmc_job = job(threads=4, app=qmcpack, serial=True)

# System To Be Simulated
structure = read_structure('H2O.xyz')
structure.bounding_box(box='cubic', scale=1.5)
structure.add_kmesh(
    kgrid=(1, 1, 1),
    kshift=(0, 0, 0),
)
H2O_molecule = generate_physical_system(
    structure=structure,
    net_charge=0,
    net_spin=0,
    O=6,
    H=1,
)

# DFT SCF To Generate Converged Density
scf = generate_pwscf(
    identifier='scf',
    path='.',
    job=scf_job,
    input_type='scf',
    system=H2O_molecule,
    pseudos=dft_pps,
    ecut=50,
    ecutrho=400,
    conv_thr=1.0e-5,
Пример #8
0
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 graphene physical system
graphene = generate_physical_system(
    structure = 'graphite_aa',  # graphite keyword
    cell      = 'hex',          # hexagonal cell shape
    tiling    = (2,2,1),        # tiling of primitive cell
    constants = (2.462,10.0),   # a,c constants
    units     = 'A',            # in Angstrom
    kgrid     = (1,1,1),        # Monkhorst-Pack grid
    kshift    = (.5,.5,.5),     # and shift
    C         = 4               # C has 4 valence electrons
    ) 


#generate the simulations for the qmc workflow
qsims = standard_qmc(
    # subdirectory of runs 
    directory       = 'graphene_test',
    # description of the physical system
    system          = graphene,
    pseudos         = ['C.BFD.upf',  # pwscf PP file
                       'C.BFD.xml'], # qmcpack PP file
    # job parameters
Пример #9
0
from nexus import run_project

# set global parameters of nexus
settings(
    pseudo_dir='../pseudopotentials',  # directory with pseudopotentials
    generate_only=0,  # only write 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_system = generate_physical_system(  # make the physical system
    structure='./Ge_T_16.xyz',  # out of the T interstitial structure
    axes=[
        [5.66, 5.66, 0.],  # specify cell axes (in Angstrom)
        [0., 5.66, 5.66],
        [5.66, 0., 5.66]
    ],
    Ge=4,  # pseudo-Ge has 4 valence electrons
)

# specify MP k-point grids for successive relaxations
supercell_kgrids = [
    (1, 1, 1),  #   1 k-point
    (2, 2, 2),  #   8 k-points
    (4, 4, 4),  #  64 k-points
    (6, 6, 6)
]  # 216 k-points

# describe the relaxation calculations
# and link them together into a simulation cascade
Пример #10
0
#! /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_pyscf_to_afqmc
from nexus import generate_qmcpack

settings(
    results = '',
    sleep   = 3,
    machine = 'ws16',
    )

system = generate_physical_system(
    units    = 'A',
    elem_pos = 'Ne 0 0 0',
    )

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,
    )
Пример #11
0
    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',
    Be         = 2,                    # Zeff=7 for ccECP
    H          = 1,
    net_spin   = 0,   # 2S
    net_charge = 0,
    )

sims = []
# perform Hartree-Fock
scf = generate_pyscf(
    identifier = 'scf',               # log output goes to scf.out
    path       = 'scf',            # directory to run in
    job          = job(serial=True, nodes=4, queue='debug', hours=0.5, constraint='knl', presub=scf_presub),
    #job        = job(serial=True, nodes=1, threads=4, presub=scf_presub),
    template   = 'scf_guess/scf_template.py', # pyscf template file
    system     = system,
    mole       = obj(                 # used to make Mole() inputs
        verbose  = 4,
Пример #12
0
    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), 
    kshift    = (0,0,0), # Assumes we study transitions from Gamma. For non-gamma tilings, use kshift appropriately
    C         = 4,
    )

dia = generate_physical_system(
    **dia_inputs
    )

dia_plus = generate_physical_system(
    net_charge = 1,
    net_spin   = 1,
    **dia_inputs
    )

dia_minus = generate_physical_system(
    net_charge = -1,
    net_spin   = -1,
    **dia_inputs
    )

scf = generate_pwscf(
Пример #13
0
        timestep      = 0.01,
        nonlocalmoves = True
        )
    ]

# create opt & DMC sim's for each bond length
sims = []
scale = 1.00
directory = 'scale_'+str(scale)

# make stretched/compressed dimer
dimer = generate_physical_system(
    type       = 'dimer',      # dimer selected
    dimer      = ('O','O'),    # atoms in dimer
    separation = 1.2074*scale, # dimer bond length
    Lbox       = 15.0,         # box size
    units      = 'A',          # Angstrom units
    net_spin   = 2,            # Nup-Ndown = 2
    O          = 6             # O has 6 val. electrons
    )

# describe scf run
scf = generate_pwscf(
    identifier   = 'scf',
    path         = directory,
    system       = dimer,
    job          = Job(cores=16),
    input_type   = 'scf',
    pseudos      = ['O.BFD.upf'],
    input_dft    = 'lda',
    ecut         = 200,
Пример #14
0
#    pos        :  corresponding atomic positions in cartesian coordinates
#    kgrid      :  Monkhorst-Pack grid
#    kshift     :  Monkhorst-Pack shift (between 0 and 0.5)
#    net_charge :  system charge in units of e
#    net_spin   :  # of up spins - # of down spins
#    C = 4      :  (pseudo) carbon has 4 valence electrons
my_system = generate_physical_system(
    units='A',
    axes=[[3.57000000e+00, 0.00000000e+00, 0.00000000e+00],
          [0.00000000e+00, 3.57000000e+00, 0.00000000e+00],
          [0.00000000e+00, 0.00000000e+00, 3.57000000e+00]],
    elem=['C', 'C', 'C', 'C', 'C', 'C', 'C', 'C'],
    pos=[[0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
         [8.92500000e-01, 8.92500000e-01, 8.92500000e-01],
         [0.00000000e+00, 1.78500000e+00, 1.78500000e+00],
         [8.92500000e-01, 2.67750000e+00, 2.67750000e+00],
         [1.78500000e+00, 0.00000000e+00, 1.78500000e+00],
         [2.67750000e+00, 8.92500000e-01, 2.67750000e+00],
         [1.78500000e+00, 1.78500000e+00, 0.00000000e+00],
         [2.67750000e+00, 2.67750000e+00, 8.92500000e-01]],
    kgrid=(1, 1, 1),
    kshift=(0, 0, 0),
    net_charge=0,
    net_spin=0,
    C=4  # one line like this for each atomic species
)

my_bconds = 'ppp'  #  ppp/nnn for periodic/open BC's in QMC
#  if nnn, center atoms about (a1+a2+a3)/2

sims = []
Пример #15
0
from nexus import generate_pyscf_to_afqmc
from nexus import generate_qmcpack

settings(
    results='',
    sleep=3,
    machine='ws16',
)

a = 3.6

system = generate_physical_system(
    units='A',
    axes=[[0, a / 2, a / 2], [a / 2, 0, a / 2], [a / 2, a / 2, 0]],
    elem=('C', 'C'),
    pos=[[0, 0, 0], [a / 4, a / 4, a / 4]],
    tiling=(2, 2, 2),
    kgrid=(1, 1, 1),
    kshift=(0, 0, 0),
)

scf = generate_pyscf(
    identifier='scf',
    path='rhf',
    job=job(serial=True),
    template='./scf_template.py',
    system=system,
    cell=obj(
        basis='gth-szv',
        pseudo='gth-pade',
        mesh=[25, 25, 25],
Пример #16
0
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 /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)

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
)

run_project()
Пример #17
0
# run geometry optimization, scf, and polarization
# for all BFO cells
for strain in strains:
    for shear in shears:
        path = 'st_{0:4.3f}_sh_{1:4.3f}/'.format(strain, shear)

        # strain and shearing cell parameters
        a = 7.80 * (1. - strain)
        c = shear * a
        k = 0.0348994967 * c

        # physical system for strained cell
        system = generate_physical_system(
            axes=[[a, 0, 0], [0, a, 0], [k, 0, c]],
            elem=24 * ['O'] + 8 * ['Fe'] + 8 * ['Bi'],
            posu=loadtxt('BFO_upos.dat'),
            units='A',
            kgrid=(2, 2, 2),
            kshift=(0, 0, 0))

        # geometry relaxation run
        geo = generate_vasp(
            # standard inputs
            identifier='geo',
            path=path,
            job=vjob,
            system=system,
            # vasp inputs
            ibrion=2,
            isif=2,
            ediffg=1e-6,
Пример #18
0
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
Пример #19
0
#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 graphene physical system
graphene = generate_physical_system(
    structure='graphite_aa',  # graphite keyword
    cell='hex',  # hexagonal cell shape
    tiling=(2, 2, 1),  # tiling of primitive cell
    constants=(2.462, 10.0),  # a,c constants
    units='A',  # in Angstrom
    kgrid=(1, 1, 1),  # Monkhorst-Pack grid
    kshift=(.5, .5, .5),  # and shift
    C=4  # C has 4 valence electrons
)

#generate the simulations for the qmc workflow
qsims = standard_qmc(
    # subdirectory of runs
    directory='graphene_test',
    # description of the physical system
    system=graphene,
    pseudos=[
        'C.BFD.upf',  # pwscf PP file
        'C.BFD.xml'
    ],  # qmcpack PP file
Пример #20
0
    vesta = get_machine('vesta')  # allow one job at a time (lab only)
    vesta.queue_size = 2
#end if

# create DFT, OPT, & DMC sim's for each bond length
sims = []
scales = [1.00, 0.90, 0.925, 0.95, 0.975, 1.025, 1.05, 1.075, 1.10]
for scale in scales:
    directory = 'scale_' + str(scale)

    # make stretched/compressed dimer
    dimer = generate_physical_system(
        type='dimer',
        dimer=('O', 'O'),
        separation=1.2074 * scale,
        Lbox=10.0,  # use 15.0 or so for production
        units='A',
        net_spin=2,
        O=6,
    )

    # describe DFT run
    dft = generate_pwscf(
        identifier='dft',
        path=directory,
        job=dftjob,
        system=dimer,
        input_type='scf',
        pseudos=['O.BFD.upf'],
        input_dft='lda',
        ecut=300,
Пример #21
0
# job details
dft_job = job(nodes=1, minutes=20, queue="qmcpack", app=pwscf)
p2q_job = job(cores=1, minutes=20, queue="qmcpack", app=pw2qmcpack)
qmc_job = job(nodes=32, minutes=20, threads=16, queue="qmcpack", app=qmcpack)

# create 2 atom sheet of graphene
graphene = generate_physical_system(
    axes=[[9.30501148, 0.00000000, 0.0000000],
          [-4.6525058, 8.05837632, 0.0000000],
          [0.00000000, 0.00000000, 15.0000000]],
    elem=['C', 'C', 'C', 'C', 'C', 'C', 'C', 'C'],
    pos=[[0.00000000, 0.00000000, 7.50000000],
         [2.32625287, 1.34306272, 7.50000000],
         [4.65250574, 0.00000000, 7.50000000],
         [6.97875861, 1.34306272, 7.50000000],
         [-2.32625290, 4.02918816, 7.50000000],
         [-0.00000003, 5.37225088, 7.50000000],
         [2.32625284, 4.02918816, 7.50000000],
         [4.65250571, 5.37225088, 7.50000000]],
    units='B',
    kgrid=(1, 1, 1),
    kshift=(0, 0, 0),
    net_charge=0,
    net_spin=0,
    C=4)

sims = []

# scf run to generate converged charge density
scf = generate_pwscf(identifier='scf',
                     path=directory + '/scf',
    results       = '',
    status_only   = 0,
    generate_only = 0,
    sleep         = 3,
    machine       = 'ws16',
    qprc          = '/home/ubuntu/apps/qp2/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
qp_shared = dict(
    path   = 'O_dimer/selci',
    job    = qp_job,
    system = dimer,
    prefix = 'fci', # single shared ezfio
    )

# run Hartree-Fock
scf = generate_quantum_package(
    identifier            = 'scf',
    run_type              = 'scf',
    ao_basis              = 'aug-cc-pvdz',
from nexus import generate_physical_system
from nexus import generate_pwscf_input

# generate using keywords + system

# read structure from file
s = read_structure('VO2_M1_afm.xsf')
s.elem[0] = 'V1'  # set AFM pattern
s.elem[1] = 'V2'
s.elem[2] = 'V1'
s.elem[3] = 'V2'

# create physical system from structure
vo2 = generate_physical_system(
    structure=s,
    V1=13,
    V2=13,
    O=6,
)

# generate pwscf input
pw = generate_pwscf_input(
    selector='generic',
    calculation='scf',
    disk_io='low',
    verbosity='high',
    wf_collect=True,
    input_dft='lda',
    hubbard_u=obj(V1=3.5, V2=3.5),
    ecutwfc=350,
    bandfac=1.3,
    nosym=True,
Пример #24
0
jobs = get_taito_configs()

cubic_box_size=[10.0]
x=1.0*cubic_box_size[0]
d=1.2074 # nuclei separation in Angstrom
scfs=[]
ind=0

O2 = generate_physical_system(
    units  = 'A',
    axes   = [[ x,   0.0 ,  0.0   ],
             [ 0.,   x  ,  0.0   ],
             [ 0.,   0. ,   x    ]],
    elem   = ['O','O'],
    pos    = [[ x/2-d/2    ,  x/2    ,  x/2    ],
              [ x/2+d/2    ,  x/2    ,  x/2    ]],
    net_spin  = 0,
    tiling    = (1,1,1),
    kgrid     = (1,1,1), # scf kgrid given below to enable symmetries
    kshift    = (0,0,0),
    O         = 6,
)

scf = generate_pwscf(
    identifier   = 'scf',
    path         = 'scf'+str(ind),
    job          = jobs['scf'],
    input_type   = 'generic',
    calculation  = 'scf',
    input_dft    = 'lda', 
    for kgtid in [(1,1,1), (2,2,2), (3,3,3)]:
Пример #25
0
        timestep      = 0.01,
        nonlocalmoves = True
        )
    ]

# create opt & DMC sim's for each bond length
sims = []
scale = 1.00
directory = 'scale_'+str(scale)

# make stretched/compressed dimer
dimer = generate_physical_system(
    type       = 'dimer',      # dimer selected
    dimer      = ('O','O'),    # atoms in dimer
    separation = 1.2074*scale, # dimer bond length
    Lbox       = 15.0,         # box size
    units      = 'A',          # Angstrom units
    net_spin   = 2,            # Nup-Ndown = 2
    O          = 6             # O has 6 val. electrons
    )

# describe scf run
scf = generate_pwscf(
    identifier   = 'scf',
    path         = directory,
    system       = dimer,
    job          = Job(cores=16),
    input_type   = 'scf',
    pseudos      = ['O.BFD.upf'],
    input_dft    = 'lda',
    ecut         = 200,
Пример #26
0
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,
)

scf = generate_pwscf(
    identifier='scf',
    path='diamond/scf',
    job=job(cores=16, app='pw.x'),
    input_type='generic',
    calculation='scf',
    input_dft='lda',
    ecutwfc=200,
Пример #27
0
'''

rhf_runs = []
x = np.linspace(-1.5,1.5,32)
z = np.linspace(-1.0,2.0,32)
for i in range(len(x)):
  for j in range(len(z)):
    myid = "x%2.5f_z%2.5f" % (x[i],z[j])
    struct = Structure(elem=['H','C','N'],
            pos=[[x[i],0,z[j]],
                 [0,0,-CH],
                 [0,0,-(CH+CN)]]
            ,units='A')
    system = generate_physical_system(
      structure  = struct,
      net_charge = 0,
      net_spin   = 0
    )
    rhf_inputs = obj(
        identifier = myid + 'rhf',
        scftyp     = 'rhf', 
        gbasis     = basis,
        ispher     = 1,
        runtyp     = 'energy', 
        coord      = 'unique',
        system     = system,
        dirscf     = True, # use ram for speed
        job        = gms_job,
    )
    rhf = generate_gamess(
        path = myid+'/rhf',
Пример #28
0
for scaling in scalings:

    dia16_struct = generate_structure(
        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),
    )

    dia16_struct.rescale(scaling)

    dia16 = generate_physical_system(structure=dia16_struct, C=4)

    basepath = 'diamond/scale_{0:3.2f}'.format(scaling)

    scf = generate_pwscf(
        identifier='scf',
        path=basepath + '/scf',
        job=scf_job,
        input_type='generic',
        calculation='scf',
        input_dft='lda',
        ecutwfc=200,
        conv_thr=1e-8,
        nosym=True,
        wf_collect=True,
        system=dia16,
Пример #29
0
scf_job             = job(app=pwscf,serial=True)
nscf_job            = job(app=pwscf,serial=True)
p2q_job             = job(app=pw2qmcpack,serial=True)
opt_job             = job(threads=4,app=qmcpack,serial=True)
dmc_job             = job(threads=4,app=qmcpack,serial=True)

# System To Be Simulated
rocksalt_LiH = generate_physical_system(
    lattice         = 'cubic',
    cell            = 'primitive',
    centering       = 'F',
    atoms           = ('Li','H'),
    basis           = [[0.0,0.0,0.0],
                       [0.5,0.5,0.5]],
    basis_vectors   = 'conventional',
    constants       = 7.1,
    units           = 'B',
    kgrid           = (1,1,1),
    kshift          = (0,0,0),
    net_charge      = 0,
    net_spin        = 0,
    Li              = 1,
    H               = 1,
    )

# DFT SCF To Generate Converged Density
scf = generate_pwscf(
    identifier      = 'scf',
    path            = '.',
    job             = scf_job,
    input_type      = 'scf',
Пример #30
0
    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), 
    kshift    = (0,0,0), # Assumes we study transitions from Gamma. For non-gamma tilings, use kshift appropriately
    C         = 4
    )

scf = generate_pwscf(
    identifier   = 'scf',
    path         = 'scf',
    job          = job(cores=16,app='pw.x'),
    input_type   = 'generic',
    calculation  = 'scf',
    nspin        = 2,
    input_dft    = 'lda', 
Пример #31
0
# read in the xyz file
structure = read_structure('c20.cage.xyz')
# 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
    kshift=(0, 0, 0)  # and shift
)
# add electronic information
c20 = generate_physical_system(
    structure=structure,  # C20 structure
    net_charge=0,  # net charge in units of e
    net_spin=0,  # net spin in units of e-spin
    C=4,  # C has 4 valence electrons
)

# scf run produces charge density
scf = generate_pwscf(
    # nexus inputs
    identifier='scf',  # identifier/file prefix
    path='c20/scf',  # directory for scf run
    job=job(cores=16),  # run on 16 cores
    pseudos=['C.BFD.upf'],  # pwscf PP file
    system=c20,  # run c20
    # input format selector
    input_type='scf',  # scf, nscf, relax, or generic
    # pwscf input parameters
    input_dft='lda',  # dft functional
Пример #32
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]],
    )

rhf = generate_gamess(
    identifier = 'rhf',
    path       = 'pp_cisd',
    job        = gms_job,
    system     = h2o,
    pseudos    = ['O.BFD_V5Z.gms','H.BFD_V5Z_ANO.gms'],
    scftyp     = 'rohf',
Пример #33
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,
                              Ni=18,
                              O=6,
                              net_spin=1)
mag = [0.7]
tot_mag = 1

#######################################################################
########################## Change here only ##########################

shared_scf = obj(
    input_type='generic',
    occupations='smearing',
    smearing='gaussian',
    degauss=0.005,
    tot_magnetization=tot_mag,
    ####################
Пример #34
0
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 *

settings(pseudo_dir='../../pseudopotentials',
         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)

#Standardized Primitive cell -- run rest of the calculations on this cell
dia2_structure = get_primitive_cell(structure=dia.structure)['structure']
#get_band_tiling requires "SeeK-path" python3 libraries

dia2 = generate_physical_system(
    structure=dia2_structure,
    kgrid=(1, 1, 1),
    kshift=(
        0, 0, 0
    ),  # Assumes we study transitions from Gamma. For non-gamma tilings, use kshift appropriately
    tiling=[3, 1, 3],
    C=4,
Пример #35
0
    sleep         = 3,                    # check on runs every 'sleep' seconds
    generate_only = 0,                    # only make input files
    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
                 [2./3,1./3, 0]],
    tiling    = (2,2,1),          # tiling of primitive cell
    kgrid     = (1,1,1),          # Monkhorst-Pack grid
    kshift    = (.5,.5,.5),       # and shift
    C         = 4                 # C has 4 valence electrons
    ) 


# list of simulations in workflow
sims = []

# scf run produces charge density
scf = generate_pwscf(
    # nexus inputs
    identifier   = 'scf',           # identifier/file prefix