arXiv:2610.06142quant-phOct 2026

Manuscript Offprint

arXiv:2610.06142

When Equivalent Quantum Circuits Lose Synthesis Choices

Boshuai Ye, Peng Liang, Arif Ali Khan

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

BOSHUAI YE, Software Engineering and Information Systems (SEIS), Faculty of Information Technology and Electrical Engineering, University of Oulu, Finland

PENG LIANG, School of Computer Science, Wuhan University, China

ARIF ALI KHAN, Software Engineering and Information Systems (SEIS), Faculty of Information Technology and Electrical Engineering, University of Oulu, Finland

Quantum compilers synthesize high-level operations, such as the quantum Fourier transform or multi-controlled X gates, into gate-level circuits, often choosing among synthesis methods that produce different gate counts. Between tools and compilation stages, a circuit may be serialized, exchanged as OpenQASM text, converted between compilers, or lowered to gates. Such a representation change can preserve the computation but leave only a fixed gate-level implementation of the high-level operation. The receiving compiler then loses synthesis availability, the ability to apply synthesis to that operation, and compiles the fixed implementation instead. This loss is easy to miss: compilation still succeeds, and functional-equivalence checks still pass.

We study synthesis availability in Qiskit, TKET, and Cirq using controlled experiments, repository analysis, circuits captured from project tests, and a Munich Quantum Toolkit (MQT) pipeline. We find that synthesis availability survives serialization when deserialization restores the high-level operation, survives compiler conversion only when the receiving compiler supports that operation, and does not survive the evaluated OpenQASM routes. After a direct OpenQASM 3 round trip, requested synthesis has no effect in all 360 delivered conditions, yet compilation succeeds. The loss changes the compiled circuit's two-qubit gate count, up or down, only where the lost synthesis differs from the fixed implementation; in the MQT pipeline, which requests no synthesis, OpenQASM 2 interchange raises this count by 37.2% for an eight-qubit Grover circuit.

To restore synthesis availability, we introduce Verified, which records each high-level operation before the representation change and, afterwards, reconstructs the operation only if a check confirms that the record still matches the delivered circuit. Verified restores the requested synthesis in all 830 recovery runs, with a median verification time of 2.0–638 ms per operation family. The check rejects every record that later transformations have made stale, but also some valid records; reconstructing from stale records without the check produces non-equivalent circuits. Preserving the computation is therefore not enough: compilers and interchange tools should report whether requested synthesis takes effect and verify operation records before reconstruction.

1 Introduction

Before a quantum program can run on specific hardware, a compiler translates it into supported operations, selects gate implementations, maps logical qubits to physical qubits, and inserts routing operations required by the hardware connectivity [18, 47]. These decisions can substantially affect the resulting circuit’s gate count and depth [23].

Quantum software frameworks such as Qiskit, TKET, and Cirq provide high-level operations for expressing complex computations [6, 18, 47]. Examples include the quantum Fourier transform (QFT), multi-controlled X (MCX), and linear reversible functions. A high-level operation specifies a computation without fixing its gate-level realization [38, 47]. Synthesis replaces such an operation with a gate-level implementation. For example, Qiskit provides multiple synthesis methods for QFT and MCX, and the chosen method can depend on hardware connectivity, available spare qubits (ancillas), and the desired circuit cost [21, 22, 34, 38, 47]. Prior work has shown that retaining high-level operations can enable smaller compiled circuits [45, 46]. What remains unclear is what

Authors' Contact Information: Boshuai Ye, Software Engineering and Information Systems (SEIS), Faculty of Information Technology and Electrical Engineering, University of Oulu, Oulu, Finland, boshuai.ye@oulu.fi; Peng Liang, School of Computer Science, Wuhan University, Wuhan, China, liangp@whu.edu.cn; Arif Ali Khan, Software Engineering and Information Systems (SEIS), Faculty of Information Technology and Electrical Engineering, University of Oulu, Oulu, Finland, arif.khan@oulu.fi.

