Exemplo n.º 1
0
# One can create a dictionary mapping keywords to values 
unit_cell = {
    "acell": 3*[10.217],       
    'rprim': [ [.0, .5, .5],
               [.5, .0, .5],
               [.5, .5, .0]],
    'ntypat': 1,
    'znucl': [14,],
    'natom': 2,
    'typat': [1, 1],
    'xred': [ [.0, .0, .0],
              [.25,.25,.25] ]
}

# and set the variables in the input file with the call:
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