QM Common Data Model Design¶
This page defines the boundaries of MolOP’s common QM input and result containers. The goal is to let Gaussian, ORCA, and future program parsers project into one shared model without letting duplicated fields overwrite each other.
Layers¶
The common QM model has three layers:
- Compatibility fields:
method,functional,basis_set,keywords,request_num_cpu,request_memory, andresources_raw. They remain available for existing API users, but new parser logic should not treat them as authoritative. - Input request containers:
model_chemistry,task_requests,resource_request,excited_state_requests, andmultireference_requests. Parsers should write these structured fields first. - Result containers:
energies,molecular_orbitals,vibrations,single_point_properties,electronic_states, andmultireference_result. These describe calculation output and should not infer input requests in reverse.
Source Of Truth¶
Structured containers are authoritative. After parsing structured semantics, parsers should call project_common_qm_fields() to project structured containers onto compatibility fields:
model_chemistry.raw_keywords->keywordsmodel_chemistry.method_family/method->methodmodel_chemistry.functional->functionalmodel_chemistry.basis_set->basis_setresource_request.num_cpu/memory/raw->request_num_cpu/request_memory/resources_raw
The legacy refresh_common_qm_containers() method is kept for existing callers only. It backfills empty
structured fields from compatibility fields and then projects the structured values back to compatibility
fields. It never lets flat fields overwrite already parsed structured semantics. To change normalized
semantics, modify the structured container and call project_common_qm_fields().
Input Requests¶
QMModelChemistry describes model chemistry:
methodis the stable concrete electronic-structure method used for matching and protocol identity. GaussianR,U, andROprefixes are removed from this value and retained separately inspin_treatment; the original route token remains available in Gaussian’s semantic route evidence.- Functionals and dispersion belong to the same model-chemistry expression. Gaussian and ORCA both append the dispersion suffix to
functional, such asB3LYP-GD3BJ. dispersion_correctionalso stores the normalized dispersion label, such asGD3BJorD4.basis_setsstores mixed basis sets, auxiliary basis sets, ECPs, and atom-scoped overrides.basis_setstores only the primary global orbital basis.solvation_modelandsolventdescribe the input request and are separate from output-sideBaseCalcFrame.solvent.
QMTaskRequest describes only generic task types and generic task options, such as sp, opt, freq, excited_state, and multi_reference. Domain-specific excited-state and multi-reference parameters belong in their dedicated containers.
ExcitedStateRequest describes requested roots, number of states, spin channels, root following, and requested properties.
MultireferenceRequest describes requested multi-reference method, reference method, active space, state blocks, thresholds, and corrections.
Results¶
ElectronicStates stores state/root-resolved output data for excited-state, MRCI, CASSCF, and related calculations. It does not replace energies, which remains the overall or ground-state energy container.
MultireferenceResult stores multi-reference output data, including method, active space, state-resolved results, corrections, and diagnostics. It does not replace input-side MultireferenceRequest.
Parser Rules¶
New parser logic should follow this flow:
- Declare a canonical
format_id, implement_quick_check_file_format()and_locate_segments()on the file parser, and locate original source ranges directly. - Implement
_parse_artifact_metadata()or_parse_segment_metadata()only when that scope has metadata. - Parse program-specific syntax into semantic models and build common structured containers.
- If resource or keyword data was initially parsed into legacy fields, use
backfill_common_qm_containers_from_legacy()only to fill empty structured fields. - Call
project_common_qm_fields()and test structured fields and compatibility projections together.
Do not reintroduce _split_file() or _parse_metadata(). The locator is the
only source of truth for segment/frame boundaries and the source slices sent to
the frame parser.
Do not store new semantics only in keywords, resources_raw, or options. options is reserved for program-specific details that do not yet have a common field.