app¶
AGAT model applications
- class AgatCalculator(Calculator)¶
Deploy AGAT model on
ase.calculators
, which can relax and find the ground state energy of a structure.Note
Go to https://wiki.fysik.dtu.dk/ase/development/calculators.html#adding-new-calculators for more information about
ase.calculators
- implemented_properties¶
['energy', 'forces']
- default_parameters¶
{}
- __init__(self, model_save_dir, graph_build_scheme_dir, device='cuda', **kwargs)¶
- Parameters:
model_save_dir (str) – Directory storing the well-trained model.
graph_build_scheme_dir (str) – Direcotry storing the
graph_build_scheme.json
file.device (str, optional) – model device, defaults to ‘cuda’
**kwargs –
other input arguments
- Returns:
Calculated properties.
- Return type:
dict
Example:
model_save_dir = 'agat_model' graph_build_scheme_dir = 'dataset' atoms = read('CONTCAR') calculator=AgatCalculator(model_save_dir, graph_build_scheme_dir) atoms = Atoms(atoms, calculator=calculator) dyn = BFGS(atoms, trajectory='test.traj') dyn.run(fmax=0.005) traj = read('test.traj', index=':') write("XDATCAR.gat", traj)
- load_graph_build_scheme(self, path)¶
Load graph building scheme.
Note
This file is normally saved to the disk when you build your dataset, under the same directory containing
all_graphs.bin
.- Parameters:
path (str) – Directory for storing
graph_build_scheme.json
file.- Returns:
A dict denotes how to build the graph.
- Return type:
dict
- calculate(self, atoms=None, properties=None, system_changes=['positions', 'numbers', 'cell', 'pbc'])¶
- Parameters:
atoms (ase.atoms, optional) – ase.atoms object, defaults to None
properties (none, optional) – calculated properties, defaults to None
system_changes (TYPE, optional) – DESCRIPTION, defaults to [‘positions’, ‘numbers’, ‘cell’, ‘pbc’]
- Returns:
calculated results
- Return type:
dict