Examples

the following examples work with all calculators of the ADF modeling suite. Any python script using these libraries should be launched using the “$ADFBIN/startpython” binary.

Geometry Relaxation via ADF Drivers

# Required imports
    from ase.calculators.scm import ADF
    from ase.io              import read

    # Read molecular geometry from xyz file
    mol = read('some_mol.xyz')

    # Create calculator object with calculation details. Note the job argument
    calc = ADF(label = 'some_mol',
               job   = 'GeometryOptimization',
               basis = 'DZP',
               xc    = 'GGA:BP',
               core  = 'Small')

    # Assign calculator to system object
    mol.set_calculator(calc)

    # Due to the requested ``job`` the final energy of a geometry optimization results,
    # which is internally performed by ADF
    e = mol.get_potential_energy()

Geometry Relaxation with ASE

# Required imports
    from ase.calculators.scm import ADF
    from ase.optimize.bfgs   import BFGS
    from ase.io              import read

    # Read molecular geometry from xyz file
    mol = read('some_mol.xyz')

    # Create calculator object with calculation details. Note the job argument
    calc = ADF(label = 'some_mol',
               job   = 'SinglePoint',
               basis = 'DZP',
               xc    = 'GGA:BP',
               core  = 'Small')

    # Assign calculator to system object
    mol.set_calculator(calc)

    # For this ``job`` type the potential energy calculation only yields
    # a single point energy at this stage
    e_init = mol.get_potential_energy()

    # Geometry optimisation requires a driver object (here BFGS) from ``ase.optimize``
    driver = BFGS(mol, trajectory='some_mol.traj')

    # Invoce optimiser run to converge nuclear forces below 0.05 eV/Angstrom
    # within 200 steps at most
    driver.run(fmax=0.05, steps=200)