systems
systems
¶
Benchmark system configurations.
Each :class:SystemSpec declaratively describes one benchmark system —
its molecule source, FF-assembly strategy, and metadata — and the
:data:SYSTEMS registry maps a CLI key to that spec. The single
public entry point is :func:load_system, which dispatches to the
right molecule loader and the right FF strategy based on the spec.
Adding a new system = appending a :class:SystemSpec entry to
:data:SYSTEMS; no new module-level function is required.
Usage::
from q2mm.systems import load_system, SYSTEMS
sys_data = load_system("rh-enamide", engine=engine)
The FF-assembly strategies live in :mod:q2mm.models.loaders and
correspond to the published-FF workflows in Farrugia, Helquist, Norrby
& Wiest 2025 (the QFUERZA paper — see AGENTS.md "Key Papers").
FFStrategy
module-attribute
¶
Names of the FF-assembly strategies in :mod:q2mm.models.loaders.
StartingPoint
module-attribute
¶
Choice of starting-parameter values for the optimizer.
"qfuerza"(default, canonical): take the FF skeleton from the.fldfile (atom-type rows, OPT-substructure topology, frozen/ active partition, vdW, stretch-bend, Urey-Bradley) and overwrite the OPT bond and angle scalars with QFUERZA Hessian-derived estimates averaged across the training molecules (Farrugia 2025 protocol). This is the standard QFUERZA workflow as defined in the literature: the chemist provides the FF skeleton (no tool can automate the decisions of which atom types to use or which substructure rows need OPT parameters); QFUERZA fills in the Hessian-derivable scalars. Frozen MM3 backbone parameters are untouched; torsions are zeroed; OPT parameters that :func:qfuerza_intodoes not estimate (stretch-bends, vdW, Urey-Bradley) retain their literature values — the audit in :func:load_systemrecords this explicitly."published": use the literature OPT values from the.fldfile(s) as-is, with no QFUERZA overwrite. This is the publication-baseline path used to reproduce historical convergence runs.
For qfuerza_fresh strategy (CH3F), "qfuerza" is a no-op
because the FF is already QFUERZA-derived; the audit records this.
SystemData
dataclass
¶
SystemData(molecules: list[Q2MMMolecule], forcefield: ForceField, reference: ReferenceData, qm_freqs_per_mol: list[ndarray], metadata: dict[str, Any] = dict(), normal_modes: dict[str, ndarray] | None = None)
Loaded data for a benchmark system, ready for optimization.
Attributes:
| Name | Type | Description |
|---|---|---|
molecules |
list[Q2MMMolecule]
|
One or more molecules with geometry (and optionally Hessians). |
forcefield |
ForceField
|
Template force field (from QFUERZA estimation or file). |
reference |
ReferenceData
|
Reference data for the objective function. |
qm_freqs_per_mol |
list[ndarray]
|
QM real frequencies per molecule (for reporting only).
These frequencies are stored separately from |
metadata |
dict[str, Any]
|
Extra info (level of theory, molecule name, etc.). |
normal_modes |
dict[str, ndarray] | None
|
Pre-computed normal modes for PES distortion analysis.
|
ExternalDataRoots
dataclass
¶
ExternalDataRoots(rh_enamide: Path | None = None, supporting_info: Path | None = None, mm3_base: Path | None = None)
Explicit locations for scientific data that Q2MM does not distribute.
Attributes:
| Name | Type | Description |
|---|---|---|
rh_enamide |
Path | None
|
Directory containing |
supporting_info |
Path | None
|
Root of the extracted Wahlers/Rosales dissertation
supporting information. Environment fallback:
|
mm3_base |
Path | None
|
Path to the licensed MM3 base |
from_environment
classmethod
¶
from_environment() -> ExternalDataRoots
Build roots from Q2MM's documented environment variables.
Source code in q2mm/systems.py
SystemSpec
dataclass
¶
SystemSpec(key: str, name: str, molecule_loader: Callable[..., list[Q2MMMolecule]], ff_strategy: FFStrategy, uses_external_data_roots: bool = False, ff_paths: Mapping[str, Callable[..., Path]] = dict(), normal_modes_path: Callable[[Path | None], Path | None] | None = None, metadata: Mapping[str, Any] = dict(), metal: str | None = None, description: str = '', default_forms: tuple[str, ...] = ('mm3',))
Declarative spec for one benchmark system.
The :func:load_system dispatcher reads this spec to build a
:class:SystemData for the system. Add new systems by appending
to :data:SYSTEMS; do not write per-system loader functions.
Attributes:
| Name | Type | Description |
|---|---|---|
key |
str
|
CLI key (e.g. |
name |
str
|
Human-readable system name. |
molecule_loader |
Callable[..., list[Q2MMMolecule]]
|
Zero-argument callable returning the training- set molecules (with QM Hessians for the published-FF systems). |
uses_external_data_roots |
bool
|
Whether :func: |
ff_strategy |
FFStrategy
|
Name of the FF-assembly strategy in
:mod: |
ff_paths |
Mapping[str, Callable[..., Path]]
|
Mapping of strategy-specific path keys to callables that
return a :class:
|
normal_modes_path |
Callable[[Path | None], Path | None] | None
|
Optional callable returning a path to a
|
metadata |
Mapping[str, Any]
|
Static metadata merged into the returned
:class: |
metal |
str | None
|
Optional element symbol for vdW injection during
|
description |
str
|
One-line CLI description. |
default_forms |
tuple[str, ...]
|
Functional forms to benchmark by default. |
load_rh_enamide_molecules
¶
load_rh_enamide_molecules(*, data_roots: ExternalDataRoots | None = None) -> list[Q2MMMolecule]
Load 9 rh-enamide structures with Jaguar Hessians.
This is the shared loader used by both the benchmark CLI and tests.
Returns:
| Type | Description |
|---|---|
list[Q2MMMolecule]
|
list[Q2MMMolecule]: 9 molecules with Hessian matrices. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the rh-enamide dataset is not found. |
ValueError
|
If the number of MacroModel structures doesn't match the number of Jaguar input files. |
Source code in q2mm/systems.py
load_heck_relay_molecules
¶
load_heck_relay_molecules(*, data_roots: ExternalDataRoots | None = None) -> list[Q2MMMolecule]
Load the 23 Heck relay TS molecules from Gaussian logs.
Returns:
| Type | Description |
|---|---|
list[Q2MMMolecule]
|
List of Q2MMMolecule with Hessians and MM3 atom types assigned. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the training set directory is absent. |
Source code in q2mm/systems.py
load_pd_allyl_molecules
¶
load_pd_allyl_molecules(*, data_roots: ExternalDataRoots | None = None) -> list[Q2MMMolecule]
Load the 21 Pd-allyl amination TS molecules (Wahlers Ch 3).
load_pd_conjugate_molecules
¶
load_pd_conjugate_molecules(*, data_roots: ExternalDataRoots | None = None) -> list[Q2MMMolecule]
Load the 10 Pd 1,4-conjugate addition TS molecules (Wahlers Ch 5).
load_rh_conjugate_molecules
¶
load_rh_conjugate_molecules(*, data_roots: ExternalDataRoots | None = None) -> list[Q2MMMolecule]
Load the 10 Rh 1,4-conjugate addition TS molecules (Wahlers Ch 6).
load_system
¶
load_system(key: str, *, engine: Any | None = None, functional_form: str | None = None, molecule_loader_kwargs: dict[str, Any] | None = None, data_roots: ExternalDataRoots | None = None, starting_point: StartingPoint = 'qfuerza', qfuerza_replace_with: float = 1.0) -> SystemData
Build a :class:SystemData for one benchmark system.
The single loader entry point. Dispatches on the system's
:class:SystemSpec to build the molecule list and the force
field, then constructs the reference data and metadata.
Reference construction depends on the FF strategy:
qfuerza_fresh(single-molecule, e.g. CH3F): a frequency-only reference is built fromengine.frequencies(molecule, ff)compared against the QM frequencies derived from the Hessian. The engine must be provided in this case.published_opt/published_opt_composed(multi-molecule published-FF systems): an eigenmatrix-diagonal reference is built via :meth:ReferenceData.from_molecules. The engine is unused.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
System key from :data: |
required |
engine
|
Any | None
|
MM engine instance; required for |
None
|
functional_form
|
str | None
|
Override the FF's functional form
( |
None
|
molecule_loader_kwargs
|
dict[str, Any] | None
|
Optional kwargs forwarded to the
system's molecule loader (e.g. |
None
|
data_roots
|
ExternalDataRoots | None
|
Explicit locations for non-distributed scientific data.
When omitted, the named |
None
|
starting_point
|
StartingPoint
|
Where the starting OPT parameter values come
from. See :data: |
'qfuerza'
|
qfuerza_replace_with
|
float
|
Replacement value (Hartree/Bohr²) for the
most negative TS-Hessian eigenvalue during QFUERZA
projection. Default |
1.0
|
Returns:
| Type | Description |
|---|---|
SystemData
|
A fully-populated :class: |
SystemData
|
|
SystemData
|
parameter type, how many active scalars were QFUERZA-overwritten |
SystemData
|
vs retained from the published FF vs frozen — see |
SystemData
|
func: |
Raises:
| Type | Description |
|---|---|
KeyError
|
If key is not in :data: |
TypeError
|
If engine is required but not provided. |
ValueError
|
If starting_point is not one of |
Source code in q2mm/systems.py
733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 | |