seamm_ase package#

Submodules#

seamm_ase.seamm_ase module#

class seamm_ase.seamm_ase.ASE_mixin[source]#

Bases: object

A mix-in class for connnecting with ASE methods and calculators.

ase_atoms(configuration)[source]#

Return an ASE Atoms object for the configuration.

Parameters:

configuration (molsystem._Configuration) – The configuration

Returns:

atoms – The ASE Atoms object.

Return type:

ase.Atoms()

ase_calculator(calculator, properties=['energy'], system_changes=['positions', 'numbers', 'cell', 'pbc', 'initial_charges', 'initial_magmoms'])[source]#

Create a calculator for the structure step.

Parameters:
  • ase (ase.calculators.calculator.Calculator) – The ASE calculator we are working for

  • properties (list of str) – The properties to calculate.

  • system_changes (int) – The changes to the system.

Returns:

results – The dictionary of results from the calculation.

Return type:

dict

ase_read_bibliography()[source]#

Read the bibliography from a file and add to the local bibliography

run_ase_Hessian(step_size=0.01, on_error='keep last subdirectory', on_success='delete all subdirectories')[source]#

Run ASE to get the Hessian

Parameters:

step_size (float) – The finite-difference step, in Angstrom

Returns:

vibrations

Return type:

ASE VibrationsData() object

run_ase_optimizer(P, PP)[source]#

Run a Structure step.

Parameters:
  • P (dict) – The current values of the parameters

  • PP (dict) – The current values of the parameters, formatted for printing

class seamm_ase.seamm_ase.SEAMM_Calculator(step, calculator=None, name=None, configuration=None, **kwargs)[source]#

Bases: Calculator

Generic ASE calculator for SEAMM.

This is a generic calculator that can be used from any step in SEAMM to use functionality in ASE.

The step must have a calculator method that is called by this class:

def calculator(
    self,
    calculator,
    properties=["energy"],
    system_changes=ASE_all_changes,
):
    """Create a calculator for the structure step.

    Parameters
    ----------
    ase : ase.calculators.calculator.Calculator
        The ASE calculator we are working for
    properties : list of str
        The properties to calculate.
    system_changes : int
        The changes to the system.
    """
...

An example can be found in the Structure step.

The step must also create the SEAMM_Calculator, passing itself into the constructor, and set up the Atoms object to use this calculator:

...
symbols = configuration.atoms.symbols
XYZ = configuration.atoms.coordinates

calculator = SEAMM_Calculator(self)
atoms = ASE_Atoms("".join(symbols), positions=XYZ, calculator=calculator)
...

The step can then call the calculate method of the SEAMM_Calculator to perform the calculation, or can pass the calculator to other ASE drivers that will use the calculator.

calculate(atoms=None, properties=['energy', 'forces'], system_changes=['positions', 'numbers', 'cell', 'pbc', 'initial_charges', 'initial_magmoms'])[source]#

Perform the calculation.

Parameters:
  • atoms (ase.Atoms) – The atoms object to calculate.

  • properties (list of str) – The properties to calculate.

  • system_changes (int) – The changes to the system.

Returns:

The results of the calculation.

Return type:

dict

check_state(atoms, tol=1e-10)[source]#

Check for any system changes since last calculation.

property configuration#

The configuration this calculator represents.

get_property(name, atoms=None, allow_calculation=True)[source]#

Get the named property.

implemented_properties: List[str] = ['energy', 'forces']#

Properties calculator can handle (energy, forces, …)

property name#

A name for this calculator.

nolabel = True#

Module contents#

Connector between SEAMM and ASE