Skip to content

Commit 14eea1f

Browse files
committed
Improve AGOX documentation
1 parent c66a568 commit 14eea1f

2 files changed

Lines changed: 53 additions & 4 deletions

File tree

docs/source/tutorials/agox_tutorial.rst

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ The example script can be found in the following directory:
1414
1515
raffle/example/python_pkg/agox_runs/Si-Ge_run/agox_run.py
1616
17+
Requirements
18+
------------
19+
1720
This script utilises the `hex` slurm experiment management package.
1821
The script is designed to run on a slurm cluster, but can also be run locally by removing the slurm-specific code.
1922
`hex` can be installed via pip:
@@ -35,7 +38,9 @@ To use the RAFFLE generator, you need to install the `raffle_generator` branch o
3538
cd agox
3639
pip install -e .
3740
38-
The RAFFLE generator differs slightly from the standard AGOX generator, as it requires a host structure to be provided directly to the generator.
41+
The RAFFLE generator differs slightly from the standard AGOX generator.
42+
If using `from_host` in RAFFLE, then the host structure must be provided to the generator directly in addition to the environment.
43+
Otherwise, the host structure (without information regarding the system's energy) is provided automatically by the AGOX framework.
3944

4045
An environment must be set up for the search, this defines the host structure, the stoichiometry of atoms to be added, and the bounding box for the search.
4146
The bounding box must first be defined in terms of a lower left and upper right corner, which can be done using the `bounds_to_confinement` function.
@@ -93,15 +98,17 @@ The RAFFLE generator can then be set up using the `RaffleGenerator` class in AGO
9398
9499
generator = RaffleGenerator(
95100
**environment.get_confinement(),
96-
host = template,
101+
element_energies = {
102+
'Si': -4.0,
103+
'Ge': -3.5
104+
}, # example element energies
97105
database = database,
98-
environment = environment,
99-
species = symbols,
100106
n_structures = 5,
101107
...
102108
)
103109
104110
This sets up the RAFFLE generator to generate 5 structures each iteration, using the host structure and the environment defined earlier.
111+
A more extensive list of arguments specific to the RAFFLE generator can be found at the end of this tutorial in the section :ref:`raffle_generator_arguments`.
105112

106113
Evaluators and structure filters can be set up as usual in AGOX.
107114
For example, to set up an evaluator to perform structural optimisation, and a pre- and post-process filter that removes structures with bondlengths less than a certain value, you can use the following code:
@@ -143,3 +150,43 @@ Finally, the AGOX search can be set up and run using the `AGOX` class in AGOX:
143150
144151
## Run the AGOX search for N_iterations
145152
agox.run(N_iterations=40)
153+
154+
155+
.. _raffle_generator_arguments:
156+
157+
RAFFLE generator specific arguments
158+
-----------------------------------
159+
160+
The RAFFLE generator has several specific arguments that can be set to control the generation of structures.
161+
The required argument for the RAFFLE generator is:
162+
163+
- ``element_energies``: A dictionary of element energies, taking the form ``{'Si': -4.0, 'Ge': -3.5}``. These are reference energies for the elements in the system, similar to chemical potentials.
164+
165+
More information on this can be found in :ref:`element-energies`.
166+
167+
Other optional arguments that can be set include:
168+
169+
- ``n_structures``: The number of structures to generate in each iteration.
170+
- ``host``: The host structure to use for the generation. This can be an ASE Atoms object.
171+
- ``kBT``: The weighting factor for scaling the importance of different atomic features based on their system's relative energy.
172+
- ``history_len``: The length of the history for tracking change in the generalised descriptor.
173+
- ``width``: The width of the Gaussian functions used in the distribution functions (list of three floats, for 2-, 3-, and 4-body interactions).
174+
- ``sigma``: The standard deviation of the Gaussian functions used in the distribution functions (list of three floats, for 2-, 3-, and 4-body interactions).
175+
- ``cutoff_min``: The minimum cutoff for the Gaussian functions (list of three floats, for 2-, 3-, and 4-body interactions).
176+
- ``cutoff_max``: The maximum cutoff for the Gaussian functions (list of three floats, for 2-, 3-, and 4-body interactions).
177+
- ``radius_distance_tol``: The radius distance tolerance for the element-pair covalent radii (list of four floats, for 3-body min, 3-body max, 4-body min, and 4-body max interactions).
178+
- ``transfer_data``: A list of ASE Atoms objects used to initialise the generalised descriptor.
179+
- ``method_ratio``: The ratio of placement methods to use in the generation (dictionary with keys `void`, `rand`, `walk`, `grow`, and `min`, and values as floats representing the relative importance of each method).
180+
- ``deallocate_systems``: A boolean flag to indicate whether to deallocate the individual distribution functions of systems after they have been combined into the generalised descriptor.
181+
- ``from_host``: A boolean flag to indicate whether to represent the energies with respect to the host structure.
182+
- ``max_walk_attempts``: The maximum number of attempts to place an atom using the `walk` method before giving up.
183+
- ``walk_step_size_coarse``: The initial/coarse step size for the `walk` method.
184+
- ``walk_step_size_fine``: The final/fine step size for the `walk` method.
185+
- ``grid_spacing``: The spacing of the grid used for the `void` and `min` methods.
186+
- ``seed``: A random seed for reproducibility.
187+
188+
Other arguments exist that are not specific to the RAFFLE generator, but are used in the AGOX framework, such as:
189+
190+
- ``database``: The database object to use for storing the generated structures.
191+
192+
Documentation of these arguments can be found in the AGOX documentation: https://agox.gitlab.io/agox/generators/

docs/source/tutorials/parameters_tutorial.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ To set the placement method ratios for a specific generation method, the user ca
111111
)
112112
113113
114+
.. _element-energies:
115+
114116
Energy references
115117
-----------------
116118

0 commit comments

Comments
 (0)