Exemplo n.º 1
0
inp.set_variables(**unit_cell)

# Alternatively, it's possible to create a dictionary on the fly with the syntax.
inp.set_variables(kptopt=1, 
                  ngkpt=[2, 2, 2], 
                  nshiftk=1, 
                  shiftk=[0.0, 0.0, 0.0]
                  )

# To print the input to stdout use:
print(inp)

# To write the input to a file, use:
# inp.write("run.abi")

# A slightly more complicated example: input file with two datasets
inp = AbiInput(pseudos="14si.pspnc", pseudo_dir=data.pseudo_dir, ndtset=2)

# Global variable common to all datasets.
inp.tolwfr = 1e-8

# To specify values for the different datasets, one can use the syntax
inp.ecut1 = 10
inp.ecut2 = 20

# or by passing the index of the dataset to set_variables via the dtset argument.
inp.set_variables(ngkpt=[2,2,2], tsmear=0.004, dtset=1)
inp.set_variables(kptopt=[4,4,4], tsmear=0.008, dtset=2)

print(inp)