Core Module

Base Active Learning

class alomancy.core.base_active_learning.BaseActiveLearningWorkflow(initial_train_file_path: str, initial_test_file_path: str, jobs_dict: dict, number_of_al_loops: int = 5, verbose: int = 0, start_loop: int = 0, plots: bool = True)[source]

Bases: ABC

Abstract base class for active learning workflows.

This class provides the core AL loop structure while requiring subclasses to implement the specific methods for structure generation, high-accuracy evaluation, MLIP training, and evaluation.

Subclasses must implement the following abstract methods: - high_accuracy_evaluation - train_mlip - generate_structures

abstractmethod generate_structures(base_name: str, structure_generation_job_dict: dict, train_data: list[Atoms], **kwargs) list[Atoms][source]

Generate structures for active learning selection.

Parameters:
  • base_name (str) – Base name for this AL loop

  • structure_generation_job_dict (dict) – Dictionary containing job name and HPC parameters for structure generation

  • train_data (List[Atoms]) – Current training data

  • **kwargs – Additional keyword arguments

Returns:

Generated structures for high-accuracy evaluation

Return type:

List[Atoms]

abstractmethod high_accuracy_evaluation(base_name: str, high_accuracy_eval_job_dict: dict, structures: list[Atoms], **kwargs) list[Atoms][source]

Run high-accuracy calculations on selected structures.

Parameters:
  • base_name (str) – Base name for this AL loop

  • high_accuracy_eval_job_dict (dict) – Dictionary containing job name and HPC parameters for high-accuracy evaluation

  • structures (List[Atoms]) – Structures to evaluate with high-accuracy method

  • **kwargs – Additional keyword arguments

Returns:

Structures with high-accuracy results (energy, forces, etc.)

Return type:

List[Atoms]

process_structure(structure: Atoms) Atoms[source]

Process a structure before adding it to the training set.

We will

Parameters:

structure (Atoms) – The structure to process.

Returns:

The processed structure.

Return type:

Atoms

run(**kwargs) None[source]

Run the active learning workflow.

This method defines the core AL loop and calls the abstract methods that must be implemented by subclasses.

abstractmethod train_mlip(base_name: str, mlip_committee_job_dict: dict, **kwargs) DataFrame[source]

Train machine learning interatomic potential.

Parameters:
  • base_name (str) – Base name for this AL loop

  • mlip_committee_job_dict (dict) – Dictionary containing job name and HPC parameters for MLIP training

  • train_data (List[Atoms]) – Training data for MLIP

  • **kwargs – Additional keyword arguments

Returns:

Path to trained model file, if applicable

Return type:

Optional[str]

Standard Active Learning

class alomancy.core.standard_active_learning.ActiveLearningStandardMACE(initial_train_file_path: str, initial_test_file_path: str, jobs_dict: dict, number_of_al_loops: int = 5, verbose: int = 0, start_loop: int = 0, plots: bool = True)[source]

Bases: BaseActiveLearningWorkflow

AL Technique: Committee MLIP: MACE Structure Generation: MD High-Accuracy Evaluation: Quantum Espresso (DFT)

generate_structures(base_name: str, job_dict: dict, train_atoms_list: list[Atoms]) list[Atoms][source]

Generate structures for active learning selection.

Parameters:
  • base_name (str) – Base name for this AL loop

  • structure_generation_job_dict (dict) – Dictionary containing job name and HPC parameters for structure generation

  • train_data (List[Atoms]) – Current training data

  • **kwargs – Additional keyword arguments

Returns:

Generated structures for high-accuracy evaluation

Return type:

List[Atoms]

high_accuracy_evaluation(base_name: str, high_accuracy_eval_job_dict: dict, structures: list[Atoms]) list[Atoms][source]

Run high-accuracy calculations on selected structures.

Parameters:
  • base_name (str) – Base name for this AL loop

  • high_accuracy_eval_job_dict (dict) – Dictionary containing job name and HPC parameters for high-accuracy evaluation

  • structures (List[Atoms]) – Structures to evaluate with high-accuracy method

  • **kwargs – Additional keyword arguments

Returns:

Structures with high-accuracy results (energy, forces, etc.)

Return type:

List[Atoms]

train_mlip(base_name: str, mlip_committee_job_dict: dict) DataFrame[source]

Train machine learning interatomic potential.

Parameters:
  • base_name (str) – Base name for this AL loop

  • mlip_committee_job_dict (dict) – Dictionary containing job name and HPC parameters for MLIP training

  • train_data (List[Atoms]) – Training data for MLIP

  • **kwargs – Additional keyword arguments

Returns:

Path to trained model file, if applicable

Return type:

Optional[str]