ipsuite package¶
Subpackages¶
- ipsuite.analysis package
- Subpackages
- Submodules
- ipsuite.analysis.bin_property module
- ipsuite.analysis.bond_stretch module
- ipsuite.analysis.ensemble module
- ipsuite.analysis.md module
- ipsuite.analysis.sensitivity module
AnalyseGlobalForceSensitivityAnalyseSingleForceSensitivityAnalyseSingleForceSensitivity.alphaAnalyseSingleForceSensitivity.dataAnalyseSingleForceSensitivity.get_values()AnalyseSingleForceSensitivity.run()AnalyseSingleForceSensitivity.sensitivityAnalyseSingleForceSensitivity.sensitivity_plotAnalyseSingleForceSensitivity.sim_listAnalyseSingleForceSensitivity.t_confidence_interval()
IsConstraintMDMoveSingleParticlenonuniform_imshow()
- Module contents
AllowedStructuresFilterAnalyseDensityAnalyseGlobalForceSensitivityAnalyseSingleForceSensitivityAnalyseSingleForceSensitivity.alphaAnalyseSingleForceSensitivity.dataAnalyseSingleForceSensitivity.get_values()AnalyseSingleForceSensitivity.run()AnalyseSingleForceSensitivity.sensitivityAnalyseSingleForceSensitivity.sensitivity_plotAnalyseSingleForceSensitivity.sim_listAnalyseSingleForceSensitivity.t_confidence_interval()
AnalyseStructureMeanForceBondStretchAnalysesBondStretchAnalyses.ase_calculatorBondStretchAnalyses.dataBondStretchAnalyses.data_idBondStretchAnalyses.fig_sizeBondStretchAnalyses.get_plots()BondStretchAnalyses.idxsBondStretchAnalyses.n_stepsBondStretchAnalyses.plots_dirBondStretchAnalyses.r_maxBondStretchAnalyses.r_minBondStretchAnalyses.run()
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
CollectMDStepsDipoleHistogramEnergyHistogramEnergyUncertaintyHistogramForceAnglesForceDecompositionForceDecomposition.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
ForcesHistogramForcesUncertaintyHistogramMDStabilityMDStability.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
MoveSingleParticlePredictionPredictionMetricsPredictionMetrics.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
RattleAnalysisStressHistogram
- ipsuite.base package
- ipsuite.bootstrap package
- Submodules
- ipsuite.bootstrap.random_displacements module
- ipsuite.bootstrap.surface_mods module
- Module contents
- ipsuite.calculators package
- Submodules
- ipsuite.calculators.ase_geoopt module
ASEGeoOptASEGeoOpt.checksASEGeoOpt.constraintsASEGeoOpt.dataASEGeoOpt.data_idASEGeoOpt.dump_rateASEGeoOpt.framesASEGeoOpt.get_atoms()ASEGeoOpt.init_kwargsASEGeoOpt.log_fileASEGeoOpt.maxstepASEGeoOpt.modelASEGeoOpt.model_outsASEGeoOpt.optimizerASEGeoOpt.repeatASEGeoOpt.run()ASEGeoOpt.run_kwargsASEGeoOpt.sampling_rateASEGeoOpt.traj_file
- ipsuite.calculators.ase_md module
- ipsuite.calculators.ase_standard module
- ipsuite.calculators.cp2k module
CP2KSinglePointCP2KSinglePoint.cp2k_directoryCP2KSinglePoint.cp2k_filesCP2KSinglePoint.cp2k_paramsCP2KSinglePoint.cp2k_shellCP2KSinglePoint.dataCP2KSinglePoint.failed_configsCP2KSinglePoint.failure_policyCP2KSinglePoint.framesCP2KSinglePoint.get_calculator()CP2KSinglePoint.get_input_script()CP2KSinglePoint.output_fileCP2KSinglePoint.run()CP2KSinglePoint.wfn_restart_fileCP2KSinglePoint.wfn_restart_node
- ipsuite.calculators.lammps module
LammpsSimulatorLammpsSimulator.create_input_script()LammpsSimulator.dataLammpsSimulator.dump_fileLammpsSimulator.fill_atoms_with_life()LammpsSimulator.framesLammpsSimulator.get_atoms()LammpsSimulator.get_template()LammpsSimulator.lmp_directoryLammpsSimulator.lmp_exeLammpsSimulator.lmp_paramsLammpsSimulator.lmp_templateLammpsSimulator.log_fileLammpsSimulator.run()LammpsSimulator.skiprun
- ipsuite.calculators.orca module
- ipsuite.calculators.xtb module
xTBSinglePointxTBSinglePoint.accuracyxTBSinglePoint.chargexTBSinglePoint.dataxTBSinglePoint.electronic_temperaturexTBSinglePoint.get_calculator()xTBSinglePoint.initial_guessxTBSinglePoint.max_iterationsxTBSinglePoint.methodxTBSinglePoint.mixer_dampingxTBSinglePoint.multiplicityxTBSinglePoint.run()xTBSinglePoint.spin_polarization
- Module contents
ASEGeoOptASEGeoOpt.checksASEGeoOpt.constraintsASEGeoOpt.dataASEGeoOpt.data_idASEGeoOpt.dump_rateASEGeoOpt.framesASEGeoOpt.get_atoms()ASEGeoOpt.init_kwargsASEGeoOpt.log_fileASEGeoOpt.maxstepASEGeoOpt.modelASEGeoOpt.model_outsASEGeoOpt.optimizerASEGeoOpt.repeatASEGeoOpt.run()ASEGeoOpt.run_kwargsASEGeoOpt.sampling_rateASEGeoOpt.traj_file
CP2KSinglePointCP2KSinglePoint.cp2k_directoryCP2KSinglePoint.cp2k_filesCP2KSinglePoint.cp2k_paramsCP2KSinglePoint.cp2k_shellCP2KSinglePoint.dataCP2KSinglePoint.failed_configsCP2KSinglePoint.failure_policyCP2KSinglePoint.framesCP2KSinglePoint.get_calculator()CP2KSinglePoint.get_input_script()CP2KSinglePoint.output_fileCP2KSinglePoint.run()CP2KSinglePoint.wfn_restart_fileCP2KSinglePoint.wfn_restart_node
EMTSinglePointLJSinglePointLammpsSimulatorLammpsSimulator.create_input_script()LammpsSimulator.dataLammpsSimulator.dump_fileLammpsSimulator.fill_atoms_with_life()LammpsSimulator.framesLammpsSimulator.get_atoms()LammpsSimulator.get_template()LammpsSimulator.lmp_directoryLammpsSimulator.lmp_exeLammpsSimulator.lmp_paramsLammpsSimulator.lmp_templateLammpsSimulator.log_fileLammpsSimulator.run()LammpsSimulator.skiprun
MixCalculatorOrcaSinglePointPlumedModelxTBSinglePointxTBSinglePoint.accuracyxTBSinglePoint.chargexTBSinglePoint.dataxTBSinglePoint.electronic_temperaturexTBSinglePoint.get_calculator()xTBSinglePoint.initial_guessxTBSinglePoint.max_iterationsxTBSinglePoint.methodxTBSinglePoint.mixer_dampingxTBSinglePoint.multiplicityxTBSinglePoint.run()xTBSinglePoint.spin_polarization
- ipsuite.configuration_comparison package
- ipsuite.configuration_generation package
- Submodules
- ipsuite.configuration_generation.packmol module
- ipsuite.configuration_generation.smiles_to_atoms module
- Module contents
MultiPackmolPackmolSmiles2AtomsSmiles2ConformersSmiles2GromacsSmiles2Gromacs.cleanupSmiles2Gromacs.config_filesSmiles2Gromacs.countSmiles2Gromacs.densitySmiles2Gromacs.framesSmiles2Gromacs.fudgeLJSmiles2Gromacs.fudgeQQSmiles2Gromacs.itp_filesSmiles2Gromacs.labelsSmiles2Gromacs.maxwarnSmiles2Gromacs.mdp_filesSmiles2Gromacs.output_dirSmiles2Gromacs.pdb_filesSmiles2Gromacs.production_indicesSmiles2Gromacs.run()Smiles2Gromacs.smilesSmiles2Gromacs.toleranceSmiles2Gromacs.traj_file
- ipsuite.configuration_selection package
- Submodules
- ipsuite.configuration_selection.base module
- ipsuite.configuration_selection.filter module
- ipsuite.configuration_selection.index module
- ipsuite.configuration_selection.kernel module
- ipsuite.configuration_selection.random module
- ipsuite.configuration_selection.split module
- ipsuite.configuration_selection.threshold module
- ipsuite.configuration_selection.uniform_arange module
- ipsuite.configuration_selection.uniform_energetic module
- ipsuite.configuration_selection.uniform_temporal module
- Module contents
- ipsuite.data_loading package
- ipsuite.fields package
- ipsuite.geometry package
- ipsuite.models package
- ipsuite.project package
- ipsuite.static_data package
- ipsuite.utils package
Submodules¶
ipsuite.nodes module¶
Module contents¶
The ipsuite package.
- class ipsuite.ASEGeoOpt(*args, **kwargs)[source]¶
Bases:
IPSNodeGeometry optimization using ASE optimizers.
Parameters¶
- datalist[ase.Atoms]
Input atomic configurations to optimize.
- data_idint, default=-1
Index of the configuration to optimize from the data list.
- modelNodeWithCalculator
A model node that implements ‘get_calculator’ method.
- optimizerstr, default=”FIRE”
Name of the ASE optimizer to use (e.g., “FIRE”, “BFGS”, “LBFGS”).
- repeattuple[int, int, int], default=(1, 1, 1)
Repeat the unit cell in x, y, z directions.
- run_kwargsdict, default={“fmax”: 0.05}
Keyword arguments passed to the optimizer run method.
- init_kwargsdict, default={}
Keyword arguments passed to the optimizer initialization.
- maxstepint, optional
Maximum number of optimization steps to perform.
- sampling_rateint, default=1
How often to sample atomic configurations during optimization.
- dump_rateint, default=1000
How many configurations to cache before writing to file.
- checkslist, optional
List of check nodes for monitoring optimization progress.
- constraintslist, optional
List of constraint nodes to apply during optimization.
Attributes¶
- frameslist[ase.Atoms]
Optimized atomic configurations from the trajectory.
- traj_filePath
Path to the HDF5 trajectory file containing optimization steps.
Examples¶
>>> model = ips.MACEMPModel() >>> with project: ... data = ips.AddData(file="ethanol.xyz") ... geoopt = ips.ASEGeoOpt(data=data.frames, model=model, optimizer="FIRE") >>> project.repro() >>> print(f"Optimization completed with {len(geoopt.frames)} steps") Optimization completed with 74 steps
- checks: list = None¶
- constraints: list = None¶
- data: List[Atoms]¶
- data_id: int = -1¶
- dump_rate: int = 1000¶
- property frames: List[Atoms]¶
- init_kwargs: dict¶
- log_file: Path = PosixPath('$nwd$/opt.log')¶
- maxstep: int = None¶
- model: NodeWithCalculator¶
- model_outs: Path = PosixPath('$nwd$/model_outs')¶
- optimizer: str = 'FIRE'¶
- repeat: tuple[int, int, int] = (1, 1, 1)¶
- run_kwargs: dict¶
- sampling_rate: int = 1¶
- traj_file: Path = PosixPath('$nwd$/structures.h5')¶
- class ipsuite.ASEMD(*args, **kwargs)[source]¶
Bases:
NodeMolecular Dynamics simulation node using ASE.
Parameters¶
- modelNodeWithCalculator
The computational model/calculator used for force and energy calculations.
- datalist[ase.Atoms]
List of atomic structures to simulate.
- data_idsint or list[int], default -1
Indices of structures from data to simulate. If -1, simulates all structures.
- checkslist, optional
List of simulation checks/monitors to apply during the simulation.
- constraintslist, optional
List of constraints to apply to the atomic system.
- modifierslist, optional
List of modifiers to dynamically change simulation parameters.
- thermostatNodeWithThermostat
Thermostat object for temperature control during simulation.
- stepsint
Total number of MD steps to perform.
- sampling_rateint, default 1
Frequency of data sampling (every N steps).
- repeattuple[int, int, int], default (1, 1, 1)
Cell repetition factors in x, y, z directions.
- dump_rateint, default 1000
Frequency of writing trajectory data to disk.
- use_momentabool, default False
Whether to use existing atomic momenta or initialize with Maxwell-Boltzmann.
- seedint, default 42
Random seed for reproducible simulations.
Attributes¶
- metricsPath
Output path for simulation metrics (CSV files).
- frames_pathPath
Output path for trajectory frames (HDF5 files).
- model_outsPath
Output path for model-specific output files.
- laufband_pathPath
Path to the job queue database file.
- frameslist[ase.Atoms]
Property that returns all trajectory frames from saved files.
- structureslist[list[ase.Atoms]]
Property that returns structures organized by simulation run.
Examples¶
>>> thermostat = ips.LangevinThermostat(temperature=300, friction=0.05, time_step=0.5) >>> model = ips.MACEMPModel() >>> with project: ... data = ips.AddData(file="ethanol.xyz") ... md = ips.ASEMD( ... model=model, ... data=data.frames, ... thermostat=thermostat, ... steps=1000, ... ) >>> project.build()
- checks: list¶
- constraints: list¶
- data: list[Atoms]¶
- data_ids: int | list[int] = -1¶
- dump_rate: int = 1000¶
- property frames: list[Atoms]¶
- frames_path: Path = PosixPath('$nwd$/frames')¶
- laufband_path: Path = PosixPath('$nwd$/laufband.sqlite')¶
- metrics: Path = PosixPath('$nwd$/metrics')¶
- model: NodeWithCalculator¶
- model_outs: Path = PosixPath('$nwd$/model')¶
- modifiers: list¶
- repeat: tuple[int, int, int] = (1, 1, 1)¶
- sampling_rate: int = 1¶
- seed: int = 42¶
- steps: int¶
- property structures: list[list[Atoms]]¶
Return the structures as a list of lists of Atoms.
- thermostat: NodeWithThermostat¶
- use_momenta: bool = False¶
- class ipsuite.ASEMDSafeSampling(*args, **kwargs)[source]¶
Bases:
ASEMDMolecular Dynamics simulation node using ASE with safe sampling.
This class inherits from
ASEMDand adds a safe sampling mechanism. If a simulation fails, it is restarted with a reduced temperature. This is particularly useful for sampling simulations with potentially unstable models.Parameters¶
- modelNodeWithCalculator
The computational model/calculator used for force and energy calculations.
- datalist[ase.Atoms]
List of atomic structures to simulate.
- data_idsint or list[int], default -1
Indices of structures from data to simulate. If -1, simulates all structures.
- checkslist, optional
List of simulation checks/monitors to apply during the simulation. It is recommended to include a DebugCheck.
- constraintslist, optional
List of constraints to apply to the atomic system.
- modifierslist, optional
List of modifiers to dynamically change simulation parameters.
- thermostatNodeWithThermostat
Thermostat object for temperature control during simulation.
- stepsint
Total number of MD steps to perform.
- sampling_rateint, default 1
Frequency of data sampling (every N steps).
- repeattuple[int, int, int], default (1, 1, 1)
Cell repetition factors in x, y, z directions.
- dump_rateint, default 1000
Frequency of writing trajectory data to disk.
- use_momentabool, default False
Whether to use existing atomic momenta or initialize with Maxwell-Boltzmann.
- seedint, default 42
Random seed for reproducible simulations.
- temperature_reduction_factorfloat, default 0.9
Factor by which the temperature is reduced upon simulation failure.
Attributes¶
- metricsPath
Output path for simulation metrics (CSV files).
- frames_pathPath
Output path for trajectory frames (HDF5 files).
- model_outsPath
Output path for model-specific output files.
- laufband_pathPath
Path to the job queue database file.
- frameslist[ase.Atoms]
Property that returns all trajectory frames from saved files.
- structureslist[list[ase.Atoms]]
Property that returns structures organized by simulation run.
Examples¶
>>> thermostat = ips.LangevinThermostat(temperature=300, friction=0.05, time_step=0.5) >>> model = ips.MACEMPModel() >>> with project: ... data = ips.AddData(file="ethanol.xyz") ... md = ips.ASEMDSafeSampling( ... model=model, ... data=data.frames, ... thermostat=thermostat, ... steps=1000, ... checks=[ips.DebugCheck()], ... ) >>> project.build()
- temperature_reduction_factor: float = 0.9¶
- class ipsuite.AddData(*args, **kwargs)[source]¶
Bases:
IPSNodeLoad atomic configurations from files using ASE.
Parameters¶
- filestr or Path
Path to the file containing atomic configurations.
- lines_to_readint, optional
Maximum number of configurations to read. If None, reads all.
Attributes¶
- framesList[ase.Atoms]
List of loaded atomic configurations.
Examples¶
>>> with project: ... data = ips.AddData(file="ethanol.xyz", lines_to_read=50) >>> project.repro() >>> print(f"Loaded {len(data.frames)} configurations.") Loaded 50 configurations.
- file: str | Path¶
- property frames: List[Atoms]¶
- frames_path: Path = PosixPath('$nwd$/frames.h5')¶
- lines_to_read: int | None = None¶
- class ipsuite.AddDataH5MD(*args, **kwargs)[source]¶
Bases:
IPSNodeLoad Data directly from a H5MD trajectory file.
- file: str | Path¶
- property frames: List[Atoms]¶
- class ipsuite.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.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- 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.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.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.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.ApplyCalculator(*args, **kwargs)[source]¶
Bases:
NodeApply a calculator to a list of atoms objects and store the results in a H5MD file.
Parameters¶
- datalist[ase.Atoms]
List of atoms objects to calculate.
- modelNodeWithCalculator
Node providing the calculator object to apply to the data.
- frames_pathpathlib.Path, optional
Path to the H5MD file where the results will be stored.
- dump_rateint, optional
If specified, the results will be dumped to the H5MD file every dump_rate frames. If None, all frames will be dumped at once at the end of the calculation.
- model_outspathlib.Path, optional
Path to the directory where the model outputs will be stored. Defaults to a subdirectory named “model” in the current working directory.
- additivebool, optional
If True, adds the new calculator results to existing calculations. If False (default), replaces any existing calculator results. This is useful for adding corrections (e.g., D3 dispersion) to existing models.
Laufband Configuration¶
This node can use Laufband for auto-checkpointing and parallel execution. To enable Laufband features, you can use the following environment variable:
# Enable LAUFBAND export LAUFBAND_DISABLED="0" # Maximum number of retries for killed jobs export LAUFBAND_MAX_KILLED_RETRIES="3". # optional, can be used to identify the job export LAUFBAND_IDENTIFIER=${SLURM_JOB_ID}
Examples¶
>>> model = ips.MACEMPModel() >>> with project: ... data = ips.AddData(file="ethanol.xyz") ... calc_results = ips.ApplyCalculator(data=data.frames, model=model) >>> project.repro() >>> print(f"Calculated properties for {len(calc_results.frames)} configurations") Calculated properties for 100 configurations
- additive: bool = False¶
- data: list[Atoms]¶
- dump_rate: int | None = 1¶
- property frames: list[Atoms]¶
- frames_path: Path = PosixPath('$nwd$/frames.h5')¶
- implemented_properties: list[str]¶
- model: NodeWithCalculator¶
- model_outs: Path = PosixPath('$nwd$/model')¶
- class ipsuite.BarycenterMapping(frozen: bool = False, cutoffs: dict[str, float] | None = None, _components: Any | None = None)[source]¶
Bases:
objectNode that “coarse grains” each molecule in a configuration into its center of mass. Useful for operations affecting intermolecular distance, but not intramolecular distances.
Mapping nodes can be used in a more functional manner when initialized with data=None outside the project graph. In that case, one can use the mapping methods but the Node itself does not store the transformed configurations.
Attributes¶
- frozen: bool
If True, the neighbor list is only constructed for the first configuration. The indices of the molecules will be frozen for all configurations.
- cutoffs: dict[str, float] | None
cutoffs of each element. Dictionary with keys for the symbols and values of the cutoff radii. If None, use the ase.data.covalent_radii. Default: None
- cutoffs: dict[str, float] | None = None¶
- frozen: bool = False¶
- class ipsuite.Berendsen(time_step: float, temperature: float, taut: float = 100)[source]¶
Bases:
objectInitialize the Berendsen thermostat
Attributes¶
- time_step: float
time step of simulation
- temperature: float
temperature in K to simulate at
- taut: float
Temperature coupling time scale.
- taut: float = 100¶
- temperature: float¶
- time_step: float¶
- class ipsuite.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.
- 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.BoxOscillatingRampModifier(cell_amplitude: float | list[float], num_oscillations: float, end_cell: float | None = None, num_ramp_oscillations: float | None = None, interval: int = 1)[source]¶
Bases:
objectRamp the simulation cell to a specified end cell with some oscillations.
Attributes¶
- end_cell: float, list[float], optional
cell to ramp to, cubic or tetragonal. If None, the cell will oscillate around the initial cell.
- cell_amplitude: float
amplitude in oscillations of the diagonal cell elements
- num_oscillations: float
number of oscillations. No oscillations will occur if set to 0.
- interval: int, default 1
interval in which the box size is changed.
- num_ramp_oscillations: float, optional
number of oscillations to ramp the box size to the end cell. This value has to be smaller than num_oscillations. For LotF applications, this can prevent a loop of ever decreasing cell sizes. To ensure this use a value of 0.5.
- cell_amplitude: float | list[float]¶
- end_cell: float | None = None¶
- interval: int = 1¶
- num_oscillations: float¶
- num_ramp_oscillations: float | None = None¶
- class ipsuite.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
- 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.CP2KModel(config: str | ~pathlib.Path, files: list[str | ~pathlib.Path] = <factory>, cmd: str | None = None)[source]¶
Bases:
objectCP2K ASE calculator model.
Parameters¶
- configstr | Path
Path to the CP2K input file in YAML format. See https://github.com/cp2k/cp2k-input-tools for more information on the input file format.
- fileslist[str | Path]
List of files to copy to the cp2k directory. These files are typically basis sets and potential files.
- cmdstr | None
Path to the cp2k executable. If not set, the environment variable IPSUITE_CP2K_SHELL is used.
Examples¶
>> import ipsuite as ips >> project = ips.Project() >> cp2k = ips.CP2KModel( .. config=”cp2k.yaml”, .. files=[“GTH_BASIS_SETS”, “GTH_POTENTIALS”], .. ) >> with project: .. water = ips.Smiles2Conformers(smiles=”O”, numConfs=100) .. box = ips.MultiPackmol( .. data=[water.frames], count=[16], density=1000, n_configurations=11, .. ) .. ips.ApplyCalculator( .. data=box.frames, .. model=cp2k, .. ) >> project.build()
- cmd: str | None = None¶
- config: str | Path¶
- files: list[str | Path]¶
- class ipsuite.CP2KSinglePoint(*args, **kwargs)[source]¶
Bases:
IPSNodeNode for running CP2K Single point calculations.
Parameters¶
- cp2k_shellstr, default=None
The cmd to run cp2k. If None, the environment variable IPSUITE_CP2K_SHELL is used.
- cp2k_paramsstr
The path to the cp2k yaml input file. cp2k-input-tools is used to generate the input file from the yaml file.
- cp2k_fileslist[str]
Additional dependencies for the cp2k calculation.
- wfn_restart_filestr, optional
The path to the wfn restart file.
- wfn_restart_nodestr, optional
A cp2k Node that has a wfn restart file.
- cp2k_directory: Path = PosixPath('$nwd$/cp2k')¶
- cp2k_files: list[str] = None¶
- cp2k_params: str = 'cp2k.yaml'¶
- cp2k_shell: str | None = None¶
- data: list[Atoms]¶
- failed_configs: dict = NOT_AVAILABLE¶
- failure_policy: Literal['skip', 'fail'] = 'fail'¶
- property frames: list[Atoms]¶
- output_file: Path = PosixPath('$nwd$/structures.h5')¶
- wfn_restart_file: str = None¶
- wfn_restart_node: Node = None¶
- class ipsuite.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')¶
- class ipsuite.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.ConnectivityCheck(status: str | None | bool = None, bonded_min_dist: float = 0.6, bonded_max_dist: float = 2.0)[source]¶
Bases:
CheckCheck to see whether the covalent connectivity of the system changes during a simulation. The connectivity is based on ASE’s natural cutoffs. The pair of atoms which triggered this check will be converted to Lithium for easy visibility
- bonded_max_dist: float = 2.0¶
- bonded_min_dist: float = 0.6¶
- class ipsuite.DebugCheck(status: str | None | bool = None, n_iterations: int = 10)[source]¶
Bases:
CheckA check that interrupts the dynamics after a fixed amount of iterations. For testing purposes.
Attributes¶
- n_iterations: int
number of iterations before stopping
- initialize(atoms: Atoms) None[source]¶
Stores some reference property to compare the current property against and see whether the simulation should be stopped. Derived classes do not need to override this if they consider absolute values and not comparisons.
- n_iterations: int = 10¶
- class ipsuite.DensityCheck(status: str | None | bool = None, max_density: float | None = None, min_density: float | None = None)[source]¶
Bases:
Check- max_density: float | None = None¶
- min_density: float | None = None¶
- status: str | None | bool = None¶
- class ipsuite.DipoleHistogram(*args, **kwargs)[source]¶
Bases:
LabelHistogramCreates a histogram of all dipole labels contained in a dataset.
- datalabel: str = 'dipole'¶
- xlabel: str = '$\\mu$ / eV Ang'¶
- class ipsuite.EMTSinglePoint[source]¶
Bases:
objectThis is a testing Node! It uses ASE’S EMT calculator with default arguments. The calculator accept all elements and implements energy, forces, making it very useful for creating dummy data.
- class ipsuite.EnergyHistogram(*args, **kwargs)[source]¶
Bases:
LabelHistogramCreates a histogram of all energy labels contained in a dataset.
- datalabel: str = 'energy'¶
- xlabel: str = '$E$ / eV'¶
- class ipsuite.EnergySpikeCheck(status: str | None | bool = None, min_factor: float = 0.5, max_factor: float = 2.0, max_energy: float | None = None, min_energy: float | None = None)[source]¶
Bases:
CheckCheck to see whether the potential energy of the system has fallen below a minimum or above a maximum threshold.
Attributes¶
min_factor: Simulation stops if E(current) > E(initial) * min_factor max_factor: Simulation stops if E(current) < E(initial) * max_factor
- initialize(atoms: Atoms) None[source]¶
Stores some reference property to compare the current property against and see whether the simulation should be stopped. Derived classes do not need to override this if they consider absolute values and not comparisons.
- max_energy: float | None = None¶
- max_factor: float = 2.0¶
- min_energy: float | None = None¶
- min_factor: float = 0.5¶
- class ipsuite.EnergyUncertaintyHistogram(*args, **kwargs)[source]¶
Bases:
LabelHistogramCreates a histogram of all energy uncertainties in a prediction.
- datalabel: str = 'energy-uncertainty'¶
- xlabel: str = '$\\sigma(E)$ / eV'¶
- class ipsuite.EnsembleModel(*, name: str | None = None, always_changed: bool = False, models: List[ipsuite.models.base.MLModel])[source]¶
Bases:
IPSNode- get_calculator(**kwargs) Calculator[source]¶
Property to return a model specific ase calculator object.
Returns¶
- calc:
ase calculator object
- class ipsuite.FilterOutlier(*args, **kwargs)[source]¶
Bases:
IPSNodeRemove outliers from the data based on a given property.
Attributes¶
- keystr, default=”energy”
The property to filter on.
- thresholdfloat, default=3
The threshold for filtering in units of standard deviations.
- direction{“above”, “below”, “both”}, default=”both”
The direction to filter in.
- data: list[Atoms]¶
- direction: Literal['above', 'below', 'both'] = 'both'¶
- property excluded_frames¶
- filtered_indices: list = NOT_AVAILABLE¶
- property frames: list[Atoms]¶
- histogram: str = PosixPath('$nwd$/histogram.png')¶
- key: str = 'energy'¶
- threshold: float = 3¶
- class ipsuite.FixedBondLengthConstraint(atom_id_1: int, atom_id_2: int)[source]¶
Bases:
objectFix the Bondlength between two atoms
Attributes¶
- atom_id_1: int
index of atom 1
- atom_id_2: int
index of atom 2
Returns¶
- ase.constraints.FixBondLengths
Constraint that fixes the bond Length between atom_id_1 and atom_id_2
- atom_id_1: int¶
- atom_id_2: int¶
- class ipsuite.FixedLayerConstraint(upper_limit: float, lower_limit: float)[source]¶
Bases:
object- Class to fix a layer of atoms within a MD
simulation
Attributes¶
- upper_limit: float
all atoms with a lower z pos will be fixed.
- lower_limit: float
all atoms with a higher z pos will be fixed.
- lower_limit: float¶
- upper_limit: float¶
- class ipsuite.FixedSphereConstraint(radius: float, atom_id: int | None = None, atom_type: str | None = None)[source]¶
Bases:
objectAttributes¶
- atom_id: int
The id to use as the center of the sphere to fix. If None, the closed atom to the center will be picked.
- atom_type: str, optional
The type of the atom to fix. E.g. if atom_type = H, atom_id = 1, the first hydrogen atom will be fixed. If None, the first atom will be fixed, no matter the type.
radius: float
- atom_id: int | None = None¶
- atom_type: str | None = None¶
- radius: float¶
- class ipsuite.Flatten(*args, **kwargs)[source]¶
Bases:
ProcessAtomsFlattens list[list[ase.Atoms]] to list[ase.Atoms]
- data: list[list[Atoms]]¶
- class ipsuite.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')¶
- class ipsuite.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¶
- class ipsuite.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¶
- class ipsuite.ForcesHistogram(*args, **kwargs)[source]¶
Bases:
LabelHistogramCreates a histogram of all force labels contained in a dataset.
- datalabel: str = 'forces'¶
- xlabel: str = '$F$ / eV/Ang'¶
- class ipsuite.ForcesUncertaintyHistogram(*args, **kwargs)[source]¶
Bases:
LabelHistogramCreates a histogram of all force uncertainties in a prediction.
- datalabel: str = 'forces-uncertainty'¶
- xlabel: str = '$\\sigma(F)$ / eV/Ang'¶
- class ipsuite.GenericASEModel(module: str, class_name: str, kwargs: dict[str, Any] | None = None, parameter_paths: str | Path | list[str | Path] | None = None, file_paths: str | Path | list[str | Path] | None = None)[source]¶
Bases:
objectGeneric ASE calculator.
Load any ASE calculator from a module and class name.
Parameters¶
- modulestr
Module name containing the calculator class. For LJ this would be ‘ase.calculators.lj’.
- class_namestr
Class name of the calculator. For LJ this would be ‘LennardJones’.
- kwargsdict, default=None
Additional keyword arguments to pass to the calculator. For LJ this could be {‘epsilon’: 1.0, ‘sigma’: 1.0}.
- parameter_pathsstr, Path, list[str|Path], default=None
Path to configuration files for the calculator, e.g. cp2k.yaml.
- file_pathsstr, Path, list[str|Path], default=None
Path to files needed by the calculator, e.g. GTH_BASIS_SETS.
- property available: bool¶
- class_name: str¶
- file_paths: str | Path | list[str | Path] | None = None¶
- kwargs: dict[str, Any] | None = None¶
- module: str¶
- parameter_paths: str | Path | list[str | Path] | None = None¶
- class ipsuite.HookeanConstraint(atom_ids: list[tuple], k: float, rt: float)[source]¶
Bases:
objectApplies a Hookean (spring) force between pairs of atoms.
Attributes¶
- atom_ids: list[tuple]
List of atom indices that need to be constrained. Example: Fix only atoms in water with bonds if the IDs are as follows: H=0, H=1, O=2 Then the following atom_ids list is needed: [(0, 2), (1, 2)]
- k: float
Hookes law (spring) constant to apply when distance exceeds threshold_length. Units of eV A^-2. # TODO: Allow different k for each pair
- rt: float
The threshold length below which there is no force. # TODO: Allow different rt for each pair
Returns¶
- list[ase.constraints.Hookean]
List of constraints that fixes the bond Length between the molecules in the atom_id tuples.
- atom_ids: list[tuple]¶
- k: float¶
- rt: float¶
- class ipsuite.IndexSelection(*args, **kwargs)[source]¶
Bases:
ConfigurationSelectionSelect configurations by explicit indices or slice parameters.
Parameters¶
- datalist[ase.Atoms]
The atomic configurations to select from.
- indiceslist[int], optional
Explicit list of indices to select. Cannot be used with slice parameters.
- startint, optional
Start index for slice selection.
- stopint, optional
Stop index for slice selection.
- stepint, optional
Step size for slice selection.
Attributes¶
- selected_idslist[int]
Indices of selected configurations.
- frameslist[ase.Atoms]
The selected atomic configurations.
- excluded_frameslist[ase.Atoms]
The atomic configurations that were not selected.
Examples¶
>>> with project: ... data = ips.AddData(file="ethanol.xyz") ... selector = ips.IndexSelection(data=data.frames, indices=[0, 5, 10, 15]) >>> project.repro() >>> print(f"Selected {len(selector.selected_ids)} configurations with IDs: " ... f"{selector.selected_ids}") Selected 4 configurations with IDs: [0, 5, 10, 15]
- indices: list[int] | None = None¶
- select_atoms(atoms_lst: List[Atoms]) List[int][source]¶
Select Atoms by explicit indices or slice parameters.
- start: int | None = None¶
- step: int | None = None¶
- stop: int | None = None¶
- class ipsuite.LJSinglePoint(epsilon: float = 1.0, sigma: float = 1.0, rc: float = 10.0)[source]¶
Bases:
objectThis is a testing Node! It uses ASE’S Lennard-Jones calculator with default arguments. The calculator accept all elements and implements energy, forces and stress, making it very useful for creating dummy data.
- epsilon: float = 1.0¶
- rc: float = 10.0¶
- sigma: float = 1.0¶
- class ipsuite.LammpsSimulator(*args, **kwargs)[source]¶
Bases:
ProcessSingleAtomCan perform LAMMPS Simulations.
Parameters¶
- lmp_exe: str
This is the name or path of the LAMMPS executable. Either path to executable, “lmp” or “lamp_<machine>”. See https://docs.lammps.org/Run_basics.html for more information
- lmp_params: str
Path to file. To be able to change parameters with DVC and not have to change them manually in the input script, a params file in yaml format and corresponding template file must be provided.
- lmp_template: str
Path to file. In combination with the params file this will be the input script for the LAMMPS simulation
- skiprun: bool, optional
Whether to skip running LAMMPS or not, by default False
Returns¶
- None
This function does not return anything. Instead, it creates a LAMMPS input script based on the specified template and parameter files, runs the LAMMPS simulation using the specified executable, and saves the simulation output to the specified directory.
- dump_file: Path = PosixPath('$nwd$/NPT.lammpstraj')¶
- property frames: list[Atoms]¶
- classmethod get_template(filename: str = 'lmp.jinja2', name='lammps_npt.jinja2') None[source]¶
Get the template file.
Parameters¶
- filename: str, optional
The name where to write the template to.
- name: str, optional
The name of the template, by default “lammps_npt.jinja2”
Returns¶
- lmp_directory: str = PosixPath('$nwd$/lammps')¶
- lmp_exe: str = 'lmp_serial'¶
- lmp_params: str¶
- lmp_template: str¶
- log_file: Path = PosixPath('$nwd$/NPT.log')¶
- skiprun: bool = False¶
- class ipsuite.LangevinThermostat(time_step: float, temperature: float, friction: float)[source]¶
Bases:
objectInitialize the langevin thermostat
Attributes¶
- time_step: float
The simulation time step should be adjust for the system. To properly resolve C-H vibrations, a time step of 0.5 fs is recommended. For systems without significant C-H vibrations, larger time steps might be used.
- temperature: float
temperature in Kelvin to simulate at
- friction: float
friction of the Langevin simulator
- friction: float¶
- temperature: float¶
- time_step: float¶
- class ipsuite.MACEMPModel(model: str | Path | None = None, device: str = '', default_dtype: str = 'float32', dispersion: bool = False, damping: Literal['zero', 'bj', 'zerom', 'bjm'] = 'bj', dispersion_xc: str = 'pbe', dispersion_cutoff: float = 21.167088422553647, model_path: Path | None = None)[source]¶
Bases:
objectInterface for the MACE model.
For more information, see: - https://github.com/ACEsuit/mace
- damping: Literal['zero', 'bj', 'zerom', 'bjm'] = 'bj'¶
- default_dtype: str = 'float32'¶
- device: str = ''¶
- dispersion: bool = False¶
- dispersion_cutoff: float = 21.167088422553647¶
- dispersion_xc: str = 'pbe'¶
- model: str | Path | None = None¶
- model_path: Path | None = None¶
- class ipsuite.MD22Dataset(*, name: str | None = None, always_changed: bool = False, dataset: str)[source]¶
Bases:
IPSNode- dataset: str¶
- datasets = {'AT-AT': 'http://www.quantum-machine.org/gdml/repo/static/md22_AT-AT.zip', 'AT-AT-CG-CG': 'http://www.quantum-machine.org/gdml/repo/static/md22_AT-AT-CG-CG.zip', 'Ac-Ala3-NHMe': 'http://www.quantum-machine.org/gdml/repo/static/md22_Ac-Ala3-NHMe.zip', 'DHA': 'http://www.quantum-machine.org/gdml/repo/static/md22_DHA.zip', 'buckyball-catcher': 'http://www.quantum-machine.org/gdml/repo/static/md22_buckyball-catcher.zip', 'double-walled_nanotube': 'http://www.quantum-machine.org/gdml/repo/static/md22_double-walled_nanotube.zip', 'stachyose': 'http://www.quantum-machine.org/gdml/repo/static/md22_stachyose.zip'}¶
- frames: list[Atoms] = NOT_AVAILABLE¶
- class ipsuite.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.MixCalculator(*args, **kwargs)[source]¶
Bases:
IPSNodeCombine multiple models or calculators into one.
- Attributes:
- calculators: list[NodeWithCalculator]
List of calculators to combine.
- method: str
choose from “mean” or “sum” to combine the calculators.
- calculators: list[NodeWithCalculator]¶
- get_calculator(**kwargs) Calculator[source]¶
Property to return a model specific ase calculator object.
Returns¶
- calc:
ase calculator object
- method: str = 'sum'¶
- class ipsuite.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.MultiPackmol(*args, **kwargs)[source]¶
Bases:
PackmolCreate multiple configurations with packmol.
This Node generates multiple configurations with packmol. This is best used in conjunction with Smiles2Conformers:
Attributes¶
- n_configurationsint
Number of configurations to create.
- seedint
Seed for the random number generator.
Notes¶
Output structures should be relaxed before further use.
Example¶
>>> import ipsuite as ips >>> project = ips.Project() >>> with project: ... bf4 = ips.Smiles2Conformers( ... smiles='[B-](F)(F)(F)F', numConfs=10 ... ) ... bmim = ips.Smiles2Conformers( ... smiles='CCCCN1C=C[N+](=C1)C', ... numConfs=10 ... ) ... molecules = ips.MultiPackmol( ... data=[bf4.frames, bmim.frames], ... count=[1, 1], density=1210, n_configurations=10 ... ) ... box = ips.MultiPackmol( ... data=[molecules.frames], count=[10], density=1210, n_configurations=1 ... ) >>> project.build()
- n_configurations: int¶
- seed: int = 42¶
- class ipsuite.NPTThermostat(time_step: float, temperature: float, pressure: float, ttime: float, pfactor: float, tetragonal_strain: bool = True, fraction_traceless: int | float = 1)[source]¶
Bases:
objectInitialize the ASE NPT barostat (Nose Hoover temperature coupling + Parrinello Rahman pressure coupling).
Attributes¶
- time_step: float
time step of simulation
- temperature: float
temperature in K to simulate at
- pressure: float
pressure in ASE units
- ttime: float
characteristic temperature coupling time in ASE units
- pfactor: float
characteristic pressure coupling time in ASE units
- tetragonal_strain: bool
if True allows only the diagonal elements of the box to change, i.e. box angles are constant
- fraction_traceless: Union[int, float]
How much of the traceless part of the virial to keep. If set to 0, the volume of the cell can change, but the shape cannot.
- fraction_traceless: int | float = 1¶
- pfactor: float¶
- pressure: float¶
- temperature: float¶
- tetragonal_strain: bool = True¶
- time_step: float¶
- ttime: float¶
- class ipsuite.NaNCheck(status: str | None | bool = None)[source]¶
Bases:
CheckCheck Node to see whether positions, energies or forces become NaN during a simulation.
- class ipsuite.ORCAModel(simpleinput: str = 'B3LYP def2-TZVP enGrad TightSCF', blocks: str = '%pal nprocs 2 end', cmd: str | None = None)[source]¶
Bases:
objectORCA ASE calculator model.
Parameters¶
- simpleinputstr
The ORCA input string. For example: “B3LYP def2-TZVP enGrad TightSCF” to compute the energy and forces of a system using the B3LYP functional with the def2-TZVP basis set. See [1]_ for more information.
- blocksstr
The ORCA blocks string to select the number of processors and other settings. For example: “%pal nprocs 2 end”.
- cmdstr | None
The command to run ORCA. If not set, the environment variable IPSUITE_ORCA_SHELL is used.
Examples¶
>> import ipsuite as ips >> project = ips.Project() >> orca = ips.ORCAModel( .. simpleinput=”B3LYP def2-TZVP enGrad TightSCF”, .. blocks=”%pal nprocs 2 end”, .. ) >> with project: .. water = ips.Smiles2Conformers(smiles=”O”, numConfs=100) .. ips.ApplyCalculator( .. data=water.frames, .. model=orca, .. ) >> project.build()
- blocks: str = '%pal nprocs 2 end'¶
- cmd: str | None = None¶
- simpleinput: str = 'B3LYP def2-TZVP enGrad TightSCF'¶
- class ipsuite.OrcaSinglePoint(*args, **kwargs)[source]¶
Bases:
IPSNodeNode for running ORCA Single point calculations.
Parameters¶
- orca_shellstr, default=None
The cmd to run orca. If None, the environment variable IPSUITE_ORCA_SHELL is used.
- data: list[Atoms]¶
- property frames: list[Atoms]¶
- orca_directory: Path = PosixPath('$nwd$/orca')¶
- orca_shell: str | None = None¶
- orcablocks: str = '%pal nprocs 16 end'¶
- orcasimpleinput: str = 'B3LYP def2-TZVP'¶
- output_file: str = PosixPath('$nwd$/structures.h5')¶
- class ipsuite.Packmol(*args, **kwargs)[source]¶
Bases:
IPSNodeCreate a box with packmol.
Attributes¶
- data: list[list[ase.Atoms]]
For each entry in the list the last ase.Atoms object is used to create the new structure.
- data_ids: list[int]
The id of the data to use for each entry in data. If None the last entry. Has to be the same length as data. data: [[A], [B]], [-1, 3] -> [A[-1], B[3]]
- count: list[int]
Number of molecules to add for each entry in data.
- tolerancefloat
Tolerance for the distance of atoms in angstrom.
- densityfloat
Density of the system in kg/m^3. Either density or box is required.
- pbcbool
If True the periodic boundary conditions are set for the generated structure and the box used by packmol is scaled by the tolerance, to avoid overlapping atoms with periodic boundary conditions.
Notes¶
Output structures should be relaxed before further use.
- count: list¶
- data: list[list[Atoms]]¶
- data_ids: list[int] = None¶
- density: float¶
- property frames: list[Atoms]¶
- frames_path: Path = PosixPath('$nwd$/frames.h5')¶
- pbc: bool = True¶
- tolerance: float = 2.0¶
- class ipsuite.PlumedModel(*args, **kwargs)[source]¶
Bases:
IPSNodePlumed interface.
Parameters¶
- data: list[ase.Atoms]
List of ase atoms objects used to initialize the calculator.
- data_id: int
Index of the ase atoms object to use for initialization.
- model: NodeWithCalculator
The node that provides the calculator to compute unbiased energy and forces.
- config: str | Path
Path to the plumed input file.
- temperature: float
Temperature of the simulation in Kelvin.
- timestep: float
Timestep of the simulation in fs.
Example¶
An example config file for plumed can look like this:
hoh-c: DISTANCE ATOMS=48,3 c-r1: DISTANCE ATOMS=2,3 metad: METAD ARG=hoh-c,c-r1 PACE=100 HEIGHT=0.75 SIGMA=0.5,0.5 BIASFACTOR=10 TEMP=400 FILE=HILLS GRID_MIN=1.15,1.15 GRID_MAX=8.0,8.0 GRID_BIN=200,200 PRINT ARG=hoh-c,c-r1 STRIDE=10 FILE=COLVAR
References¶
[1] Plumed manual: https://www.plumed.org/doc-master/user-doc/html/index.html [2] Plumed : https://www.plumed.org/
- config: str | Path¶
- data: list[Atoms]¶
- data_id: int = -1¶
- model: NodeWithCalculator¶
- temperature: float¶
- timestep: float¶
- class ipsuite.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
- class ipsuite.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¶
- class ipsuite.PressureRampModifier(end_pressure_au: float, start_pressure_au: float | None = None, interval: int = 1)[source]¶
Bases:
objectRamp the temperature from start_temperature to temperature. Works only for the NPT thermostat (not NPTBerendsen).
Attributes¶
- start_pressure_au: float, optional
pressure to start from, if None, the pressure of the thermostat is used. Uses ASE units.
- end_pressure_au: float
pressure to ramp to. Uses ASE units.
- interval: int, default 1
interval in which the pressure is changed.
- end_pressure_au: float¶
- interval: int = 1¶
- start_pressure_au: float | None = None¶
- class ipsuite.Project(*args, disable=False, immutable_nodes=True, deployment=None, tags: dict[str, str] | None = None, **kwargs)[source]¶
Bases:
ProjectProject class for MLSuite interfacing.
- class ipsuite.RandomSelection(*args, **kwargs)[source]¶
Bases:
ConfigurationSelectionSelect configurations randomly without replacement.
Parameters¶
- datalist[ase.Atoms]
The atomic configurations to select from.
- n_configurationsint
Number of configurations to select.
- seedint, default=1234
Random seed for reproducible selection.
Attributes¶
- selected_idslist[int]
Indices of selected configurations.
- frameslist[ase.Atoms]
The selected atomic configurations.
- excluded_frameslist[ase.Atoms]
The atomic configurations that were not selected.
Examples¶
>>> with project: ... data = ips.AddData(file="ethanol.xyz") ... selector = ips.RandomSelection(data=data.frames, n_configurations=10, seed=42) >>> project.repro() >>> print(f"Selected {len(selector.selected_ids)} configurations with IDs: " ... f"{selector.selected_ids}") Selected 10 configurations with IDs: [83, 53, 70, 45, 44, 39, 22, 80, 10, 0]
- n_configurations: int¶
- seed: int = 1234¶
- class ipsuite.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
- 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.RattleAtoms(*args, **kwargs)[source]¶
Bases:
BootstrapGenerate configurations with randomly displaced atomic positions.
Creates new configurations by applying random displacements to each atom’s position.
Parameters¶
- datalist[ase.Atoms]
Input atomic configurations to modify.
- data_idint, default=-1
Index of the configuration to use from the data list.
- n_configurationsint
Number of rattled configurations to generate.
- maximumfloat
Maximum displacement magnitude (Ångström) for each atom.
- include_originalbool, default=True
Whether to include the original configuration in output.
- seedint, default=0
Random seed for reproducible displacement generation.
Attributes¶
- frameslist[ase.Atoms]
Generated configurations with rattled atomic positions.
- frames_pathPath
Path to the HDF5 file storing the generated configurations.
Examples¶
>>> with project: ... data = ips.AddData(file="ethanol.xyz") ... rattled = ips.RattleAtoms(data=data.frames, n_configurations=5, maximum=0.1) >>> project.repro() >>> print(f"Generated {len(rattled.frames)} rattled configurations") Generated 6 rattled configurations
- class ipsuite.RescaleBoxModifier(cell: int | None = None, density: float | None = None)[source]¶
Bases:
object- cell: int | None = None¶
- density: float | None = None¶
- class ipsuite.RotateMolecules(*args, **kwargs)[source]¶
Bases:
BootstrapGenerate configurations with randomly rotated molecular units.
Creates new configurations by applying random rotations to individual molecular units around their barycenter while preserving internal bond structures. Requires distinct molecular entities in the system.
Parameters¶
- datalist[ase.Atoms]
Input atomic configurations containing molecular units.
- data_idint, default=-1
Index of the configuration to use from the data list.
- n_configurationsint
Number of configurations with rotated molecules to generate.
- maximumfloat
Maximum rotation angle (radians) for each molecule.
- include_originalbool, default=True
Whether to include the original configuration in output.
- seedint, default=0
Random seed for reproducible rotation generation.
Attributes¶
- frameslist[ase.Atoms]
Generated configurations with rotated molecular units.
- frames_pathPath
Path to the HDF5 file storing the generated configurations.
Examples¶
>>> with project: ... data = ips.AddData(file="ethanol.xyz") ... rotated = ips.RotateMolecules(data=data.frames, n_configurations=5, ... maximum=3.14159) >>> project.repro() >>> print(f"Generated {len(rotated.frames)} configurations with rotated molecules") Generated 6 configurations with rotated molecules
- class ipsuite.SVCRBarostat(time_step: int, temperature: float, betaT: float = 4.57e-05, pressure_au: float = 1.01325, taut: float = 100, taup: float | None = None)[source]¶
Bases:
objectInitialize the CSVR thermostat
Attributes¶
- time_step: float
time step of simulation
- temperature: float
temperature in K to simulate at
- betaT: float
Very approximate compressibility of the system.
- pressure_au: float
Pressure in atomic units.
- taut: float
Temperature coupling time scale.
- taup: float
Pressure coupling time scale.
- betaT: float = 4.57e-05¶
- pressure_au: float = 1.01325¶
- taup: float | None = None¶
- taut: float = 100¶
- temperature: float¶
- time_step: int¶
- class ipsuite.Smiles2Atoms(*, name: str | None = None, always_changed: bool = False, smiles: str, seed: int = 1234, frames_path: pathlib.Path = PosixPath('$nwd$/frames.h5'), molecule_image_path: pathlib.Path = PosixPath('$nwd$/molecule.png'))[source]¶
Bases:
IPSNode- property frames: list[Atoms]¶
- frames_path: Path = PosixPath('$nwd$/frames.h5')¶
- molecule_image_path: Path = PosixPath('$nwd$/molecule.png')¶
- seed: int = 1234¶
- smiles: str¶
- class ipsuite.Smiles2Conformers(*args, **kwargs)[source]¶
Bases:
IPSNodeGenerate molecular conformers from a SMILES string.
Attributes¶
- smilesstr
The SMILES string representing the molecule.
- numConfsint
The number of conformers to generate.
- seedint, optional
Random seed for conformer generation (default is 42).
- maxAttemptsint, optional
Maximum number of attempts to generate conformers (default is 1000).
Methods¶
- frameslist of ase.Atoms
Property to load and return the generated conformers as a list of ASE Atoms.
Notes¶
Instead of creating one composite smile like [B-](F)(F)(F)F.CCCCN1C=C[N+](=C1)C create two molecules and use MultiPackmol to generate the single molecule. This will avoid overlapping structures.
Examples¶
>>> with project: ... methanol_conformers = ips.Smiles2Conformers(smiles="CO", numConfs=5) >>> project.repro() >>> frames = methanol_conformers.frames >>> print(f"Generated {len(frames)} conformers.") Generated 5 conformers.
- property frames: list[Atoms]¶
- frames_path: Path = PosixPath('$nwd$/frames.h5')¶
- maxAttempts: int = 1000¶
- molecule_image_path: Path = PosixPath('$nwd$/molecule.png')¶
- numConfs: int¶
- seed: int = 42¶
- smiles: str¶
- class ipsuite.Smiles2Gromacs(*args, **kwargs)[source]¶
Bases:
IPSNodeGromacs Node.
Attributes¶
- smiles: list[str]
List of SMILES strings for the molecules to be packed.
- count: list[int]
Number of each molecule to pack.
- labels: list[str]
List of 3-letter labels for each molecule.
- density: float
Density of the packed box in g/cm^3.
- mdp_files: list[str | pathlib.Path]
List of paths to the Gromacs MDP files.
- config_files: list[str | pathlib.Path]
Same like mdp_files but in the json or yaml format. These will run BEFORE the MDP files.
- itp_files: list[str | None]|None
if given, for each label either the path to the ITP file or None. The order must match the order of the labels.
- pdb_files: list[str | pathlib.Path]|None
if given, for each label either the path to the PDB file or None. The order must match the order of the labels.
- production_indices: list[int]|None
The gromacs runs that should be stored in the trajectory file. If None, the last run is stored. The order is always the same as the order of the MDP files.
Installation¶
To install the required software, run the following commands:
conda install conda-forge::gromacs conda install conda-forge::acpype pip install MDAnalysis pyedr
- cleanup: bool = True¶
- config_files: Sequence[str | Path]¶
- count: list[int]¶
- density: float¶
- property frames: list[Atoms]¶
- fudgeLJ: float = 1.0¶
- fudgeQQ: float = 1.0¶
- itp_files: Sequence[str | Path | None]¶
- labels: list[str]¶
- maxwarn: int = 0¶
- mdp_files: Sequence[str | Path]¶
- output_dir: Path = PosixPath('$nwd$/gromacs')¶
- pdb_files: Sequence[str | Path | None]¶
- production_indices: list[int] = None¶
- smiles: list[str]¶
- tolerance: float = 2.0¶
- traj_file: list[Atoms] = PosixPath('$nwd$/structures.h5')¶
- class ipsuite.SplitSelection(*args, **kwargs)[source]¶
Bases:
ConfigurationSelectionSelect the first n% of configurations from the dataset.
Parameters¶
- datalist[ase.Atoms]
The atomic configurations to select from.
- splitfloat
Fraction of the data to select (0.0 to 1.0).
Attributes¶
- selected_idslist[int]
Indices of selected configurations.
- frameslist[ase.Atoms]
The selected atomic configurations.
- excluded_frameslist[ase.Atoms]
The atomic configurations that were not selected.
Examples¶
>>> with project: ... data = ips.AddData(file="ethanol.xyz") # contains 100 frames ... selector = ips.SplitSelection(data=data.frames, split=0.1) >>> project.repro() >>> print(f"Selected {len(selector.selected_ids)} configurations with IDs: " ... f"{selector.selected_ids}") Selected 10 configurations with IDs: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
- select_atoms(atoms_lst: List[Atoms]) List[int][source]¶
Run the selection method.
Attributes¶
- atoms_lst: List[ase.Atoms]
List of ase Atoms objects to select configurations from.
Returns¶
- List[int]:
A list of the selected ids from 0 .. len(atoms_lst)
- split: float¶
- class ipsuite.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¶
- labels_df: DataFrame = NOT_AVAILABLE¶
- logy_scale: bool = True¶
- plots_dir: Path = PosixPath('$nwd$/plots')¶
- class ipsuite.SurfaceRasterMetrics(*args, **kwargs)[source]¶
Bases:
PredictionMetricsThis class analyzes the surface interaction of an additive with a surface. It is used to evaluate how well the surface structure is learned during training. Note that the bulk atoms should not be rattled in the SurfaceRasterScan node.
Attributes¶
- scan_node: SurfaceRasterScan()
The node used for generating the structures
- scan_node: SurfaceRasterScan¶
- class ipsuite.SurfaceRasterScan(*args, **kwargs)[source]¶
Bases:
ProcessSingleAtomThis class generates periodic structures by creating a vacuum slab in the z-direction and adding additives at various positions. It is useful for generating input structures for surface training simulations or in combination with the SurfaceRasterMetrics class to analyze how well surface interactions are captured in the training.
Attributes¶
- symbol: str
ASE symbol representing the additives.
- z_dist_list: list[float]
A list of z-distances at which additives will be added.
- n_conf_per_dist: list[int]
The number of configurations to generate per z-distance.
- cell_fraction: list[float]
Fractional scaling of the unit cell in x and y directions.
- random: bool
If True, additives are placed randomly within the specified cell_fraction.
- max_rattel_shift: float
Maximum random displacement for each atom.
- seed: int
Seed for randomly distributing the additive.
- cell_fraction: list[float] = (1, 1)¶
- max_rattel_shift: float = None¶
- n_conf_per_dist: list[int] = (5, 5)¶
- random: bool = False¶
- seed: int = 1¶
- symbol: str¶
- z_dist_list: list[float]¶
- class ipsuite.TBLiteModel(method: str = 'GFN2-xTB', verbosity: int = 0, charge: int = 0, multiplicity: int = 1)[source]¶
Bases:
objectA model for the TBLite calculator [1]_.
Parameters¶
- methodstr
The method to use for the calculator.
- verbosityint
The verbosity level of the calculator.
- chargeint
The charge of the structure
- multiplicityint
The spin multiplicity of the structure
[1] Examples¶
>> import ipsuite as ips >> project = ips.Project() >> tblite = ips.TBLiteModel(method=”GFN2-xTB”) >> with project: .. water = ips.Smiles2Conformers(smiles=”O”, numConfs=100) .. box = ips.MultiPackmol( .. data=[water.frames], count=[16], density=1000, n_configurations=11, .. ) .. ips.ApplyCalculator( .. data=box.frames, .. model=tblite, .. ) >> project.build()
- charge: int = 0¶
- method: str = 'GFN2-xTB'¶
- multiplicity: int = 1¶
- verbosity: int = 0¶
- class ipsuite.TemperatureCheck(status: str | None | bool = None, max_temperature: float = 10000.0)[source]¶
Bases:
CheckCalculate and check teperature during a MD simulation
Attributes¶
- max_temperature: float
maximum temperature, when reaching it simulation will be stopped
- initialize(atoms: Atoms) None[source]¶
Stores some reference property to compare the current property against and see whether the simulation should be stopped. Derived classes do not need to override this if they consider absolute values and not comparisons.
- max_temperature: float = 10000.0¶
- class ipsuite.TemperatureOscillatingRampModifier(end_temperature: float, temperature_amplitude: float, num_oscillations: float, start_temperature: float | None = None, interval: int = 1)[source]¶
Bases:
objectRamp the temperature from start_temperature to temperature with some oscillations.
Attributes¶
- start_temperature: float, optional
temperature to start from, if None, the temperature of the thermostat is used.
- end_temperature: float
temperature to ramp to.
- temperature_amplitude: float
amplitude of temperature oscillations.
- num_oscillations: float
number of oscillations. No oscillations will occur if set to 0.
- interval: int, default 1
interval in which the temperature is changed.
- end_temperature: float¶
- interval: int = 1¶
- num_oscillations: float¶
- start_temperature: float | None = None¶
- temperature_amplitude: float¶
- class ipsuite.TemperatureRampModifier(temperature: float, start_temperature: float | None = None, interval: int = 1)[source]¶
Bases:
objectRamp the temperature from start_temperature to temperature.
Attributes¶
- start_temperature: float, optional
temperature to start from, if None, the temperature of the thermostat is used.
- temperature: float
temperature to ramp to.
- interval: int, default 1
interval in which the temperature is changed.
- interval: int = 1¶
- start_temperature: float | None = None¶
- temperature: float¶
- class ipsuite.ThresholdCheck(status: str | None | bool = None, key: str = 'energy_uncertainty', max_std: float = None, window_size: int = 500, max_value: float = None, minimum_window_size: int = 1, larger_only: bool = False)[source]¶
Bases:
CheckCalculate and check a given threshold and std during a MD simulation
Compute the standard deviation of the selected property. If the property is off by more than a selected amount from the mean, the simulation will be stopped. Furthermore, the simulation will be stopped if the property exceeds a threshold value.
Attributes¶
- key: str
name of the property to check
- max_std: float, optional
Maximum number of standard deviations away from the mean to stop the simulation. Roughly the value corresponds to the following percentiles:
{1: 68%, 2: 95%, 3: 99.7%}
- window_size: int, optional
Number of steps to average over
- max_value: float, optional
Maximum value of the property to check before the simulation is stopped
- minimum_window_size: int, optional
Minimum number of steps to average over before checking the standard deviation. Also minimum number of steps to run, before the simulation can be stopped.
- larger_only: bool, optional
Only check the standard deviation of points that are larger than the mean. E.g. useful for uncertainties, where a lower uncertainty is not a problem.
- get_value(atoms)[source]¶
Get the value of the property to check. Extracted into method so it can be subclassed.
- initialize(atoms: Atoms) None[source]¶
Stores some reference property to compare the current property against and see whether the simulation should be stopped. Derived classes do not need to override this if they consider absolute values and not comparisons.
- key: str = 'energy_uncertainty'¶
- larger_only: bool = False¶
- max_std: float = None¶
- max_value: float = None¶
- minimum_window_size: int = 1¶
- window_size: int = 500¶
- class ipsuite.ThresholdSelection(*args, **kwargs)[source]¶
Bases:
ConfigurationSelectionSelect atoms based on a given threshold.
Select atoms above a given threshold or the n_configurations with the highest / lowest value. Typically useful for uncertainty based selection.
Attributes¶
- key: str
The key in ‘calc.results’ to select from
- threshold: float, optional
All values above (or below if negative) this threshold will be selected. If n_configurations is given, ‘self.threshold’ will be prioritized, but a maximum of n_configurations will be selected.
- reference: str, optional
For visualizing the selection a reference value can be given. For ‘energy_uncertainty’ this would typically be ‘energy’.
- n_configurations: int, optional
Number of configurations to select.
- min_distance: int, optional
Minimum distance between selected configurations.
- dim_reduction: str, optional
Reduces the dimensionality of the chosen uncertainty along the specified axis by calculating either the maximum or mean value.
Choose from [“max”, “mean”]
- reduction_axis: tuple(int), optional
Specifies the axis along which the reduction occurs.
- dim_reduction: str = None¶
- key: str = 'energy_uncertainty'¶
- min_distance: int = 1¶
- n_configurations: int | None = None¶
- reduction_axis: list[int] = (1, 2)¶
- reference: str = 'energy'¶
- select_atoms(atoms_lst: List[Atoms], save_fig: bool = True) List[int][source]¶
Take every nth (step) object of a given atoms list.
Parameters¶
- atoms_lst: typing.List[ase.Atoms]
list of atoms objects to arange
Returns¶
- typing.List[int]:
list containing the taken indices
- threshold: float | None = None¶
- class ipsuite.TorchDFTD3(xc: str, damping: str, cutoff: float, abc: bool, cnthr: float, dtype: str, device: str | None = None, skin: float = 0.0)[source]¶
Bases:
objectCompute D3 correction terms using torch-dftd.
Attributes¶
xc : str damping : str cutoff : float abc : bool
ATM 3-body interaction
- cnthrfloat
Coordination number cutoff distance in angstrom
- dtypestr
Data type used for the calculation.
- devicestr
Device used for the calculation. Defaults to “cuda” if available, otherwise “cpu”.
- skinfloat
If > 0, switches to a D3 implementation that reuses neighborlists. This can significantly improve performance.
- abc: bool¶
- cnthr: float¶
- cutoff: float¶
- damping: str¶
- device: str | None = None¶
- dtype: str¶
- skin: float = 0.0¶
- xc: str¶
- class ipsuite.TranslateMolecules(*args, **kwargs)[source]¶
Bases:
BootstrapGenerate configurations with randomly translated molecular units.
Creates new configurations by applying random translations to individual molecular units while preserving their internal structure. Requires the presence of distinct molecular entities in the system.
Parameters¶
- datalist[ase.Atoms]
Input atomic configurations containing molecular units.
- data_idint, default=-1
Index of the configuration to use from the data list.
- n_configurationsint
Number of configurations with translated molecules to generate.
- maximumfloat
Maximum translation distance (Ångström) for each molecule.
- include_originalbool, default=True
Whether to include the original configuration in output.
- seedint, default=0
Random seed for reproducible translation generation.
Attributes¶
- frameslist[ase.Atoms]
Generated configurations with translated molecular units.
- frames_pathPath
Path to the HDF5 file storing the generated configurations.
Examples¶
>>> with project: ... data = ips.AddData(file="ethanol.xyz") ... translated = ips.TranslateMolecules(data=data.frames, n_configurations=5, ... maximum=0.5) >>> project.repro() >>> print(f"Generated {len(translated.frames)} configurations with translated " ... f"molecules") Generated 6 configurations with translated molecules
- class ipsuite.UniformArangeSelection(*args, **kwargs)[source]¶
Bases:
ConfigurationSelectionSelect configurations with uniform spacing using a step size.
Parameters¶
- datalist[ase.Atoms]
The atomic configurations to select from.
- stepint
Step size for selection. Every nth configuration will be selected.
Attributes¶
- selected_idslist[int]
Indices of selected configurations.
- frameslist[ase.Atoms]
The selected atomic configurations.
- excluded_frameslist[ase.Atoms]
The atomic configurations that were not selected.
Examples¶
>>> with project: ... data = ips.AddData(file="ethanol.xyz") # contains 100 frames ... selector = ips.UniformArangeSelection(data=data.frames, step=10) >>> project.repro() >>> print(f"Selected {len(selector.selected_ids)} configurations with IDs: " ... f"{selector.selected_ids}") Selected 10 configurations with IDs: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90]
- select_atoms(atoms_lst: List[Atoms]) List[int][source]¶
Take every nth (step) object of a given atoms list.
Parameters¶
- atoms_lst: typing.List[ase.Atoms]
list of atoms objects to arange
Returns¶
- typing.List[int]:
list containing the taken indices
- step: int¶
- class ipsuite.UniformEnergeticSelection(*args, **kwargs)[source]¶
Bases:
ConfigurationSelectionA class to perform data selection based on uniform global energy selection.
- n_configurations: int¶
- class ipsuite.UniformTemporalSelection(*args, **kwargs)[source]¶
Bases:
ConfigurationSelectionSelect configurations uniformly distributed across time.
Parameters¶
- datalist[ase.Atoms]
The atomic configurations to select from.
- n_configurationsint
Number of configurations to select uniformly across the trajectory.
Attributes¶
- selected_idslist[int]
Indices of selected configurations.
- frameslist[ase.Atoms]
The selected atomic configurations.
- excluded_frameslist[ase.Atoms]
The atomic configurations that were not selected.
Examples¶
>>> with project: ... data = ips.AddData(file="ethanol.xyz") # contains 100 frames ... selector = ips.UniformTemporalSelection(data=data.frames, n_configurations=5) >>> project.repro() >>> print(f"Selected {len(selector.selected_ids)} configurations with IDs: " ... f"{selector.selected_ids}") Selected 5 configurations with IDs: [0, 25, 50, 74, 99]
- n_configurations: int¶
- class ipsuite.VelocityVerletDynamic(time_step: int)[source]¶
Bases:
objectInitialize the Velocity Verlet dynamics
Attributes¶
- time_step: float
time step of simulation
- time_step: int¶
- class ipsuite.xTBSinglePoint(*args, **kwargs)[source]¶
Bases:
ProcessAtomsNode for labeling date with xTB and obtaining ASE calculators.
Installation: conda install conda-forge::tblite-python
Attributes¶
- method: str
xTB method to be used. Only “GFN1-xTB” supports PBC.
- accuracy: float = 1.0¶
- charge: int = None¶
- electronic_temperature: float = 300.0¶
- initial_guess: str = 'sad'¶
- max_iterations: int = 250¶
- method: str = 'GFN1-xTB'¶
- mixer_damping: float = 0.4¶
- multiplicity: int = None¶
- spin_polarization: float = None¶