2. Quantum Computing
According to [
22], the computational space in quantum computing is richer than in classical computing. Classical computation is based on bits, which take values in
. The state space defined by
n bits has a size of
. Dynamic system (DS) problem solving often requires steering a system toward desired states, yet this is challenged by the no-cloning theorem. The central difficulty lies in determining a quantum gate sequence that transforms an initial state into a target state with minimal error.
Quantum computation can be implemented using qubits (discrete variables) or qumodes (continuous variables). Repeated measurements (“shots”) on qubits can provide statistical approximations to continuous-variable behavior.
2.1. Discrete Qubits
Discrete qubits are defined on the basis
, forming Hilbert vectors of dimension n in the computational basis
. A discrete qubit in Hilbert space is described as
with
satisfying
In most cases, the vectors
are chosen from the computational basis.
Unitary matrices perform operations on discrete qubits. Measurements collapse qubit states into classical basis states, and multiple shots yield empirical probabilities that approximate a continuous distribution.
A unitary transformation of an initial state
is written as
A single-qubit logic gate is a
matrix. For example, the Hadamard (or diffusion) matrix
acting on
produces
, which preserves normalization. Any composition of gates must yield a unitary matrix to ensure this property.
The qubit information is stored as a two dimensional vector , while the m qubit Hilbert vector is stored as an dimensional vector .
The identity matrix is denoted by
I, while the Pauli operators
X and
Z are
Parameterized Quantum Circuits (PQCs) [
23] introduce variational parameters
, producing states of the form
For example, a qubit rotation is given by
Such relations between Hilbert vectors and unitary operators can be modeled naturally by Quantum Petri Nets (QPNs) [
24,
25].
2.2. Qumodes
Continuous-variable quantum states, or qumodes, evolve in Fock space, defined as the direct sum of Hilbert spaces representing zero-, one-, two-particle states, and so on [
22,
26]. A correspondence between qubit- and qumode-based quantum computing is included in [
27]. While a qubit state is expressed as
, a qumode uses the continuous basis
with
.
Formally, the Fock space is
with
being an operator for tensor symmetrization or unsymmetrization.
A qumode state is
with
Because infinite expansions are impractical, a cutoff
is introduced:
with
. The qumode is stored as
With m qumodes and cutoff , the state space has dimension . Operations are represented by Gaussian operators.
A system comprising m qumodes, each truncated to a cutoff dimension , is described by a state vector residing in a Hilbert space of dimension . The operators acting on this space are represented by matrices, which typically implement Gaussian transformations for the standard continuous-variable gate set.
Fundamental operations on a single qumode include rotation or phase shift, position displacement, momentum displacement, and squeezing [
26,
28]. These transformations are defined using the bosonic annihilation
and creation
operators, whose matrix representations in the Fock basis are given by:
The number operator,
, is consequently a diagonal matrix whose entries correspond to the photon numbers
This operator satisfies the eigenvalue equation for Fock state .
The canonical position (
) and momentum (
) operators are derived from the annihilation and creation operators:
These operators define the phase space and obey the canonical commutation relation , where ℏ (Plank’s constant) is often set to 2 in this context.
A phase space rotation by an angle
is generated by the number operator and is represented by the unitary matrix
Using the relation , the rotation result of can be calculated.
Displacement in phase space by a complex amplitude
is achieved by the operator
The squeezing operation, which reduces the variance of one quadrature at the expense of the other, is parameterized by a squeezing factor
r and an angle
:
According to [
29], a practical and computationally efficient method for implementing a rotation by
in the phase space of the quadrature operators is the linear transformation
Displacement along the position or momentum quadrature corresponds to the translations
Squeezing (by a factor
s) transformations scale the quadratures according to
For systems with multiple qumodes, a fundamental two-mode operation is the beamsplitter transformation, which couples modes i and j:
Complex multi-qumode circuits, such as interferometers, can be constructed from networks of these basic elements (beamsplitters and phase shifters). These networks implement unitary transformations that preserve the Gaussian character of the input states [
26]. Methods also exist for designing control sequences to steer a qumode system towards a desired target state [
30].
Qumode measurement schemes are broadly classified into Gaussian and non-Gaussian strategies [
31]. Gaussian measurements include the following:
Homodyne detection: This technique measures a generalized quadrature observable, , which is the eigenbasis of a Hermitian operator. The measurement projects the state onto with outcome .
Heterodyne detection: This method performs a simultaneous albeit noisy measurement of both conjugate quadratures, and . It projects onto coherent states with outcomes .
The primary non-Gaussian measurement is the following:
For both single- and multi-qumode states, experimental results can be processed to extract expectation values, variances, or full probability distributions, providing outcomes over a continuous domain [
28].
2.3. Artificial Intelligence Related to Quantum Computing
The requirements of DSs concern stabilizing or leading them to a target state or around it. When the DS is disturbed, it must return to the target state or follow a desired trajectory. Some specifications of DSs require reactions to different inputs, considered control demands (i.e., control signals) or disturbances. Subjects in the DS field include modeling, synthesis, identification, or control. Such kinds of DSs can be obtained by finding some system’s fixed parameters, dynamically changing the parameters provided by functions, or finding control reactions to internal or external events. Optimization of DSs can be performed offline or online. Some offline optimization methods include the search for fixed parameters that lead the systems to target states or around a specified state. Online optimization methods involve continuously changing specific parameters to improve DS behaviors or discovering new reaction rules.
The problem of controlling a dynamic system when the state cannot be directly measured and the control performance metrics are unknown or only partially known is solved in [
32].
A domain where quantum computing is expected to achieve great success against classical computing is machine learning and artificial intelligence [
11]. Both optimization and machine learning, which are involved in quantum computing, require the repeated execution of specific models. Using artificial neural networks, support vector machines, rule-based systems, etc., machine learning (supervised, unsupervised, deep learning, and reinforcement learning) can solve iteratively the above-presented optimization problems. The procedures have to implement a functional
F model, a cost function, and a decision maker for search improvement. These can be solved on a quantum-centric implementation, deciding which parts are implemented on QCs (quantum computers) and which on CCs (classical computers) [
2,
23].
Some qubits at arbitrary locations are connected with a real-time classical connection, creating the statistics of entanglement through quasiprobability decomposition (QPD) [
33].
The fluid dynamics problem is considered purely classical, where the hardness stems from the need to solve non-linear differential equations [
34]. A high-level diagram of a hybrid quantum–classical training algorithm for variational circuits is described here.
General heuristic optimization methods are used for their few and weak requirements concerning the process models. Some of them are bio-inspired, and others are based on physical concepts. The current approaches use Genetic Algorithms (GAs) and Particle Swarm Optimization (PSO).
There are evolutionary methods that solve combinatorial problems involving a finite state space [
35,
36]. Some approaches solve static optimization problems by using a continuous space [
37].
In [
24], a quantum method that solves discrete dynamic optimization problems in a finite state space is presented.
2.4. Current Research State of the Field
Quantum programs are often modeled and implemented by quantum logic gates or by unitary matrices in Hilbert spaces. A set of quantum logic gates composes a quantum logic circuit. Any quantum logic circuit can be described by a unitary matrix.
Unitary matrices can perform any quantum logic gate or any quantum logic circuits. Any unitary matrix can be implemented by a set of available quantum logic gates or it can be approximated with a specified precision by a set of available gates of a Quantum Processor Unit (QPU).
According to [
38], quantum dynamic systems contain more information than the original classical system. The classical DS is linked to a QC presentation using the density of probability.
Wharton et al. (2011) use timed unitary operators and compose sequences of such operators to describe dynamic system evolution [
39].
Liu et al. (2023) proposed quantum memory avoiding the quantum no-cloning theorem (principle) effect involved in reading and writing processes (which cannot copy information), realizing this by using quantum operations [
18].
Quantum Petri Net (QPN) models were introduced for describing and solving some quantum computing problems in [
24,
25,
40]. A QPN version linking quantum events semantics and quantum software is introduced in [
41].
Recently, a quantum buffer was designed using Petri Net models [
42].
In [
43], the modeling and analysis of quantum applications are performed using Colored Petri Nets.
In [
44], Object Enhanced Time Petri Net (OETPN) modeling techniques were used for complex problems of classical software engineering.
Our previous research showed capabilities and benefits of Quantum Petri Nets (QPNs) in modeling quantum programs or conceiving models for classical program construction inspired by quantum computation. So, the collaboration between OETPNs, which sustain the development of classical object-oriented programs, and QPNs, which are used for quantum program development, can lead to software platforms with capabilities derived from both [
24].
In [
45,
46], distributed quantum applications are implemented based on cooperation between quantum and classical computing. A circuit representation of the quantum teleportation process, sending quantum information from a source to a destination, is performed using some quantum logic gates. In the current article, a model for this process combining QPNs and OETPNs is proposed. The result of sending an information qubit from Quantum Processing Unit 1 (
) to
is shown in
Figure 1.
The circles represent PN places that correspond to state elements. The information assigned to places composes the PN marking that models the state of the system. The transitions model the system’s state changes performed by the assigned operations. Filled rectangles represent quantum operations, while empty rectangles correspond to classical operations. Places , and are classical, while the rest of the places are quantum. Places and model measurements of quantum places and , respectively.
The vector information to send is , and the Bell state is .
They are used for the transition mappings providing the vectors
The previous model of teleportation can be reduced by joining sequential transitions. The simplified version is represented in
Figure 2. The two entangled states stored in
and
containing the vector
are used as support for teleportation of the vector
stored in
. The system relevant initial state is given by the marking
. Almost instantly, the quantum system state becomes
, but only after the execution of the classical transition
and the sending of the classical bits to
, the vector
is teleported. The teleportation is consistent only if the classical transmission is performed during the coherence time interval of
.
Table 1 shows the meanings and sizes of nodes and the involved operations for the QPN model shown in
Figure 2.
The bidirectional communication between
and
is shown in
Figure 3. This model performs
and
.
The double communication is timed by classical transitions and , which include the qubit measurements and their transmissions.
Places and model quantum communications channels denoted by and , respectively. Places and model classical channels and , respectively. They control the behavior of quantum gates modeled by transitions and .
2.5. Analysis and Verification of Quantum and Classical Petri Nets
PNs are bipartite oriented graphs composed of nodes that model the states (represented by places) and their changes (described by transitions). Classical tasks are implemented by digital bits and classical logic circuits that execute logic or arithmetic operations.
Usually, quantum applications are composed of cooperating classical and quantum tasks. Classical tasks solve the user interface, set the quantum task parameters, and control the start and measurements of the quantum tasks. Quantum tasks implemented by discrete variables (i.e., qubits) or continuous variables (i.e., qumodes) change the physical process states by quantum circuits executing quantum operations. Concentrated or distributed quantum tasks evolve at a much higher speed relative to their counterpart classical components.
Verification and analysis of PNs are often performed by Petri Net-based Language and reachability graphs. These methods were used in the current research study.
The behavior of Classical or Quantum Petri Nets, as well as the relations between these two kinds of PNs, must be analyzed and verified.
Petri Net-Based Language (PNL)
This method describes the execution of parallel, sequential, and concurrent transitions. It can also be used for Classical PNs or Quantum PNs. Using the notations “*” for sequence, “+” for alternative, for concurrence, and for closing a loop, the behavior of a PN can be described. For example,
describes the sequential execution of transitions and ;
describes the alternative for executing transition or ;
describes concurrent execution;
describes a loop .
Details of their use are provided in [
47,
48]. PNL can be extended for Enhanced Time Petri Nets (ETPNs) obtaining a language (ETPNL) capable of describing dynamic open system behavior.
DQCPNs include quantum task models and classical task models that behave in different domains and interact through clearly defined and modeled frontiers separating them. Both kinds of tasks are modeled by PN-based templates. PN-based Language can describe concurrency and can be used to determine the precedence relations. Enhanced (Time) PN-based Language can include input events and signal output events linked to their frontiers.
Enhanced (Time) Petri Net-based Language can be defined in the following manner: Time is a classical task feature, while quantum tasks lack it, so EPNL notation should be used for quantum program description. The precedence notation corresponding to transitions is endowed with two parameters, and , representing external input and output events, respectively, becoming . These events are included in quantum or classical places according to the specification. When one or both events are missing, this is marked by the symbol “-”.
For example, the model shown in
Figure 3 can be described by the sequences
The entanglement sequence is
Transitions
and
are externally controlled without the controls represented in
Figure 3. Classical transitions can be delayed by clock ticks, which are kinds of external time input events.
2.6. Reachability Graphs
The execution of transitions changes the states of classical and quantum components. The Classical or Quantum PNs states are represented by markings. Reachability graphs are used to determine the markings that can be reached during program execution. A reachability graph analysis approach can be used to determine and enforce the desired control requirement for a composed classical quantum model.
Some sequences of transitions provide cyclic behaviors, while others determine acyclic behaviors. The interface(s) between classical and quantum tasks creates a frontier that must be analyzed for quantum-centric application verification.
Unlike bounded numerical PNs, where the state numbers are finite, the current approach involves infinite numbers of states for classical and quantum parts. As a consequence, the term state label is more appropriate for the reached markings than reached states.
In qubit implementation, the state is considered its probability on the basic axis. In qumode implementation, the physical state is defined by the photons’ position and momentum. The vector is used as the quantum program state, a replacement of the real physical state.
3. Materials and Methods
Distributed quantum-centric applications are composed of classical parts and quantum parts. In the current approach, the classical parts are modeled by OETPNs and the quantum parts by QPNs. All components must cooperate to fulfill the specifications and the requirements of the application.
3.1. Parameterized Quantum Circuits (PQCs)
A unitary matrix
can be parameterized by a parameter
[
23]. This performs the relation
A classical part of a quantum-centric computing program provides the parameter
. The model shown in
Figure 4 starts from the initial quantum state
and the classical state
.
Typically, is the initial state obtained from n qubits, each in state , forming the product state . In some cases, the required initial state is obtained by multiplying by a unitary matrix.
Changing the variational parameters while a QPU executes a quantum program modifies its quantum state.
The quantum part state is . When the quantum program begins, its state changes instantly to . The mapping reloads place with the initial value in an ideal QPU (with I being the identity matrix). In a real QPU, however, noise leads to the relation , where represents the noise effect in time and is the practical approximation of the resulting unitary matrix that replaces the ideal I matrix. If the quantum program interacts with a classical program, their interaction must occur within the quantum fidelity period.
The execution of classical transition
results in
The execution of before provides the measurement v of . Conversely, if is executed first, the measurement of is provided.
As was shown, a quantum program model can describe the joining of qubit vectors (e.g., transitions
or
in
Figure 3) or split the qubit vector (e.g., transitions
and
or
and
in
Figure 3). The split qubits (or vectors) can be measured separately during quantum program execution. Consequently, the place sizes or the token sizes that can be set in a place may vary depending on the developer’s needs.
3.2. QPN Models with Qumodes
Our earlier QPN models were based on discrete qubits in Hilbert space. In these models, places store quantum states using V vectors of dimension m and/or vectors of dimension . State evolution is modeled by transitions performing unitary operations either on individual qubits or collectively on multiple qubits.
The current approach extends the previous definition of QPNs to include one or both types of quantum variables: discrete qubits and qumodes. The V vectors can consist of qumodes or, collectively, multi-qumodes. In this case, Hilbert space is replaced by Fock space, and the unitary operations are adjusted accordingly. As mentioned earlier, cutoff dimensions must be introduced, which set the size of multi-qumodes to .
The equivalent qubit parameterized unitary matrix for a qumode can be obtained by a sequence of displacement and rotation .
The overall structure of QPN models remains the same, as do the sequences of transitions describing the evolution. In the case of discrete qubits, measurement often requires multiple shots, whereas for qumodes, a single shot is sufficient.
3.3. Temporal Analysis of DQCPN Model
A temporal analysis should verify the state changes of the quantum program in relation to its interaction with the classical program. Consider the double communication program shown in
Figure 3. The initial states of
are
According to the Classical Petri Net principle of atomic transitions, transitions
and
cannot occur simultaneously. They are concurrent; therefore, their corresponding events are ordered by the “happen before” relation represented by
: either
or
. The QPN reachability graph contains the states
and
before reaching the final state
Both measuring events must occur within the fidelity periods of the QPUs to ensure computational correctness.
The partial ordering involved in entanglement in quantum programs can be determined by inference of EPNL relations. So, the construction of reachability graphs can be obtained under the constraints given by EPNL. Due to the entanglement requirement, the constraint
must be implemented for
Figure 3.
A quantum-centric program consists of a QPN and a Classical Petri Net, modeled here by OETPN. The interface between the QPN and the OETPN includes classical control places and classical measurement places.
3.4. QPN Definition
Figure 5 illustrates a QPN model composed of four places and a transition. The places represented by circles model the system state described either by a Hilbert vector denoted by
or by an array of qubits or qumodes denoted by
V, as shown in
Figure 6.
A vector
can be converted into the corresponding vector
by the relation
System change is performed by transitions, denoted here by
, which modify the states of the system. When particular qubits or qumodes of a vector are involved, the corresponding mappings are marked on the arcs. A descriptive representation can be seen in
Figure 7.
If the detailed relations performed on qubits or qumodes composing a vector
V are
these lead to a new vector
. The corresponding vector
can be directly determined by a composed unitary matrix
U given by
When the unitary matrices depend on parameters, they can be provided by control places. For example, a rotation angle may be used in a unitary matrix through sine and cosine functions, yielding .
In this approach, the mappings multiply the input tokens stored in the transition input places by unitary matrices. More details are given in [
24].
The formal
definition of
is
where the following apply:
N = (P, T, F) is a bipartite oriented graph (i.e., net with two disjoint sets of nodes).
is a finite set of places, with .
is a finite set of transitions, with .
is the flow relation.
is a vector containing the sizes of the vectors ) stored in the corresponding places; for qumodes, the cutoff dimensions must be included.
is a set of input channels providing the parameters of unitary matrices.
is a set of output channels providing the measurements of some qubits.
is the set of mappings (i.e., pair ) assigned to arcs linking the transitions with places; if one of them is missing, it is denoted by .
is a matrix with initialized values (i.e., the initial quantum superposed states).
init is the initialization method.
end is the stop method.
is a matrix storing the values of the final quantum superposed state (i.e., the result matrix).
Some important relations related to QPNs are
°t describes the transition t input place set;
describes the transition t output place set.
QPN tokens are quantum superposed vectors stored in places and transformed by transitions implementing unitary matrices. Let
and
be two vectors in Hilbert space or Fock space. Then,
Above, A is a matrix that generates a transformation of a quantum superposed state. , where is the conjugate transpose of A. Such matrix A is called unitary. This property of A guarantees that the transformation with is valid. For simplicity reasons, only particular cases of unitary matrices are used in this work.
Similar quantum operations can also be defined for qumodes and multi-qumodes.
3.5. Quantum Tasks with Repeated Operation Execution
Figure 8 shows a theoretical QPN model that requires the periodic execution of operations
and
, followed by transition
, which measures the state of
. The model contains conflicting transitions
and
. The decision whether to continue the quantum process or to stop it and measure place
is difficult to implement. Another challenge is to change the state of place
.
Until quantum technology permits the modification of a quantum register qubit (currently forbidden by the no-cloning principle), the model shown in
Figure 9 can be used. The number of times
n that the operations
and
are executed is fixed and predefined.
3.6. Quantum Iterative Task Execution
Some applications, like machine learning, require the iterative execution of quantum tasks with different parameters.
Figure 10 displays a quantum task that executes the operations modeled by transitions
and
dependent by the parameters
and
set by a classical task. For a two-qubit register, an example of
is
This operation rotates the first qubit by an angle determined by the parameter used to set the QLC assigned to transition . In an iterative execution, the parameters and the QLCs are set before the quantum task begins.
3.7. Distributed Quantum-Centric Petri Nets (DQCPN)
A DQCPN model consists of cooperating QPNs and OETPNs. A QPN has quantum places
and transitions
, while an OETPN has classical places
and transitions
. OETPN models can be distributed and implemented on a classical computer network, while QPNs can be distributed and implemented on a set of cooperating QPUs. OETPNs and QPNs can interact through quantum–classical interfaces:
where
Here and represent the numbers of QPU components and OETPN components, respectively.
The interface between two QPNs contains quantum transitions that implement entangled quantum places. Classical places and classical transitions compose the interfaces between two OETPNs. The frontier between a QPU and a classical computing component is represented by classical places, while the quantum–classical interface is implemented by measuring transitions of quantum places.
3.8. Quantum Processor Unit (QPU) Model
Figure 11 displays the generic template of a quantum task implemented on a Quantum Processor Unit. The node specifications are as follows:
Input quantum places: and .
Output quantum places: and .
Internal initial places (corresponding to internal qubits): Their type is quantum.
Entangled qubits places: and . Their type is quantum.
Measured places (qubits): and . Their type is classical vector.
Control places: , , , and . Their type is classical vector. They can be used to set QLC parameters or for the selection of QLCs.
Measurement control places: . There can be multiple classical measurement control places.
Transition parameters: and . These determine the unitary matrices performed by transitions. They are classical vectors and define the types or behaviors of the involved unitary matrices.
Execution of a program built using this template is performed under the following assumptions:
No noise is present; thus, the quantum process can last as long as necessary.
Transitions are executed under the All at Once principle.
Once a stable state is reached, it can be changed by the control places or by changes in input places’ states, leading to another stable state.
Quantum measurements do not stop the QPU process.
Classical measurements stop the measured qubit but not the unmeasured qubits.
A complex quantum program can be implemented on more QPUs by linking their input and output places. Each QPU executes a quantum task, and the set of quantum tasks run concurrently.
3.9. QPN Model of a Quantum Task
A quantum program is composed of a set of distributed, concurrent, and communicating quantum tasks. Typically, each quantum task is deployed on a QPU; however, this is not mandatory—multiple tasks can be implemented on the same QPU.
The
model of a quantum task is composed of the tuple
where the following apply:
N = (P, T, F) is the earlier defined net (
Section 3.4).
is the earlier defined vector (
Section 3.4).
is a mapping assigning types to places: .
is a set of unitary matrices corresponding to quantum logic circuits available in the QPU, which can be assigned to transitions through the mapping .
is a set of qubits or qumodes (usually initialized in the quantum state ).
is a set of input places receiving quantum vector information from other quantum tasks (QPUs).
is a set of input control places used for transition control. They contain parameters from the set used in the transition unitary matrices.
is a set of output places used for sending quantum vectors to other quantum tasks (i.e., QPUs).
is a set of measurement places that store classical information from measured qubits or qumodes for output QPU use.
is a set of controlled transitions used to measure their input places, storing the information in as either quantum or classical type.
A quantum task begins when control place
receives parameters. The enabled transitions, conventionally partitioned in steps, are executed. The quantum task reaches a balanced state that persists until one of the input places from
receives an event that changes its state (Algorithm 1).
Algorithm 1 QPU or quantum task executor |
Input: Initialization: while time horizon do for all do if t enabled then * execute t; end if; end for; * ; * ; ; WAIT(input event); end while; END algorithm;
|
3.10. Optimization of DSs
A quantum approach of combinatorial problems is based on the Quantum Approximate Optimization Algorithm (QAOA) [
49]. Dynamic optimization problems with continuous variables are more challenging, particularly in open systems.
Variational Quantum Algorithms (VQAs), frequently used for optimization, are hybrid algorithms that employ both quantum and classical computing to find approximate solutions. These can be either gradient-based or gradient-free methods [
30].
Evolutionary Systems (ESs) and their extensions Quantum Evolutionary Systems (QESs) are also commonly used in DS optimization. More details are given in [
24].
Genetic Algorithms (GAs) and Quantum Genetic Algorithms (QGAs) are based on individuals grouped into populations that are iteratively improved using performance evaluations [
50].
Unlike GAs, QGAs require the quantum implementation of individuals and the execution of genetic operations such as mutation, permutation, crossover, and combination. These operations can be efficiently implemented and controlled on a quantum computer (QC) or a QPU. Performance-based individual selection increases the chance of choosing better candidates. Performance evaluation requires adding unitary vectors multiplied by sub-unitary coefficients, which can be implemented through a unitary matrix applied to output variables.
For optimal control, Particle Swarm Optimization (PSO) has been used. A historical perspective on PSO development is given in [
51].
PSO is a metaheuristic global optimization paradigm valued for its ease of application to complex multi-dimensional problems unsolvable by traditional deterministic algorithms [
51,
52]. Various methods have been developed to avoid local optima and improve search speed. Applications of PSO in multiple fields are analyzed in [
53].
A quantum variant, Quantum Particle Swarm Optimization (QPSO), is described in [
54,
55,
56]. Both classical PSO and QPSO benefit from features inspired by natural organisms. PSO models particles as moving in Newtonian space, characterized by position and velocity [
52].
PSO has been enhanced with quantum features, yielding QPSO [
55]. Quantum entanglement has been incorporated for quantum-inspired PSO [
57]. Cooperative swarm intelligence is another application of QPSO [
57]. QPSO can also be applied successfully to multi-task problems [
58].
4. Experiments
As an application of DQCPNs, an Urban Vehicle Traffic Control (UVTC) system is chosen. Links between quantum computing and traffic management can be found in [
59].
According to [
60], a key component for the study and development of intelligent transportation systems is traffic modeling, which provides a framework for better investigating and testing the state of the road in real time and accurately predicting future traffic. Colored Petri Nets and Complex Event Processing are used for this purpose, representing the modeling of the city map and its vehicle traffic. Remarkably, here, the scalability challenge can be addressed by classical (Colored) Petri Nets, so their extension to QPNs is expected to also retain this feature.
The proposed QPN is a distinct type of PN model that retains most of the PN features. Supervised machine learning requires model training, where the high speed of quantum simulations constitutes a relevant benefit. The DQCPN approach supports the distributed implementation of UVTS, as well as model training.
The Urban Vehicle Traffic System (UVTS) is a modern and complex problem involving variations in traffic flow that require timely reactions under temporal constraints [
61]. The UVTS can be described as vehicle flows that vary probabilistically in space and time [
62]. Traffic flow parameters can be changed and controlled at intersections.
The current approach considers a network of simple intersections with two phases of controllable duration. The template of such an intersection is shown in
Figure 12, where for direction
i , the flow states are denoted by
, the input flows by
, and the output flows by
.
The relations describing the dynamics of the intersection in
Figure 12 consist of incoming flows, internal flows, and outgoing exit flows. An incoming input flow
in iteration
k is split into two directions,
and
, as
according to the split coefficient
of input flow
at time
k.
The intersection flows are controlled by a signal , with and representing phase duration parameters. All intersections are assigned the same cycle duration.
The flows for the horizontal directions
(modulo 4) in iteration
k are described by
where
is the flow state at time
k and
is the exit flow. The notation
means the minimum of
a and
b.
The flows for the vertical directions
(modulo 4) in iteration
k are described by
Exit flows
are constrained by a value
representing the maximum lane exit capacity:
An UVTS composed of four intersections,
, and
, is shown in
Figure 13. This system is used for optimal control with the goal of achieving maximum throughput.
Each intersection has two input flows () and two output flows () coming from or going outside the controlled area. Here is used for horizontal flows and for vertical flows.
The incoming flows in the system
(
) may vary, but the control system modifies control
(
) such that the UVTS achieves the highest possible throughput, for the current demands, as assessed by
For simplicity, the input flow splits () are considered constant.
The flows of the UVTS model can be implemented by QPNs using different types of places and their corresponding transitions:
Single qubits in Hilbert space with multiple shots;
Multi-qubits (discrete) in Hilbert space with a single shot;
Single qumodes in Fock space with a single shot;
Multi-qumodes in Fock space with a single shot.
In this approach, each QPU implements an intersection, and the entire UVTS is implemented in four linked QPUs.
An input flow
split into
and
according to a parameter
set in control place
is represented in
Figure 14.
Figure 15 shows the QPN model representing the exit flow
, composed of the previous flow (
), the forward input flow (
), and the right input flow (
).
By combining these components, the QPN model shown in
Figure 16 is obtained. Place
represents the initial value
of a qubit or qumode. It is used by the mapping assigned to
for setting in
the initial value
of
, according to the value loaded in
. Place
receives the input value
, which is split by transition
according to the split value
set in place
. A similar role is played by nodes
, and
.
Transitions and model the increase in flow by the input flow in phases one and two, respectively. The increase values are set in and . Transition models the exit flow stored in , measured by , and sent forward by . The time when the exit flow is measured is controlled by place .
The execution of the above QPN model can be divided in steps:
Step 1 executes concurrently transitions and , producing flows , , , , and .
Step 2 executes transition , increasing flow with when phase 1 is open.
Step 3 executes transition , which adds right flow during phase 2.
Step 4 executes transition , releasing the vehicle flow to the next intersection or out of the system.
Step 5 models the exit flow by transition and place .
Finally, transition is executed, and exit flows are measured.
4.1. Lane Flows: Implementation and Simulation
Quantum model implementation and simulation of UVTSs can be performed using either discrete variables or continuous variables for flow modeling. Discrete variables can be implemented with one qubit per flow or with multiple qubits per flow. In the latter approach, the time for performing arithmetic operations (see [
63]) can be utilized in the classical style. Another approach is based on qumodes, using one qumode per flow or multiple qumodes per flow.
4.1.1. One-Qubit-per-Flow Implementation
Each of the flows mentioned above is implemented by one qubit. Instead of the well-known Bloch sphere, the qubit is represented on a circle.
Figure 17 illustrates a qubit constrained to a circle (plane) described by
The qubit measurement is obtained by projecting it onto the axis. Multiple execution shots are required to obtain reliable flow measurements. A mapping from the flow domain to the qubit measurement domain converts a flow variable into a qubit, or vice versa. For example, a flow range of vehicles/minute corresponds to the qubit measurement range .
For the input split model shown in
Figure 14, an implementation based on one qubit per flow is proposed, as illustrated in
Figure 18. It describes a qubit
that controls two entangled inputs
and
, defined by the pair
and
, where
.
The model shown in
Figure 14 was practically implemented based on the relations
with the split flows being given by
Using the split relations
and
, the rotation angles
and
can be determined:
A lane exit flow
opposite entrance
i is determined by the relations
with
and
taken from modulo 4. An exit flow
from one intersection becomes the input flow of the next. Assuming that a phase is open when
and closed when
, the coefficients
and
determine the entrance and exit of the lanes.
In
Figure 16, the input splits are controlled by
and
, while the crossings are controlled by
and
. The rotation angles of transitions
and
are
Place is initialized to , and transition , controlled by place , injects into place the initial value of flow state . Input place receives the split value . Transition , controlled by place , sets the qubit in place , representing the sum of the two previous qubits. The input value is added to , controlled by the state of . It is assumed that enters during phase one on and during phase two on . The exiting vehicle flow of a lane, with state , is modeled by transition . Vehicles exit in both phases, represented by and . The rotation angle of transition is fixed and identical for all flows moving forward, denoted by .
4.1.2. Multi-Qubits-per-Flow Implementation
Using four qubits to represent a vehicle flow can cover the range vehicles/minute. The number of times these operations are applied is set in the control places , and .
4.1.3. One-Qumode-per-Flow Implementation
A qumode can represent a vehicle flow if a scaling function is applied.
Let
of dimension 8 be a variable modeling a vehicle flow
, and let
be a function that converts the measured value into the corresponding flow by the relation
The initialization of flow
corresponds to a qumode value
, obtained as
The parameters and can be determined using Particle Swarm Optimization (PSO) or a Genetic Algorithm (GA) so that the resulting qumode is an acceptable approximation of (i.e., ).
The input flow split can be simulated using two entangled qumodes. A beamsplitter gate provides two exit qumodes that are separately rotated, one in the positive direction and the other in the negative direction.
Flow addition or subtraction can be simulated by positive or negative displacement and rotation, respectively.
In conclusion, using qumodes does not require changing the implementation logic. Only the mappings assigned to transitions must be modified for qumode operations.
4.2. Intersection Model
By joining the flow inputs in a vector
U, the lane flow states in a vector
X, the lane exits in a vector
E, and the phase controls
of the two phases, the composed (concentrated) QPN model of the QPU that integrates the crossroad is obtained. These vectors correspond to the relations
The vector describes the split input vector containing pairs for . Some exit flows are measured, and some outputs of an intersection are linked to inputs of other intersections.
For practical reasons, the qubit implementation was performed using
V vectors instead of
vectors. Detailing the two phases and representing separately the input vehicle flows used in the second phase by
, the QPN model of all four lanes integrated into an intersection is shown in
Figure 19.
Each QPU integrates the QPN model of an UVTS intersection. The vectors of an intersection’s four lanes are denoted by and . Place integrates four qubits initialized at . Controlled transition sets in place state .
Input place receives four qubits , which are split by transition according to the split values provided by place . Thus, place contains eight qubits .
Some of these inputs are used by controlled transition (modeling phase 1), while the other four are used by transition (phase 2). Both phases are controlled by places and , which store the control qubit . Transition models the four exit flows. These are measured by transition and sent out through transition via place .
The intersection model can be implemented with either four qubits per vehicle flow or one qumode per vehicle flow. The vectors and the operations assigned to transitions must be adapted accordingly.
4.3. UVTS QPN Model
Figure 20 displays a QPN model integrating the QPN models of all four intersections. If the previous vectors are joined according to their roles, we obtain the vectors of the QPN model corresponding to the entire UVTC system. They are denoted by
The qubits or qumodes initialized in place at state are mapped by controlled transition into place , according to the required states , transmitted through place . Place is initialized at for all four qubits, vectors of qubits, or qumodes.
Transition sets in the external inputs according to the information received through place . The internal inputs stored in (i.e., ) are provided by transition from the exit flow lanes.
Transition
splits the input flows, storing them in place
, denoted by
. Transition
models phase 1 of all intersections, while
models the opposite phases. Transition
models the lane exits of all intersections. Transition
models the feedback of exit flows converted into internal input flows.
links the exit flows with the corresponding input flows according to the UVT topology depicted in
Figure 13.
Information stored in place can be measured at the request of the classical component.
Table 2 shows the nodes, their sizes, and the operations involved for the one-qubit-per-flow implementation. It can be extended for the four-qubits-per-flow or one-qumode-per-flow implementations.
Figure 21 shows the architecture of the distributed quantum-centric application solving the optimal control of the UVT problem. The classical computing components receive the inputs
, the current flow states
, and the input splits
S of
U. These are sent to the control component, which fills the control places of the QPUs. An initial control set
is also provided. The quantum computing process is then started. After a specified delay, Control measures exit lane flows
, which are used to compute input splits and lane exit flows.
The optimization component finds control
by using the measured values
. The control problem of UVT with QPN models consists of finding intersection phase controls
for a given initial flow
, input splits
, and input demand flows
such that the highest throughput (see Equation (
54)) is achieved.
The optimization problem was solved using the Particle Swarm Optimization (PSO) algorithm and the Genetic Algorithm (GA), with comparable results. A GA individual or PSO particle represents the vector .
The current problem reduces to finding the phase control vector
That is, finding in a four-dimensional search space.
The Quantum Computing System (QCS) reaches the initial equilibrium state by executing the sequence
During an experimental scenario, the inputs and the control are fixed, leading the system to states for , converging to equilibrium states . The QCS then performs the relation .
The classical control component implements the Algorithm 2:
Algorithm 2 Classical control |
Control() Input: Output: ; Initialization: *calculate ; set while do set with ; /quantum tasks execution set ; /measurement request ; * calculate ; ; end while; END algorithm;
|
A mapping is used to convert the output flows into input flows of neighbor intersections.
Being a hybrid implementation, the
reachability graph must contain both classical and quantum states. The marking is
, where
and
The reachability graph of the hybrid implementation can be expressed as , where the superscript denotes the iteration.
The QPN model of the UVTS can be implemented using either discrete or continuous variables, as described in [
22]. A discrete-variable QPN was used in [
24].
4.4. Dynamic System Optimal Control
The Evolutionary System (GA or PSO) used for heuristic optimization has the role of finding optimal control
of the UVTS in state
for given
and split
S. It implements the Algorithm 3:
Algorithm 3 Evolutionary system |
Evolutionary system() Input: Output: ; Initialization: * the initial population while do ; * calculate J; ; * Improve Population end while; ; END algorithm;
|
4.5. Experimental Results
The experiments were partitioned into three scenarios starting from initial flow state and applying three vectors of outside inputs:
Scenario 1: UVTS cycles 0 to 6.
Scenario 2: UVTS cycles 7 to 11.
Scenario 3: UVTS cycles 12 to 17.
All the input splits were .
Figure 22,
Figure 23,
Figure 24 and
Figure 25 display the evolution of flow
of intersection
. The other flows have similar evolution. For one qubit per flow or one qumode per flow, a scale factor of 15 is used to obtain the real value of the vehicle number per minute.
The lane modeled by one qubit per flow is displayed for Scenario 2 in
Figure 22. The orange curve shows flow
at the end of each cycle, while the blue curve represents its values at intermediate steps. The initial state was
. The input sequences for the six cycles were
and
. The phase controls of the four intersections were
.
The lane modeled by four qubits per flow is displayed for Scenario 2 in
Figure 23. The red curve shows
at the end of each cycle, while the blue curve represents intermediate values. The initial state was
. The input sequences were
and
, with
.
The lane modeled by one qumode per flow is displayed for Scenario 2 in
Figure 24. The goal was to replicate the same evolution obtained with one qubit per flow. While the qubit implementation uses the rotation gate
, the qumode implementation applies a displacement
followed by
. The values of
and
were determined using PSO and GA, minimizing at each cycle the deviation
, where
is the qumode-based flow and
is the qubit-based flow. The total fitness fraction assessing the deviation between qubit and qumode simulations was 0.2098.
Figure 24 shows the qumode-based lane simulation in gray, with the corresponding qubit-based simulation in blue. The input sequences, initial state, and controls were identical to those of the qubit simulation.
Table 3 shows the pairs of parameters
used for displacement and rotation in each QPN step of vehicle traffic simulation.
Figure 25 shows the evolution of the controlled UVTS: blue for input evolution, orange for lane flow evolution, and green for throughput. UVTS throughput was divided by 5 to use the same vertical axis.
UVTS throughput was analyzed under three input vectors:
;
;
.
Table 4 summarizes the results obtained using the GA and PSO methods.
5. Discussion
The proposed approach uses general quantum gates, ignoring the
logical quantum circuit synthesis and the involved compilation and transpilation processes. We are aware that the performance of quantum computers depends not only on the necessary physical qubits or qumodes but also on the gate error rates, which were not subjects of the current research study. According to [
4], the classical processors work synergistically with quantum processors for generating control logic, providing storage and networking services at runtime. The application quality depends on the classical software and how it is linked to quantum software.
Solving a problem starts with its specification, and after its analysis, an algorithm or a set of algorithms is deduced. Some functions are determined that must be implemented on Quantum and Classical Processing Units. Which of them have to be implemented on QC and which on CC constitutes a question that the developer must answer. QC implementation benefits from the opportunity to quickly obtain the solution to some complex problem that must obey real-time requirements. The feasibility analysis would provide the answer if the required architecture met the expected results.
In the above-mentioned reference, quantum temporal cohesion is defined as executing an operation on multiple qubits in the same time span. Quantum spatial cohesion is assessed by the existence of a correlation between neighboring qubits that interact. Quantum coupling is assessed by the degree of interdependence between different modules that affect the interface of the relevant components. The current approach considers a mixed quantum and classical implementation of distributed complex applications, so temporal and spatial coherence should be assessed by the involved QPUs cooperating with classical components. A similar assessment should be used for mixed coupled components.
The verification of quantum-centric applications involves the verification of the quantum parts and the classical parts, as well as their interactions. Besides the state space dimensions, which are usually large, there is an explosion of state space size that makes the direct verification of all the possible reachable states impossible. Using some state labels having kinds of shared features or common links can lead to affordable verification methods. The inherent quantum randomness can be included in the state representatives. Even some precedence relations can be defined and analyzed in relation to sets of concurrent quantum and classical operations.
All the implementations are affected by quantum execution errors. The desired precision determines the number of necessary experiments. The precision assessment must begin with the sequence of the transitions that are executed and the precision of the operations involved. For example, the sequence for reaching the initial equilibrium state of the UVTS (see Equation 70) provides the operations that are executed. Their precision depends on the quantum computer that executes these operations.