Exemple #1
0
def make_input():
    """
    """
    pseudos = abidata.pseudos("8o_hard.paw", "7n.paw", "1h.paw")

    # Crystal structure and definition of the path
    xangst = np.fromstring("""
        0.0000000000E+00  0.0000000000E+00  0.0000000000E+00
       -3.7593832509E-01 -2.8581911534E-01  8.7109635973E-01
       -3.8439081179E-01  8.6764073738E-01 -2.8530130333E-01
        4.0000000000E+00  0.0000000000E+00  0.0000000000E+00
        4.3461703447E+00 -9.9808458269E-02 -9.5466143436E-01
        4.3190273240E+00 -7.8675247603E-01  5.6699786920E-01
        4.3411410402E+00  8.7383785043E-01  4.0224838603E-01
        1.0280313162E+00  2.2598784215E-02  1.5561763093E-02""",
                           sep=" ").reshape((-1, 3))

    xangst_lastimg = np.fromstring("""
        0.0000000000E+00  0.0000000000E+00  0.0000000000E+00
       -3.0400286349E-01 -1.9039526061E-01  9.0873550186E-01
       -3.2251946581E-01  9.0284480687E-01 -1.8824324581E-01
        4.0000000000E+00  0.0000000000E+00  0.0000000000E+00
        4.4876385468E+00 -1.4925704575E-01 -8.9716581956E-01
        4.2142401901E+00 -7.8694929117E-01  6.3097154506E-01
        4.3498225718E+00  8.7106686509E-01  4.2709343135E-01
        2.9570301511E+00  5.5992672027E-02 -1.3560839453E-01""",
                                   sep=" ").reshape((-1, 3))

    structure = abilab.Structure.from_abivars(
        acell=abilab.ArrayWithUnit([10, 5, 5], "ang").to("bohr"),
        rprim=np.eye(3),
        typat=[1, 3, 3, 2, 3, 3, 3, 3],  # Type of atoms (H2O + NH3 + H)
        znucl=[8.0, 7.0, 1.0],
        xangst=xangst,
    )

    inp = abilab.AbinitInput(structure, pseudos)

    inp.set_vars(
        # Options for parallelism
        paral_kgb=1,

        # Input/output options
        prtwf=0,
        prtden=0,
        prteig=0,
        prtdensph=0,
        timopt=-1,

        # Convergence parameters
        ecut=20.,
        pawecutdg=40.,

        # Control of the relaxation    # TO BE SUPPRESSED WHEN USING IMGMOV keyword
        #ionmov 3                      # BFGS (Broyden) algorithm for ions relaxation
        #optcell 0                     # No cell optimization
        #ntime 20                      # Max. number of "time" steps
        #tolmxf 5.0d-5                 # Stopping criterion of relaxation cycle

        # Control of the SCF cycle
        toldff=5.0e-7,
        nstep=50,

        # Electronic configuration
        nband=10,
        occopt=1,
        ixc="-001009",  # Select LDA XC functional (LDA PZ from LibXC)

        # BZ sampling
        kptopt=0,  # Scheme for k-points generation
        nkpt=1,
        kpt=3 * [0.],  # Explicit k-point (gamma point)
        nsym=1,  # No symmetry
        natfix=2,
        iatfix=[1, 4],  # Keep O and N atoms fixed
        charge=1.0,  # Charge of the simulation cell

        # IMAGE section.
        nimage=12,  # Number of points along the string
        imgmov=2,  # Selection of "String Method" algo
        ntimimage=50,  # Max. number of relaxation steps of the string
        tolimg=
        0.0001,  # Tol. criterion (will stop when average energy of cells < tolimg)
        dynimage="0 10*1 0",  # Keep first and last images fixed
        fxcartfactor=1.0,  # Time step for evolution step of string method.
        prtvolimg=2,  # Printing volume (0=full, 1=intermediate, 2=minimal)
        xangst_lastimg=xangst_lastimg,
    )

    return inp
