FORQ: Fortran-to-Quantum Translator and Hybrid Orchestration Layer
Definition
FORQ is a Fortran-to-Quantum translator and orchestration layer that automatically offloads selected HPC routines from classical Fortran code to quantum hardware. The Fortran programmer does not need any knowledge of quantum computing; FORQ autonomously determines which parts of the program are suitable for quantum execution and manages the full transport and feedback pipeline.
Architecture
The architecture consists of three primary components:
- An Ada-based analysis engine;
- A PostgreSQL-driven decision layer;
- A transport layer for quantum execution and hybrid result handling.
Ada Analysis Engine
The analysis engine processes Fortran source code and constructs an internal representation. Using static analysis, complexity patterns, and profiling data, code segments are classified as:
- classical execution;
- quantum candidates;
- hybrid (classical + quantum).
PostgreSQL Decision Layer
Analysis results are stored in PostgreSQL. The database acts as the decision-making layer for:
- selecting routines for quantum translation;
- storing metadata and runtime profiles;
- managing hybrid results and execution status.
Quantum Translation and Transport Layer
Selected Fortran routines are translated into a quantum IR (e.g., QASM or circuit representations). The transport layer:
- serializes input data;
- submits jobs to a quantum backend;
- receives measurement results and error codes;
- monitors timeouts and SLA constraints.
Hybrid Feedback
Quantum results are stored in PostgreSQL as:
- raw measurement data;
- aggregated outputs;
- metadata on backend, shots, and versions.
The original Fortran program retrieves these results through the FORQ runtime API or direct database queries, allowing the classical program to transparently continue with quantum-accelerated results.
Conclusion
FORQ provides a complete pipeline for automatic quantum offloading of Fortran HPC routines. Through Ada analysis, PostgreSQL decision-making, and a standardized transport layer, classical Fortran programs can benefit from hybrid quantum computing without requiring the programmer to understand quantum technology.