Ye, Liang, and Khan

happens when a circuit is saved, exchanged, or converted in a way that preserves the computation but removes the high-level operation before later compilation.

During quantum program development and compilation, a circuit may be serialized and restored using QPY (Qiskit's binary circuit serialization format), exchanged as OpenQASM 3 text and reparsed by the receiving compiler, converted between compilers such as Qiskit and TKET, or lowered to gate-level operations [7, 18, 40, 42, 47]. These representation changes support circuit exchange, interoperability between compiler frameworks, and multi-stage compilation, but they can also remove high-level operations that enable the receiving compiler to choose more efficient implementations. We call the point where a receiving compiler obtains the resulting representation a representation boundary.

For example, a direct OpenQASM 3 round trip exports a Qiskit circuit containing a high-level QFTGate to OpenQASM 3 text and immediately imports it back. The imported circuit still computes the QFT, but the QFTGate has become a generic Gate named qft (Figure 1A). Compilation still succeeds, yet the requested synthesis method qft.line no longer takes effect, and the median two-qubit gate count rises from 135 to the default 150 (see Section 2). We call this a loss of synthesis availability: the receiving compiler can no longer apply synthesis to the high-level operation.

This loss is easy to miss. Qiskit reports neither errors nor warnings, and a functional-equivalence check tests whether the computation is preserved [4, 35] but does not test whether synthesis remains available. Yet the loss can add two-qubit gates, whose error rates on noisy hardware can be an order of magnitude higher than those of single-qubit gates [28], reducing the likelihood of a correct result. The loss also occurs without an explicit synthesis request: in a Munich Quantum Toolkit (MQT) pipeline, an OpenQASM 2 round trip removes MCX synthesis availability for an eight-qubit Grover circuit; its two-qubit gate count rises by 37.2% and its estimated fault-tolerant runtime by 68.0%. This motivates our first research question (RQ1): which representation changes preserve synthesis availability, and when does losing it affect compiled circuit cost?

Keeping the high-level operation would avoid the loss, but an OpenQASM round trip keeps only a gate's name and definition [25], and TKET has no comparable QFT operation [41]. The operation must then be reconstructed after the boundary, as some project code already does (see Section 5.2). An operation record stored with the circuit can keep the operation's type, parameters, and qubit binding. Later transformations such as qubit routing and optimization can, however, leave the record out of date (stale), and reconstructing from a stale record can produce a non-equivalent circuit, as it does for all 17 stale records on which we test unchecked reconstruction (see Section 5.2.2). Recovery must therefore check that the record still matches the delivered circuit and otherwise leave the circuit unchanged (Figure 1B). This motivates our second research question (RQ2): can a retained operation record restore synthesis availability lost at a representation boundary while preserving functional equivalence, and how much time does verification require?

We study both questions in Qiskit, TKET, and Cirq with the following contributions:

  • We distinguish synthesis availability from functional equivalence and characterize its preservation across serialization, OpenQASM interchange, compiler conversion, and lowering in three quantum compiler frameworks.

  • We audit repositories of Qiskit-based projects. Their code changes a circuit’s representation on 51 code paths, selects a non-default synthesis method in 64 places, and reconstructs a high-level operation in five places. In circuits captured from the projects’ tests, OpenQASM interchange raises the two-qubit gate count of 38 MCX circuits by 10–164%; all 38 circuits have a clean ancilla (a spare qubit in a known state) available at the MCX. OpenQASM interchange also raises the count of five small adders by 25–57% without any ancilla.

A Loss of synthesis availability

Figure

Fig. 1. The QFT example. (A) A direct OpenQASM 3 round trip preserves the computation but removes synthesis availability. (B) Verified reconstructs the operation only if the record matches the delivered circuit.

  • We introduce and evaluate Verified, which checks an operation record before reconstructing a high-level operation. Verified restores the requested synthesis in all 830 controlled recovery runs and rejects every stale record in our evaluation.

References (33)