oqp.pyoqp

PyOQP

This module serves as the main entry point for the OQP (Open Quantum Package)
software. It handles command-line arguments, initializes the OQP environment,
and executes the appropriate computations or tests.

Classes

Runner

Functions

main()

generate_reference_cli(inputs)

feature_coverage_cli(examples_dir)

validate_examples_cli(examples_dir)

run_tests(test_path, *[, input_format])

Module Contents

class Runner(project=None, input_file=None, log=None, input_dict=None, silent=0, usempi=True, input_metadata=None)
OQP main class for running calculations and tests.

one can read input parameters from text file using input_file, e.g,
    OQP(project=project_name, log=log_file, input_file=a_text_file)

or

one can pass input parameters to OQP internally using input_dict, e.g.,
    OQP(project=project_name, log=log_file, input_dict=USER_CONFIG)
    USER_CONFIG follows the same format as OQP_CONFIG_SCHEMA
mpi_manager
run_func
mol
run(test_mod=False)
Run the OQP calculation or test.

:param test_mod: Flag to run in test mode.
:type test_mod: bool
results()
Collect calculation results for internal Python communication.

:returns: A dictionary containing calculation results.
:rtype: dict
reload()
Reload calculation based on the specified guess type.
back_door(data)
Set back door data for the molecule.

:param data: Data to be set as back door for the molecule.
test()
Run tests and check results against reference data (json).
main()
Main function to handle command-line arguments and run OQP.
generate_reference_cli(inputs)
(Re)generate lean JSON test references for the given input files.

Runs each input and writes only the regression-registry keys (physics +
identity/metadata) next to the input, dropping internal OQP:: arrays. This is
the supported, repeatable way to add or refresh example references so the
committed set stays clean, small, and consistent with the registry. The
written references are validated against the registry before returning.
feature_coverage_cli(examples_dir)
Gate: every opt-in feature flag in the input schema must be exercised by
at least one example, so a new feature cannot ship without a test. Exit 0
if covered (grandfathered gaps are warnings), 1 if a new flag is untested.
validate_examples_cli(examples_dir)
Gate: every example reference must carry the regression values its
runtype/method/properties require (per the registry). Returns a process
exit code (0 = all good, 1 = at least one reference is missing a value).
run_tests(test_path, *, input_format='auto')
Run OQP tests.

:param test_path: Path to the test directory or 'all' or 'other'.
:type test_path: str
:param input_format: ``auto`` (default), ``inp``, ``oqp``, or ``both``.
:type input_format: str

:returns: Test report.
:rtype: str