Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ntypat=1,
typat=1,
znucl=1,
xcart=[0.0, 0.0, 0.0],
acell=acell,
rprim=[1, 0, 0, 0, 1, 0, 0, 0, 1],
)
global_vars = dict(
ecut=ecut,
nband=1,
diemac=2.0,
nstep=10,
)
h2_inp = abilab.AbinitInput(structure=h2, pseudos=abidata.pseudos("01h.pspgth"))
h2_inp.set_vars(global_vars)
h2_inp.set_kmesh(ngkpt=(1,1,1), shiftk=(0,0,0))
h2_inp.set_vars(
ionmov=3,
ntime=10,
tolmxf=5e-4,
toldff=5e-5,
)
h_inp = abilab.AbinitInput(structure=h, pseudos=abidata.pseudos("01h.pspgth"))
h_inp.set_vars(global_vars)
h_inp.set_vars(
nsppol=2,
nband=(1, 1),
def make_inputs(options):
structure = abilab.Structure.from_abivars(unit_cell)
if options.paw:
raise RuntimeError("PAW is not implemented")
else:
pseudos = abidata.pseudos("26fe.pspnc", "83-Bi.GGA.fhi", '8o.pspnc')
#pseudos = ["fe.pot", "bi.pot", 'o.pot']
gs_inp = abilab.MultiDataset(structure, pseudos=pseudos, ndtset=2)
gs_inp.set_vars(global_vars)
gs_inp.set_vars(timopt=-1, kptopt=3, mem_test=0)
gs_inp[0].set_vars(tolvrs=1.0e-18)
gs_inp[1].set_vars(
iscf=-2,
tolwfr=1.0e-22,
nband=100,
nbdbuf=10,
)
"""
This function constructs the input file for the GS calculation:
"""
structure = dict(
angdeg=3*[60.0],
acell=3*[7.1992351952],
natom=2,
ntypat=2,
typat=[1, 2],
znucl=[31, 15],
xred=[
0.0000000000, 0.0000000000, 0.0000000000,
0.2500000000, 0.2500000000, 0.2500000000,
])
pseudos = abidata.pseudos("Ga.oncvpsp", "P.psp8")
gs_inp = abilab.AbinitInput(structure, pseudos=pseudos)
gs_inp.set_vars(
nband=8,
ecut=20.0, # Too low
ngkpt=ngkpt,
nshiftk=1,
shiftk=[0, 0, 0],
tolvrs=1.0e-8,
nstep=150,
)
return gs_inp
def make_scf_input(nspinor=1, usepaw=0):
"""Returns GS input file for Silicon"""
if nspinor == 1:
pseudos = abidata.pseudos("14si.pspnc") if usepaw == 0 else abidata.pseudos("Si.GGA_PBE-JTH-paw.xml")
else:
pseudos = abidata.pseudos("Si_r.psp8") if usepaw == 0 else abidata.pseudos("Si.GGA_PBE-JTH-paw.xml")
structure = dict(
ntypat=1,
natom=2,
typat=[1, 1],
znucl=14,
#acell=3 * [10.26310667319252], # https://docs.abinit.org/tests/v7/Input/t82.in
acell=3 * [10.2073557], # 5.4015 Ang
rprim=[[0.0, 0.5, 0.5],
[0.5, 0.0, 0.5],
[0.5, 0.5, 0.0]],
xred=[ [0.0 , 0.0 , 0.0],
[0.25, 0.25, 0.25]],
)
def build_flow(options):
"""
Create a `Flow` for Grüneisen calculations:
Three relaxations at fixed volume followed by phonon calculation on a q-mesh.
"""
# Working directory (default is the name of the script with '.py' removed and "run_" replaced by "flow_")
if not options.workdir:
options.workdir = os.path.basename(sys.argv[0]).replace(".py", "").replace("run_", "flow_")
flow = flowtk.Flow(workdir=options.workdir)
# This function constructs the input files for the phonon calculation:
# GS input + the input files for the phonon calculation.
pseudos = abidata.pseudos("14si.pspnc")
structure = abidata.structure_from_ucell("Si")
gs_inp = abilab.AbinitInput(structure, pseudos=pseudos)
# Global variables used both for the GS and the DFPT run.
gs_inp.set_vars(
nband=4,
ecut=2.0,
ngkpt=[4, 4, 4],
nshiftk=4,
shiftk=[0.0, 0.0, 0.5, # This gives the usual fcc Monkhorst-Pack grid
0.0, 0.5, 0.0,
0.5, 0.0, 0.0,
0.5, 0.5, 0.5],
diemac=12.0,
iomode=3,
def build_flow(options):
# Working directory (default is the name of the script with '.py' removed and "run_" replaced by "flow_")
if not options.workdir:
options.workdir = os.path.basename(sys.argv[0]).replace(".py", "").replace("run_", "flow_")
flow = flowtk.Flow(options.workdir, manager=options.manager)
# Create the work for the band structure calculation.
structure = abidata.structure_from_ucell("NiO")
pseudos = abidata.pseudos("28ni.paw", "8o.2.paw")
# The code below set up the parameters for the LDA+U calculation in NiO.
#usepawu 1
#lpawu 2 -1
#upawu 8.0 0.0 eV
#jpawu 0.8 0.0 eV
usepawu = 1
u_values = [5.0, 8.0]
for u in u_values:
# Apply U-J on Ni only.
luj_params = LdauParams(usepawu, structure)
luj_params.luj_for_symbol("Ni", l=2, u=u, j=0.1*u, unit="eV")
scf_input, nscf_input, dos_input = make_scf_nscf_dos_inputs(structure, pseudos, luj_params)
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)
# Dataset 1 (GS run)
structure = abilab.Structure.from_abivars(
acell=[7.5389648144E+00, 7.5389648144E+00, 1.2277795374E+01],
natom=4,
ntypat=2,
rprim=[ np.sqrt(0.75), 0.5, 0.0 ,
-np.sqrt(0.75), 0.5, 0.0,
0.0, 0.0, 1.0],
typat=[1, 1, 2, 2],
xred=[1/3, 2/3, 0,
2/3, 1/3, 1/2,
1/3, 2/3, 3.7608588373E-01,
2/3, 1/3, 8.7608588373E-01],
znucl=[13, 33],
)
pseudos = abidata.pseudos("13al.pspnc", "33as.pspnc")
gs_inp = abilab.AbinitInput(structure, pseudos=pseudos)
# Set other important variables (consistent with tutorial)
# Aall the other DFPT runs will inherit these parameters.
gs_inp.set_vars(
nband=8,
ecut=6.0,
ecutsm=0.5, # Important when performing structural optimization
# with variable cell. All DFPT calculations should use
# the same value to be consistent.
ngkpt=[4, 4, 4],
nshiftk=1,
shiftk=[0.0, 0.0, 0.5], # This choice preserves the hexagonal symmetry of the grid.
diemac=9.0,
nstep=40,
paral_kgb=paral_kgb,