Classes | |
| class | ErrorManager |
| Responsible for errors handling. More... | |
| class | FileManager |
| Responsible for generic IO operations. More... | |
| struct | FrameEnergyForces |
| struct | GpInitializationOverrides |
| class | LogManager |
| Responsible for logging. More... | |
| struct | MetatomicConfigFields |
| struct | NebDriverConfig |
| struct | TrainedGpState |
Functions | |
| void | loadParametersFromCapnp (const std::string &binary_filename, gpr::InputParameters ¶meters) |
| Loads parameters by reading a memory-mapped Cap'n Proto binary file. | |
| bool | readerIsLegacyDimer (capnp::MessageReader &reader) |
| Whether reader is a gprd_params.capnp message rather than a params.capnp message. | |
| void | overlayLegacyDimerReader (capnp::MessageReader &reader, gpr::schema::InputParameters::Builder unified) |
| Copy a gprd_params.capnp reader onto a unified builder. | |
| GpInitializationOverrides | readGpInitializationOverrides (gpr::schema::InputParameters::Reader params) |
| void | applyDimerConfigFromCapnp (gpr::schema::InputParameters::Reader params, gpr::InputParameters ¶meters) |
| Project the dimer arm of a unified configuration into the runtime parameter record. | |
| void | loadNebConfigFromCapnp (const std::string &binary_filename, gpr::neb::GPNEBConfig &config) |
| Load the NEB-chain knobs from a unified-schema (params.capnp) Cap'n Proto binary into a gpr::neb::GPNEBConfig. | |
| void | applyNebConfigFromCapnp (gpr::schema::InputParameters::Reader params, gpr::neb::GPNEBConfig &config, bool validate_rigid_deflation=true) |
| Materialize a gpr::neb::GPNEBConfig from an already-open unified-schema message. Reader-based counterpart of loadNebConfigFromCapnp with additional driver, GP and uncertainty controls for a file baseline. The filename-based adapter retains the established binary override subset. Unset scalar fields use the unified schema defaults. | |
| void | applyOciConfigFromCapnp (gpr::schema::InputParameters::Reader params, gpr::neb::OCINEBConfig &config) |
| Materialize a gpr::neb::OCINEBConfig (the –use-mmf / –mmf-* family, plus the dimer posterior-variance accept-tau gate carried on Uncertainty) from an already-open unified-schema message. | |
| void | applyMetatomicConfigFromCapnp (gpr::schema::InputParameters::Reader params, MetatomicConfigFields &metatomic) |
| Materialize the metatomic oracle knobs (model/device live on the top-level InputParameters; rotations/so3-policy/uncertainty threshold live on InputParameters.metatomic) from an already-open unified-schema message. | |
| void | applyDriverConfigFromCapnp (gpr::schema::InputParameters::Reader params, NebDriverConfig &driver) |
| Materialize the driver-level knobs (endpoint paths, run I/O, image count, seed, endpoint assignment / pruning switches) from an already-open unified-schema message. | |
| void | loadOciMmfConfigFromCapnp (const std::string &filename, gpr::neb::OCINEBConfig &config) |
| Load the binary MMF override subset, preserving uncertainty controls. | |
| void | saveTrainedGpState (const std::string &path, const GaussianProcessRegression &gp, const Observation &observations, const AtomsConfiguration &atoms) |
| Write gp-state.npz. A second save of the same state is the same bytes. | |
| TrainedGpState | loadTrainedGpState (const std::string &path) |
| TrainedGpState | observationState (const Observation &observations) |
| A state that carries observations and no pair kernel. | |
| bool | applyTrainedGpState (GaussianProcessRegression &gp, const TrainedGpState &state, const AtomsConfiguration &atoms, bool require_identity) |
| void | refuseNonFiniteSeedRows (const Observation &observations, Eigen::Index expected_cols) |
| void | noteLocalKernel (neb::ActiveLearningSession &session, const TrainedGpState &state) |
| int | seedSession (neb::ActiveLearningSession &session, const TrainedGpState &state, bool require_identity, Eigen::Index expected_cols) |
| std::string | resolveGpStatePath (const std::string &spec, bool restart) |
| std::string | outputDirectory (const std::string &output_path) |
| Directory of an output path, or . when the path has no directory. | |
| void | loadEnvironmentAtomTypes (std::istream &input, gpr::AtomsConfiguration &atoms_config, const gpr::InputParameters ¶meters) |
| void | loadEnvironmentAtomTypes (const std::string &path, gpr::AtomsConfiguration &atoms_config, const gpr::InputParameters ¶meters) |
| void | initializeAtomsConfiguration (const gpr::Coord &R_init, const gpr::InputParameters ¶meters, const std::unordered_map< std::string, gpr::Index_t > &atomtypes, gpr::AtomsConfiguration &atoms_config) |
| std::array< double, 9 > | cellMatrixFromLengthsAndAngles (const std::array< double, 3 > &cell, const std::array< double, 3 > &angles) |
| void | setCellDimensionsFromLengthsAndAngles (const std::array< double, 3 > &cell, const std::array< double, 3 > &angles, gpr::InputParameters ¶meters) |
| static void | requireUsableFrame (const readcon::CFrame &frame, const char *role) |
| template<class To, class From> | |
| static To | checkedNarrow (From value, const char *field) |
| void | loadAtomsConfigurationFromFrame (const readcon::CFrame &frame, gpr::AtomsConfiguration &atoms_config, gpr::Coord &R_init, gpr::InputParameters ¶meters, const readcon::CFrame *product, std::vector< int > *reactive_atoms) |
| template<typename Type, typename AtomicNr> | |
| std::vector< Type > | elementAtomTypes (const AtomicNr *atomic_nrs, std::size_t n_atoms) |
| double | maxAtomicForce (const double *forces, std::size_t n_atoms) noexcept |
| Largest atomic force norm. NaN when any component is non-finite. | |
| int | addAtomWithOptionalForce (readcon::RKRConFrameBuilder *builder, const char *symbol, double x, double y, double z, bool fixed, std::uint64_t atom_id, double mass, const double *force) |
| Add one atom. force is three doubles, or null when the atom has none. | |
| FrameEnergyForces | frameEnergyForces (const readcon::RKRConFrame *frame, const readcon::CFrame &parsed) |
| std::string | seedKernelAtomsIdentity (const AtomsConfiguration &atoms) |
| Atomic descriptor identity; moving positions belong to the observations. | |
| std::string | seedKernelIdentity (const GaussianProcessRegression &gp, const AtomsConfiguration &atoms) |
| bool | readSeedKernelAtomTypes (std::istream &input, AtomsConfiguration &atoms, const InputParameters ¶meters) |
| Restore the archived type map after checking physical atom identity. | |
| void | writeSeedKernel (std::ostream &out, const GaussianProcessRegression &gp, const AtomsConfiguration &atoms) |
| Write fitted covariance parameters, output units, and descriptor identity. | |
| bool | readSeedKernel (std::istream &input, GaussianProcessRegression &gp, const AtomsConfiguration &atoms, bool require_identity, bool preserve_source_noise) |
| Validate the complete seed before changing any model parameter. | |
|
inline |
Add one atom. force is three doubles, or null when the atom has none.
Definition at line 99 of file ReadConLoader.h.
| void gpr::io::applyDimerConfigFromCapnp | ( | gpr::schema::InputParameters::Reader | params, |
| gpr::InputParameters & | parameters ) |
Project the dimer arm of a unified configuration into the runtime parameter record.
The reader may be backed by either a params.capnp binary or TOML through UnifiedConfigMessage. The message must select InputParameters.method.dimer.
Definition at line 358 of file CapnProtoNebLoader.cpp.
| void gpr::io::applyDriverConfigFromCapnp | ( | gpr::schema::InputParameters::Reader | params, |
| NebDriverConfig & | driver ) |
Materialize the driver-level knobs (endpoint paths, run I/O, image count, seed, endpoint assignment / pruning switches) from an already-open unified-schema message.
Definition at line 613 of file CapnProtoNebLoader.cpp.
| void gpr::io::applyMetatomicConfigFromCapnp | ( | gpr::schema::InputParameters::Reader | params, |
| MetatomicConfigFields & | metatomic ) |
Materialize the metatomic oracle knobs (model/device live on the top-level InputParameters; rotations/so3-policy/uncertainty threshold live on InputParameters.metatomic) from an already-open unified-schema message.
Definition at line 601 of file CapnProtoNebLoader.cpp.
| void gpr::io::applyNebConfigFromCapnp | ( | gpr::schema::InputParameters::Reader | params, |
| gpr::neb::GPNEBConfig & | config, | ||
| bool | validate_rigid_deflation = true ) |
Materialize a gpr::neb::GPNEBConfig from an already-open unified-schema message. Reader-based counterpart of loadNebConfigFromCapnp with additional driver, GP and uncertainty controls for a file baseline. The filename-based adapter retains the established binary override subset. Unset scalar fields use the unified schema defaults.
| std::runtime_error | if the message carries no NebParams (method union not set to neb). |
Definition at line 526 of file CapnProtoNebLoader.cpp.
| void gpr::io::applyOciConfigFromCapnp | ( | gpr::schema::InputParameters::Reader | params, |
| gpr::neb::OCINEBConfig & | config ) |
Materialize a gpr::neb::OCINEBConfig (the –use-mmf / –mmf-* family, plus the dimer posterior-variance accept-tau gate carried on Uncertainty) from an already-open unified-schema message.
| std::runtime_error | if the message carries no NebParams. |
Definition at line 588 of file CapnProtoNebLoader.cpp.
| bool gpr::io::applyTrainedGpState | ( | GaussianProcessRegression & | gp, |
| const TrainedGpState & | state, | ||
| const AtomsConfiguration & | atoms, | ||
| bool | require_identity ) |
Install the saved hyperparameters. Raw float64 values overwrite the text kernel, so a load/apply round trip keeps the bits. Returns false when the kernel does not match this model.
Definition at line 564 of file GpState.cpp.
| std::array< double, 9 > gpr::io::cellMatrixFromLengthsAndAngles | ( | const std::array< double, 3 > & | cell, |
| const std::array< double, 3 > & | angles ) |
Full 3x3 cell matrix (row-major; rows are the lattice vectors a, b, c) from .con lengths + angles (degrees, order alpha, beta, gamma). Lower-triangular convention: a along x, b in the xy plane.
Definition at line 239 of file ReadConLoader.cpp.
|
static |
Definition at line 282 of file ReadConLoader.cpp.
|
nodiscard |
Dense atom types for n_atoms atomic numbers: one type per element, numbered in order of first appearance.
Definition at line 43 of file ReadConLoader.h.
|
inlinenodiscard |
Definition at line 117 of file ReadConLoader.h.
| void gpr::io::initializeAtomsConfiguration | ( | const gpr::Coord & | R_init, |
| const gpr::InputParameters & | parameters, | ||
| const std::unordered_map< std::string, gpr::Index_t > & | atomtypes, | ||
| gpr::AtomsConfiguration & | atoms_config ) |
Definition at line 163 of file ReadConLoader.cpp.
| void gpr::io::loadAtomsConfigurationFromFrame | ( | const readcon::CFrame & | frame, |
| gpr::AtomsConfiguration & | atoms_config, | ||
| gpr::Coord & | R_init, | ||
| gpr::InputParameters & | parameters, | ||
| const readcon::CFrame * | product = nullptr, | ||
| std::vector< int > * | reactive_atoms = nullptr ) |
Fill the configuration from a readcon frame: positions, frozen flags, ids, atomic numbers, one atom type per element, the cell, then the moving/frozen split and pair types. With a product frame of the same atoms, every atom whose covalent bond set differs between the two frames is moved to its element's reactive type (gpr::geometry::assignReactiveAtomTypes) before the pair types are built, so the reactive pairs get their own kernel length scales; reactive_atoms receives their indices.
Definition at line 291 of file ReadConLoader.cpp.
| void gpr::io::loadEnvironmentAtomTypes | ( | const std::string & | path, |
| gpr::AtomsConfiguration & | atoms_config, | ||
| const gpr::InputParameters & | parameters ) |
Definition at line 152 of file ReadConLoader.cpp.
| void gpr::io::loadEnvironmentAtomTypes | ( | std::istream & | input, |
| gpr::AtomsConfiguration & | atoms_config, | ||
| const gpr::InputParameters & | parameters ) |
Load fixed environment classes from rows: atom index, atomic number, type, and optionally the base type (element and reaction role) the class refines, which fills pair_type_parent for tied length scales. Validate every row before replacing types and rebuilding moving/frozen pairs.
Definition at line 27 of file ReadConLoader.cpp.
| void gpr::io::loadNebConfigFromCapnp | ( | const std::string & | binary_filename, |
| gpr::neb::GPNEBConfig & | config ) |
Load the NEB-chain knobs from a unified-schema (params.capnp) Cap'n Proto binary into a gpr::neb::GPNEBConfig.
Reads the InputParameters.method.neb branch (NebParams) plus the shared GP conditioning blocks (HsSvd.principledNugget/kappaMax, optimizer.lengthScalePriors.lengthScalePrior) and maps them onto the GP-OIE config. The 9-way acquisition switch mirrors the DistMetric / ScgCurvatureMode switch pattern in loadParametersFromCapnp. Fields absent from the message keep their GPNEBConfig defaults (capnp supplies schema defaults). This is the gprn (NEB) counterpart to loadParametersFromCapnp, which serves the dimer driver via the legacy gprd_params.capnp schema.
| binary_filename | Path to the unified-schema Cap'n Proto binary. |
| config | The GP-NEB config to populate (NEB knobs only). |
| std::runtime_error | if the file is missing/empty or carries no NebParams (method union not set to neb). |
Definition at line 660 of file CapnProtoNebLoader.cpp.
| void gpr::io::loadOciMmfConfigFromCapnp | ( | const std::string & | filename, |
| gpr::neb::OCINEBConfig & | config ) |
Load the binary MMF override subset, preserving uncertainty controls.
Definition at line 667 of file CapnProtoNebLoader.cpp.
| void gpr::io::loadParametersFromCapnp | ( | const std::string & | binary_filename, |
| gpr::InputParameters & | parameters ) |
Loads parameters by reading a memory-mapped Cap'n Proto binary file.
This function replaces the manual text parsing of FileManager::readInputFile. It opens the binary file, maps it to memory, and populates the legacy gpr::InputParameters struct.
| binary_filename | The path to the Cap'n Proto binary file (e.g., "capnp_params.bin"). |
| parameters | The legacy C++ parameters struct to be filled. |
Definition at line 20 of file CapnProtoManager.cpp.
|
nodiscard |
Definition at line 516 of file GpState.cpp.
|
inlinenodiscardnoexcept |
Largest atomic force norm. NaN when any component is non-finite.
Definition at line 82 of file ReadConLoader.h.
| void gpr::io::noteLocalKernel | ( | neb::ActiveLearningSession & | session, |
| const TrainedGpState & | state ) |
Definition at line 619 of file GpState.cpp.
|
nodiscard |
A state that carries observations and no pair kernel.
Definition at line 556 of file GpState.cpp.
|
nodiscard |
Directory of an output path, or . when the path has no directory.
Definition at line 714 of file GpState.cpp.
| void gpr::io::overlayLegacyDimerReader | ( | capnp::MessageReader & | reader, |
| gpr::schema::InputParameters::Builder | unified ) |
Copy a gprd_params.capnp reader onto a unified builder.
The builder's dimer arm must already be initialized. Strings and lists are copied into the builder, so the legacy reader can be destroyed afterwards. Schema defaults of fields the legacy message left unset overwrite the builder, matching loadParametersFromCapnp.
Definition at line 411 of file CapnProtoManager.cpp.
| bool gpr::io::readerIsLegacyDimer | ( | capnp::MessageReader & | reader | ) |
Whether reader is a gprd_params.capnp message rather than a params.capnp message.
Cap'n Proto does not store the schema id, so the size of the root's data and pointer sections decides. A gprd_params.capnp message has the root of one of that schema's revisions since its field numbers settled. A params.capnp message has one data word and between the 20 pointers of that schema's first revision and its current count; no root is both. A root between two gprd_params.capnp revisions is refused, since no writer emitted it. A root at least as large as the current params.capnp root is a newer params.capnp message when its schema version is newer than this build, and the caller checks that version. The same size stamped with a version this build knows matches no revision and throws std::runtime_error naming the version and the size. Any other root throws std::runtime_error naming its size.
Definition at line 389 of file CapnProtoManager.cpp.
| GpInitializationOverrides gpr::io::readGpInitializationOverrides | ( | gpr::schema::InputParameters::Reader | params | ) |
Definition at line 325 of file CapnProtoNebLoader.cpp.
| bool gpr::io::readSeedKernel | ( | std::istream & | input, |
| GaussianProcessRegression & | gp, | ||
| const AtomsConfiguration & | atoms, | ||
| bool | require_identity, | ||
| bool | preserve_source_noise ) |
Validate the complete seed before changing any model parameter.
Definition at line 310 of file SeedKernel.cpp.
| bool gpr::io::readSeedKernelAtomTypes | ( | std::istream & | input, |
| AtomsConfiguration & | atoms, | ||
| const InputParameters & | parameters ) |
Restore the archived type map after checking physical atom identity.
Restore a saved type map before GP initialization. Physical composition, frozen geometry, cell, and the rebuilt pair ordering must match exactly. Kernel parameters and model-profile compatibility are checked separately by readSeedKernel after the destination GP is initialized.
Definition at line 175 of file SeedKernel.cpp.
| void gpr::io::refuseNonFiniteSeedRows | ( | const Observation & | observations, |
| Eigen::Index | expected_cols = -1 ) |
Refuse a seed whose rows are non-finite, the wrong length, or a different width from this search. expected_cols < 0 skips the width check. The message names how many rows would have been kept.
Definition at line 587 of file GpState.cpp.
|
static |
Definition at line 267 of file ReadConLoader.cpp.
|
nodiscard |
--gp-init names the npz file. --restart names a directory or a previous output file; the npz is that directory's gp-state.npz, or the sibling of the output file.
Definition at line 694 of file GpState.cpp.
| void gpr::io::saveTrainedGpState | ( | const std::string & | path, |
| const GaussianProcessRegression & | gp, | ||
| const Observation & | observations, | ||
| const AtomsConfiguration & | atoms ) |
Write gp-state.npz. A second save of the same state is the same bytes.
Definition at line 450 of file GpState.cpp.
|
nodiscard |
Atomic descriptor identity; moving positions belong to the observations.
Definition at line 26 of file SeedKernel.cpp.
|
nodiscard |
Definition at line 158 of file SeedKernel.cpp.
| int gpr::io::seedSession | ( | neb::ActiveLearningSession & | session, |
| const TrainedGpState & | state, | ||
| bool | require_identity, | ||
| Eigen::Index | expected_cols = -1 ) |
Copy seed rows into the session. They are prior data: append does not count an oracle call. The hook installs hyperparameters once the session builds its GP. expected_cols < 0 skips the width check; a seed with rows of any other width is refused before a column is stored.
Definition at line 638 of file GpState.cpp.
| void gpr::io::setCellDimensionsFromLengthsAndAngles | ( | const std::array< double, 3 > & | cell, |
| const std::array< double, 3 > & | angles, | ||
| gpr::InputParameters & | parameters ) |
Definition at line 255 of file ReadConLoader.cpp.
| void gpr::io::writeSeedKernel | ( | std::ostream & | out, |
| const GaussianProcessRegression & | gp, | ||
| const AtomsConfiguration & | atoms ) |
Write fitted covariance parameters, output units, and descriptor identity.
Definition at line 259 of file SeedKernel.cpp.