Development of Evolutionary Systems Based on Quantum Petri Nets

: Evolutionary systems (ES) include software applications that solve problems using heuristic methods instead of the deterministic ones. The classical computing used for ES development involves random methods to improve different kinds of genomes. The mappings of these genomes lead to individuals that correspond to the searched solutions. The individual evaluations by simulations serve for the improvement of their genotypes. Quantum computations, unlike the classical computations, can describe and simulate a large set of individuals simultaneously. This feature is used to diminish the time for ﬁnding the solutions. Quantum Petri Nets (QPNs) can model dynamical systems with probabilistic features that make them appropriate for the development of ES. Some examples of ES applications using the QPNs are given to show the beneﬁts of the current approach. The current research solves quantum evolutionary problems using quantum genetic algorithms conceived and improved based on QPN. They were tested on a dynamic system using a Quantum Discrete Controlled Walker (QDCW).


Introduction
The current research concerns applications, such as urban vehicle traffic, airplane traffic, weather, markets, electric power networks, fluids networks, telecommunications and data transmission, etc., that have stochastic behaviors. There are some entities that have to be controlled or managed to behave according to the required specifications.
Quantum computers have different capabilities compared to classical computers and their use should cover the domains where these differences would lead to significant benefits. The authors of [1] review the quantum algorithms that have been discovered and reveal their features that outperform classical algorithms.
According to [2], tools are needed to create and debug quantum computers and their programs. These tools can help to elucidate hidden issues and drive towards design with the best chance for overall success.
The current approach developed methods that can sustain the heuristic search of evaluated solutions that exceed specified thresholds. The previously conceived ES methods are modified according to the features provided by the quantum algorithms.
The general objective in simulating a quantum system is to determine its structure or behavior, given knowledge of its components and the environment in which it exists.
In [2] the quantum computers are partitioned in three categories: • Analogue quantum computers that directly manipulate the interactions between qubits without breaking the operations in logic gates. • Digital noisy intermediate-scale quantum computers that use primitive gate operations on physical qubits.
• Fully error-corrected quantum computers that enable noisy physical qubits to emulate stable logical qubits.
The QPNs (Quantum Petri Nets) can be used to model the quantum software applications, to analyze their structure and to verify their behaviors [3]. After the simulations of the QPN models, the implementation of the quantum applications is expected to be achieved (compiled) without difficulties.
This article shows the links between quantum algorithms and their corresponding QPN models. These can sustain the quantum processor configuration and quantum program conception, verification and debugging.
The two directions for solving the problems concern the contraption of methods that use quantum computation methods implemented on classical computers and to create new concepts that allow the finding of the ES solutions using the quantum computers. Quantum Computing (QC) is recommended to be used in applications where it outperforms the classical computation. Some reviews ( [4,5]) present as main QC directions: breaking cryptosystems [6], unstructured search problems, finding accurate approximate solutions to optimization problems, finding the minimum of an unsorted list of integers, determining a graph connectivity, solving linear equations, quantum annealing, etc.
The search in an unstructured database is obtained in [7] using a function F(x), x ∈ X = {0, 1, . . . , (n − 1)}, with F(x) = 0, for ∀x ∈ X, x = j where F(j) = 1. The problem consists of finding j. The exponential speedup of the search compared to the classical computation is an undoubted benefit.
Shor's algorithm solves the factorization problem [8]. It is given F(x) = a x mod N with a ∈ R, 1 < a < N. The request is the finding of the smallest integer r such that a r mod N = 1. Again, the algorithm's exponential search determines its use in many applications, such as the use of QC in cryptography [6,9] .
The inverse transform of a matrix introduced in [10] is used for solving linear equations of the form A · x = b, where A is a Hermitean N × N matrix and b a given unit vector. QC solves such problems that appear in many practical applications with exponential speedup.
Hybrid methods involving quantum and classical computers can be used as Variational Quantum Eigensolver [11,12]. The eigenvalues and eigenvectors of a Hamiltonian are used to transform a system iteratively to a desired specified one.
Quantum annealing is an optimization method for combinatorial problems where the superposition is used for avoiding the focalization in local minimums [13].
Quantum walk opens ways for algorithm construction that solves search problems on a graph [14].
According to [15], the classical random walk concept has been used as a computational framework for designing classical algorithms for complex problems, while quantum variants provide a speed-up in computational power for various algorithms with distinct elements in spatial search or graph connectivity. A quantum walker following a unitary operation for evolution is named a unitary quantum walker, while one that does not meet this condition is a non-unitary quantum walker. The non-unitary evolution of a quantum system is implemented/defined by adding some qubits to the quantum system followed by a unitary transformation. The result is obtained by discarding the extra qubits. Both kinds of walker have benefits in practical applications.
An example is the optimization of a search based on random walks that require the reduction of the number of necessary repetitions [16,17].
Some quantum walker approaches tackle the Quantum Discrete Random Walkers (QDRWs) in an infinite space or finite space [18]. Other researchers studied the quantum continuous random walkers (in an infinite space) [19,20]. They are widely used in practical applications [5]. An application of quantum discrete walker ranking in grid nodes is given in [21].
The reference [22] contains some variants of Quantum Discrete Walker (QRW) approaches and different variants of generalized coin tossing. In [23], two entangled coins were used to control the walker's move in a one-dimension space.
One goal in walker problems is the reducing of the hitting time and the diminishing of mixing time [24].
Quantum walk can be used for search of element distinctness (e.g., find two equal elements) [25].
The comprehensive review [26] divides the quantum walker approaches as Schrodinger and combinatorial. To be noted is the decoherence definition as a physical phenomenon that typically arises from the interaction of quantum systems and their environment. This interaction can be used for quantum process control as it will be seen further for controlling the walker moves.
Quantum Approximate Optimization Algorithm (QAOA) uses the mapping of the objective function to Hamiltonian that brings the problem into Hilbert space [27][28][29]. The expectation value of the Hamiltonian is improved by using quantum mechanical techniques in the Hilbert space. QAOA can be extended by adding constraints. A relevant problem is the so called MaxCut where a graph G = (V, E) with V vertices and E edges has to be cut in such a manner that it maximizes the number of edges crossing the cut.
In conclusion, the main quantum walk research directions and their practical applications focus on the hitting times, the quantum amplification control and the marked element detection.

