Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
#structure.perturb(distance=0.01)
# Compress the lattice so that ABINIT complains about dilatmx
structure.scale_lattice(structure.volume * scalevol)
global_vars = dict(
ecut=6,
ecutsm=0.5,
ngkpt=[4,4,4],
shiftk=[0,0,0],
nshiftk=1,
chksymbreak=0,
paral_kgb=tvars.paral_kgb,
)
multi = abilab.MultiDataset(structure, pseudos=abidata.pseudos("14si.pspnc"), ndtset=2)
# Global variables
multi.set_vars(global_vars)
# Dataset 1 (Atom Relaxation)
multi[0].set_vars(
optcell=0,
ionmov=2,
tolrff=0.02,
tolmxf=5.0e-5,
ntime=ntime,
)
# Dataset 2 (Atom + Cell Relaxation)
multi[1].set_vars(
optcell=1,
def make_scf_nscf_inputs(structure, paral_kgb=1):
multi = abilab.MultiDataset(structure, pseudos=data.pseudos("14si.pspnc"), ndtset=2)
# Global variables
global_vars = dict(
ecut=6,
nband=8,
timopt=-1,
paral_kgb=0,
#nstep=4, # This is not enough to converge. Used to test the automatic restart.
nstep=10,
iomode=3,
)
multi.set_vars(global_vars)
# Dataset 1 (GS run)
multi[0].set_kmesh(ngkpt=[8,8,8], shiftk=[0,0,0])
Build and return a `Flow` to perform a convergence study wrt to ecut.
Args:
structure_file: (optional) file containing the crystalline structure.
If None, crystalline silicon structure.
ecut_list: List of cutoff energies to be investigated.
"""
# Define the structure and add the necessary pseudos:
if structure_file is None:
multi = abilab.MultiDataset(structure=abidata.cif_file("si.cif"),
pseudos=abidata.pseudos("14si.pspnc"), ndtset=len(ecut_list))
workdir = "flow_Si_ecut_convergence"
else:
structure = abilab.Structure.from_file(structure_file)
pseudos = abilab.PseudoTable() ## todo fix this
multi = abilab.MultiDataset(structure, pseudos=pseudos, ndtset=len(ecut_list))
workdir = "flow_" + structure.composition.reduced_formula + "_ecut_convergence"
# Add mnemonics to the input files.
multi.set_mnemonics(True)
# Global variables
multi.set_vars(tolvrs=1e-9)
multi.set_kmesh(ngkpt=[4, 4, 4], shiftk=[0, 0, 0])
# Here we set the value of ecut used by the i-th task.
for i, ecut in enumerate(ecut_list):
multi[i].set_vars(ecut=ecut)
return flowtk.Flow.from_inputs(workdir=workdir, inputs=multi.split_datasets())
# Perturb the structure (random perturbation of 0.1 Angstrom)
# then compress the volume to trigger dilatmx.
#structure.perturb(distance=0.1)
#structure.scale_lattice(structure.volume * 0.6)
global_vars = dict(
ecut=28,
ngkpt=[4,4,4],
shiftk=[0,0,0],
nshiftk=1,
chksymbreak=0,
paral_kgb=paral_kgb,
#prtwf=0,
)
multi = abilab.MultiDataset(structure, pseudos=pseudos, ndtset=2)
# Global variables
multi.set_vars(global_vars)
# Dataset 1 (Atom Relaxation)
multi[0].set_vars(
optcell=0,
ionmov=2,
tolrff=0.02,
tolmxf=5.0e-5,
ntime=50,
#ntime=3, #To test the restart
#dilatmx=1.1, # FIXME: abinit crashes if I don't use this
)
# Dataset 2 (Atom + Cell Relaxation)
def make_scf_nscf_inputs(nsppol, paral_kgb=1):
"""
Generate two input files for the GS and the NSCF run for given `nsppol`.
"""
# Fe normal bcc structure for test of a ferromagnetic calculation
multi = abilab.MultiDataset(structure=data.structure_from_ucell("Fe-fm"),
pseudos=data.pseudos("26fe.pspnc"), ndtset=2)
# Global variables
global_vars = dict(
nsppol=nsppol,
ecut=18,
nband=8,
occopt=3,
tsmear=0.01,
paral_kgb=paral_kgb,
)
if nsppol == 2:
global_vars.update(spinat=[0.0, 0.0, 4.0])
multi.set_vars(global_vars)
def make_scf_nscf_dos_inputs(structure, pseudos, luj_params, paral_kgb=1):
# Input file taken from tldau_2.in
multi = abilab.MultiDataset(structure, pseudos=pseudos, ndtset=3)
# Global variables
global_vars = dict(
#
ecut=12,
pawecutdg=30,
nband=40,
occopt=7,
tsmear=0.015,
nstep=50,
paral_kgb=paral_kgb,
#
# Spin
nsppol=1,
nspden=2,
nspinor=1,
def make_inputs(paral_kgb=1):
"""
Returns a tuple of 4 input files for SCF, NSCF, SCR, SIGMA calculations.
These files are then used as templates for the convergence study
wrt ecuteps and the number of bands in W.
"""
multi = abilab.MultiDataset(abidata.structure_from_ucell("SiC"),
pseudos=abidata.pseudos("14si.pspnc", "6c.pspnc"), ndtset=4)
ecut = 12
global_vars = dict(
ecut=ecut,
istwfk="*1",
paral_kgb=paral_kgb,
gwpara=2,
iomode=1,
)
ecuteps = 4
ngkpt = [4, 4, 4]
shiftk = [0, 0, 0]
multi.set_vars(global_vars)