### Get Help for Jobflow Runner Start Command Source: https://github.com/autoatml/autoplex/blob/main/docs/user/jobflowremote.md Displays detailed usage information and available options for the 'jf runner start' command. ```bash jf runner start -h ``` -------------------------------- ### Start MongoDB Instance Source: https://github.com/autoatml/autoplex/blob/main/docs/user/mongodb.md Command to start a MongoDB database instance, binding to all network interfaces and specifying the database path and port. ```bash mongod --bind_ip_all --dbpath /this_is_the_path_to_your_db --quiet --port 27017 ``` -------------------------------- ### Start MongoDB using Configuration File Source: https://github.com/autoatml/autoplex/blob/main/docs/user/mongodb.md Command to start a MongoDB instance using a specified configuration file and a custom socket prefix. ```bash mongod -f path/to/mongod.conf --quiet --unixSocketPrefix path/to/store/.sock/file ``` -------------------------------- ### MongoDB Configuration File Example Source: https://github.com/autoatml/autoplex/blob/main/docs/user/mongodb.md An example configuration file for MongoDB, specifying process management, network settings, storage, and logging. ```yaml processManagement: fork: false pidFilePath: /dss/dsshome1/00/username/path/to/store/your/pidfile/mongod.pid net: bindIp: 0.0.0.0 port: 27017 storage: dbPath: /dss/dsshome1/00/username/path/to/store/your/db/mongo systemLog: destination: file path: /dss/dsshome1/00/username/path/to/mongod.log logAppend: true storage: journal: enabled: true ``` -------------------------------- ### Install Autoplex from Source Source: https://github.com/autoatml/autoplex/blob/main/docs/dev/dev_install.md Clone the repository and install autoplex with all development dependencies. Note that non-Python programs for ACE potential fitting are not installed by this command and must be installed separately. ```bash git clone https://github.com/autoatml/autoplex.git cd autoplex pip install -e .[strict,dev,tests,docs] ``` -------------------------------- ### Autoplex Workflow Output Example Source: https://github.com/autoatml/autoplex/blob/main/docs/user/phonon/flows/flows.md Example output showing training and testing errors for an MLIP fit. ```bash Training error of MLIP (eV/at.): 0.0049634 Testing error of MLIP (eV/at.): 0.0023569 ``` -------------------------------- ### Mock VASP Setup Note Source: https://github.com/autoatml/autoplex/blob/main/tutorials/tutorial_phonon.ipynb This comment indicates that VASP calculations will be mocked for the tutorial. Ensure that folders with pre-computed VASP output files are available for the notebook to execute correctly. ```python # Please note that I am reusing the same relaxations here in several steps. ``` -------------------------------- ### Start MongoDB Service with Homebrew Source: https://github.com/autoatml/autoplex/blob/main/docs/user/mongodb.md Command to start the MongoDB community service using Homebrew. Use `brew services list` to check its status. ```bash brew services start mongodb-community ``` -------------------------------- ### Complete DFT vs ML Benchmark Workflow Setup Source: https://github.com/autoatml/autoplex/blob/main/docs/user/phonon/flows/flows.md Sets up the CompleteDFTvsMLBenchmarkWorkflow by defining material IDs for structures and benchmarks. This workflow automates VASP and phonopy calculations, MLIP fits, and benchmarks. ```python mpbenchmark = ["mp-22905"] for mpid in mpids: structure = mpr.get_structure_by_material_id(mpid) structure_list.append(structure) for mpbm in mpbenchmark: bm_structure = mpr.get_structure_by_material_id(mpbm) benchmark_structure_list.append(bm_structure) complete_flow = CompleteDFTvsMLBenchmarkWorkflow( apply_data_preprocessing=True, ).make( structure_list=structure_list, mp_ids=mpids, benchmark_structures=benchmark_structure_list, benchmark_mp_ids=mpbenchmark) complete_flow.name = "tutorial" autoplex_flow = complete_flow ``` -------------------------------- ### Iterative Phonon Workflow Setup Source: https://github.com/autoatml/autoplex/blob/main/docs/user/phonon/flows/flows.md Sets up an iterative version of the CompleteDFTvsMLBenchmarkWorkflow to converge phonon RMSE. It allows for different configurations in the first generation compared to subsequent ones. ```python from mp_api.client import MPRester from autoplex.auto.phonons.flows import CompleteDFTvsMLBenchmarkWorkflow, IterativeCompleteDFTvsMLBenchmarkWorkflow mpr = MPRester(api_key='YOUR_MP_API_KEY') structure_list = [] benchmark_structure_list = [] mpids = ["mp-22905"] # you can put as many mpids as needed e.g. mpids = ["mp-22905", "mp-1185319"] for all LiCl entries in the Materials Project mpbenchmark = ["mp-22905"] for mpid in mpids: structure = mpr.get_structure_by_material_id(mpid) structure_list.append(structure) for mpbm in mpbenchmark: bm_structure = mpr.get_structure_by_material_id(mpbm) benchmark_structure_list.append(bm_structure) complete_flow=IterativeCompleteDFTvsMLBenchmarkWorkflow(rms_max=0.2, max_iterations=4, complete_dft_vs_ml_benchmark_workflow_0=CompleteDFTvsMLBenchmarkWorkflow( apply_data_preprocessing=True, add_dft_phonon_struct=True, ), complete_dft_vs_ml_benchmark_workflow_1=CompleteDFTvsMLBenchmarkWorkflow( apply_data_preprocessing=True, add_dft_phonon_struct=False, ) ).make( structure_list=structure_list, mp_ids=mpids, benchmark_structures=benchmark_structure_list, benchmark_mp_ids=mpbenchmark) complete_flow.name = "tutorial" autoplex_flow = complete_flow ``` -------------------------------- ### Atomate2 Configuration Example Source: https://github.com/autoatml/autoplex/blob/main/docs/user/jobflowremote.md An example of an atomate2.yaml configuration file. This file is used on the remote cluster to specify commands for computational packages like VASP and LOBSTER. ```yaml VASP_CMD: your hpc vasp_std cmd VASP_GAMMA_CMD: your hpc vasp_gam cmd LOBSTER_CMD: your hpc lobster cmd ``` -------------------------------- ### Install Julia and ACEpotentials Dependencies Source: https://github.com/autoatml/autoplex/blob/main/README.md Installs Julia version 1.9.2 and configures Julia with necessary registries and packages for ACEpotentials fitting. ```bash curl -fsSL https://install.julialang.org | sh -s -- default-channel 1.9.2 ``` ```julia using Pkg; Pkg.Registry.add("General"); Pkg.Registry.add(Pkg.Registry.RegistrySpec(url="https://github.com/ACEsuit/ACEregistry")); Pkg.add(Pkg.PackageSpec(;name="ACEpotentials", version="0.6.7")); Pkg.add("DataFrames"); Pkg.add("CSV") ``` -------------------------------- ### Install pytest-xdist for Parallel Testing Source: https://github.com/autoatml/autoplex/blob/main/docs/dev/dev_install.md Install the pytest-xdist library to enable parallel test execution. ```bash pip install pytest-xdist ``` -------------------------------- ### Install Julia v1.9.2 Source: https://github.com/autoatml/autoplex/blob/main/docs/user/installation/installation.md Installs a specific version of Julia, which is required for fitting and validating ACEpotentials. ```bash curl -fsSL https://install.julialang.org | sh -s -- default-channel 1.9.2 ``` -------------------------------- ### Install MongoDB using Homebrew Source: https://github.com/autoatml/autoplex/blob/main/docs/user/mongodb.md Commands to install MongoDB Community Edition using Homebrew, including tapping the official MongoDB repository. ```bash brew tap mongodb/brew brew update brew install mongodb-community ``` -------------------------------- ### Finetune MACE-MP-0 with Custom Settings Source: https://github.com/autoatml/autoplex/blob/main/docs/user/phonon/flows/fitting/fitting.md Configure the `CompleteDFTvsMLBenchmarkWorkflowMPSettings` for finetuning MACE-MP-0. This example sets custom volume scale factors, rattle/distort types, and detailed MACE fitting parameters including weights, epochs, and learning rate. ```python complete_workflow_mace = CompleteDFTvsMLBenchmarkWorkflowMPSettings( ml_models=["MACE"], volume_custom_scale_factors=[0.95,1.00,1.05], rattle_type=0, distort_type=0, apply_data_preprocessing=True, ... ).make( structure_list=[structure], mp_ids=["mpid"], benchmark_mp_ids=["mpid"], benchmark_structures=[structure], fit_kwargs_list=[ { "model": "MACE", "name": "MACE_final", "foundation_model": "large", "multiheads_finetuning": False, "r_max": 6, "loss": "huber", "energy_weight": 1000.0, "forces_weight": 1000.0, "stress_weight": 1.0, "compute_stress": True, "E0s": "average", "scaling": "rms_forces_scaling", "batch_size": 1, "max_num_epochs": 200, "ema": True, "ema_decay": 0.99, "amsgrad": True, "default_dtype": "float64", "restart_latest": True, "lr": 0.0001, "patience": 20, "device": "cpu", "save_cpu": True, "seed": 3 } ], ) ``` -------------------------------- ### Configure M3GNet Fitting Hyperparameters Source: https://github.com/autoatml/autoplex/blob/main/docs/user/phonon/flows/fitting/fitting.md Pass M3GNet fitting hyperparameters to the `make` method of `CompleteDFTvsMLBenchmarkWorkflow`. This example sets cutoff, batch size, epochs, and other M3GNet-specific parameters. ```python complete_flow = CompleteDFTvsMLBenchmarkWorkflow( ml_models=["M3GNet"], ..., apply_data_preprocessing=True, ).make(..., structure_list=[structure], mp_ids=["mpid"], benchmark_mp_ids=["mpid"], benchmark_structures=[structure], fit_kwargs_list=[ { "cutoff": 5.0, "threebody_cutoff": 4.0, "batch_size": 10, "max_epochs": 1000, "include_stresses": True, "hidden_dim": 128, "num_units": 128, "max_l": 4, "max_n": 4, "device": "cuda", "test_equal_to_val": True } ], ..., ) ``` -------------------------------- ### FireWorks Launchpad Configuration (YAML) Source: https://github.com/autoatml/autoplex/blob/main/docs/user/mongodb.md Configure the launchpad to connect to your MongoDB instance. Ensure 'host', 'port', 'name', 'username', and 'password' match your MongoDB setup. ```yaml host: login_node_name port: 27017 name: database_name username: admin password: adminpassword ssl_ca_file: null logdir: null strm_lvl: INFO user_indices: [] wf_user_indices: [] ``` -------------------------------- ### Generate Jobflow Project Source: https://github.com/autoatml/autoplex/blob/main/docs/user/jobflowremote.md Run this command to generate an empty project configuration file in your home directory. This file is essential for jobflow-remote setup. ```bash jf project generate --full YOUR_PROJECT_NAME ``` -------------------------------- ### GAP Default Settings JSON Source: https://github.com/autoatml/autoplex/blob/main/docs/user/phonon/flows/fitting/fitting.md Example of the default GAP fitting settings structure, including file naming conventions and parameter names for energy, forces, and virial. ```json "general": { "at_file": "train.extxyz", "energy_parameter_name": "REF_energy", "force_parameter_name": "REF_forces", "virial_parameter_name": "REF_virial", "gp_file": "gap_file.xml" }, ``` -------------------------------- ### Iterative DFT vs ML Benchmark Workflow Setup Source: https://github.com/autoatml/autoplex/blob/main/tutorials/tutorial_phonon.ipynb Configures an IterativeCompleteDFTvsMLBenchmarkWorkflow for comparing DFT and ML models. This workflow iteratively refines predictions and includes settings for data preprocessing, structure generation, and model fitting. ```python from pymatgen.analysis.defects.workflows.builder import IterativeCompleteDFTvsMLBenchmarkWorkflow, CompleteDFTvsMLBenchmarkWorkflow iteration_flow = IterativeCompleteDFTvsMLBenchmarkWorkflow( max_iterations=2, # with the current test data, you can switch between 1 and 2 rms_max=0.2, complete_dft_vs_ml_benchmark_workflow_0=CompleteDFTvsMLBenchmarkWorkflow( symprec=1e-3, apply_data_preprocessing=True, add_dft_rattled_struct=True, add_dft_phonon_struct=True, volume_custom_scale_factors=[1.0], rattle_type=0, distort_type=0, rattle_std=0.1, # benchmark_kwargs={"relax_maker_kwargs": {"relax_cell": False}}, supercell_settings={ "min_length": 10, "max_length": 15, "min_atoms": 10, "max_atoms": 300, "fallback_min_length": 9, }, # settings that worked with a GAP split_ratio=0.33, regularization=False, separated=False, num_processes_fit=48, displacement_maker=phonon_displacement_maker, phonon_bulk_relax_maker=phonon_bulk_relax_maker, phonon_static_energy_maker=phonon_static_energy_maker, rattled_bulk_relax_maker=phonon_bulk_relax_maker, isolated_atom_maker=static_isolated_atom_maker, ), complete_dft_vs_ml_benchmark_workflow_1=CompleteDFTvsMLBenchmarkWorkflow( symprec=1e-3, apply_data_preprocessing=True, add_dft_phonon_struct=False, add_dft_rattled_struct=True, volume_custom_scale_factors=[1.0], rattle_type=0, distort_type=0, rattle_std=0.1, # maybe 0.1 benchmark_kwargs={"relax_maker_kwargs": {"relax_cell": False}}, supercell_settings={ "min_length": 10, "max_length": 15, "min_atoms": 10, "max_atoms": 300, "fallback_min_length": 9, }, # settings that worked with a GAP split_ratio=0.33, regularization=False, separated=False, num_processes_fit=48, displacement_maker=phonon_displacement_maker, phonon_bulk_relax_maker=phonon_bulk_relax_maker, phonon_static_energy_maker=phonon_static_energy_maker, rattled_bulk_relax_maker=phonon_bulk_relax_maker, ``` -------------------------------- ### Configure MACE Fitting Hyperparameters Source: https://github.com/autoatml/autoplex/blob/main/docs/user/phonon/flows/fitting/fitting.md Pass MACE fitting hyperparameters to the `make` method of `CompleteDFTvsMLBenchmarkWorkflow`. This example configures model type, weights, cutoff, epochs, and other MACE-specific parameters. ```python complete_flow = CompleteDFTvsMLBenchmarkWorkflow( ml_models=["MACE"], ..., apply_data_preprocessing=True, ).make(..., structure_list=[structure], mp_ids=["mpid"], benchmark_mp_ids=["mpid"], benchmark_structures=[structure], fit_kwargs_list=[ { "model": "MACE", "config_type_weights": '{"Default": 1.0}', "hidden_irreps": "128x0e + 128x1o", "r_max": 5.0, "batch_size": 10, "max_num_epochs": 1500, "start_swa": 1200, "ema_decay": 0.99, "correlation": 3, "loss": "huber", "default_dtype": "float32", "device": "cuda" } ], ... ) ``` -------------------------------- ### Start MongoDB with Custom Socket Prefix Source: https://github.com/autoatml/autoplex/blob/main/docs/user/mongodb.md Use this command if you encounter errors related to socket file permissions. It allows specifying a custom directory for temporary socket files. ```bash mongod --bind_ip_all --dbpath /this_is_the_path_to/your_db --quiet --port 27017 --unixSocketPrefix /new/directory/for/temp/file ``` -------------------------------- ### Install Autoplex with Pacemaker Dependencies Source: https://github.com/autoatml/autoplex/blob/main/README.md Installs Autoplex with Pacemaker support, along with specific versions of TensorFlow, TensorPotential, and python-ace. Ensure CMake is available before installing python-ace. ```bash pip install autoplex[pacemaker] ``` ```bash pip install tensorflow==2.8.0 ``` ```bash pip install --no-deps git+https://github.com/ICAMS/TensorPotential.git@1e44b2558356800ae070658c0bb856ff9bf74538 ``` ```bash pip install --no-deps git+https://github.com/ICAMS/python-ace.git@d1c213a7d9c5b809a3ae83b2e5a916be26d921f0 ``` -------------------------------- ### Complete DFT vs ML Benchmark Workflow Source: https://context7.com/autoatml/autoplex/llms.txt Initiates a full phonon MLIP workflow. This includes generating DFT reference data, preprocessing and splitting the dataset, fitting MLIP models, and benchmarking them against DFT phonon band structures. Configure parameters like ML models, data augmentation, and fitting settings. ```python from mp_api.client import MPRester from autoplex.auto.phonons.flows import CompleteDFTvsMLBenchmarkWorkflow from jobflow_remote import submit_flow mpr = MPRester(api_key="YOUR_MP_API_KEY") mpids = ["mp-22905"] # LiCl rocksalt mpbenchmark = ["mp-22905"] structure_list = [mpr.get_structure_by_material_id(m) for m in mpids] benchmark_structures = [mpr.get_structure_by_material_id(m) for m in mpbenchmark] complete_flow = CompleteDFTvsMLBenchmarkWorkflow( ml_models=["GAP"], add_dft_phonon_struct=True, # include phonopy-displaced supercells add_dft_rattled_struct=True, # include rattled supercells n_structures=50, # number of rattled structures symprec=1e-4, rattle_std=0.01, distort_type=0, # 0=volume, 1=angle, 2=both volume_scale_factor_range=[0.95, 1.05], supercell_settings={"min_length": 15, "max_length": 20, "min_atoms": 50, "max_atoms": 500}, apply_data_preprocessing=True, distillation=True, force_max=40.0, split_ratio=0.4, atom_wise_regularization=True, atomwise_regularization_parameter=0.1, force_min=0.01, num_processes_fit=48, summary_filename_prefix="results_", ).make( structure_list=structure_list, mp_ids=mpids, benchmark_structures=benchmark_structures, benchmark_mp_ids=mpbenchmark, fit_kwargs_list=[{ "soap": { "delta": 1.0, "l_max": 12, "n_max": 10, "atom_sigma": 0.5, "zeta": 4, "cutoff": 5.0, "cutoff_transition_width": 1.0, "central_weight": 1.0, "n_sparse": 9000, "f0": 0.0, "covariance_type": "dot_product", "sparse_method": "cur_points", }, "general": { "two_body": False, "three_body": False, "soap": True, "default_sigma": "{0.001 0.05 0.05 0.0}", "sparse_jitter": 1e-8, }, }], ) complete_flow.name = "LiCl_GAP_workflow" resources = {"nodes": 3, "partition": "micro", "time": "2:00:00", "ntasks": 144} print(submit_flow(complete_flow, worker="my_worker", resources=resources, project="autoplex")) # Expected summary output (results_LiCl.txt): # Potential Structure MPID Displacement(Å) RMSE(THz) imagmodes(pot) imagmodes(dft) # GAP LiCl mp-22905 0.01 0.576 False False ``` -------------------------------- ### Compile and Install AIRSS Source: https://github.com/autoatml/autoplex/blob/main/README.md Downloads, compiles, and installs the AIRSS package version 0.9.3. Ensure you are in the correct directory after extraction. ```bash curl -O https://www.mtg.msm.cam.ac.uk/files/airss-0.9.3.tgz; tar -xf airss-0.9.3.tgz; rm airss-0.9.3.tgz; cd airss; make ; make install ; make neat; cd .. ``` -------------------------------- ### Complete DFT vs ML Phonon Benchmark Workflow Source: https://github.com/autoatml/autoplex/blob/main/docs/user/phonon/flows/benchmark/benchmark.md Sets up and runs a complete benchmark workflow comparing DFT and ML phonon calculations. It can utilize pre-existing DFT data or automatically execute VASP calculations if no references are provided. A mix of pre-existing and missing DFT references is not supported. ```python from mp_api.client import MPRester from autoplex.auto.phonons.flows import CompleteDFTvsMLBenchmarkWorkflow from atomate2.common.schemas.phonons import PhononBSDOSDoc from monty.serialization import loadfn mpr = MPRester(api_key='YOUR_MP_API_KEY') structure_list = [] benchmark_structure_list = [] mpids = ["mp-22905"] mpbenchmark = ["mp-22905"] dft_data = loadfn("/path/to/DFT/ref/data/PhononBSDOSDoc_mp_22905.json") dft_reference: PhononBSDOSDoc = dft_data["output"] for mpid in mpids: structure = mpr.get_structure_by_material_id(mpid) structure_list.append(structure) for mpbm in mpbenchmark: bm_structure = mpr.get_structure_by_material_id(mpbm) benchmark_structure_list.append(bm_structure) complete_flow = CompleteDFTvsMLBenchmarkWorkflow( apply_data_preprocessing=True, ).make( structure_list=structure_list, mp_ids=mpids, benchmark_structures=benchmark_structure_list, benchmark_mp_ids=mpbenchmark, dft_references=[dft_reference]) ``` -------------------------------- ### Install Autoplex with Strict Dependencies Source: https://github.com/autoatml/autoplex/blob/main/README.md Use this command to install Autoplex along with all necessary Python packages and dependencies for MLIP fits. ```bash pip install autoplex[strict] ``` -------------------------------- ### Configure DFT vs ML Benchmark Workflow Source: https://github.com/autoatml/autoplex/blob/main/docs/user/phonon/flows/fitting/fitting.md Set up a benchmark workflow including ML models, data preprocessing, force thresholds, and split ratios. MLIP-specific fit parameters can be passed via `fit_kwargs_list`. ```python complete_flow = CompleteDFTvsMLBenchmarkWorkflow( ml_models=["GAP", "MACE"], ..., apply_data_preprocessing=True, f_max=40.0, split_ratio=0.4, num_processes_fit=48, benchmark_kwargs={"relax_maker_kwargs": {"relax_cell": False, "relax_kwargs": ...}, "calculator_kwargs": {"device": "cpu"}} ).make(..., fit_kwargs_list=[ {"general": {"two_body": True, "three_body": False, "soap": False}}, # GAP parameters {"model": "MACE", "device": "cuda"} # MACE parameters # fit_kwargs_list has to have the same order as in ml_models ], ... # put the other hyperparameter commands here as shown below ) ``` -------------------------------- ### Create and Run Phonon Benchmark Source: https://github.com/autoatml/autoplex/blob/main/docs/user/phonon/flows/benchmark/benchmark.md This snippet demonstrates how to initialize and run a PhononBenchmarkMaker using a specified structure and DFT reference data. It configures the underlying relaxation and static energy makers with a GAP potential and then creates and runs the benchmark job. ```python from atomate2.forcefields.jobs import ForceFieldRelaxMaker, ForceFieldStaticMaker from atomate2.phonons.jobs import PhononMaker, PhononBenchmarkMaker from jobflow import run_locally from mp_api.client import MPRester from pymatgen.core import Structure from monty.serialization import loadfn # Connect to the job store # store.connect() # Assuming 'store' is already defined and connected mpr = MPRester(api_key = 'YOUR_API_KEY') mpid = "mp-22905" structure = mpr.get_structure_by_material_id(mpid) dft_data = loadfn("/path/to/DFT/ref/data/PhononBSDOSDoc_mp_22905.json") dft_reference: PhononBSDOSDoc = dft_data["output"] potential_filename = "/path/to/GAP/file/gap_file.xml" phojob = PhononMaker( bulk_relax_maker=ForceFieldRelaxMaker(calculator_kwargs={"args_str": "IP GAP", "param_filename": potential_filename}, relax_cell=True, relax_kwargs={"interval": 500, "fmax": 0.00001}, steps=10000, force_field_name="GAP", ), phonon_displacement_maker=ForceFieldStaticMaker(calculator_kwargs={"args_str": "IP GAP", "param_filename": potential_filename}, force_field_name="GAP", ), static_energy_maker=ForceFieldStaticMaker(calculator_kwargs={"args_str": "IP GAP", "param_filename": potential_filename}), store_force_constants=False, min_length=18, generate_frequencies_eigenvectors_kwargs={"units": "THz"}, force_field_name="GAP", ).make(structure=structure) bm = PhononBenchmarkMaker(name="Benchmark").make( structure=structure, benchmark_mp_id = "mp-22905", displacement=0.01, atomwise_regularization_parameter=0.1, soap_dict={'n_sparse': 6000, 'delta': 0.5}, suffix="", # exemplary values ml_phonon_task_doc = phojob.output, dft_phonon_task_doc = dft_reference) comp_bm = write_benchmark_metrics( benchmark_structures=[structure], metrics=[[bm.output]], ) run_locally([phojob, bm, comp_bm], create_folders=True, store=store) ``` -------------------------------- ### Successful LAMMPS Installation Output Source: https://github.com/autoatml/autoplex/blob/main/README.md This is the expected output when the LAMMPS Python interface is successfully installed and initialized. It confirms the version and threading settings. ```bash LAMMPS (29 Aug 2024 - Update 1) OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) using 1 OpenMP thread(s) per MPI task >>> ``` -------------------------------- ### Initialize CompleteDFTvsMLBenchmarkWorkflow Source: https://github.com/autoatml/autoplex/blob/main/docs/user/phonon/flows/flows.md Construct the `CompleteDFTvsMLBenchmarkWorkflow` using `MPRester` to fetch structures. This workflow is designed for benchmarking machine-learned potentials against DFT results for phonon calculations. ```python from mp_api.client import MPRester from autoplex.auto.phonons.flows import CompleteDFTvsMLBenchmarkWorkflow mpr = MPRester(api_key='YOUR_MP_API_KEY') structure_list = [] benchmark_structure_list = [] mpids = ["mp-22905"] ``` -------------------------------- ### Combine Existing Dataset with RSS for New MLIP Training Source: https://github.com/autoatml/autoplex/blob/main/docs/user/rss/flow/quick_start/start.md Illustrates how to initialize an RSS workflow that merges an existing dataset with newly generated RSS structures to train a new MLIP. This is useful when you have prior data or no trained MLIP yet. ```python from autoplex.auto.rss.config import RssConfig rss_config = RssConfig.from_file('path/to/your/config.yaml') rss_job = RssMaker(name="your workflow name", rss_config=rss_config).make( pre_database_dir='path/to/pre-existing/database') ``` -------------------------------- ### Install GCC and Gfortran for AIRSS Source: https://github.com/autoatml/autoplex/blob/main/README.md Installs the necessary GCC and Gfortran compilers (version 5 and above) required for building AIRSS utilities on Ubuntu/Debian systems. ```bash apt install -y build-essential gfortran ``` -------------------------------- ### Configure CASTEP Static Calculation Parameters Source: https://github.com/autoatml/autoplex/blob/main/docs/user/rss/flow/input/input.md Initialize a CastepStaticMaker with user-defined parameters for cutoff energy, XC functional, SCF convergence, and k-point settings. Ensure these parameters are tuned for your specific system to guarantee convergence. ```python from autoplex.settings import RssConfig from autoplex.auto.rss.flows import RssMaker from autoplex.misc.castep.jobs import CastepStaticMaker from autoplex.misc.castep.utils import CastepStaticSetGenerator castep_maker = CastepStaticMaker( name="static_castep", input_set_generator=CastepStaticSetGenerator( user_param_settings={ "cut_off_energy": 600.0, "xc_functional": "PBE", "max_scf_cycles": 1000, "elec_energy_tol": 1e-5, "smearing_scheme": "Gaussian", "smearing_width": 0.05, "spin_polarized": False, "finite_basis_corr": "automatic", "perc_extra_bands": 100 }, user_cell_settings={ "kpoint_mp_spacing": 0.03, "symmetry_generate": True, }, ), ) ``` -------------------------------- ### Load RSS Configuration and Create RSS Job Source: https://github.com/autoatml/autoplex/blob/main/docs/user/rss/flow/input/input.md Load an RSS configuration from a file and then create an RssMaker instance. Ensure that the static energy maker and static energy maker for isolated atoms are provided as per the specific requirements of your project. ```python rss_config = RssConfig.from_file('/path/to/rss/config/file') rss_job = RssMaker(name="Si_rss", rss_config=rss_config, static_energy_maker=# code-specific static maker, see above static_energy_maker_isolated_atoms=# code-specific static maker, see above ).make() ``` -------------------------------- ### Autoplex Workflow Results Summary Example Source: https://github.com/autoatml/autoplex/blob/main/docs/user/phonon/flows/flows.md Example summary of essential results from an Autoplex workflow run, including potential type, structure, RMSE, and parameters. ```text Potential Structure MPID Displacement (Å) RMSE (THz) imagmodes(pot) imagmodes(dft) Database type (Hyper-)Parameters GAP LiCl mp-22905 0.01 0.57608 False False full atom-wise f=0.1: n_sparse = 6000, SOAP delta = 0.5 ``` -------------------------------- ### Generate RSS Data and Train MLIP Source: https://github.com/autoatml/autoplex/blob/main/docs/user/rss/flow/quick_start/start.md This snippet shows how to initialize an RSS configuration, generate a new RSS dataset, preprocess and merge it with existing data, and then train an MLIP model. Ensure your configuration file path and pre-existing database path are correctly specified. ```python from autoplex.settings import RssConfig from autoplex.auto.rss.flows import RssMaker from autoplex.fitting.common.flows import MLIPFitMaker from autoplex.data.common.jobs import preprocess_data rss_config = RssConfig.from_file('path/to/your/config.yaml') rss_job = RssMaker(name="your workflow name", rss_config=rss_config).make() data_preprocessing_job = preprocess_data( dft_ref_dir=rss_job.output["mlip_path"], # The path to store the RSS dataset can be read from the previous job. pre_database_dir='path/to/pre-existing/database', # The path to store the pre-existing dataset that you'd like to merge. ) fitting_job = MLIPFitMaker( mlip_type="MACE", # Select the potential model you want to use for training. ref_energy_name="REF_energy", # Define the name of the labels you are using. ref_force_name="REF_forces", ref_virial_name="REF_virial", apply_data_preprocessing=False, ).make( isolated_atom_energies=rss_job.output["isolated_atom_energies"], database_dir=data_preprocessing_job.output, device='cuda', **fit_kwargs, # define the hyperparameters for potential training here. ) jobs = [rss_job, data_preprocessing_job, fitting_job] ``` -------------------------------- ### Check for Errors in Jobflow Project Setup Source: https://github.com/autoatml/autoplex/blob/main/docs/user/jobflowremote.md This command performs a more comprehensive check of your jobflow-remote setup, including MongoDB connection verification. Use it to diagnose any issues. ```bash jf project check --errors ``` -------------------------------- ### Install autoplex with workflow managers Source: https://github.com/autoatml/autoplex/blob/main/docs/user/installation/installation.md Installs autoplex along with optional support for workflow managers like FireWorks and jobflow-remote. This command enables advanced workflow capabilities. ```bash pip install autoplex[strict,workflow-managers] ``` -------------------------------- ### Build Documentation Locally Source: https://github.com/autoatml/autoplex/blob/main/docs/dev/dev_install.md Build the autoplex documentation using sphinx-build, outputting to the _build directory. The -W flag will treat warnings as errors. ```bash sphinx-build -W docs _build ``` -------------------------------- ### Start Jobflow Runner in Interactive Mode Source: https://github.com/autoatml/autoplex/blob/main/docs/user/jobflowremote.md Starts the Jobflow runner daemon in single-process interactive mode, enabling MFA login with OTP. Requires manual confirmation for host connection and subsequent password/OTP entry. ```bash jf runner start -s -i ``` -------------------------------- ### Troubleshoot Stuck Tests Source: https://github.com/autoatml/autoplex/blob/main/docs/dev/dev_install.md Prefix pytest with OMP_NUM_THREADS=1 to resolve issues where test execution gets stuck. ```bash OMP_NUM_THREADS=1 pytest ``` -------------------------------- ### Check Jobflow Project Setup Source: https://github.com/autoatml/autoplex/blob/main/docs/user/jobflowremote.md Verify that your jobflow-remote project is set up correctly. This command checks worker configuration and connection status. ```bash jf project check -w example_worker ``` -------------------------------- ### Update User INCAR Settings Source: https://github.com/autoatml/autoplex/blob/main/docs/user/phonon/flows/fitting/fitting.md Modifies the VASP INCAR settings for the Autoplex flow. This example specifically sets the NPAR parameter to 4. ```python autoplex_flow = update_user_incar_settings(autoplex_flow, {"NPAR": 4}) ``` -------------------------------- ### Create atomate2 Directory Scaffold Source: https://github.com/autoatml/autoplex/blob/main/docs/user/mongodb.md Creates the necessary directory structure for atomate2, including configuration and log directories. ```bash mkdir -p atomate2/{config,logs} ``` -------------------------------- ### Run Benchmark with Pre-existing DFT and GAP Potential Source: https://github.com/autoatml/autoplex/blob/main/docs/user/phonon/flows/benchmark/benchmark.md Template for running or repeating a phonon benchmark using pre-existing DFT calculations and a GAP potential. Requires DFT data in the form of a `PhononBSDOSDoc` task document object. Sets environment variables for threading and configures the job store. ```python #!/usr/bin/env python import os from atomate2.common.schemas.phonons import PhononBSDOSDoc from atomate2.forcefields.jobs import ForceFieldRelaxMaker, ForceFieldStaticMaker from mp_api.client import MPRester from autoplex.benchmark.phonons.flows import PhononBenchmarkMaker from atomate2.forcefields.flows.phonons import PhononMaker from autoplex.benchmark.phonons.jobs import write_benchmark_metrics from monty.serialization import loadfn from jobflow import SETTINGS from jobflow import run_locally os.environ["OMP_NUM_THREADS"] = "48" os.environ["OPENBLAS_NUM_THREADS"] = "1" store = SETTINGS.JOB_STORE ``` -------------------------------- ### Add Julia ACEpotentials Dependencies Source: https://github.com/autoatml/autoplex/blob/main/docs/user/installation/installation.md Configures Julia's package manager to add necessary registries and install the ACEpotentials package along with DataFrames and CSV. ```bash julia -e 'using Pkg; Pkg.Registry.add("General"); Pkg.Registry.add(Pkg.Registry.RegistrySpec(url="https://github.com/ACEsuit/ACEregistry")); Pkg.add(Pkg.PackageSpec(;name="ACEpotentials", version="0.6.7")); Pkg.add("DataFrames"); Pkg.add("CSV")' ``` -------------------------------- ### Set Autoplex Flow Name Source: https://github.com/autoatml/autoplex/blob/main/docs/user/phonon/flows/fitting/fitting.md Assigns a descriptive name to the Autoplex flow. This example names the flow 'small Sn test, test without phonon2'. ```python autoplex_flow.name = "small Sn test, test without phonon2" ``` -------------------------------- ### Benchmark MLIP Phonons Against DFT with PhononBenchmarkMaker Source: https://context7.com/autoatml/autoplex/llms.txt Benchmark a fitted MLIP against DFT phonon calculations using PhononBenchmarkMaker. This computes band-structure RMSE and generates diagnostic plots. Requires `ml_phonon_task_doc` and `dft_phonon_task_doc` from atomate2 runs. ```python from autoplex.benchmark.phonons.flows import PhononBenchmarkMaker from jobflow import run_locally # ml_phonon_task_doc and dft_phonon_task_doc are PhononBSDOSDoc objects # obtained from atomate2 PhononMaker runs benchmark_job = PhononBenchmarkMaker().make( ml_model="GAP", structure=structure, # pymatgen Structure benchmark_mp_id="mp-22905", ml_phonon_task_doc=ml_doc, dft_phonon_task_doc=dft_doc, displacement=0.01, atomwise_regularization_parameter=0.1, soap_dict={"n_sparse": 6000, "delta": 1.0}, suffix="", ) run_locally(benchmark_job, create_folders=True) # Outputs: RMSE (THz), band structure comparison PNG, q-point RMSE PNG ```