ipsuite.analysis package¶
Subpackages¶
- ipsuite.analysis.model package
- Submodules
- ipsuite.analysis.model.dynamics module
BoxHeatUpBoxHeatUp.dataBoxHeatUp.flux_dataBoxHeatUp.frictionBoxHeatUp.get_atoms()BoxHeatUp.max_temperatureBoxHeatUp.modelBoxHeatUp.model_outsBoxHeatUp.plot_temperature()BoxHeatUp.plotsBoxHeatUp.repeatBoxHeatUp.run()BoxHeatUp.start_temperatureBoxHeatUp.stepsBoxHeatUp.stop_temperatureBoxHeatUp.time_step
BoxScaleMDStabilityMDStability.binsMDStability.checksMDStability.dataMDStability.framesMDStability.get_plots()MDStability.initial_temperatureMDStability.max_stepsMDStability.modelMDStability.model_outsMDStability.plots_dirMDStability.run()MDStability.save_last_nMDStability.seedMDStability.stable_steps_dfMDStability.time_stepMDStability.traj_file
RattleAnalysisrun_stability_nve()
- ipsuite.analysis.model.dynamics_checks module
- ipsuite.analysis.model.math module
- ipsuite.analysis.model.plots module
- ipsuite.analysis.model.predict module
CalibrationMetricsCalibrationMetrics.data_fileCalibrationMetrics.energyCalibrationMetrics.force_dist_slicesCalibrationMetrics.forcesCalibrationMetrics.get_data()CalibrationMetrics.get_metrics()CalibrationMetrics.get_plots()CalibrationMetrics.plots_dirCalibrationMetrics.run()CalibrationMetrics.xCalibrationMetrics.y
ForceAnglesForceDecompositionForceDecomposition.get_histogram()ForceDecomposition.get_metrics()ForceDecomposition.get_plots()ForceDecomposition.histogram_pltForceDecomposition.rot_force_pltForceDecomposition.rot_forcesForceDecomposition.run()ForceDecomposition.trans_force_pltForceDecomposition.trans_forcesForceDecomposition.vib_force_pltForceDecomposition.vib_forcesForceDecomposition.wasserstein_distanceForceDecomposition.xForceDecomposition.y
ForceUncertaintyDecompositionForceUncertaintyDecomposition.get_metrics()ForceUncertaintyDecomposition.get_plots()ForceUncertaintyDecomposition.plots_dirForceUncertaintyDecomposition.rot_forcesForceUncertaintyDecomposition.run()ForceUncertaintyDecomposition.trans_forcesForceUncertaintyDecomposition.vib_forcesForceUncertaintyDecomposition.xForceUncertaintyDecomposition.y
PredictionPredictionMetricsPredictionMetrics.data_filePredictionMetrics.energyPredictionMetrics.figure_ymaxPredictionMetrics.forcesPredictionMetrics.get_content()PredictionMetrics.get_data()PredictionMetrics.get_metrics()PredictionMetrics.get_plots()PredictionMetrics.plots_dirPredictionMetrics.run()PredictionMetrics.stressPredictionMetrics.stress_deviatPredictionMetrics.stress_hydroPredictionMetrics.xPredictionMetrics.y
decompose_force_uncertainty()
- Module contents
BoxHeatUpBoxHeatUp.dataBoxHeatUp.flux_dataBoxHeatUp.frictionBoxHeatUp.get_atoms()BoxHeatUp.max_temperatureBoxHeatUp.modelBoxHeatUp.model_outsBoxHeatUp.plot_temperature()BoxHeatUp.plotsBoxHeatUp.repeatBoxHeatUp.run()BoxHeatUp.start_temperatureBoxHeatUp.stepsBoxHeatUp.stop_temperatureBoxHeatUp.time_step
BoxScaleCalibrationMetricsCalibrationMetrics.data_fileCalibrationMetrics.energyCalibrationMetrics.force_dist_slicesCalibrationMetrics.forcesCalibrationMetrics.get_data()CalibrationMetrics.get_metrics()CalibrationMetrics.get_plots()CalibrationMetrics.plots_dirCalibrationMetrics.run()CalibrationMetrics.xCalibrationMetrics.y
ForceAnglesForceDecompositionForceDecomposition.get_histogram()ForceDecomposition.get_metrics()ForceDecomposition.get_plots()ForceDecomposition.histogram_pltForceDecomposition.rot_force_pltForceDecomposition.rot_forcesForceDecomposition.run()ForceDecomposition.trans_force_pltForceDecomposition.trans_forcesForceDecomposition.vib_force_pltForceDecomposition.vib_forcesForceDecomposition.wasserstein_distanceForceDecomposition.xForceDecomposition.y
ForceUncertaintyDecompositionForceUncertaintyDecomposition.get_metrics()ForceUncertaintyDecomposition.get_plots()ForceUncertaintyDecomposition.plots_dirForceUncertaintyDecomposition.rot_forcesForceUncertaintyDecomposition.run()ForceUncertaintyDecomposition.trans_forcesForceUncertaintyDecomposition.vib_forcesForceUncertaintyDecomposition.xForceUncertaintyDecomposition.y
MDStabilityMDStability.binsMDStability.checksMDStability.dataMDStability.framesMDStability.get_plots()MDStability.initial_temperatureMDStability.max_stepsMDStability.modelMDStability.model_outsMDStability.plots_dirMDStability.run()MDStability.save_last_nMDStability.seedMDStability.stable_steps_dfMDStability.time_stepMDStability.traj_file
PredictionPredictionMetricsPredictionMetrics.data_filePredictionMetrics.energyPredictionMetrics.figure_ymaxPredictionMetrics.forcesPredictionMetrics.get_content()PredictionMetrics.get_data()PredictionMetrics.get_metrics()PredictionMetrics.get_plots()PredictionMetrics.plots_dirPredictionMetrics.run()PredictionMetrics.stressPredictionMetrics.stress_deviatPredictionMetrics.stress_hydroPredictionMetrics.xPredictionMetrics.y
RattleAnalysis
Submodules¶
ipsuite.analysis.bin_property module¶
- class ipsuite.analysis.bin_property.DipoleHistogram(*args, **kwargs)[source]¶
Bases:
LabelHistogramCreates a histogram of all dipole labels contained in a dataset.
- data: list[ase.Atoms]¶
- datalabel: str = 'dipole'¶
- xlabel: str = '$\\mu$ / eV Ang'¶
- class ipsuite.analysis.bin_property.EnergyHistogram(*args, **kwargs)[source]¶
Bases:
LabelHistogramCreates a histogram of all energy labels contained in a dataset.
- data: list[ase.Atoms]¶
- datalabel: str = 'energy'¶
- xlabel: str = '$E$ / eV'¶
- class ipsuite.analysis.bin_property.EnergyUncertaintyHistogram(*args, **kwargs)[source]¶
Bases:
LabelHistogramCreates a histogram of all energy uncertainties in a prediction.
- data: list[ase.Atoms]¶
- datalabel: str = 'energy-uncertainty'¶
- xlabel: str = '$\\sigma(E)$ / eV'¶
- class ipsuite.analysis.bin_property.ForcesHistogram(*args, **kwargs)[source]¶
Bases:
LabelHistogramCreates a histogram of all force labels contained in a dataset.
- data: list[ase.Atoms]¶
- datalabel: str = 'forces'¶
- xlabel: str = '$F$ / eV/Ang'¶
- class ipsuite.analysis.bin_property.ForcesUncertaintyHistogram(*args, **kwargs)[source]¶
Bases:
LabelHistogramCreates a histogram of all force uncertainties in a prediction.
- data: list[ase.Atoms]¶
- datalabel: str = 'forces-uncertainty'¶
- xlabel: str = '$\\sigma(F)$ / eV/Ang'¶
- class ipsuite.analysis.bin_property.LabelHistogram(*args, **kwargs)[source]¶
Bases:
AnalyseAtomsBase class for creating histogram of a dataset.
Parameters¶
- data: list
List of Atoms objects.
- bins: int | str
Number of bins in the histogram, or string indicating how to find the number of bins. See https://numpy.org/devdocs/reference/generated/numpy.histogram_bin_edges.html#numpy.histogram_bin_edges
- bins: int | str = 'auto'¶
- labels_df: DataFrame = NOT_AVAILABLE¶
- logy_scale: bool = True¶
- metrics: float = NOT_AVAILABLE¶
- plots_dir: Path = PosixPath('$nwd$/plots')¶
- x_lim: tuple = None¶
- y_lim: tuple = None¶
- class ipsuite.analysis.bin_property.StressHistogram(*args, **kwargs)[source]¶
Bases:
AnalyseAtomsCreates histograms for the hydrostatic and deviatoric components of the stress tensor.
Parameters¶
- data: list
List of Atoms objects.
- bins: int
Number of bins in the histogram.
- bins: int = None¶
- data: list[ase.Atoms]¶
- labels_df: DataFrame = NOT_AVAILABLE¶
- logy_scale: bool = True¶
- plots_dir: Path = PosixPath('$nwd$/plots')¶
ipsuite.analysis.bond_stretch module¶
- class ipsuite.analysis.bond_stretch.BondStretchAnalyses(*args, **kwargs)[source]¶
Bases:
ProcessAtoms- Analyses a Model by evaluating the elongation of a bond
in terms of energy, forces and optionally the uncertainty.
Attributes¶
- ase_calculator: ase.calculator
ase calculator to use for simulation
- idxs: [int, int]
indices of the two atoms that should be analyzed
- r_min: float
minimal bond length
- r_max: float
maximal bond length
- n_steps: int
number of steps that should be used for the bond elongation
- data_id: int
index of the structure in the list of structures used for the bond stretch analyses
- fig_size: (float, float)
size of the plot
- ase_calculator: Any¶
- data_id: int | None = 0¶
- fig_size: Tuple[int, int] = (10, 7)¶
- idxs: Tuple[int, int]¶
- n_steps: int¶
- plots_dir: Path = PosixPath('$nwd$/plots')¶
- r_max: float¶
- r_min: float¶
ipsuite.analysis.ensemble module¶
ipsuite.analysis.md module¶
- class ipsuite.analysis.md.AnalyseDensity(*, name: str | None = None, always_changed: bool = False, data: list[ase.atoms.Atoms], window: int = 1000, start: int = 0, end: int = None, figure: pathlib.Path = PosixPath('$nwd$/density.png'))[source]¶
Bases:
AnalyseAtoms- data: list[ase.Atoms]¶
- density: dict = NOT_AVAILABLE¶
- end: int = None¶
- figure: Path = PosixPath('$nwd$/density.png')¶
- results: DataFrame = NOT_AVAILABLE¶
- start: int = 0¶
- window: int = 1000¶
ipsuite.analysis.sensitivity module¶
- class ipsuite.analysis.sensitivity.AnalyseGlobalForceSensitivity(*, name: str | None = None, always_changed: bool = False, atoms_list: list[ase.atoms.Atoms], plots: pathlib.Path = PosixPath('$nwd$/plots'))[source]¶
Bases:
IPSNode- atoms_list: list[Atoms]¶
- plots: Path = PosixPath('$nwd$/plots')¶
- class ipsuite.analysis.sensitivity.AnalyseSingleForceSensitivity(*, name: str | None = None, always_changed: bool = False, data: list[list[ase.atoms.Atoms]], sim_list: list, alpha: float = 0.05, sensitivity_plot: str = PosixPath('$nwd$/sensitivity.png'))[source]¶
Bases:
IPSNode- alpha: float = 0.05¶
- data: list[list[Atoms]]¶
- sensitivity: DataFrame = NOT_AVAILABLE¶
- sensitivity_plot: str = PosixPath('$nwd$/sensitivity.png')¶
- sim_list: list¶
- class ipsuite.analysis.sensitivity.IsConstraintMD(*args, **kwargs)[source]¶
Bases:
ProtocolProtocol for objects that have a results attribute.
- radius: float¶
- selected_atom_id: int¶
- class ipsuite.analysis.sensitivity.MoveSingleParticle(*args, **kwargs)[source]¶
Bases:
IPSNodeMove a single particle in a given direction.
- atom_id: int = 0¶
- atoms: list = NOT_AVAILABLE¶
- atoms_list: Any¶
- atoms_list_id: int = 0¶
- atoms_path: Path = PosixPath('$nwd$/atoms')¶
- samples: int = 10¶
- scale: float = 0.5¶
- seed: int = 1234¶
- ipsuite.analysis.sensitivity.nonuniform_imshow(ax, x, y, z, aspect=1, cmap=<matplotlib.colors.LinearSegmentedColormap object>)[source]¶
Plot a non-uniformly sampled 2D array.
References¶
adapted from https://stackoverflow.com/a/53780594/10504481
Module contents¶
- class ipsuite.analysis.AllowedStructuresFilter(*args, **kwargs)[source]¶
Bases:
IPSNodeSearch a given dataset for outliers.
Iterates all structures in the dataset, uses covalent radii to determine the atoms in each molecule, and checks if the molecule is allowed.
Attributes¶
- datalist[ase.Atoms]
The dataset to search.
- moleculeslist[ase.Atoms], optional
The molecules that are allowed.
- smileslist[str], optional
The SMILES strings of the allowed molecules.
- cutoffsdict[str, float] | None, optional
The cutoffs for each element. If None, use the ase.data.covalent_radii. Default: None
- cutoffs: dict[str, float] | None = None¶
- data: list[Atoms]¶
- property excluded_frames: list[Atoms]¶
- fail: bool = False¶
- property frames: list[Atoms]¶
- molecules: list[Atoms]¶
- outliers: list[int] = NOT_AVAILABLE¶
- smiles: list[str]¶
- class ipsuite.analysis.AnalyseDensity(*, name: str | None = None, always_changed: bool = False, data: list[ase.atoms.Atoms], window: int = 1000, start: int = 0, end: int = None, figure: pathlib.Path = PosixPath('$nwd$/density.png'))[source]¶
Bases:
AnalyseAtoms- data: list[ase.Atoms]¶
- density: dict = NOT_AVAILABLE¶
- end: int = None¶
- figure: Path = PosixPath('$nwd$/density.png')¶
- results: DataFrame = NOT_AVAILABLE¶
- start: int = 0¶
- window: int = 1000¶
- class ipsuite.analysis.AnalyseGlobalForceSensitivity(*, name: str | None = None, always_changed: bool = False, atoms_list: list[ase.atoms.Atoms], plots: pathlib.Path = PosixPath('$nwd$/plots'))[source]¶
Bases:
IPSNode- atoms_list: list[Atoms]¶
- plots: Path = PosixPath('$nwd$/plots')¶
- class ipsuite.analysis.AnalyseSingleForceSensitivity(*, name: str | None = None, always_changed: bool = False, data: list[list[ase.atoms.Atoms]], sim_list: list, alpha: float = 0.05, sensitivity_plot: str = PosixPath('$nwd$/sensitivity.png'))[source]¶
Bases:
IPSNode- alpha: float = 0.05¶
- data: list[list[Atoms]]¶
- sensitivity: DataFrame = NOT_AVAILABLE¶
- sensitivity_plot: str = PosixPath('$nwd$/sensitivity.png')¶
- sim_list: list¶
- class ipsuite.analysis.AnalyseStructureMeanForce(*args, **kwargs)[source]¶
Bases:
IPSNodeAnalyze mean force magnitude across atomic configurations.
Computes the magnitude of the total force vector (sum of all atomic forces) for each configuration. For well-converged periodic structures, this should approach zero. Useful for checking DFT convergence, force consistency, and identifying problematic structures in datasets.
Parameters¶
- datalist[ase.Atoms]
Atomic configurations with calculated forces to analyze.
Attributes¶
- forcesdict
Statistical summary containing mean, std, min, max force magnitudes.
- figure_pathPath
Path to the generated force analysis plot.
Examples¶
>>> model = ips.MACEMPModel() >>> with project: ... data = ips.AddData(file="ethanol.xyz") ... calc_data = ips.ApplyCalculator(data=data.frames, model=model) ... force_analysis = ips.AnalyseStructureMeanForce(data=calc_data.frames) >>> project.repro() >>> print(f"Mean force magnitude: {force_analysis.forces['mean']:.4f} eV/Å") Mean force magnitude: 0.0000 eV/Å
- data: list[Atoms]¶
- figure_path: Path = PosixPath('$nwd$/forces.png')¶
- forces: dict = NOT_AVAILABLE¶
- class ipsuite.analysis.BondStretchAnalyses(*args, **kwargs)[source]¶
Bases:
ProcessAtoms- Analyses a Model by evaluating the elongation of a bond
in terms of energy, forces and optionally the uncertainty.
Attributes¶
- ase_calculator: ase.calculator
ase calculator to use for simulation
- idxs: [int, int]
indices of the two atoms that should be analyzed
- r_min: float
minimal bond length
- r_max: float
maximal bond length
- n_steps: int
number of steps that should be used for the bond elongation
- data_id: int
index of the structure in the list of structures used for the bond stretch analyses
- fig_size: (float, float)
size of the plot
- ase_calculator: Any¶
- data: list[ase.Atoms]¶
- data_id: int | None = 0¶
- fig_size: Tuple[int, int] = (10, 7)¶
- idxs: Tuple[int, int]¶
- n_steps: int¶
- plots_dir: Path = PosixPath('$nwd$/plots')¶
- r_max: float¶
- r_min: float¶
- class ipsuite.analysis.BoxHeatUp(*args, **kwargs)[source]¶
Bases:
ProcessSingleAtomPerform a heat-up analysis by gradually increasing the temperature of the system and monitoring the measured temperature and energy.
Parameters¶
- start_temperaturefloat
The initial temperature (in Kelvin) to start the analysis.
- stop_temperaturefloat
The upper bound of the temperature range (in Kelvin).
- stepsint
Number of temperature increments between start and stop temperature.
- time_stepfloat, optional
Time step of the simulation in femtoseconds. Default is 0.5 fs.
- frictionfloat
Langevin friction coefficient.
- repeattuple of int, optional
Number of repetitions of the unit cell in each direction. Default is (1, 1, 1).
- max_temperaturefloat or None, optional
Maximum allowed temperature before stopping the simulation. If None, set to 1.5 * stop_temperature.
- modeltyping.Any
The MLModel node that implements the ‘get_calculator’ method.
- model_outspathlib.Path
Output directory for model results.
- plotspathlib.Path
Path to save the temperature plot.
Attributes¶
- flux_datapd.DataFrame
DataFrame containing measured temperature, total energy, and set temperature at each step.
- steps_before_explosionint
Number of steps completed before exceeding max_temperature, or -1 if not exceeded.
- frameslist of ase.Atoms
List of atomic configurations at each step.
- data: List[ase.Atoms]¶
- flux_data: DataFrame = NOT_AVAILABLE¶
- friction: float¶
- max_temperature: float | None = None¶
- model: Any¶
- model_outs: Path = PosixPath('$nwd$/model')¶
- plots: Path = PosixPath('$nwd$/temperature.png')¶
- repeat: tuple[int, int, int] = (1, 1, 1)¶
- start_temperature: float¶
- steps: int¶
- stop_temperature: float¶
- time_step: float = 0.5¶
- class ipsuite.analysis.BoxScale(*args, **kwargs)[source]¶
Bases:
ProcessSingleAtomScale all particles and predict energies.
Attributes¶
model: The MLModel node that implements the ‘predict’ method atoms: list[Atoms] to predict properties for start: int, default = None
The initial box scale, default value is the original box size.
- stop: float, default = 1.0
The stop value for the generated space of stdev points
- num: int, default = 100
The size of the generated space of stdev points
- data: List[ase.Atoms]¶
- energies: DataFrame = NOT_AVAILABLE¶
- mapping: Any | None = None¶
- model_outs: Path = PosixPath('$nwd$/model')¶
- num: int = 100¶
- plot: Path = PosixPath('$nwd$/energy.png')¶
- start: float = 1¶
- stop: float = 2.0¶
- class ipsuite.analysis.CalibrationMetrics(*args, **kwargs)[source]¶
Bases:
ComparePredictionsAnalyse the calibration of a models uncertainty estimate. Plots the empirical vs predicted error distribution, a log-log calibration plot and the miscalibration area. Further, various UQ metrics are computed: - Mean absolute calibration error - Root mean square miscalibration error - Miscalibration area - NLL - RLL
For more information checkout the uncertainty toolbox or the following paper: 10.1088/2632-2153/ad594a
Parameters¶
- force_dist_slices: List[tuple]
Interval in which to analyse the gassianity of error distributions.
- data_file: Path = PosixPath('$nwd$/data.npz')¶
- energy: dict = NOT_AVAILABLE¶
- force_dist_slices: List[tuple] | None = None¶
- forces: dict = NOT_AVAILABLE¶
- plots_dir: Path = PosixPath('$nwd$/plots')¶
- x: list[ase.Atoms]¶
- y: list[ase.Atoms]¶
- class ipsuite.analysis.CollectMDSteps(*, name: str | None = None, always_changed: bool = False, mds: list[ipsuite.dynamics.md_nodes.ASEMD])[source]¶
Bases:
IPSNode- metrics: dict = NOT_AVAILABLE¶
- class ipsuite.analysis.DipoleHistogram(*args, **kwargs)[source]¶
Bases:
LabelHistogramCreates a histogram of all dipole labels contained in a dataset.
- data: list[ase.Atoms]¶
- datalabel: str = 'dipole'¶
- xlabel: str = '$\\mu$ / eV Ang'¶
- class ipsuite.analysis.EnergyHistogram(*args, **kwargs)[source]¶
Bases:
LabelHistogramCreates a histogram of all energy labels contained in a dataset.
- data: list[ase.Atoms]¶
- datalabel: str = 'energy'¶
- xlabel: str = '$E$ / eV'¶
- class ipsuite.analysis.EnergyUncertaintyHistogram(*args, **kwargs)[source]¶
Bases:
LabelHistogramCreates a histogram of all energy uncertainties in a prediction.
- data: list[ase.Atoms]¶
- datalabel: str = 'energy-uncertainty'¶
- xlabel: str = '$\\sigma(E)$ / eV'¶
- class ipsuite.analysis.ForceAngles(*, name: str | None = None, always_changed: bool = False, x: list[ase.atoms.Atoms], y: list[ase.atoms.Atoms], plot: pathlib.Path = PosixPath('$nwd$/angle.png'), log_plot: pathlib.Path = PosixPath('$nwd$/angle_ylog.png'))[source]¶
Bases:
ComparePredictions- angles: dict = NOT_AVAILABLE¶
- log_plot: Path = PosixPath('$nwd$/angle_ylog.png')¶
- plot: Path = PosixPath('$nwd$/angle.png')¶
- x: list[ase.Atoms]¶
- y: list[ase.Atoms]¶
- class ipsuite.analysis.ForceDecomposition(*args, **kwargs)[source]¶
Bases:
ComparePredictionsNode for decomposing forces in a system of molecular units into translational, rotational and vibrational components.
The implementation follows the method described in https://doi.org/10.26434/chemrxiv-2022-l4tb9
Currently, single atoms and diatomic molecules are simply filtered out. Please raise an issue if you need those cases to be treated correctly in your work.
Attributes¶
- wasserstein_distance: float
Compute the wasserstein distance between the distributions of the predicted and true forces for each trans, rot, vib component.
- histogram_plt: Path = PosixPath('$nwd$/histogram.png')¶
- rot_force_plt: Path = PosixPath('$nwd$/rot_force.png')¶
- rot_forces: dict = NOT_AVAILABLE¶
- trans_force_plt: Path = PosixPath('$nwd$/trans_force.png')¶
- trans_forces: dict = NOT_AVAILABLE¶
- vib_force_plt: Path = PosixPath('$nwd$/vib_force.png')¶
- vib_forces: dict = NOT_AVAILABLE¶
- wasserstein_distance: dict = NOT_AVAILABLE¶
- x: list[ase.Atoms]¶
- y: list[ase.Atoms]¶
- class ipsuite.analysis.ForceUncertaintyDecomposition(*args, **kwargs)[source]¶
Bases:
ComparePredictionsNode for decomposing force uncertainties in a system of molecular units into translational, rotational and vibrational components.
The implementation follows the method described in https://doi.org/10.26434/chemrxiv-2022-l4tb9
Currently, single atoms and diatomic molecules are simply filtered out. Please raise an issue if you need those cases to be treated correctly in your work.
- plots_dir: Path = PosixPath('$nwd$/plots')¶
- rot_forces: dict = NOT_AVAILABLE¶
- trans_forces: dict = NOT_AVAILABLE¶
- vib_forces: dict = NOT_AVAILABLE¶
- x: list[ase.Atoms]¶
- y: list[ase.Atoms]¶
- class ipsuite.analysis.ForcesHistogram(*args, **kwargs)[source]¶
Bases:
LabelHistogramCreates a histogram of all force labels contained in a dataset.
- data: list[ase.Atoms]¶
- datalabel: str = 'forces'¶
- xlabel: str = '$F$ / eV/Ang'¶
- class ipsuite.analysis.ForcesUncertaintyHistogram(*args, **kwargs)[source]¶
Bases:
LabelHistogramCreates a histogram of all force uncertainties in a prediction.
- data: list[ase.Atoms]¶
- datalabel: str = 'forces-uncertainty'¶
- xlabel: str = '$\\sigma(F)$ / eV/Ang'¶
- class ipsuite.analysis.MDStability(*args, **kwargs)[source]¶
Bases:
IPSNodePerform NVE molecular dynamics for all supplied atoms using a trained model. Several stability checks can be supplied to judge whether a particular trajectory is stable. If the check fails, the trajectory is terminated. After all trajectories are done, a histogram of the duration of stability is created.
Attributes¶
model: A node which implements the calc property. Typically an MLModel instance. data: list[Atoms] to run MD for for max_steps: Maximum number of steps for each trajectory time_step: MD integration time step initial_temperature: Initial velocities are drawn from a maxwell boltzman distribution. save_last_n: how many configurations before the instability should be saved bins: number of bins in the histogram seed: seed for the MaxwellBoltzmann distribution
- bins: int = None¶
- checks: list[Node] = None¶
- data: list[Atoms]¶
- property frames: List[Atoms]¶
- initial_temperature: float = 300¶
- max_steps: int¶
- model: Any¶
- model_outs: Path = PosixPath('$nwd$/model_outs')¶
- plots_dir: Path = PosixPath('$nwd$/plots')¶
- save_last_n: int = 1¶
- seed: int = 0¶
- stable_steps_df: DataFrame = NOT_AVAILABLE¶
- time_step: float = 0.5¶
- traj_file: Path = PosixPath('$nwd$/structures.h5')¶
- class ipsuite.analysis.MoveSingleParticle(*args, **kwargs)[source]¶
Bases:
IPSNodeMove a single particle in a given direction.
- atom_id: int = 0¶
- atoms: list = NOT_AVAILABLE¶
- atoms_list: Any¶
- atoms_list_id: int = 0¶
- atoms_path: Path = PosixPath('$nwd$/atoms')¶
- samples: int = 10¶
- scale: float = 0.5¶
- seed: int = 1234¶
- class ipsuite.analysis.Prediction(*args, **kwargs)[source]¶
Bases:
ProcessAtomsCreate and Save the predictions from model on atoms.
Attributes¶
model: The MLModel node that implements the ‘predict’ method atoms: list[Atoms] to predict properties for
predictions: list[Atoms] the atoms that have the predicted properties from model
- data: list[ase.Atoms]¶
- class ipsuite.analysis.PredictionMetrics(*args, **kwargs)[source]¶
Bases:
ComparePredictionsCompare model predictions against reference data with comprehensive metrics.
Computes and visualizes prediction accuracy for energy, forces, and stress with statistical measures including MAE, RMSE, and correlation coefficients. Useful for benchmarking different models and analyzing prediction quality.
Parameters¶
- xlist[ase.Atoms]
Reference (ground truth) atomic configurations with calculated properties.
- ylist[ase.Atoms]
Model predictions on the same configurations.
- figure_ymaxdict[str, float], optional
Y-axis limits for plots by property type (energy, forces, stress).
Attributes¶
- energydict
Energy prediction metrics (MAE, RMSE, R², etc.) in meV/atom.
- forcesdict
Force prediction metrics (MAE, RMSE, R², etc.) in meV/Å.
- stressdict
Stress prediction metrics in eV/ų.
- plots_dirPath
Directory containing generated comparison plots.
Examples¶
>>> medium_model = ips.MACEMPModel(model="medium") >>> small_model = ips.MACEMPModel(model="small") >>> with project: ... data = ips.AddData(file="ethanol.xyz") ... medium_data = ips.ApplyCalculator(data=data.frames, model=medium_model) ... small_data = ips.ApplyCalculator(data=data.frames, model=small_model) ... metrics = ips.PredictionMetrics(x=medium_data.frames, y=small_data.frames) >>> project.repro() >>> print(f"Energy MAE: {metrics.energy['mae']:.2f} meV/atom") Energy MAE: 52.23 meV/atom >>> print(f"Force MAE: {metrics.forces['mae']:.2f} meV/Å") Force MAE: 213.22 meV/Å
- data_file: Path = PosixPath('$nwd$/data.npz')¶
- energy: dict = NOT_AVAILABLE¶
- figure_ymax: dict[str, float]¶
- forces: dict = NOT_AVAILABLE¶
- plots_dir: Path = PosixPath('$nwd$/plots')¶
- stress: dict = NOT_AVAILABLE¶
- stress_deviat: dict = NOT_AVAILABLE¶
- stress_hydro: dict = NOT_AVAILABLE¶
- x: list[ase.Atoms]¶
- y: list[ase.Atoms]¶
- class ipsuite.analysis.RattleAnalysis(*args, **kwargs)[source]¶
Bases:
ProcessSingleAtomMove particles with a given stdev from a starting configuration and predict.
Attributes¶
model: The MLModel node that implements the ‘predict’ method atoms: list[Atoms] to predict properties for logspace: bool, default=True
Increase the stdev of rattle with ‘np.logspace’ instead of ‘np.linspace’
- stop: float, default = 1.0
The stop value for the generated space of stdev points
- num: int, default = 100
The size of the generated space of stdev points
- factor: float, default = 0.001
The ‘np.linspace(0.0, stop, num) * factor’
- atom_id: int, default = 0
The atom to pick from self.atoms as a starting point
- data: List[ase.Atoms]¶
- energies: DataFrame = NOT_AVAILABLE¶
- factor: float = 0.001¶
- logspace: bool = True¶
- model_outs: Path = PosixPath('$nwd$/model')¶
- num: int = 100¶
- seed: int = 1234¶
- stop: float = 3.0¶
- class ipsuite.analysis.StressHistogram(*args, **kwargs)[source]¶
Bases:
AnalyseAtomsCreates histograms for the hydrostatic and deviatoric components of the stress tensor.
Parameters¶
- data: list
List of Atoms objects.
- bins: int
Number of bins in the histogram.
- bins: int = None¶
- data: list[ase.Atoms]¶
- labels_df: DataFrame = NOT_AVAILABLE¶
- logy_scale: bool = True¶
- plots_dir: Path = PosixPath('$nwd$/plots')¶