Manuscript Offprint
arXiv:2611.04274Reasoning about Shared-Qubit Concurrency in Quantum Computing
Abstract
In this paper, we develop a semantic model for the parallel execution of quantum circuits, providing a formal foundation for studying shared-qubit concurrency in quantum computing. As in classical shared-memory concurrency, parallel quantum circuits may interfere with one another through operations on shared qubits. However, quantum entanglement and the noncommutativeity of quantum operations introduce additional challenges for reasoning about their correctness. To address these challenges, we generalise the classical Owicki–Gries method to quantum computing at the level of quantum circuits. Our approach enables compositional reasoning about parallel quantum circuits by separating the verification of individual components from the analysis of interference between them. We formulate proof rules for establishing the correctness of parallel quantum circuits and prove their soundness with respect to the proposed semantic model.
Keywords: Quantum circuits, parallel execution, shared qubits, concurrency, semantics, interference freedom, proof rules
1. Introduction
Shared-memory concurrency is an important technique in classical programming, allowing multiple components of a program to cooperate through a common memory. It provides a natural way to express computations in which different tasks access and modify shared data. However, designing and reasoning about shared-memory parallel programs are notoriously challenging. An internal survey at Microsoft [9] revealed that concurrency is widely used within the company. However, 60% of respondents reported frequently encountering concurrency-related issues, and most concurrency bugs were considered to be of high severity.
In a shared-memory parallel program, an action performed by one component may modify the shared state on which another component depends, thereby invalidating assumptions that would hold during its isolated execution. Consequently, the behaviour of a parallel program depends not only on the computations performed by its individual components, but also on the order in which their actions are interleaved.
A similar challenge arises in quantum computing when the components of a parallel quantum circuit operate on shared qubits. For components acting on disjoint registers, their operations commute, and their combined behaviour can be described by the tensor product of their respective transformations. When registers overlap, however, an operation performed by one component may alter the quantum state subsequently accessed by another. Different execution orders can therefore produce different transformations and different output states. To see this more clearly, let us consider a simple example:
Example 1.1. Let SWAP and H stand for the swapping gate and Hadamard gate, respectively. Consider the following parallel execution of two quantum circuits performed on a system of three qubits :
Note that quantum gates SWAP and H in share qubit . The actual implementation of SAWP on hardware may be:
Let us write:
Then the question is whether and are equivalent? The answer is No. Indeed, if SWAP is considered as an atomic action, then executing with input yields final state or , where . However, the following execution of with the same input yields a final state that is different from any final state of :
It is interesting to note that the final state of are all product state, but the final state of in (1.1) is an entangled state.
From the above example, we observe that, as in classical computing, the individual components of a parallel quantum circuit can interfere with one another by updating shared qubits. Thus, the input/output behaviour of a parallel quantum circuit is not determined solely by the input/out behaviour of its components. On the other hand, quantum memory introduces features that distinguish this problem from its classical counterpart. In particular, shared registers may be entangled with other registers, so reasoning about the reduced state of a shared register alone can lose correlations relevant to the computation. An operation on one register can change these correlations even when the reduced state of another register remains unchanged.
Shared-qubit concurrency thus raises a fundamental question:
- How can we understand and reason about the behaviour of a quantum computation whose components interact through a common quantum memory?
In classical computing, one of the major approaches to reasoning about shared-memory parallel programs is the Owicki–Gries method [14, 15] (see also Chapters 7 and 10 of the textbooks [1, 6], respectively). Its central idea is to separate the verification of the correctness of individual components from checking that they do not interfere with one another. First, each component is annotated with assertions and verified using Hoare logic as if it were executed in isolation. Then, interference freedom is established by checking that every atomic action of one component preserves the assertions used in the proofs of the other components, whenever both the action's precondition and the relevant assertion hold. These checks ensure that each component's correctness proof remains valid under arbitrary interleavings of the components' atomic actions. The method therefore combines local correctness proofs with explicit compatibility conditions to establish the correctness of the parallel program as a whole. Formally, the Owicki–Gries method can be presented as the proof rule (R-PC) in Figure 1, where is a shared-memory parallel program. In the premises of this rule, the correctness of each component is expressed by a Hoare triple , where the precondition and postcondition are first-order logical formulas. Subject to the non-interference conditions, the correctness of the parallel program is then inferred, with precondition and postcondition .
Figure 1: Proof Rule for Parallel Composition.
Contributions of this paper:. The aim of this paper is to generalise the Owicki–Gries method to quantum computing. We achieve this goal for the special case where are quantum circuits without mid-circuit measurements. In this setting, following the approach of Birkhoff–von Neumann quantum logic [2], it suffices to use subspaces of the underlying Hilbert spaces as preconditions and postconditions, since we are concerned with characterising the possible output pure quantum states arising from a given set of input pure quantum states. The main technical challenge is to develop a satisfactory treatment of interference that accounts for both the ordering of operations and their effects on the joint quantum state, which may be entangled.
However, we emphasise that extending this approach to general quantum programs with control flow, such as conditional statements based on mid-circuit measurements and loops, remains a largely open problem. In this more general setting, correctness is concerned not only with the possible output states but also with the expected values of observables in the output states, as specified by quantum Hoare triples whose preconditions and postconditions are general Hermitian operators [5, 19].
Organisation of the paper:. The remainder of this paper is organised as follows. Section 2 reviews some technical preliminaries. Section 3 defines the syntax and semantics of quantum circuits and introduces a semantic model for their parallel execution. Section 4 defines correctness formulas for quantum circuits. Section 5 presents proof rules for reasoning about the sequential execution of quantum circuits. Section 6 develops a notion of proofs for quantum circuits containing atomic regions. The main result of this paper is presented in Section 7, where we develop proof rules for reasoning about the parallel execution of quantum circuits with shared qubits. Section 8 illustrates the application of these rules through a case study. Section 9 discusses related work, and Section 10 concludes the paper.
Since we only consider quantum circuits in this paper, all Hilbert spaces are assumed to be finite-dimensional.
2.1. Birkhoff-von Neumann Quantum Logic
Recall from classical logic that a proposition about a classical system can be mathematically modelled by a subset , where is the state space – the set of all possible states – of the system. For each , satisfaction (state satisfies proposition ) is interpreted as . In quantum logic, however, all proposition about a quantum system are mathematically represented by a subspace of the state space of the system, which is a (finite-dimensional) Hilbert space . For any pure quantum state and subspace of , satisfaction is also interpreted as membership .
For classical propositions, the logical connectives “and”, “or”, “not” can be simply interpreted as set-theoretic operations and (complement), respectively. However, this interpretation of connectives cannot be directly generalised to the quantum case because although preserves closeness under linear combination, and do not. The operations appropriate for the interpretations of logical connectives “and”, “or”, “not” for quantum propositions are (join) and (ortho-complement) [2], where for any subspaces of ,
- , where for any subset , is the smallest subspace of containing :
- , where means that and are orthogonal; that is, their inner product .
Let denote the set of all subspaces of . Then it is well-known that is a complete modular lattice [2]. In this paper, given a quantum circuit with Hilbert space , we specify the correctness of using the Hoare triple , where . This denotes that for any input state , all corresponding output states will belong to .
2.2. Technical Lemmas
Birkhoff-von Neumann quantum logic, described in the previous subsection, is primarily concerned with logical relations and operations on subspaces of a fixed Hilbert space. However, when reasoning about quantum circuits, we need to understand how these logical relations and operations behave under quantum gates (i.e., unitary transformations). We first present a lemma that characterises this behaviour. Furthermore, compositional reasoning about quantum circuits requires us to derive the correctness properties of larger circuits, such as sequential and parallel compositions, from those of their components. To this end, we need to transfer logical relations and operations between the Hilbert spaces associated with individual components and those associated with larger circuits. We therefore establish two lifting lemmas that facilitate such transfers.
Let be an unitary operator on a Hilbert space and a subspace of . Then we define the image of under as
It is easy to show that is also a subspace of with the same dimension as . Since is also an unitary operator, is well-defined.
The first lemma asserts that unitary operators preserve quantum logical operations.
Lemma 2.1. Let U be an unitary operator on . Then for any subspaces and of , we have:
The next lemma shows that tensoring with an auxiliary Hilbert space preserves the quantum logical operations on subspaces: intersection, join, and orthocomplement. This allows quantum logical reasoning to extend naturally to larger quantum circuits.
Lemma 2.2. Let and be subspaces of Hilbert space . Then for any Hilbert space , we have:
The correctness of a quantum circuit can be characterised by the inclusion , where is the unitary operator denoted by the circuit and and are its precondition and postcondition subspaces, respectively. The following lemma shows that this inclusion is preserved when the system is extended with an external environment . This enables us to establish the correctness of larger quantum circuits by reasoning about their individual components.
Lemma 2.3 (Lifting). Let and as in equation (1). Then for any Hilbert space and for any subspace of , we have:
where is the identity operator on .
For readability, the proofs of the above lemmas are deferred to the appendix.
3. Quantum Circuits and Their Parallel Execution
In this section, we first recall the formal definitions of the syntax and semantics of quantum circuits. Building on these definitions, we introduce a semantic model for the parallel execution of quantum circuits. This model will serve as the basis for reasoning about concurrency in quantum computing at the level of quantum circuits. The soundness of all proof rules developed in this paper will be established with respect to this semantic model.
3.1. Syntax of Quantum Circuits
The syntax and semantics of quantum circuits presented in this subsection and the next are standard in the literature. Our presentation follows [21]. We assume a set of qubit variables and a set of basic quantum gates. Quantum circuits are generated by the following syntax:
where is a basic quantum gate and is a sequence of qubit variables in such that if is an -qubit gates, then consists of qubits. Intuitively, means that quantum gate performing on quantum register , and denotes the sequential composition of and . We use to denote the set of qubit variables occurring in a quantum circuit .
The inverse of a quantum circuit , denoted , is the circuit that reverses the computation performed by . It is constructed by reversing the order of all gates in and replacing each gate with its inverse. More precisely, it is inductively defined as follows:
-
if , then ;
-
if , then .
3.2. Semantics of Quantum Circuits
Let us first introduce several notations. For any qubit , we write for its Hilbert space. For any , we define:
The identity operator on is denoted by . For any quantum state , we define for the quantum variables of . For any and operator on , the cylindrical extension of on is defined as the following operator on :
The operational semantics of a quantum circuit is modelled by the sequential execution of quantum gates in . To describe the operational semantics precisely, we define a configuration to be a pair , where is a quantum circuit and for some . Intuitively, is the circuit to be executed or the termination symbol , and is the current state of qubits. Then:
Definition 3.1. The operational semantics of quantum circuits is defined by the following two transition rules:
In the rule , we use the convention that .
Here, (UT) stands for unitary transformation and (SC) for sequential composition. It should be noted that operator in the premise of the rule (UT) is actually an abbreviation of its cylindrical extension . Since later in this paper, we will consider parallel execution of quantum circuits, it should be particularly pointed out that a basic quantum gate in the transition rule (UT) is always treated as an atomic action and thus cannot be interrupted by other actions.
Definition 3.2. Let . Then the denotational semantics of a quantum circuit on variables is defined as an unitary operator on by induction on the structure of :
-
if , then ;
-
if , then .
We often simply write for when Q can be recognised from the context.
It is easy to see that the operational and denotational semantics are equivalent in the following sense: for any quantum circuit and for any ,
where stands for the reflective and transitive closure of the transition relation in Definition 3.1. Also, we can show that for any quantum circuit .
For compositional reasoning, we often need to examine the behaviour of a quantum circuit in the presence of external systems. The following lemma shows how the operational and denotational semantics of a quantum circuit extend to this larger setting.
Lemma 3.1 (Lifting of Semantics). Let . Then:
- for any and ,
- .
The above lemma can be easily proved by induction on the structure of quantum circuit .
3.3. Atomic Regions
With the preliminaries from the previous subsections in place, we now turn to the parallel execution of quantum circuits. As in classical computing, concurrency involving shared qubits can significantly complicate the behaviour of a parallel quantum circuit. A major reason is that its component circuits can interfere with one another by applying quantum gates to shared qubits. In classical parallel programming, atomic regions were introduced to reduce the possible points of interference: each atomic region executes without interruption by other components. In this subsection, we generalise this notion to quantum circuits.
Definition 3.3. 1. If is a quantum circuit defined by the syntax (9), then is called an atomic region.
- A quantum circuit with atomic regions is a sequence , where , and each () is either a basic quantum gate or an atomic region.
It is clear from the above definition that an atomic region cannot contain other atomic regions; that is, atomic regions are not allowed to be nested.
The operational semantics of atomic regions is defined by the following transition rule:
The transition rule (AR) reduces the multi-step computation of the body of an atomic region into a single step and thus reflects the intuitive meaning of atomic region. Accordingly, the denotational semantics of atomic regions and quantum circuits with atomic regions are defined as follows:
-
;
-
If is a quantum circuit with atomic regions, then .
It is easy to see that the equivalence (10) between operational and denotational semantics can be generalised to quantum circuits with atomic regions.
3.4. Parallel Execution of Quantum Circuits
To specify parallel execution of quantum circuits, we introduce the following syntax for parallel compositions of quantum circuits:
where , and are quantum circuits with atomic regions. Intuitively, means that quantum circuits run in parallel.
Let be a parallel quantum circuit. Then the operational semantics of is defined by the interleaving execution model:
- if one of its components, say , performs an atomic action, then performs the same atomic action. Thus, the executions of two different components, say and (), may overlap, and their overlapping is modelled by executing them sequentially, in either order.
Formally, we have:
Definition 3.4. The operational semantics of parallel quantum circuit is defined by the following transition rule: for any and for any with ,
Here, (PC) stands for parallel composition. We define the termination of as ; that is, terminates iff all its components () terminate.
Note that the denotational semantics of a single quantum circuit is a unitary operator on for some , which maps each quantum state to a quantum state . However, due to the nondeterminism introduced in the interleaving execution model, the denotational semantics of a parallel quantum circuit should be defined as a set-valued function; that is, for a single input, may have multiple possible outputs. More precisely, we have:
Definition 3.5. Let . The denotational semantics of a parallel quantum circuit on variables is defined as the mapping from a quantum state in to a set of quantum states in : for any in ,
where stands for the reflexive and transitive closure of the transition relation defined in Definition 3.4.
To illustrate the above definitions, let us see a simple example.
Example 3.1. Let us consider the parallel quantum circuit in Example 1.1. According to the transition rule (PC) in Definition 3.4, when executing on the input state , in addition to the final states , and given in Example 1.1, allows the following additional execution path:
which yields another entangle final state. Therefore, we have:
However, if we require in to be executed atomically, that is, if we define
then it is easy to see that
4. Correctness Formulas
The operational and denotational semantics of parallel quantum circuits defined in the previous section provide a formal foundation for reasoning about shared-qubit concurrency in quantum computing. To facilitate such reasoning, our next goal is to develop effective proof rules for parallel quantum circuits. As a first step towards this goal, in this section, we introduce the notion of a correctness formula for formally specifying the correctness of quantum circuits.
For any set of quantum variables, we adopt the idea of Birkhoff-von Neumann quantum logic that a proposition about the (composed) quantum system of quantum variables is a subspace of Hilbert space . In this case, we define for the quantum variables of (see Section 2). If , and is a subspace of , then its cylindrical extension on is defined to be the subspace of :
There is a subtle difference between classical and quantum propositions. For example, is a proposition about classical variables and . It can be freely seen as a proposition about variables and (with no restriction on ). However, if , then a proposition about cannot be directly viewed as a proposition about . Instead, one needs to use its cylindrical extension for this purpose.
Using subspaces of a Hilbert space as preconditions and postconditions, we can introduce:
Definition 4.1. Let be a (parallel) quantum circuit with , and let be subspaces of . Then
is called a correctness formula or Hoare triple for .
Quantum Hoare triples were first introduced in [5] for general precondition and postcondition as observables modelled by Hermitian operators between the zero and identity operators. The special class of Hoare triples with subspaces as preconditions and postconditions as in Birkhoff-von Neumann quantum logic was studied in [20].
Intuitively, means that the output of quantum circuit lies in subspace provided its input is from subspace . Formally, we have:
Definition 4.2. Hoare triple is said to be valid, written
if for any , it holds that ; equivalently , where .
It should be pointed out that the above definition applies to both sequential and parallel executions of quantum circuits. In the sequential case, it suffices to require that, for every , we have .
To illustrate the above definition, let us see an example of parallel quantum circuits.
Example 4.1. 1. We first consider a disjoint parallel quantum circuit . Let , where is the EPR pair. Then it holds that .
- Let . Then we have:
- (Noncommuting exchange gates on an entangled subspace) Consider four qubits in the order , and define
(14)
(15)
These vectors are orthonormal. Let , stand for the SWAP operator, and
We set the parallel quantum circuit:
Here, is treated as a basic gate, hence as an atomic action at the chosen level of abstraction, and the two components share . It can be checked that for all real , we have:
The following lemma shows that the correctness of a quantum circuit is preserved when it is considered in a larger environment. As we will see shortly, this lemma, together with the proof rule (R-SC) to be presented in Figure 2, enables us to conveniently reason about the correctness of sequentially composed quantum circuits acting on different sets of qubits.
Lemma 4.1 (Lifting of Correctness). Let , and let be subspaces of . Then
Proof. Immediate from Lemmas 2.3 and 3.1(2).
5. Proof Rules for Sequential Execution of Quantum Circuits
Using the notion of a correctness formula introduced above, we present a series of proof rules for reasoning about the sequential execution of quantum circuits in this section. Conceptually, these rules serve as a stepping stone towards our ultimate goal of reasoning about parallel quantum circuits. In practical applications, they will be used in combination with the proof rules for parallel execution to be developed in Section 7.
A proof rule is of the form
where and are all correctness formulas. It means that the premises entail the conclusion . In particular, when , the rule has no premises, and is called an axiom. The basic proof rules for the sequential execution of quantum circuits are presented in Figure 2. These rules are essentially special cases of quantum Hoare logic [19], tailored to quantum circuits and restricted to subspaces as preconditions and postconditions, as in [24].
The rule (R-UT) asserts that the output state of a quantum gate lies in a subspace , provided that its input state lies in . The rule (R-SC) allows us to infer the correctness of a sequential composition from the correctness of its component circuits and . It is worth noting that this rule differs from its counterparts in [19, 24]. In Figure 2, the postcondition of and the precondition of are allowed to involve different sets of qubits; that is, . Consequently, a condition relating and is added as the third premise of (R-SC). Fortunately, this condition is usually easy to check in practical applications, where the sets of qubits involved in and typically differ only slightly. The rule (R-¬) allows us to infer the correctness of the inverse of a quantum circuit from the correctness of the circuit itself. The rule (R- ) enables us to strengthen
Figure 2: Proof Rules for Sequential Execution of Quantum Circuits
the precondition and weaken the postcondition. Finally, the rules and allow us to apply the quantum logical operations of intersection and join to preconditions and postconditions.
The following example illustrates how these rules can be used to prove correctness of quantum circuits.
Example 5.1 (Reusing a clean ancilla for a non-Clifford entangling circuit). Let be data qubits and q a work qubit, and
where
and . The work qubit q is initially in . Let
be the even- and odd-parity subspaces of . For , put
The gate rule (R-UT), followed by the sequential composition rule (R-SC), gives
Thus, (R-SC) gives
Applying to b = 0, 1, we obtain
Note that each is declared on . With and
the matching conditions in (R-SC) are exactly
Consequently, repeated applications of yield:
This indicates that the same work qubit q is safely reused across three modules acting on different pairs of data qubits.
To conclude this section, we present the following:
Theorem 5.1 (Soundness). All proof rules in Figure 2 are sound.
Proof. See Appendix Appendix A.
6. Proofs for Quantum Circuits with Atomic Regions
As in the Owicki-Gries method for reasoning about classical shared-memory concurrency [15], we need introduce the notion of proof for quantum circuits with atomic regions upon which interference freedom can be defined. First of all, we introduce a proof rule (R-AR) for atomic regions in Figure 3. The soundness of the proof rule (R-AR) immediately follows from the transition rule (AR) in Subsection 3.3.
The only difference between the correctness proofs in the classical and quantum cases is that in the quantum case we need pay special attention on matching the preconditions and postcondition in the composition of a sequence of quantum circuits (see the condition (3) in the next definition).
Figure 3: Proof Rule for Atomic Regions.
Definition 6.1. Let , where each () is either a basic quantum gate or an atomic region. Then a proof of correctness is a sequence of the form:
such that
-
and ;
-
for ; and
-
for .
We write:
for the tail of circuit , and for the precondition of in the proof (21) for .
It is particularly worth pointing out that in the proof (21), for each , the postcondition of sub-circuit can be different from the precondition of . Indeed, it is even allowed that . This flexibility comes from our new proof rule (R-SC) for sequential composition (see the remark after equation (12)). It is obvious that the condition (3) in the above definition is a reflection of the third condition in the premise of (R-SC). An important benefit of this flexibility is that in proving the correctness , we can make each step local in the sense that only necessary variables, namely those occurring in , are involved. In particular, whenever is a basic quantum gates which usually only have one or two qubits, checking the correctness becomes very easy.
The soundness of proof rules (Theorem 5.1) can be generalised to proofs of quantum circuits with atomic regions:
Theorem 6.1. If a correctness formula has a proof, then it holds that .
Proof. See Appendix Appendix B.
□
7. Proof Rules for Parallel Execution of Quantum Circuits
In this section, we establish a proof rule for compositional reasoning about parallel quantum circuits. As in the classical Owicki–Gries method, its premises combine local correctness with preservation of the assertions used by other components.
7.1. Disjoint Parallel Quantum Circuits
Although our ultimate goal is to reason about shared-qubit concurrency, as a warm-up, let us first consider the special case of disjoint parallel quantum circuits:
where for all . Suppose further that for all . Under these assumptions, the proof rule (R-PC-DQ), shown in Figure 4, was established in [23].
Figure 4: Proof Rule for Parallel Execution of Quantum Circuits.
Due to the disjointness condition, tensor products can be used to represent logical conjunctions in the precondition and postcondition of in the conclusion of the rule (R-PC-DQ). However, this approach is no longer applicable when the component circuits share qubits.
7.2. Conjunction of Quantum Propositions
To specify the preconditions and postconditions of shared-qubit parallel quantum circuits in our proof rule, we need to generalise the quantum logical conjunction , originally defined for subspaces of the same Hilbert space, to subspaces of different Hilbert spaces. This generalisation is necessary because different components of a parallel quantum circuit may involve different sets of qubit variables.
Definition 7.1. For each , let be a subspace of Hilbert space , where . We set . Then the conjunction of () is defined to be the following subspace of :
Intuitively, equational (22) means that the conjunction holds precisely when all its conjuncts hold after extension to a common register. If , Lemma 2.2 gives
In particular, if for every and for any , then it is easy to check that
7.3. Interference Freedom
Using the conjunction introduced in Definition 7.1, we can now define the notion of interference freedom for quantum circuits.
Let us first define the notion of invariance of a subspace (viewed as an assertion) under the execution of a quantum circuit, subject to a given precondition.
Definition 7.2. Let be a quantum circuit and a subspace of , and let be a subspace of , where . If the Hoare triple:
is valid, then we say that Y is invariant under C with precondition X.
Then interference freedom in a parallel quantum circuit requires that every assertion in the local proof of each component circuit be invariant under the execution of any atomic step of every other component circuit. This invariance must hold at every control location, including the terminal location of a completed component.
Definition 7.3. For each , let be a quantum circuit and
be a proof of correctness formula . If for any with , and for any and , is invariant under with , then proofs () are said to be interference free.
To illustrate the above definitions, let us consider a simple example of two local proofs that interfere with each other.
Example 7.1. Consider the parallel quantum circuit:
Let , , , and . By the proof rule (R-UT) in Figure 2, we can prove that the following two local Hoare triples
are valid, but their proofs are not interference free. The required preservation of by with precondition fails: , while
Therefore the proof rule (R-PC-Q) to be introduced in the next subsection cannot be applied to these proofs.
7.4. The Parallel Rule
We are now ready to present the proof rule (R-PC-Q) for reasoning about the parallel execution of quantum circuits, as shown in Figure 5. It should be noted that, in the premises of rule (R-PC-Q), the preconditions of different component circuits may involve different sets of qubit variables. The conjunctions appearing in the precondition and postcondition of the parallel circuit in the conclusion of the rule are defined according to Definition 7.1.
Figure 5: Proof Rule for Parallel Execution of Quantum Circuits.
It is interesting to note that, in the case of disjoint parallelism considered in Subsection 7.1, interference freedom holds automatically. Consequently, by equation (23), the proof rule (R-PC-Q) reduces to the rule (R-PC-DQ).
An application of rule (R-PC-Q) to reasoning about error syndromes in quantum error correction will be presented as a case study in the next section.
To conclude this section, we present the following:
Theorem 7.1. The proof rule (R-PC-Q) is sound.
Proof. See Appendix Appendix C.
8. Case Study
In this section, we present an example to show how the proof rule (R-PC-Q) can be used to reason about coherent syndrome extraction during concurrent logical processing.
Example 8.1. Let be a shared data register, and let be private work qubits of the two components. Write for Pauli operators on , and define
The two stabilizers commute, and both commute with . However, and anti-commute, that is, . The code subspace
has dimension four. Let and be two-qubit basic gates. On and , respectively, their cylindrical extensions are and . These extensions preserve and generally do not commute. We use the same gate symbols for these extensions when the register is clear. For , we define the two-gate atomic regions:
Consider the parallel execution of the following two components:
The first component coherently records the eigenvalue of in , and the second records that of in . They also perform possibly non-Clifford logical rotations while accessing the same data register.
Notations.. Let for a Hermitian unitary . We annotate each component after of its five atomic steps by and , where
| k | ||
|---|---|---|
| 0 | ||
| 1 | ||
| 2 | ||
| 3 | ||
| 4 | ||
| 5 |
(27)
The assertions are declared on and the assertions on . Comparisons between components use their cylindrical extensions to .
Local correctness.. We first prove the correctness of component circuits and . For a controlled involution , conjugation of the control's Pauli gives . Consequently,
The second paired region adds the remaining two Pauli factors. The Hadamard gates exchange X and Z on their private work qubits. Finally, commutes with , and commutes with . Thus, for the th atomic action or , we have:
The gate rule (R-UT) and atomic-region rule (R-AR) give the proofs:
Interference freedom.. Now we check that proofs (28) and (29) do not interfere with each other. Every atomic action of commutes with every observable , and every atomic action of commutes with every . For the paired regions, the substantive identities are
each resulting from two Pauli anticommutations; regions on distinct pairs also commute. The logical X rotation commutes with the X-type data operators in the B assertions, and the logical Z rotation commutes with the Z-type data operators in the A assertions. Hence, for every k and every action ,
and symmetrically. These unconditional preservation identities imply all the conditional obligations in Definition 7.3. They include preservation of the terminal assertions at k = 5. There are 60 directed checks when the six control locations of each component are counted; every guard intersection has dimension 16 in the 64-dimensional global space. None is vacuous.
Application of . The conjunction of the initial assertions is . The rule therefore gives
where the postcondition:
This holds for every input pure quantum state of the data and every interleaving of the ten atomic steps. There are such interleavings. Lifting correctness also permits the data to be entangled with an arbitrary external reference register.
Explanations.. The postcondition in Hoare triple (30) expresses correct syndrome correlations. More explicitly, for , let
Then
This allows coherent superpositions of syndrome sectors and entanglement between the data and the work registers. For instance, on data input , direct evaluation gives for every permitted schedule. The final global pure quantum state has Schmidt rank four across .
The rule does not require the logical rotations to commute. Intersecting every assertion in (27) with the lifted code subspace gives another interference-free pair of outlines, and hence
To exhibit schedule dependence, define
On their span, act as logical Pauli . At , input has, up to a common global phase, the two possible outputs
Both satisfy the same correctness property proved by (R-PC-Q).
The paired atomic regions are essential to this proof. Although and commute, individual and do not commute. Exposing their internal gates permits schedules that introduce an unwanted into the syndrome extraction. On a code input, such a schedule can leave the work qubits in , violating (30).
9. Related Work
In this section, we discuss related work in order to accommodate the research described in this paper into the appropriate context.
Parallel quantum programming.. Multiprogramming techniques were first introduced by Das et al. [4] for quantum computers to enable noisy intermediate-scale quantum (NISQ) devices to execute multiple workloads concurrently, thereby improving their throughput and resource utilisation. An extension of the quantum programming language Q# was proposed by Häner et al. [10] to support parallel quantum programming. Operational and denotational semantics for parallel quantum programs were developed in [22, 23]. A quantum programming language with explicit primitives for parallelism and synchronisation was introduced by Jian et al. [12], together with a formal definition of its semantics. However, the proof system presented in [22, 23] was restricted to disjoint parallel quantum programs, whose components do not share quantum variables. In contrast, this paper develops an effective proof rule for reasoning about parallel quantum circuits with shared qubits.
Quantum operating systems.. Concurrency is a central concern in the design of operating systems [16]. Several proposals for quantum operating systems have been reported in the literature [3, 7, 8, 11, 17, 18]. For example, Giortamis et al. [8] introduced a modular quantum operating system, QOS, that addresses the challenges of quantum resource management through a systematic exploration of key design trade-offs across the system stack. Ye, Wang, Qiao, and Palsberg [18] proposed HALO, the first quantum operating system designed to support fine-grained resource sharing. Tao et al. [17] developed HyperQ, a system that introduces virtual machines for quantum computers to provide fault isolation, improve resource utilisation, and reduce latency in quantum cloud computing. Delle Donne et al. [7] implemented QNodeOS, a quantum network operating system. However, these works have not systematically examined shared-memory concurrency in quantum computing. We expect that the work presented in this paper can be extended to provide a foundation for reasoning about concurrency in quantum operating systems.
10. Conclusion
In this paper, we have generalised the Owicki–Gries method for reasoning about shared-memory parallel programs to shared-qubit parallel quantum circuits. The key idea is to use subspaces of the Hilbert space of each component circuit as assertions and to define their conjunction as the intersection of their cylindrical extensions to the Hilbert space of the entire parallel circuit.
We believe that this approach could also be extended to generalise the rely-guarantee method [13] for reasoning about shared-qubit parallel quantum circuits using subspaces as preconditions and postconditions. However, as noted in the Introduction, the approach does not directly extend to general parallel quantum programs that use arbitrary Hermitian operators (i.e., physical observables) as assertions, because a suitable notion of conjunction for such assertions remains to be developed. In our view, resolving this problem is a crucial step towards establishing a general theory of shared-memory quantum concurrency.
Acknowledgement: This work was supported in part by the Australian Research Council under Grant No. DP250102952. ChatGPT-6.1 Sol was used to assist in constructing and verifying examples presented in this paper.
References
[1] K. R. Apt, F. S. de Boer and E. -R. Olderog, Verification of Sequential and Concurrent Programs (3rd Edition), Springer, 2009.
[2] G. Birkhoff, J. von Neumann, The logic of quantum mechanics, Annals of Mathematics 37 (1936) 823-843.
[3] H. Corrigan-Gibbs, D. J. Wu and D. Boneh, Quantum operating systems, Proceedings of the 16th Workshop on Hot Topics in Operating Systems (HotOS), 2017, 76-81.
[4] P. Das, S. S. Tannu, P. J. Nair and M. Qureshi, A case for multi-programming quantum computers, Proceedings of the 52nd IEEE/ACM International Symposium on Microarchitecture (MICRO), 2019, pp. 291-303.
[5] E. D'Hondt and P. Panangaden, Quantum weakest preconditions, Mathematical Structures in Computer Science.
[6] W. -P. de Roever, F. de Boer, U. Hannemann, J. Hooman, Y. Lakhnech, M. Poel and J. Zwiers, Concurrency Verification: Introduction to Compositional and Noncompositional Methods, Cambridge University Press, 2001.
[7] C. Delle Donne, M. Iuliano, B. van der Vecht, et al., An operating system for executing applications on quantum network nodes, Nature 639(2025) 321-328.
[8] E. Giortamis, F. Romão, N. Tornow and P. Bhatotia, QOS: quantum operation system, Proceedings of the 19th UNSENIX Symposium on Operating Systems Design and Implementation (OSDI), 2025, pp. 429-447.
[9] P. Godefroid and N. Nagappan, Concurrency at Microsoft – an exploratory survey, CAV Workshop on Exploiting Concurrency Efficiently and Correctly, 2008.
[10] T. Häner, V. Kliuchnikov, M. Roetteler, M. Soeken and A. Vaschillo, QParallel: explicit parallelism for programming quantum computers, arXiv 2210.03680.
[11] R. Honan, T. W. Lewis, S. Anderson and J. Cooke, A quantum computer operating system, Proceedings of the 20th International Conference on Algorithms and Architectures for Parallel Processing (ICA3PP), 2020, pp. 415-431.
[12] M. Jain, V. Fernandes, A. Madeira and L. S. Barbosa, Exploring a quantum programming language with concurrency, Companion Proceedings of the 9th International Conference on the Art, Science, and Engineering of Programming (Programming 2025), pp. 16:1-9.
[13] C. B. Jones, Tentative steps toward a development method for interfering programs, ACM Transactions on Programming Languages and Systems 5(1983) 596-619.
[14] S. Owicki and D. Gries, Verifying properties of parallel programs: an axiomatic approach, Communications of the ACM 19(1976) 279-285.
[15] S. Owicki and D. Gries, An axiomatic proof technique for parallel programs I, Acta Informatica 6 (1976) 319-340.
[16] W. Stallings, Operating Systems: Internals and Design Principles (7th Edition), Prentice Hall, 2012.
[17] R. Z. Tao and H. Z. Zhu, J. Nieh, J. N. Yao and R. H. Gu, Quantum virtual machines, Proceedings of the 19th UNSENIX Symposium on Operating Systems Design and Implementation (OSDI), 2025, pp. 411-428.
[18] J. Ye, J. Y. Wang, Y. F. Qiao and J. Palsberg, HALO: a fine-grained resource sharing quantum operating system, arXiv 2602.07191.
[19] M. S. Ying, Floyd-Hoare logic for quantum programs, ACM Transactions on Programming Languages and Systems 33(2011) 19:1-49.
[20] M.S. Ying, R.Y. Duan, Y. Feng, Z.F. Ji, Predicate transformer semantics of quantum programs, in: I. Mackie, S. Gay (Eds.), Semantic Techniques in Quantum Computation, Cambridge University Press, 2010, pp. 311–360.
[21] M. S. Ying and Z. C. Zhang, Verification of recursively defined quantum circuits, PLDI 2026.
[22] M. S. Ying, L. Zhou and Y. J. Li, Reasoning about parallel quantum programs, arXiv 1810.11334.
[23] M. S. Ying, L. Zhou, Y. J. Li and Y. Feng, A proof system for disjoint parallel quantum programs, Theoretical Computer Science 897(2022)164-184.
[24] L. Zhou, N.K. Yu and M.S. Ying, An applied quantum Hoare logic, Proceedings of the 40th ACM International Conference on Programming Language Design and Implementation (PLDI), 2019, pp. 1149-1162.
Appendix A. Proof of Theorem 5.1
The soundness of (R-UT), (R-⊆) and (R-∩) are trivial.
(R-SC) Let us write and . From the assumption , we have . By Lemma 2.3, we obtain:
On the other hand, it follows from the assumption that . Using Lemma 2.3 again, we have:
Then we obtain:
Here, (A.3) is by Definition 3.2(2), (A.4) comes from (A.1), (A.5) is by the assumption , and (A.6) is from (A.2). Therefore, it holds that
because and .
(R- ) Assume that ; that is, . Then
because is an unitary operator. By equation (4) in Lemma 2.1, we have:
=\left(\left[\![C]\!]\right^{-1}(Y)\right)^{\perp} \tag{A.9}Here, (A.8) comes from the unitarity of , and (A.10) is obtained using (A.7).
(R-∨) Assume that for all . Then . By equation (3) in Lemma 2.1 we obtain:
Therefore, it holds that .
Similarly, we can prove the soundness of .
Appendix B. Proof of Theorem 6.1
Assume that has a proof of the form (21). We first prove that
by induction on . The basis case of is trivial. Let . Then . We assume that the conclusion is true for that is,
Then by the fact that (21) is a proof, we have:
Then it follows from (B.4) that
Thus, we can apply the proof rule (R-SC) to (B.2) and (B.3) and obtain (B.1). Therefore, (B.1) is proved for all . Finally, by the condition (1) in Definition 6.1 we assert that .
Appendix C. Proof of Theorem 7.1
Assume that the Hoare triples () have interference free proofs. We are going to prove the correctness of parallel composition :
that is, for any input state , we have:
By Definition 3.5, it suffices to show that whenever
then the final state , where stands for the reflexive and transitive closure of transition relation . To this end, we first prove the following:
• Claim: Let . If
then:
-
whenever , we have ;
-
whenever , we have .
We proceed by induction on the length of the transition sequence (C.2). For the basis case of , we have , and . It follows from the assumption
that
Thus, the conclusion is true for k = 0.
Now we assume that the conclusion is true for the case of < k as the induction hypothesis. Let us further consider the case of k. First, transition sequence (C.2) can be rewritten as
where denotes the composition of k-1 copies of transition relation . By the transition rule (PC) for parallel composition, we can assume that the last step of (C.3) is derived as follows:
where ; and is a basic quantum gate or an atomic region. Moreover, it follows from the transition in the premise of (C.4) that
Now we consider the following cases:
Case 1: For , if , then from ; we obtain that and
Then by the induction hypothesis, it holds that
On the other hand, in the proof of , we have:
Using Lemma 4.1 we can derive from (C.5), (C.6) and (C.7) that
Here, (C.9) comes from the condition (3) in Definition 6.1. Similarly, using the condition (1) in Definition 6.1 we can show that if , then .
Case 2: For , if , then we have from (C.3). By the induction hypothesis, it holds that
On the other hand, since , we have and . By the induction hypothesis again, we obtain:
Combining (C.11) and (C.12), we have:
The equality in (C.13) can be easily derived using Lemma 2.2. Now the interference freedom assumption of the proofs implies:
By Lemma 4.1, we assert:
Combining from (C.3), (C.13) and (C.15) leads to
Similarly, we can prove that if , then .
Finally, by the Claim (2), we see that the state in (C.1) satisfies:
and the proof is completed.