Exemple #2
0
def make_inputs(paw=False):
    pseudos = abidata.pseudos("56ba.psp_mod", "22ti.psp_mod", "8o.psp_mod")
    #pseudos = abidata.pseudos("56ba.psp_mod", "22ti.psp_mod", "8o.pspnc")
    if paw: raise NotImplementedError("PAW")

    # SLAB ending TiO2 double layer. paralelectric configuration
    # N=9
    # Supercell and atoms

    xcart = np.fromstring("""
0.0000000000E+00  0.0000000000E+00 -4.2633349730E+00
3.7794522658E+00  3.7794522658E+00 -3.2803418097E+00
0.0000000000E+00  3.7794522658E+00 -3.6627278067E+00
3.7794522658E+00  0.0000000000E+00  6.5250113947E-01
0.0000000000E+00  3.7794522658E+00 -1.0555036964E-01
3.7794522658E+00  3.7794522658E+00  3.2682166278E-01
0.0000000000E+00  0.0000000000E+00  3.9815918094E+00
3.7794522658E+00  3.7794522658E+00  4.0167907030E+00
3.7794522658E+00  0.0000000000E+00  7.7541444349E+00
0.0000000000E+00  3.7794522658E+00  7.6664087705E+00
3.7794522658E+00  3.7794522658E+00  7.7182324796E+00
0.0000000000E+00  0.0000000000E+00  1.1412913350E+01
3.7794522658E+00  3.7794522658E+00  1.1416615533E+01
3.7794522658E+00  0.0000000000E+00  1.5117809063E+01
0.0000000000E+00  3.7794522658E+00  1.5117809063E+01
3.7794522658E+00  3.7794522658E+00  1.5117809063E+01
0.0000000000E+00  0.0000000000E+00  1.8822704777E+01
3.7794522658E+00  3.7794522658E+00  1.8819002593E+01
3.7794522658E+00  0.0000000000E+00  2.2481473692E+01
0.0000000000E+00  3.7794522658E+00  2.2569209355E+01
3.7794522658E+00  3.7794522658E+00  2.2517385647E+01
0.0000000000E+00  0.0000000000E+00  2.6254026317E+01
3.7794522658E+00  3.7794522658E+00  2.6218827423E+01
3.7794522658E+00  0.0000000000E+00  2.9583116986E+01
0.0000000000E+00  3.7794522658E+00  3.0341168496E+01
3.7794522658E+00  3.7794522658E+00  2.9908796464E+01
0.0000000000E+00  0.0000000000E+00  3.4498953099E+01
3.7794522658E+00  3.7794522658E+00  3.3515959935E+01
0.0000000000E+00  3.7794522658E+00  3.3898345933E+01
""",
                          sep=" ").reshape((-1, 3))

    # Crystal structure.
    structure = abilab.Structure.from_abivars(
        #acell="4.0 4.0 28.0 Angstrom",
        acell=abilab.ArrayWithUnit([4.0, 4.0, 28], "ang").to("bohr"),
        rprim=np.eye(3),
        typat=[
            int(i) for i in
            "3 3 2 3 3 2 1 3 3 3 2 1 3 3 3 2 1 3 3 3 2 1 3 3 3 2 3 3 2".split(
            )
        ],
        znucl=[56, 22, 8],
        xcart=xcart,
    )

    multi = abilab.MultiDataset(structure, pseudos, ndtset=2)

    # Global variables used both for the GS and the DFPT run.
    multi.set_vars(
        #electronic structure
        nband=120,
        ecut=15.0,
        pawecutdg=30.0 if paw else None,
        nstep=80,
        ngkpt=[4, 4, 1],
        shiftk=[0, 0, 0],
        paral_kgb=1,
        timopt=-1,
        prtden=0,
    )

    gs_inp, ph_inp = multi.split_datasets()

    gs_inp.set_vars(tolvrs=1e-6, kptopt=1)

    ph_inp.set_vars(
        kptopt=3,
        rfphon=1,
        irdwfk=1,
        rfatpol=[1, 1],
        rfdir=[0, 0, 1],
        nqpt=1,
        qpt=[0.0, 0.25, 0.0],
        prtwf=0,
        #tolwfr=1.0e-22,
        toldfe=1.0e-9,
        tolrde=
        0.0,  # This is a development input variable, used in the present case to avoid load unbalance
        # when studying the scaling with respect to the number of cores. Do not define it in
        # your production runs
    )

    return gs_inp, ph_inp