Evolutionary Systems
Evolutionary Algorithms (EAs) are applied to problems where pure stochastic algorithms fail or find it difficult to solve due to the high number of dimensions or function complexities [30]. Their main utilizations cover the domains of variable optimization, new structural design and improvement. EAs include: evolutionary strategies, genetic algorithms, genetic programming, genetic improvement, grammatical evolution, linear genetic programming, Cartesian genetic programming, differential evolution and gene expression evolution.
The evolutionary systems implemented on classical computers are often used for solving problems concerning: • Combinatorial requirements, • Optimization of system parameters, • Dynamic behavior optimizations, • Algorithm synthesis such as for controlling plants or for reacting to events produced by their environments.
Related to the use of QC in EA, some questions arise: What are the benefits of using QC in EA? What are the modifications required for application of QC in EA? Where and how can Quantum Evolutionary Algorithms (QEAs) be applied in practical applications? References [31,32] offer some answers to these.
Successfully detailed implementations at the Quantum Logic Circuit (QLC) level are developed and deeply analyzed in [57,58].
Some QEA used animal behaviors for searching the solutions [39,59,60]. Remarkable are the characteristics of the systems that can be approached: they could have various complexities, including non-linear, non-convex, multi-modality, non-differentiable functions and large-scale dimensionality.
Quantum control based on machine learning in an open quantum system is another direction of QC application development [61].
Closest to the view point of quantum state superposition, created by QC, is the Particle Swarm Optimization (PSO) method [62].
Analyzing the QEAs, it can be concluded that the genotypes are coded based on the quantum superposition fulfilling the Hilbert condition. The genotypes are initialized to meet some diversity requirements and covering the search domain. The individual (i.e., genotypes) are improved using unitary transformation matrix. The individual improvements can be based on a single (usually the best) individual or combining features from two individuals (i.e., crossover). Some evolution methods need genotype (or individual) repair mechanisms. There are improvements consisting of the search step adaptations, usually related to the generation iterations. It is difficult to prove the benefits of using the quantum vector representation instead of classical ones. There would be clear benefits if it can be proved that the number of searches and evaluations is smaller in the case of quantum description. The comparisons based on experiments of different QEA methods for solving particular problems can be supposed to be biased to particular characteristics.
The approaches of discrete oriented quantum random walker problems were used to show the benefits of the QPN models.
As our main contributions should be mentioned: the manner of QPN definition, their properties, analysis and verification methods. The Quantum Genetic Algorithms (QGAs) were adapted using the QPNs. They were experimented and tested on a dynamic system. A new kind of quantum discrete random walker model, based on QPN, was used for testing the QGAs. A new quantum fitness method was conceived for this purpose.

Quantum State versus Classical State
The classical bits take values in the domain {0, 1}. They are used to compose the digital information. A number of r bits can cover a domain of 2 r values.
The quantum replacement of the classical bit is the qubit denoted here |b k : |b k = α k |0 + β k |1 where the complex numbers α k and β k satisfy the relation |α k | 2 + |β k | 2 = 1 and |0 , |1 represent their quantum state.
The qubit can be represented on Bloch sphere ( Figure 1). It can be described using the angles by the relation: with θ ∈ [0, π] and φ ∈ [0, 2π]. Joining a number of g qubits leads to a quantum register modeled by qubit vectors of the form: The initialization and measurement (i.e., collapse) in quantum computers are performed on qubits. These refer to the V vectors.
The qubits (similar to the bits) can be coded at the computational level by state vectors. The content of a register composed of g (length) qubits can store information using 2 g state vectors from the set Q = {|q 0 , |q 1 , . . . , |q r−1 } with r = 2 g . These vectors compose a system of axes used for representing the data in quantum computation.
A quantum register content can be described by the superposed state vector |ψ in a Hilbert space (H) at the computational base: with c k ; i = 0, . . . , r − 1 complex numbers from the set C fulfilling the relation: ∑ r−1 k=0 |c k | 2 = 1. These coefficients are named amplitudes and they represent the probability distribution of the quantum state. The value |c k | 2 provides the probability of the quantum process to be in the quantum state |q k . This conception of storing the quantum information based on the quantum state amplitudes (i.e., the coefficients c i ) can sustain the opposite behavior manners named quantum interference.
Let |ψ 1 = ∑ r−1 i=0 c 1 i |q i and |ψ 2 be two vectors in Hilbert space. Then: A is a matrix that generates transformation of superposed quantum state.

