def get_input(structure): pseudos = get_psp(structure) inp = AbiInput(pseudos) inp.set_variables(**structure.to_abivars()) inp.set_variables(**ksampling) inp.set_variables(**electrons) inp.set_variables(**spin(structure)) return inp
def get_input(structure): pseudos = list(set([get_psp(atom.specie.symbol) for atom in structure])) inp = AbiInput(pseudos) inp.set_variables(**structure.to_abivars()) inp.set_variables(**ksampling) inp.set_variables(**electrons) inp.set_variables( spinat = [[0., 0., 0.,], [0., 0., +5.], [0., 0., -3.]], istwfk = '*1', # do not use time reversal symmetry nstep = 2000, tolvrs = 1.e-2, ) return inp
def make_input(): inp = AbiInput( pseudos = [ os.path.join(pseudo_dir, "Be.GGA_PBE-JTH.xml"), os.path.join(pseudo_dir, "Mn.GGA_PBE-JTH.xml"), os.path.join(pseudo_dir, "N.GGA_PBE-JTH.xml")], ndtset = 1) equation = ['Be', 'Mn', 'N'] structure = HalfHeusler(equation, 'gamma', a = 12.283218926) inp.set_structure(structure) inp.set_kmesh( shiftk = [ [.5,.5,.5], [.5,.0,.0], [.0,.5,.0], [.0,.0,.5], ], ngkpt = [12,12,12], ) inp.set_vars( ecut = 40, pawecutdg = 60, occopt = 3, nsppol = 2, tsmear = "0.04 eV", nband = 24, ) spins = [] for element in structure: if element.specie.symbol == 'Mn': spins.append([0.,0.,3.]) else: spins.append([0.,0.,0.]) inp.set_vars(spinat = spins) return inp
#!/usr/bin/env python from __future__ import division, print_function, unicode_literals import abipy.data as abidata from abipy.htc.input import AbiInput tsmear_list = [0.005, 0.01] ngkpt_list = [[4,4,4], [8,8,8]] occopt_list = [3, 4] inp = AbiInput(pseudos=abidata.pseudos("14si.pspnc"), ndtset=len(tsmear_list)) inp.linspace("tsmear", start=tsmear_list[0], stop=tsmear_list[-1]) print(inp) inp = AbiInput(pseudos=abidata.pseudos("14si.pspnc"), ndtset=len(tsmear_list) * len(ngkpt_list)) inp.product("tsmear", "ngkpt", tsmear_list, ngkpt_list) print(inp) # If you don't want to use multiple datasets in your calculation, # you can split the initial input into ndtset different inputs. separated_inps = inp.split_datasets() for inp in separated_inps: print(inp) # product accepts an arbitrary number of variables. inp = AbiInput(pseudos=abidata.pseudos("14si.pspnc"), ndtset=len(tsmear_list) * len(ngkpt_list) * len(occopt_list)) inp.product("tsmear", "ngkpt", "occopt", tsmear_list, ngkpt_list, occopt_list)
#!/usr/bin/env python from __future__ import division import abipy.data as data from abipy.htc.input import AbiInput inp = AbiInput(pseudos=data.pseudos("14si.pspnc"), ndtset=2) structure = inp.set_structure_from_file(data.cif_file("si.cif")) inp.set_kmesh(ngkpt=[4,4,4], shiftk=[0,0,0], dtset=1) inp.set_kpath(ndivsm=5, dtset=2) #inp.set_kpath(ndivsm=5, kptbounds=[[0,0,0], [0.5, 0.0, 0.0]], dtset=2) # Global variables inp.ecut = 10 # Dataset 1 inp.tolvrs1 = 1e-9 # Dataset 2 inp.tolwfr2 = 1e-18 inp.getden2 = -1 print(inp)