Quantum Systems versus Classic Dynamic Systems
Let |ψ x = ∑ r−1 k=0 c x k |q k be a quantum vector and x = [x 0 , x 1 , . . . , x r−1 ] T a vector with real number elements in the classic system theory. The relation between the quantum vector and the classic vector is set in the current approach by |c x k | 2 = x k for all k = 0, 1, . . . , r − 1. As it can be seen, the values x k (k = 0, 1, . . . , r − 1) correspond to the system probabilities to be in the quantum states |q k (k = 0, 1, . . . , r − 1).
Denoting with X(τ) = [c x 0 , c x 1 , . . . , c x 7 ] T the vector provided by |ψ x at a discrete time τ, a classic dynamic system can be described by X(τ + 1) = U · X(τ). If U is a unitary matrix, the walker's position, provided by X, remains in Hilbert space (i.e., on the circle domain).
If |ψ o = ∑ 1 k=0 c o k |q k is a Hilbert vector, then |ψ o x = |ψ o |ψ x is a Hilbert vector as well that extends the position with the entity orientation.
A quantum system |ψ x (τ + 1) = A · |ψ x (τ) can model an un-oriented walker, can model an oriented one. The un-oriented walker has the state |ψ x equivalent to X, while the oriented walker has the state |ψ o x equivalent to (c o 0 , c o 1 , X). The matrices A and A o have to be unitary for the walker system to remain in the Hilbert space.

Quantum Computation
Unlike the classical computation that uses logical gates, the processing of quantum information is performed by quantum processors composed of quantum logical gates. A quantum logic gate acting on a qubit is a 2 x 2 matrix. For example, the Hadamard (or diffusion) matrix: acting on the qubit |b = α|0 + β|1 , provides |b = 1 that verifies the quantum coefficients (i.e., Hilbert) condition.
A single quantum logic gate acts on a qubit, while multiple quantum gates, composing a quantum logic circuit act on a register (vector) of qubits, performing an operation of the form |ψ = A|ψ . Any such transformation of information has to fulfill the quantum coefficient condition that is met if the corresponding matrix A is unitary.
According to [63], a single qubit quantum gate can be applied to a register of r qubits on a single qubit of a quantum vector. If the qubit is in the k position, the full quantum gate matrix His described by: where I is the identity matrix. For g = 3 qubits (|b 0 , |b 1 , |b 2 ), the application of H on the middle qubit leads to the matrix A 1 = I H I which is a matrix of 8 x 8 size. Figure 2 represents a quantum logic circuit that acts on a vector, composed of 3 qubits, performing an increment operation detailed by the AND and exclusive OR operations.

Quantum Petri Nets
A quantum program involves modifications of the information stored in a set of quantum registers by the quantum gate circuits that link them. This can be modeled by Quantum Petri Nets (QPNs) [3]. Figure 3 shows an example of a QPN model that is used for their definition.
Other QPN formal definitions and modeling methods can be found in [64,65]. These show the connections between Petri nets, quantum physics and category theory. The monoidal categories are used for constructing a net theory. In [65], the definitions of QPNs were enriched with formal construction of the reachability graphs.  Figure 4 shows a QPN modeling a quantum logic circuit that sequentially applies the mappings (i.e., gate operations) A 1 , A 2 , A 3 to the qubits |b 0 , |b 1 and |b 2 , respectively, performing the operations |ψ 4  For the QPNs (see Figure 4), the following notations and concepts are used: QPN model shown in Figure 4 corresponds to QLC represented in Figure 2 if the following relations are added.
The Toffoli (CCNOT) gate that is applied to the 3 qubits has the correspondent matrix operator: The matrix operator for CNOT gate applied to the two qubits is: The NOT (Pauli-X) gate matrix operator, applied to last one qubit is: The last two matrices are transformed, using the relation (7), resulting the mappings assigned to transitions: and There are two referential systems denoted by V and Ψ that store in parallel the information in the QPN places. The quantum logic circuits (i.e., the mappings mapV) act on the V level (i.e., qubit registers) modifying the coefficient values while the mappings mapΨ act at the Ψ (computational) level modifying the amplitudes [c 0 , c 1 , · · · , c r−1 ]. For each value V there is the transformation (5) denoted by T that converts the V vector in |ψ = T (V) vector. For some pure states of |ψ the transformation and the revers transformation (conversion) V = T −1 (|ψ ) can be performed.
Some quantum algorithms use and have defined mapping mapΨ, even if at the low level they are implemented by mappings on quantum logic circuits (QLC). This requires the synthesis of QLCs that perform the mappings mapΨ. Other quantum algorithms have defined operations only at the qubit level. The conversion from V to Ψ is always defined by the transformation of the type T .
Related to QPN states, the following are specified: • Any place p s ∈ P has assigned a pair of natural numbers (g s , r s ), with r s = 2 g s specifying the dimensions of the tokens (i.e., vectors) |ψ s and V s , respectively, • Q = {|q 0 , |q 1 , . . . , |q r−1 } is the place quantum state set, • |ψ s = ∑ r−1 l=0 c s l |q l is the first part of the token that can be set in a place p s ; ] is the second part of the token set in the place p s , • The marking of a place p s is QM( When the token is missing in a place p, the place marking is QM(p) = φ (i.e., the empty set meaning nothing or the lack of information); • The system quantum superposed state QS is and it is given by or

Transition Admissibility and Execution
The QPN places can store two kinds of tokens (V token and Ψ token) and its transitions can execute two kinds of mappings (mapV and mapΨ) depending on the available tokens in their input places.
Any output arc (t k , p v ) ∈ F of a transition t k has assigned a mapping denoted mapΨ v k (. . . , |ψ j , . . . ), and a mapping mapV v k (. . . , V j , . . . ) with |ψ j and V j tokens in QM(p j ), p j ∈ • t k that transforms the information stored in its input places (i.e., Hilbert and V vectors) and sets the new token (i.e., |ψ and V vectors) in its output place p v ∈ t k • according to: or its counterpart When one of them is missing, the Equation (5) is used for transformation.
A transition is enabled for the execution of its assigned mapV and/or mapΨ mappings if and only if it has in its input places the corresponding V/Ψ tokens, respectively.
The execution of an enabled transition mapping involves the atomic logical extraction of the tokens from its input places and the injection of the tokens in its output places. When a mapV mapping is executed, it is followed by the conversion and set of the |ψ = T (V) tokens in the output places if the mapΨ mapping is not available or allowed.
An enabled transition t k is executed at a moment in the time interval (0, d k ) with 0 and d k real numbers; where d k is a very short estimated (specified) moment in time.
The start and the end of a quantum program involve: • init, a method that initializes the places with quantum vectors with amplitudes from the matrix CS 0 with CS 0 an environment matrix of QS size and complex elements fulfilling the Hilbert space condition; • end, a method that stops the quantum process by collapsing the current QS, extracts the information from places (i.e., the final state QS f ) and sets it to an environment where CS f is a matrix of g · m size with the elements in {0, 1}.

Definition of QPNs
The definition of QPN is: where: Map is the set of mappings (i.e., pair (mapΨ v k (), mapV v k ())) assigned to arcs linking the transitions with places; when one of them is missing, it is denoted by null, • QM 0 is a matrix with initialized values (i.e., the initial quantum superposed states); • init is the initialization method; • end is the stop method; • QM f is a matrix storing the values of the final quantum superposed state (i.e., the result matrix).
There are some differences concerning the QPNs related to classical PNs: • The same token set in a place can be used for enabling and execution of more than one transition. • There are non-reversible transitions (that correspond to non-reversible quantum logic circuit) and reversible transitions that correspond to reversible quantum logic gates. • Once a non-reversible transition is executed (it extracts the tokens from its input place set), no further transition can be enabled with the extracted tokens. • The transition assessment is performed in iterations that have no duration. • When some transitions are enabled, they are executed even if the tokens from their input place sets have already disappeared. • If more than one transition set tokens concurrently (simultaneously) in a place, this situation leads to conflict and has to be avoided.

Analysis and Verification of QPN Models
The need of the analysis and the verification of the quantum programs behaviors is obviously in the development process, as it is known from many procedures. Petri nets can sustain these by some popular methods. In the current approach, Petri nets-based language and the reachability graphs are used.

Petri Net Based Language
Using the notations: '*' for sequence, '+' for alternative, '&' for concurrence and '#' for closing a loop, the behavior of a PN can be described. For example: • t 1 * t 2 describes the sequential execution of the transitions t 1 and t 2 ; • t 1 + t 2 describes the alternative for execution of the transition t 1 or t 2 ; Details of their use are provided in [3].

Reachability Graphs
In [3] were used the reachabilty graphs that include the states and the transitions that lead to them. Some transitions are concurrently executed, changing the system states simultaneously. Some examples of their use are provided further. Figure 5 displays a QPN model that could execute a sequence σ = t 1 * t 2 of two reversible transitions. A reversible transition should be accepted to become initially enabled even if the token in one of its input places is missing (denoted here by φ).

QPN Model Examples 2.8.1. Reversible Transitions and Entangled Places
The transition t 1 concurrently executes the relations: where the unitary matrices A 1 and A −1 1 fulfill the relation A 1 · A −1 1 = I. After t 1 , the transition t 2 concurrently executes the relations: where the unitary matrices A 2 and A −1 2 fulfill the relation A 2 · A −1 2 = I. The places p 1 and p 3 are entangled, if the transitions t 1 and t 2 are assigned with d 1 = 0 and d 2 = 0 (i.e., zero delays). These lead to instantaneous maintenance of the relations |ψ 3 = A 2 · A 1 |ψ 1 and |ψ 1 = A −1 1 · A −1 2 |ψ 3 .

Qubit Rotations and While Loops
The QPN shown in Figure 6 describes the rotation of the qubit |q 0 stored in the place p 0 by the mapping assigned to t 0 . The rotation with an angle θ can be determined using the circle representation displayed on Figure 7. Supposing that the rotation angle is given by a qubit |q = α|0 + β|1 , the angle θ is given by θ = arcsin(β) = arccos(α). Performing this calculus offline, the mapping assigned to t 0 that achieves the rotation is:  The repetition of the loop until a specified state is achieved, is a more difficult task. In the current proposal the method introduced by [66] is considered to be used. As a consequence, it is supposed that a loop can be admittedly executed with a specified robustness. The measurement performed at each iteration, for predicate condition of exiting the loop, diminishes the qubits state with a value smaller than a specified and accepted one.
The QPN model displayed in Figure 6 executes the sequence: The while loop is determined by t 1 that executes: This involves the weak measurement of |ψ 1 (see details in [66]) that ends the loop execution when the condition is not met.
The QPN example displayed in Figure 8 corresponds to a mapping that rotates the qubit |q o = α o |0 + β o |1 stored in the place p 0 with an angle given by the control qubit |q c = α c |0 + β c |1 stored in the place p 1 , resulting the qubit |q r = α r |0 + β r |1 injected in the place p 2 . This requires the synthesis of a QLC that performs the unitary transformation (α r , β r ) = map((α 0 , β 0 ), (α c , β c )). Let be the above map(., .) given by A 1 (θ) defined in (21) with θ = arctan( β c α c ). This sets in p 2 the result of the rotation of |q 0 according to the amplitudes of |q c .
Another possibility to implement the model displayed in Figure 8 is to assign the vectors |ψ 0 , |ψ 1 and |ψ 2 to the QPN places. If the mapping assigned to transition t 0 is |ψ 2 = |ψ 0 |ψ 1 , this manner of multiplication leads to increasing the dimension of the vector set in p 2 to 2 g 2 = 2 g 0 · 2 g 1 .

Quantum Discrete Random Walker on a Circle
The chosen examples concern the Quantum Discrete Random Walker (QDRW) that moves on a circle or on a sphere (see Figure 9). They can be oriented or un-oriented. The specified 8 discrete positions on the circle can be coded with three qubits composing a vector V = [(α 0 , β 0 ), (α 1 , β 1 ), (α 2 , β 2 )] or by referring to the quantum states for each position |ψ X = ∑ 7 k=0 c x k |q k . The walker random moves are decided by throwing a coin that can be modeled by Hadamard matrix (Equation (6)). The QDRW model on a circle can be described in the Hilbert space H = H 8 X by the equation: |ψ x (τ + 1) = SH(H I · |ψ x (τ) ) (26) where SH(...) denotes the shift operator applied to its argument and τ is the clock tick. SH moves the walker to the right if the decision operator (i.e., the coin) provides "+" and to the left if the result is negative. SH is implemented by a permutation matrix (that has only one '1' on each column or line) that performs the walker evolution. SH + achieves a positive move (i.e., increase the position), while SH − determines a negative move (decrease the position value). Denoting by = 1 √ 2 , the application of H to a qubit provides: Denoting with X = [c x 0 , c x 1 , . . . , c x 7 ] T , the probability of the QDRW to be in the position The probability that QDRW follows a trajectory described by the sequence The probability that QDRW hits a target x = k during a discrete time interval θ = [a, b] is given by Π x=k;θ = ∑ b τ=a |c k (τ)| 2 . The oriented Quantum Discrete Random Walker (QDRW) QPN model is represented in Figure 10.
with α(τ) and β(τ) the complex coefficients needed for orientation fulfilling the Hilbert condition, and c k , i = 0, . . . , r complex numbers from the set C fulfilling the relation: The place p 2 models the QDRW oriented toward increasing the position (i.e., state X 0 , while the place p 5 corresponds to its orientation toward decreasing the position (i.e., X 1 ). Throwing the coin (i.e., applying the operator H) determines the change of orientations that affect the moves performed by shift operators. The QDRW dynamics is achieved by the mappings assigned to transitions. The model executes the sequence: σ = ((t1&t2) * (t3&t4)) k . The implementation requires three qubits for the walker's position and one for the orientation.
The mappings assigned to transitions are: The probability that QDRW be in a specified position x k at a time moment is given by the sum of the probabilities given by values stored in the places p 2 and p 5 : where c 0 k and c 1 k are the elements of the vectors X 0 and X 1 , respectively. These probabilities are displayed in Figure 11. For the QPN analysis of oriented QDRW on a circle its reachability graph is constructed as can be seen in Table 1. Instead of the quantum state, QRS is used here. Table 1. Reachability graph of QPN from Figure 10.
· · · · · · · · · · · · · · · · · · · · · 2.8.4. Quantum Random Walker on a Sphere Figure 9 represents the sphere (like the Earth globe) used for the walker's move and Figure 12 shows its surface displayed on two dimensions. The walker initial position is (x 0 , y 0 ). The system composed of oriented QDRW moving on a sphere is described in the Hilbert space: with the vectors |ψ X = ∑ 7 k=0 c x k · |q k and |ψ Y = ∑ 7 k=0 c y k · |q k describing the position on axes X and Y, respectively. The walker state is extended with its orientation on the both axes: The action of the coin vector |ψ K = ∑ 3 k=0 c C k · |q k that modifies the walker orientation is given by the matrix G (according to [67]): The oriented QDRW movements are given by the formula: where the square brackets are used for describing the construction of vectors. For this problem is conceived the QPN model displayed in Figure 13. The places p 0 , p 1 , p 2 and p 3 model walkers states ((X 0 , Y 0 ), (X 1 , Y 1 ), (X 2 , Y 2 ), (X 3 , Y 3 )) oriented to the right, left, up and down, respectively. The place meanings are displayed in Table 2. The initial state is: X 0 = Y 0 = [( , ), (0, 0), (0, 0), (0, 0), (0, 0), (0, 0), (0, 0), (0, 0)].
The mappings assigned to the transitions are: For the QPN analysis of oriented QDRW on a sphere, its reachability graph is displayed in Table 3. Table 3. Reachability graph of QPN from Figure 13.
· · · · · · · · · · · · · · · The probability of the oriented QDRW to be at the moment τ in the position X = x i and Y = y j is given by the coefficients of the vectors |ψ X (τ) and |ψ Y (τ) at the moment τ: The needed information required for these calculations is stored in the places p 0 , p 1 , p 2 and p 3 . The results of simulation can be seen in Figure 14.

Quantum Discrete Controlled Walker (QDCW)
The previous oriented walker's randomness (given by the generalized coin) is replaced by a matrix denoted by Γ that influences its move directions. The QDCW move equation becomes: with and G the previous diffusion matrix. The angles θ 1 and θ 2 determine the move directions. Again, the shift operator SH determines the QDCW moves toward these angles. The control problem consists of the application of Γ that leads the QDCW from a given initial state (i.e., position and orientation) to some specified target points or region.

Classic and Quantum Computers Connection
The quantum algorithms are not executed independently, but in collaboration with classic implemented algorithms. Figure 15 shows a composition of an Object Enhanced Time Petri Net (OETPN, see [68]) model that interacts with a QPN model. OETPN receives demands from operator through the classic place cp 2 and interacts with QPN through the interface (classic-quantum place) cqp. This provides the information used for the first steps of the quantum program. OETPN receives the quantum computation results through the interface (quantum-classic place) qcp. According to [32] a qubit |x = α|0 + β|1 observation or measurement can be modeled by the wave function collapse as: where pr(x ) is a random number in the range [0, 1) used for the assessing of x. QPN is initialized by the transition qt 1 in the pure state |00 . . . 0 that is switched by qt 2 in the desired initial state V or |ψ state in qp 3 using the information provided by cqp. The mapping(s) of qt 3 applies the QLC operations. If the exit condition is not fulfilled, the quantum calculations are repeated after the reaching of the qp 3 inserted by the transition qt 4 . When the exit condition is reached, the transition qt 5 sets the measured value of qp 4 by collapsing on specified axis.
Approximately 1/ 2 measurements are required to get the results with the precision . This means to repeat the quantum process with the same initialization values. OETPN can request to repeat the QPN execution by reloading the initial condition, until the expected statistical results are obtained.
The QPN places do not necessarily independently represent the quantum processor qubits that are described by the entire QPN marking. The QPN places describe the quantum program state. All the transitions' mappings are implemented at the lower level by QLCs.

Quantum Evolutionary Systems (QES)
The extension of classical ES to Quantum Evolutionary Systems (QES) concerns the replacing of the genes of classical genomes with qubits. This makes the description of an infinite number of individuals in the same instantiation of the model possible. The classical genetic operators have to be adapted to the new form of information encryption.
The individual evaluation, which in the classical computation requires the separate simulation of each of them, can be performed simultaneously. The reading of evaluations performed with different parameters can extract the information for individual selection and further on for their improvement.
Quantum control is an effective tool to drive the quantum system to a given target state and thus manipulate the dynamics of a quantum system [61]. The main goal is to control a multilevel system from an initial state to a given target state. This can solve problems related to quantum control strategies based on supervised machine learning to suppress the quantum noise in an open quantum system.
Quantum approach can be used in GA by:

Quantum Genetic Algorithms
Genetic Algorithms contain: • The genome specification that is used for construction of the genotypes, • The individual evaluation that consists of modeling the individual behaviors and assessing their performances, • The individual selection for reproduction, • The individual improvements that are performed randomly based on the previous generation performance and the use of some genetic operators, • The stopping criteria that uses either a number of tested generations reaching a performances over a desired threshold, or just the execution is exceeding a specified duration or a specified number of generations without relevant improvements. Figure 16 shows the evolutionary process performed by a GA. It executes the sequence σ = t 0 * (((t 1 * t 2 )&t 4 )#(t 3 * t 5 )) K * t 6 where K represents the number of iterations performed until the result is obtained.
Generally, the ESs need to properly solve the evaluations of individuals and their improvement. Both of them should be adapted to the problems, otherwise the targets are not reached. Due to the problem complexities, there are no clear and proven rules for the general construction of fitness functions and individual evolution operators. There are two main approaches for individual evolution (i.e., improvements) of QGAs: one uses only the mutation and the other uses the crossover before performing the mutation. The first approach uses the best individual from the previous generation as a target for random genotype improvement, while the second selects the individuals for evolution according to their performances and randomly interchanges the two individual genotypes.
For achieving the solution, in [69], the authors propose a QGA implementation that does not need the crossover involving two individuals. The justification is that all the individuals are simulated simultaneously. More recently, [57] includes and justifies the use of crossover. The current approach concerns the control of the Quantum Discrete Walker with the model shown in Figure 13. The individuals of GA determine the mappings assigned to transitions t 0 , t 1 , t 2 , t 3 , t 0 , t 1 , t 2 , and t 3 . The Classic GA (CGA) problem usually involves the finding in each intersection (node and/or time) of the walker directions such that it reaches the targets avoiding the traps. Due to the fact that the walker can start from different initial points, the search should be repeated from all of them.
For the Quantum Discrete Controlled Walker (QDCW), the problem can be defined in two manners: one solves only the change of direction and the other performs the move length (i.e., 0, 1, 2, . . . ) in the chosen direction.
The efficiency of QGA is significantly better than the conventional genetic algorithm [49]. The classic Genetic Algorithm (CGA) has to execute (simulate) many individuals for their assessment one by one. QC (quantum computing) has the advantage that it can simulate simultaneously a large number of individuals. QC uses quantum variables that can cover by superposition the entire search domain. QGAs (Quantum Genetic Algorithms) have to represent the individuals by quantum vectors. The individual modifications fulfill the Hilbert condition by using mappings involving unitary matrices.
The transition t 0 of the model shown in Figure 16 creates in the place p 1 the genotypes pool using the initial information stored in the place p 0 . The genotype V is used for the construction of the individual ψ. For the walker control problem, the solution is obtained by replacing the previous G matrix (Equation (30)) with G · Γ, where Γ is a unitary matrix (Γ = [γ j,k ] j,k=0,1,2,3 ) that has the role to diminish the randomness and to lead the walker toward the targets. The genes are |γ 0 = α 0 |q 0 + β 0 |q 1 and |γ 1 = α 1 |q 0 + β 1 |q 1 that, for implementation reasons, are changed in the vector The execution of the mapping assigned to transition t 2 evaluates the individuals using the model displayed in Figure 13. The walkers described by [ψ − o, ψ x , ψ − y] are equally initialized V w 0 = [( , ) · · · ( , )] to occupy the entire walker's space: The individual performances are set in the place p 3 . The transition t 3 selects the individuals for evolution setting them in p 4 , linking their genotypes with the performances. For improvement, the best individuals from the previous generation are stored in p 5 . The transition t 5 performs the individual improvement (i.e., population evolution). The evolution continues until a stop condition is fulfilled, and then the transition t 6 is executed, providing the final results in the place p 8 .
In conclusion, all the possible initial states of the controlled system are evaluated simultaneously based on the walker's superposition. The transitions t 1 , t 2 , t 3 and t 5 can perform their activities in parallel for the current population.
Problems of optimal control of the QDCW can be defined in two manners. One consists of the application of control signals at each tick for direction modification, and the other one involves the syntheses of an environment that leads to a kind of deflectors set in each intersection. The deflectors direct the QDCW towards the desired targets avoiding the undesired traps. The current approach concerns the first manner.
The QPN model of the QDCW that solves the first approach is shown in Figure 17. As can be seen, the parallel simulations of QDCW, the controller (replacing in each moment of time the former Γ) and the individual evaluation (i.e., fitness) is governed by the Clepsydra ticks that will stop the execution when the experiment duration expires. QDCW can discretely move on a sphere with the above presented structure. It has to reach some target points T g = {(x a g , y a g ), (x b g , y b g ), . . . } avoiding some trap points T p = {(x a p , y a p ), (x b p , y b p ), . . . }. Figure 18 shows the QDCW problem with initial walker state (1, 1), T g = {(5, 5)} and T p = {(2, 4), (3, 3), (4, 2)}. The sequence 0 * 1 * 2 * 3 * 4 * 5 * 6 * 7 represents an obtained (by CGA) optimal trajectory. The walker state is described by superposition of the composed vectors: QDCW movement for 8 clock ticks is represented by the sequence:

Fitness Functions
For the classic GA, an efficient fitness function is constructed based on assessing the trajectory cost on each point. When QDCW reaches a point (i, j) with the probability π ij , the cost to be in that position is: otherwise.
The cost of the QDCW at a moment of time τ is: The move performance is assessed with the formula: with η a specified real value considered acceptable for the walker to be in a target point. As a consequence, if the sequence σ includes points [|ψ x (τ i ) , |ψ y (τ i ) ] ∈ T g and [|ψ x (τ i ) , |ψ y (τ j ) ] ∈ T p such that τ i < τ j (i.e., τ i is precedent to τ j ), then Moreover, when the walker hits a target point with a probability greater than η, its move is not assessed further.
For a quantum approach of QGA, the current research used the following quantum fitness function. Let ψ xy = |ψ x |ψ y be the composed vector providing the information related to the walker's position (i.e., the amplitude to be there) and Ψ xy = |ψ xy ψ xy | its density matrix. The diagonal elements of this matrix Ψ xy [k, k] = c x i (τ) 2 c y j (τ) 2 ; k = 0, . . . , 15; i = 0, . . . , 7; i = 0, . . . , 7; provide the probability of the walker to be in the position (i, j).
The set T n is used to denote the positions when the walker is not on T g or T p , while T d (meaning degenerated) denotes the case when the positions are simultaneously target and trap.
Let the values Ψ n (τ), Ψ g (τ), Ψ p (τ) and Ψ d (τ) be calculated by the formulas: They will be used to assess the probabilities of QDCW to be in the mentioned partition. Obviously Ψ n (τ) + Ψ g (τ) + Ψ p (τ) + Ψ d (τ) = 1 evaluates the probability of QDCW to be in the current moment of time in the mentioned partition, but the individual evaluation needs the assessment of its entire trajectory. The evaluation is given by a dynamic quantum fitness function Φ composed of two parts (Φ 0 , Φ 1 ) moving toward positive and negative (respectively) depending on the superposition of QDCW. Φ has orientation (stored by one qubit) and position (stored by 16 qubits).
All the individuals and their assessments are simulated simultaneously during the specified time horizon (see the model represented in Figure 17). It continues with Grover's algorithm that provides the best individual and its fitness.

Controller Genome
Regarding Figure 17, the first manner has to find the value of Γ(0) and the unitary matrix U that modify the control signals according to the formula: The matrix U = A 2 (θ u 0 , θ u 1 ) is constructed based on the relation (25). The controller's genome is: [|qb u 0 , |qb u 1 , |qb γ 0 , |qb γ 1 ] where the vectors |qb γ 0 and |qb γ 1 correspond to the value of Γ(0). Γ changes the QDCW orientation according to the relation: In conclusion, the GA has the task of finding the angles θ γ 0 , θ γ 1 , θ u 0 , θ u 1 that lead to maximum performance. For the current problem, an individual genome V i is denoted by The population P w of the generation w is: where pd is the population dimension. The individual implementation requires 2 + 2 qubits, allowing the simultaneous simulation of the entire population. Another 8 qubits are needed for implementing the QDCW.

Genetic Operators
The individual (genotype) improvement introduced in [49] is used for the purpose of avoiding the premature convergence problem that leads to loss of individual diversity in early generations. For the gene improvement the direction (i.e., positive or negative) and the amplitude should be found. The direction can be chosen by comparing the best performance from the previous generation with the current individual performance. The amplitude of the search in [49] is dynamically adapted by diminishing it at each new generation.

The rotation direction is chosen based on a determinant
, where the elements are provided by a qubit from the previous generation best individual qb b k = (α b k , β b k ) and the current individual that has to be improved qb The direction of the rotation angle for improvement toward the best individual is given by −sign(A k ). The direction is not determined if A k = 0.
Let V b be the best individual from the previous generation and V j an individual of the current generation. If their fitness functions are J p b and J p j , respectively, the improvement of V j consists of applying the rotation improvement vector Θ = [θ 0 , θ 1 , . . . , θ g−1 ]. Let θ max and θ min be the maximum and minimum accepted rotation angle, respectively.
If an adaptation of the rotation angle in the generation w of the maximum z generations is used, the function for an individual improvement becomes as in Algorithm 1.
The coefficient v was added for convergence adjustment. The quantum crossover operator introduced in [57] was developed and applied in the current research. It works simultaneously on the entire population P w of dimension pd (assumed even) at the generation w. It is split into two equal parts, P w 0 and P w 1 . After ordering P w according to the chosen fitness function, it is randomly copied in P w 0 and P w 1 . The crossover operator (consisting of swapping the second parts of two individuals' genotypes) is applied simultaneously to all the individuals, and so the population P w+1 is given by Algorithm 2.

Algorithm 2 Function Crossover(P w , pd)
Require: P w , pd Ensure: P w+1 is genetically improved * parallel J p w ← simulate(P w ) sort(P w ) * randomly (P w 0 , P w 1 ) ← P w for all V j ∈ P w do * swap the last halves of V j and V pd−1−j end for return P w+1 ← P w The classical mutation operator acts on a genotype, randomly choosing a gene and randomly switching its value. The quantum mutation operator acts on the entire population, simultaneously rotating all the qubits with random angles.

Quantum Inspired Genetic Algorithms
QIGA needs a different kind of genome [48] that can be stored in the vector V according to Equation (4). Usually, all the individuals j; j = 0, 1, · · · , pd − 1 have the initial genotypes: The individual genotype modification is performed by a unitary transformation A 1 (θ) (given by (21)) with θ = random() · 2π, where random() ∈ (0, 1) is a function that generates random values. The transformation A 1 (θ) in an iteration k acts on a qubit qb i of V: The individual's qubits can be rotated with the same θ or using different rotation angles for each qubit. The individual is obtained by a transformation Γ j = T (V j ).
The individual assessment is performed by the simulation of the QPN model. Their selection for reproduction is performed by the classical roulette wheel.
Based on Figure 16, the QIGA is constructed by detailing the mappings (as in Algorithm 3). The following notations are used: • z is the maximum accepted number of generation/iterations, • w is the current iteration, • pd the population dimension, • P w is the population in the generation w, • V b , J p b are the best individual of the previous generation and its fitness function.
vidual assessment is given by the position inclusion in an assessment partition and the corresponding degrees. The HCQGA is composed of two parts: Classic Component of GA and Quantum Component of GA. The algorithms they execute are presented in Algorithms 4 and 5.

Algorithm 4 Classic Component of GA
Require: pd, z, θ max , w, θ min , v Ensure: V b , Φ b the best individual of population and its performance

Algorithm 5 Quantum Component of GA
Require: o(0), x(0), y(0), w, z and QDCW model Ensure: Φ w , V b , Φ b the best individual of population and its performance The methods set and get were used for the description of communication between classic and quantum computers.
For QDCW simulation, another 3 qubits are required for the clepsydra. The QLC has to be endowed with the necessary quantum gates for the mappings implementation.
The use of the quantum genetic operators Crossover and Mutation would lead to complete quantum genetic algorithm.

Complete Quantum Genetic Algorithm (CQGA)
This is implemented completely on a quantum computer that executes Algorithm 6.

Results
The QDRW models were tested on a software company simulator, but all the genetic algorithms were tested by simulation using Java language. For QPN, a framework can be found at "https://github.com/dahliajanabi/QPN".
For experimentation of the proposed methods, the previously presented QDRW was modified to the move control of a Quantum Discrete Controlled Walker (QDCW).

Classic GA Solution of Walker Move Control
The quantum QDCW model is similar to the QPN displayed in Figure 13. The classic walker model has the same graph ( Figure 13), but the guards and mappings have to be modified according to Object Enhanced Time Petri Nets (see reference [68] for details). For this case, the transitions t 0 , t 1 , t 2 and t 3 perform the rotations and the transitions t 0 , t 1 , t 2 and t 3 perform the move to the next positions. Unlike the quantum case, the classic walker can be in only one place p 0 , p 1 , p 2 or p 3 , because the superposition is not used in the classic computation.

Application of QIGA for QDCW
For QDCW model, the mappings assigned to transitions t 0 , t 1 , t 2 and t 3 (that correspond to generalized coin throw) in the QDRW model have to be replaced with control values applied to qubit registers. The qubit register is composed of two qubits for orientation, three qubits for X and another three qubits for Y.
The probabilities of the best individual obtained by QIGA are represented in Figure 19. The evolution of the solution search is given in Table 4. The maximum values Ψ g and Ψ p were obtained at different moments on time.  Figure 19. The representation of the probabilities of the best individual for QIGA.

Application HQCGA for QDCW Control
The values provided by the quantum fitness function where transformed into classic values using the formula: J p = (Φ 10 − 2 16 ) · 10 −4 (62) where Φ 10 represents the conversion in the base 10 of Φ.
The probabilities of the best individual obtained by HCQGA are represented in Figure 20. The evolution of the solution search is given in Table 5. The probabilities of the best individual obtained by CQGA are represented in Figure 21. The evolution of the solution search is given in Table 6.

Discussion
Modeling with QPNs can sustain all the phases of quantum software development. They help the understanding of the quantum complex problems and their use facilitate the quantum software conception. QPN can be used for description at the qubit level, or at a higher-level modeling complex mappings. The Petri net-based language can be used for analysis of classic programs as well as quantum programs. Because quantum programs are expected to be used in tandem with classic programs, the Petri nets are useful for constructing a bridge between quantum computers and classic computers, successfully showing their concurrent cooperation. The reachability graph can be used for the classic program and for the quantum program as well. The development based on QPN provides the mappings that lead to the QLC structure required for quantum program implementation. The QPN places show the necessary quantum registers and their dimensions. The transitions have assigned matrices that have to be implemented by QLCs.
The current approach concerns the control of dynamic systems where statistic features are relevant. This kind of applications require fitness functions assessing the temporal behaviors as they were introduced here.
The classic discrete walker has a deterministic behavior, so its optimal control leads to a deterministic solution. QDCW has a stochastic behavior described by superposition and so its optimal control is described by superposition too. Both walkers are controlled by changing their orientations.
The classic controller genome is a time variable vector Θ, while the quantum controller genome is composed of the initial orientation function Γ(0) and a matrix U for this function correction.
QIGA and HCQGA use similar individual evolution algorithms (genotypes improvement). Their results are close to each other. CQGA uses quantum crossover and mutation and these lead to a different solution, slightly with lower performance than the previous GAs.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following abbreviations are used in this manuscript: