Next Article in Journal
Accelerating CRYSTALS-Kyber: High-Speed NTT Design with Optimized Pipelining and Modular Reduction
Previous Article in Journal
Design of Broad-Angle Low-RCS Microstrip Antenna for Dual-Polarization Using Characteristic Mode Analysis
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Quantum Firefly Algorithm: A Novel Approach for Quantum Circuit Scheduling Optimization

1
School of Computer and Information Engineering, Harbin University of Commerce, Harbin 150028, China
2
Heilongjiang Provincial Key Laboratory of Electronic Commerce and Information Processing, Harbin 150028, China
*
Author to whom correspondence should be addressed.
Electronics 2025, 14(11), 2123; https://doi.org/10.3390/electronics14112123
Submission received: 27 April 2025 / Revised: 17 May 2025 / Accepted: 21 May 2025 / Published: 23 May 2025

Abstract

:
In the noisy intermediate-scale quantum (NISQ) era, as the scale of existing quantum hardware continues to expand, the demand for effective methods to schedule quantum gates and minimize the number of operations has become increasingly urgent. To address this demand, the Quantum Firefly Algorithm (QFA) has been designed by incorporating quantum information into the traditional firefly algorithm. This integration enables fireflies to explore multiple positions simultaneously, thereby increasing search space coverage and utilizing quantum tunneling effects to escape local optima. Through wave function evolution and collapse mechanisms described by the Schrödinger equation, a balance between exploring new solutions and exploiting known solutions is achieved by the QFA. Additionally, random perturbation steps are incorporated into the algorithm to enhance search diversity and prevent the algorithm from being trapped in local optima. In quantum circuit scheduling problems, the QFA optimizes quantum gate operation sequences by evaluating the fitness of scheduling schemes, reducing circuit depth and movement operations, while improving parallelism. Experimental results demonstrate that, compared to traditional algorithms, the QFA reduces SWAP gates by an average of 44% and CNOT gates by an average of 16%. When compared to modern algorithms, it reduces SWAP gates by an average of 7% and CNOT gates by an average of 12%.

1. Introduction

The rapid development of quantum computing hardware devices has significantly extended the coherence time of qubits. Currently, the available quantum computers are still considered noisy intermediate-scale quantum (NISQ) devices [1]. For quantum computers, minimizing the qubit operation time is crucial, as it increases the likelihood that all operations will be completed before any qubits undergo decoherence, thereby resulting in computational results with higher fidelity [2].
A quantum compiler takes a quantum circuit as an input program and generates the corresponding control sequence for execution on the target hardware. For example, in a quantum computer using superconducting qubits, a quantum operation will be compiled into several control instructions over a specific period of time. In a quantum compiler, it is essential to ensure that the execution start times of each quantum operation do not overlap. This task is referred to as quantum circuit scheduling [3,4,5].
Quantum circuit scheduling must take into account three main constraints. The first is logical dependence, which refers to the inherent order of operations in the algorithm. The other two constraints are hardware limitations: no qubit can participate in more than one gate operation simultaneously, and two-qubit gates can only be implemented between qubits that are physically connected or interact with each other. These constraints result in the inability to directly execute quantum algorithms on quantum computing devices. Solving this problem requires work in areas such as mapping, scheduling, and error correction, with quantum circuit scheduling being a critical research focus. The main purpose of scheduling is to optimize circuit performance while satisfying hardware constraints, including reducing latency and depth, optimizing the number of quantum gates, and improving parallelism and resource utilization, thereby ensuring that quantum algorithms can be correctly and efficiently executed on specific quantum hardware [6,7,8,9,10].
In recent years, efforts have been made to improve quantum circuit scheduling algorithms to better adapt to the evolving quantum computing hardware and application requirements. With the continuous advancement and expansion of existing quantum computing hardware, minimizing the number of operations has become a major research focus in quantum circuit scheduling. A two-step method was proposed by Guerreschi [11], where logical gates are first arranged without considering connections, and routing operations are subsequently added in a way that minimizes overhead. Qmap, a timing and resource-aware mapper, was presented by Lao et al. [12] to map quantum circuits onto the Surface-17 superconducting processor by addressing hardware constraints, reducing latency and operation overhead via polynomial-complexity scheduling and routing heuristics, and enabling flexibility for different processors through a configuration file. Four general methods were proposed by Alam et al. [3] to optimize Quantum Approximate Optimization Algorithm (QAOA) circuits through gate reordering. This reordering allows for more quantum gates to be executed in parallel, reduces the number of additional gates required for compiling QAOA circuits, and consequently decreases circuit depth. Four methodologies, including QAIM, IP, IC, and VIC, were proposed by Alam et al. [13] to optimize QAOA circuits for NISQ processors. By leveraging gate reordering and hardware characteristics, these methods reduce circuit depth and gate count on average, enhance success probability via variation-aware compilation, and introduce the ARG metric to validate compiled circuits on real hardware. Gate model quantum computers are essential for implementing near-term quantum computer architectures and quantum devices. A new qubit mapping scheme, QuCloud+, was proposed by Liu Lei et al. [14], which improves the fidelity and resource utilization of 2D/3D noisy intermediate-scale quantum (NISQ) computers in both single-task and multi-task programming. By addressing challenges faced by existing mapping schemes, such as crosstalk, the overhead of SWAP operations, and varying device topologies, QuCloud+ enhances the accuracy of quantum computing results and computational efficiency. A multi-qubit lattice surgery scheduling algorithm was proposed by Allyson Silva et al. [15] to optimize the orchestration of quantum circuits in two-dimensional topological quantum error-correcting codes. This method primarily focuses on the scheduling problem of multi-qubit long-distance operations. The quantum circuit can be transformed into a sequence of only non-Clifford multi-qubit gates by applying simple swapping rules, which significantly reduces the circuit length on the test circuit set. Furthermore, compared to serial execution, the expected execution time of multi-qubit gate circuits is further reduced. CutQC, proposed by Tang et al. [16], is a scalable hybrid computing approach that integrates classical and quantum computers to facilitate the evaluation of quantum circuits inaccessible to classical simulations or standalone quantum devices. By partitioning large quantum circuits into smaller subcircuits, this method enables their execution on smaller quantum devices, with classical postprocessing used to reconstruct the output of the original circuit. A systematic method for simulating clustered quantum circuits with limited quantum memory was introduced by Tianyi Peng et al. [17]. Cluster parameters K and d were defined for quantum circuits, with the tensor network of the circuit being decomposed into clusters of, at most, size d, and the number of qubits for quantum communication between clusters being limited to, at most, K. This systematic method reduces the number of qubits and the depth of the circuit, thereby enhancing robustness against relevant noises. A circuit synthesis scheme, proposed by Beatrice Nash et al. [18], addresses the problem of limited qubit connectivity in NISQ devices. The scheme is designed to optimize quantum circuits to fit the device connectivity, minimize the number of CNOT gates, and improve computational efficiency. Zhao Yun Chen et al. [19] proposed an optimized classical simulation scheme, which allows a large number of measurement results to be obtained in a short period of time, achieving efficient simulation of multi-qubit quantum circuits. The quantum circuit simulator Qulacs was proposed by Yasunari Suzuki et al. [20]. It is designed to meet the requirements of quantum computing research and is characterized by high speed and diverse functionalities, providing a powerful tool for quantum computing research. The expressibility and entanglement capabilities of parameterized quantum circuits (PQCs) for hybrid quantum-classical algorithms were explored by Sukin Sim et al. [21], offering a theoretical foundation and methodologies for the design and selection of appropriate PQCs. The quantum circuit mapping tool MQT QMAP was introduced by Robert Wille et al. [22], aimed at assisting researchers and developers in efficiently mapping quantum circuits onto practical quantum computing architectures. The circuit compilation problem in distributed quantum computing was studied by Daniele Cuomo et al. [23], who proposed an optimized compiler framework. By establishing a dynamic network flow model and introducing the concept of quasi-parallelism, the overhead of remote operations was effectively reduced, and compilation efficiency was improved. Moreover, experimental comparisons of different topological structures were conducted, providing valuable insights for the design of distributed quantum computing architectures. The quantum compiler optimization method known as Relaxed Peephole Optimization (RPO) was proposed by Ji Liu et al. [24]. By utilizing single-qubit state information, this method is designed to simplify quantum circuits, reduce the number of gates, decrease compilation time, and enhance the performance of quantum computing. A quantum circuit compilation framework based on reinforcement learning was introduced by Nils Quetschlich et al. [25]. In this approach, the quantum circuit compilation process is modeled as a Markov decision process, and reinforcement learning is applied in an effort to address challenges in the development of quantum compilers. The makespan minimization problem in quantum circuit compilation was investigated by Shelvin Chand et al. [26], who proposed two new heuristic algorithms to address it. One algorithm is a sequential decision-making method based on rollout, where the next operation to be scheduled is determined by the makespan prediction given by a guiding priority rule. The other is a stochastic version of the rollout heuristic, which alternates between rollout and a simple priority rule to explore the search space. SCIM MILQ, a scheduler for quantum tasks in high-performance computing infrastructure, was proposed by Philipp Seitz et al. [27]. This scheduler combines well-established scheduling techniques with methods unique to quantum computing, such as circuit cutting, and minimizes the makespan while scheduling tasks. Additionally, Pan et al. [28] review Quantum Secure Direct Communication (QSDC), a quantum communication method that enables direct transmission of secret messages without pre-shared keys by leveraging quantum principles such as entanglement. The paper discusses key protocols, such as the two-step QSDC, DL04 protocol, and measurement-device-independent (MDI) QSDC; experimental advancements, including 100 km fiber transmission; and existing challenges. The role of QSDC in the quantum internet through hybrid architectures is envisioned, with its security foundations in quantum mechanics and practical progress emphasized.
This paper aims to explore the challenges encountered in the quantum circuit scheduling problem. To improve the execution efficiency of quantum circuits, reduce the number of quantum gate operations, and enhance circuit parallelism, the Quantum Firefly Algorithm (QFA) is proposed for optimizing the quantum circuit scheduling method. By combining the wave function evolution in the Quantum Firefly Algorithm with classical search techniques, the structure of the quantum circuit is optimized under the constraints of qubit connection topology and quantum gate dependency relationships. As a result, the circuit depth is reduced, parallelism is improved, and the number of SWAP operations is simultaneously minimized.
Compared with previous similar quantum circuit scheduling work, the main innovation of this paper lies in the introduction of the Quantum Firefly Algorithm (QFA) into the circuit scheduling optimization process of the 2QAN quantum compiler. Traditional scheduling methods mostly employ heuristic or classical swarm intelligence algorithms (such as particle swarm optimization [29] or ant colony optimization [30]). However, due to the special quantum characteristics of the 2QAN problem, traditional intelligent optimization algorithms (IOAs) struggle to effectively handle quantum constraints, leaving room for improvement in their optimization efficacy and efficiency. The proposed QFA integrates quantum characteristics into the firefly algorithm by incorporating quantum properties into the optimization process, enhancing its applicability to quantum circuits. When applied to 2QAN quantum circuit scheduling, the QFA can better balance multi-objective optimization requirements such as circuit depth, gate parallelism, and the number of SWAP gates. By introducing quantum state evolution and wave function collapse mechanisms, the QFA demonstrates superior performance in global search capability and convergence speed. Experimental results show that this approach achieves better scheduling performance than traditional methods on multiple benchmark quantum circuits, effectively enhancing the overall performance and applicability of the 2QAN compiler.

2. Implications for Quantum Circuit Scheduling Optimization

2.1. Quantum Circuit Scheduling

The essence of quantum circuit scheduling lies in the scheduling of quantum gates and the determination of their execution order in a time-sequential manner. The execution of quantum gates requires time and is constrained by the connectivity among qubits within the quantum processing unit, as well as by the limitations of hardware timing. Therefore, the execution order of quantum gates must be arranged rationally. By optimizing gate scheduling, the waiting time for gate execution can be minimized to the greatest possible extent, thereby enhancing the execution efficiency of the quantum circuit. Furthermore, rational scheduling must also account for the correlations between quantum gates to ensure the accurate transfer of quantum states.
Compared to traditional scheduling problems, quantum circuit scheduling must satisfy the following multiple constraints:
(1)
Hardware topology limitations: Current mainstream quantum computing hardware, such as superconducting quantum chips and ion traps, is typically only capable of supporting direct interactions between partial quantum bits. In other words, not just any two quantum bits can directly perform two-qubit gate operations; only physically adjacent or coupled quantum bits can do so directly. This physical connection relationship is referred to as hardware topology. Topological constraints must be considered during scheduling; otherwise, additional SWAP gates need to be inserted, increasing circuit depth and errors.
(2)
Conflict avoidance: At the same time, a quantum bit can only participate in one gate operation. Resource conflicts occur if two gates are scheduled to act on the same quantum bit simultaneously. Therefore, scheduling algorithms must avoid such conflicts to ensure that each quantum bit participates in, at most, one gate operation per time step.
(3)
Timing constraints: Quantum gate operations have strict timing requirements. Dependencies exist between certain gates (e.g., the target qubit of a CNOT gate can only be executed after preceding gate operations are completed), and these dependencies must be ensured during scheduling. Additionally, the coherence time of quantum bits is limited, and the larger the circuit depth, the higher the error probability. Therefore, the total execution time must also be minimized during scheduling.
After the physical qubits are mapped to the circuit, two orthogonal approaches can be utilized to accomplish the scheduling operation. The first approach involves using a randomly ordered sequence of quantum gates. In this approach, quantum gates are randomly inserted into the circuit, disregarding the connection relationships between the physical qubits. Although this method is simple and straightforward, it is likely to result in an increase in circuit depth due to the relatively small number of parallel operations. The second approach involves sorting the quantum gates according to the requirements of the backend compiler. By making optimal use of the connection relationships between the physical qubits, this method can reduce the circuit depth and enhance the efficiency of parallel execution. The parallel instructions in the circuit contribute to reducing the circuit depth, dividing the layers of gates that can be executed in parallel, optimizing the compilation process, and improving both circuit efficiency and execution speed.

2.2. Quantum Circuit Layer

Definition 1.
Quantum Circuit Layer: A quantum circuit layer is defined as a set of quantum gates that can be executed in parallel within the same time step, with no conflicts occurring between qubits.
Suppose a quantum circuit has n qubits, and the set of quantum gates in the l-th layer is G l = { g l , 1 , g l , 2 , , g l , k } , where each gate g l , k acts on one or more qubits. The quantum circuit layer has the following properties:
Property 1.
Parallelism. For any  g l , i , g l , j G l that acts on the set of qubits Pi, g l , j acts on the set of qubits Pj, and P i P j = ϕ , then g l , i , g l , j can be executed in parallel within the framework of layer l.
Property 2.
Sequentiality. Let any  g l , i G l and g l + 1 , i G l + 1 . The necessary condition for g l + 1 , i to be executed is that g l , i must be executed. From the sequentiality, it is easy to know that the overall operation of the quantum circuit is the following:
U = U L U L 1 U 1
where U l is the overall operation of the l-th layer, and represents the composition of operations.
Let q represent the logical qubit and Q represent the physical qubit. The physical architecture of the logical circuit shown in Figure 1a can be represented by Figure 1b, and the form of the circuit-gate sequence is as follows:
C = ( ( q 0 , q 1 ) , ( q 0 , q 3 ) , ( q 1 , q 4 ) , ( q 0 , q 3 ) , ( q 1 , q 2 ) )

2.3. Quantum Circuit Scheduling Optimization

The optimization of quantum circuit scheduling is primarily aimed at enhancing the execution efficiency and reliability of quantum circuits. Quantum circuit scheduling optimization encompasses multiple aspects. This paper primarily focuses on the following three aspects:
(1)
Gate-level optimization: The total count of quantum gates is minimized by combining the operations of quantum gates that can be combined, eliminating redundant gate operations, or decomposing complex gates into a basic set of gates.
(2)
Parallel optimization: The parallel execution of quantum gates is maximized while considering the constraints imposed by the hardware topology.
(3)
Depth optimization: Under hardware constraints, the depth of the quantum circuit is minimized as much as possible. A reduction in depth implies a decrease in execution time.
Figure 2 presents an example of the compilation of the 5-qubit Hamiltonian circuit in Figure 1a into the network architecture shown in Figure 1b. In this diagram, nodes represent qubits, edges indicate the connectivity among qubits, and dashed lines delineate the circuit layer structure. Gate operations within the same layer can be executed in parallel. To enhance readability and avoid confusion, the SWAP gate operations are applied to the corresponding hardware qubits and are depicted on the circuit qubits.
Figure 3a describes the compilation process of a general-purpose compiler using the gate dependencies in Figure 1a, inserting three SWAP gates (as shown in Figure 2, one SWAP gate is equivalent to three CNOT gates, so the depth increases by three for each inserted SWAP gate), and outputs a circuit with 14 two-qubit gates and D = 13. The flexible operator arrangement in the Hamiltonian simulation problem is utilized in Figure 3b. In contrast, the compiler that takes into account the flexibility of operator arrangement uses only one SWAP gate. After scheduling optimization, the circuit is composed of only eight two-qubit gates with D = 9. This SWAP gate can be combined with other gates in the circuit, further reducing the number of gates and the circuit depth.

2.4. Quantum Gate Scheduling Strategy Based on 2QAN

The 2QAN [31] is a quantum circuit designed to optimize the 2-local qubit Hamiltonian simulation problem. This circuit can be optimized for different qubit topologies and hardware gate sets. The gate scheduling method in 2QAN adopts a hybrid strategy, where the graph-coloring algorithm is used to schedule commutable gates, and a conventional Directed Acyclic Graph (DAG) is employed for scheduling non-commutable gates. First, variables and data structures are created, and the initial routing instructions are copied. In the detailed output mode, statistical information about the scheduling process, such as the number of SWAP gate operations and the number of two-qubit gates, is collected.
Next, the graph-coloring algorithm is used to sort the initial routing instructions, aiming to reduce the circuit depth. By considering the dependency relationships, each gate is iterated through and scheduled into the corresponding cycle.
Existing quantum scheduling strategies are based on one-dimensional quantum arrays, where serial operations are performed during hierarchical scheduling. These strategies do not fully exploit the parallelism of quantum computing and overlook the potential for further parallelization of operations within a layer during circuit execution. To address these limitations, the Quantum Firefly Algorithm (QFA) is proposed in this paper to optimize both the depth and parallelism of quantum circuits. This approach is designed to improve the execution efficiency of quantum circuits and enhance their reliability.

3. Quantum Firefly Algorithm Design for 2QAN Quantum Circuit Scheduling

3.1. Application of QFA in Quantum Circuit Scheduling Optimization

The core of the quantum circuit scheduling problem lies in optimizing the sequence of quantum gate operations, aiming for optimal performance while adhering to dependency constraints. Compared to traditional scheduling problems, quantum circuit scheduling has several distinctive characteristics: First, strict dependency relationships exist between quantum gates, which arise from the fundamental principles of quantum computing; second, topological constraints are imposed on the physical connections between qubits, limiting the direct execution of quantum gates; and finally, multiple performance metrics, including circuit depth, parallelism, and qubit movement overhead, must be simultaneously optimized. In response to these unique challenges, a firefly algorithm integrated with quantum computing features is proposed in this paper, utilizing key mechanisms to achieve efficient scheduling.
In traditional algorithms, a firefly individual contains only its own position information and fitness value. In contrast, the Quantum Firefly Algorithm (QFA) incorporates quantum information. The introduction of quantum information is intended to leverage the relevant theories of quantum mechanics to enhance the algorithm’s search capability and optimization performance. In the firefly algorithm, each firefly is restricted to a definite position at any given moment. However, in the QFA, quantum fireflies exist in a superposition state, represented by wave functions, which allows them to explore multiple positions simultaneously, thereby increasing the coverage of the search space. The incorporation of quantum information enables quantum fireflies to overcome energy barriers through the quantum tunneling effect, allowing them to escape from local optimal solutions. The evolution of quantum states and the collapse of wave functions offer a natural mechanism for balancing the exploration of new solutions and the exploitation of known solutions. The parallelism and high efficiency of quantum information processing facilitate a quicker convergence to high-quality solutions. By integrating quantum information, the QFA demonstrates higher efficiency and greater robustness when tackling complex optimization problems.
The scheduling scheme is encoded by the algorithm as a quantum state representation. Each firefly individual is represented by a quantum state vector, which contains the sequence of gate operations and the mapping information of qubits. The amplitude of its wave function encompasses the complete scheduling information, including the order of the gate operation sequence and the mapping relationship from logical qubits to physical qubits. The expression is given as follows:
ψ i = x a x ( i ) x
where x represents the scheduling scheme, a x ( i ) is the complex value amplitude, and x | a x ( i ) | 2 = 1 .

3.2. Position Update Mechanism

This quantum state-based encoding method is designed to fully describe all dimensions of the scheduling scheme and to leverage the superposition property for expanding the search space. During the optimization process, the evolution of the scheduling scheme is realized by solving the time-dependent Schrödinger equation. First, the Hamiltonian system is constructed, incorporating both kinetic and potential energy terms. The kinetic energy term is used to represent the trend of change in the scheduling scheme, while the potential energy term reflects the scheduling constraints and optimization objectives. The Hamiltonian system is expressed as follows:
H = ħ 2 m 2 + V ( x )
The kinetic energy term is denoted as ħ 2 m 2 . The potential energy term is denoted as V(x).
Combining the position update formula from the firefly algorithm, the potential field V ( x ) is defined as follows:
V ( x ) = β I j e γ | x x j |
The attraction coefficient β for the fireflies is defined as β = β 0 e γ r 2 , where I j denotes the brightness (fitness value) of firefly j , and γ represents the light absorption coefficient. The term x x j signifies the distance from the current location x to the position x j of firefly j . The potential field parameters ( β , γ ) are adjustable; β governs the strength of attraction, influencing the rate of convergence, while γ controls the decay of the potential field, thereby affecting the scope of the search.
The kinetic term ħ 2 m 2 endows the fireflies with a quantum tunneling effect; that is, the wave function evolution under the quantum potential field allows fireflies to probabilistically penetrate potential barriers, thereby transcending local optima. Under the quantum potential field, position updates are carried out utilizing the evolution of the wave function. The probability distribution obtained after the wave function collapses is influenced by the potential field; the deeper the potential well, the greater the amplitude of the wave function, and thus the higher the probability of exploration in these regions, guiding the fireflies to potentially move to more optimal solutions.
The negative sign in the potential field formula indicates the presence of a potential well, which attracts other fireflies. It can be seen from β I j that the depth of the potential well is directly proportional to the brightness and attraction degree of the fireflies; the brighter (higher fitness value) the firefly, the deeper the potential well it generates. The term e γ | x x j | serves as a decay factor; the greater the distance, the lesser the influence of the potential energy, with the light absorption coefficient γ controlling the rate of potential energy decay.
The position update formula of the traditional firefly algorithm is given as follows:
x i = x i + β 0 e γ r i j 2 ( x j x i ) + α ε
where the first term, x i , represents the original position of firefly i, the second term is the attraction function, and the third term is the randomization function. α is the randomization parameter, β 0 is the attraction when r i j = 0 , γ is the light absorption coefficient, r i j represents the Euclidean distance between any two fireflies i and j at positions x i and x j , and ε is a random number uniformly distributed in [ 0 , 1 ] .
If the brightness of firefly i is lower than that of firefly j, firefly i is moved towards firefly j, with the movement speed being proportional to the difference in brightness and the distance between them. If the brightness of firefly i is sufficiently high and no other fireflies can attract it further, it may explore around the current solution. This approach is highly dependent on the algorithm parameters. If the parameters are not properly tuned, the firefly algorithm may converge to a suboptimal solution or converge too slowly [32]. To prevent this issue, the Quantum Firefly Algorithm utilizes wave function collapse to determine the new position.
The evolution of the quantum state is updated through the evolution of the wave function. The evolution mode of quantum firefly individuals is shown in Figure 4. When the wave function is acted upon by the following Hamiltonian system:
H ψ ( x ) = ( ħ 2 m 2 + V ( x ) ) ψ ( x )
The time evolution of the wave function is given by the following:
ψ ( x , t ) t = 1 i ħ H ψ ( x , t )
The equation is solved using the odeint function, and the general solution is expressed in the following form:
ψ ( x , t ) = ψ ( x , 0 ) e i E t / ħ
where ψ ( x , 0 ) represents the initial wave function, and E denotes the energy of the system.
The odeint function updates the wave function over a time step Δ t as follows:
ψ ( x , t + Δ t ) = ψ ( x , t ) + Δ t 1 i ħ H ψ ( x , t )
Position update via wave function collapse:
P ( x ) = ψ ( x , t ) ψ * ( x , t ) = | ψ ( x , t ) | 2 = | a x ( i ) | 2
x n e w P ( x )

3.3. Stochastic Perturbation Mechanism

A random perturbation step is incorporated to enhance the search diversity of the Quantum Firefly Algorithm. For the position vector X i of the i-th firefly, a random swap operation is performed with probability α :
P ( s w a p ) = α
where α [ 0 , 1 ] is the random perturbation coefficient, which controls whether a swap is executed. If a swap is performed, the following steps are continued; otherwise, the step is skipped.
Two distinct indices are randomly selected as follows:
j a , j b ~ U n i f o r m ( { 1 , 2 , , n } ) , j a j b
where j a and j b are two different indices randomly chosen from the dimensionality n of the position vector.
After selecting j a and j b , the elements at these two positions in X i are swapped, while all other elements remain unchanged, resulting in the following updated position vector X i n e w :
X i n e w [ j a ] = X i [ j b ]   X i n e w [ j b ] = X i [ j a ]   X i n e w [ k ] = X i [ k ] k j a , j b
Through the swap operation, a certain degree of randomness can be introduced, increasing the diversity of the exploration space and preventing the quantum fireflies from stagnating at local optima.

3.4. Multi-Objective Optimization Design

In response to the multi-objective characteristics of quantum circuit scheduling, three key metrics—circuit depth, parallelism, and quantum bit movement—are quantified as measurable objective functions. A dynamic weight adjustment mechanism is introduced to automatically calibrate the importance of each objective during the optimization process. In the early stages, emphasis is placed on optimizing circuit parallelism, with a focus on global search, while in the later stages, the weight of circuit depth is increased to concentrate on local optimization. This adaptive strategy effectively balances multiple optimization objectives and prevents convergence to local optima. Starting from the first layer, as many gates as possible that can be executed simultaneously are scheduled. After the direct routing of gates, gates that have not been directly routed, as well as SWAP gate movement operations, are performed within this layer. If there are still other gates requiring scheduling due to quantum bit conflicts that cannot be executed in the current layer, a new layer must be created. In the new layer, priority is given to gates that could not be executed previously, and the mapping of quantum bits is updated after SWAP operations are performed. This process is repeated until all gates have been scheduled. All layer operations are merged in reverse order, and each operation type is recorded, preserving the physical quantum bit positions corresponding to each operation.
Based on this layered mechanism, the fitness function for the Quantum Firefly Algorithm is designed as follows:
f = ω 1 1 d + 1 + ω 2 P N + ω 3 ( 1 m g )
where ω 1 , ω 2 , ω 3 are weight coefficients, d represents circuit depth, N denotes the total number of quantum bits, m is the number of movement operations, and g is the total number of quantum gates. P represents the average number of gates executed per cycle, that is, the average parallelism of the circuit.
P = i | C i | n
where | C i | indicates the number of quantum gates that can be executed in parallel in the i-th cycle, and n is the total number of cycles. The goal is to minimize circuit depth, maximize parallelism, and minimize the number of movement operations. By employing the Quantum Firefly Algorithm to identify the optimal scheduling method, the final optimal solution, which represents the best scheduling plan, is used to execute gate operations.
The pseudocode for the Quantum Firefly Algorithm is presented as follows (Algorithm 1):
Algorithm 1 Quantum Firefly Algorithm
Input: Objective function f(x), Number of fireflies N,
    Control parameters α, β0, γ, ℏ, MaxIter
Output: Global best solution
1: Initialize N fireflies:
  For i = 1 to N do
xi←Random_Position()
ψi←Initial_Wave_Function()
Ii← f(xi)
  End for
2: best ←Find_Best_Firefly()
3: while iter < MaxIter do
4:  for each firefly i do
5:   for each firefly j do
6:    if Ij > Ii then
7:     r ← |xi − xj|
8:     β ← β0 * exp(-γ * r2)
9:     V ←Construct_Potential(β, xi, xj)
10:    ψi←Solve_Schrodinger_Equation(V, ℏ)
11:    xi←Collapse_Wave_Function(ψi)
12:   end if
13:  end for
14:  Apply_Random_Walk(α)
15:  Ii← f(xi)
16:  Update_Best()
17: end for
18: iter←iter + 1
19: end while
20: return best
First, initialize N fireflies. Each firefly contains a random initial position x i , an initial quantum wave function ψ i , and a fitness value I i corresponding to the position x i . Find and record the optimal solution in the initial population (lines 1–2). In each iteration, compare each firefly i with all other fireflies j. If firefly j is brighter ( I j > I i ), then calculate the Euclidean distance r between the fireflies, calculate the attractiveness β , and construct the quantum potential energy field V . Solve the wave function ψ i by solving the Schrödinger equation and update the position x i through wave function collapse. When updating the position, perform a random perturbation with a probability of α , recalculate the fitness value, and update the global optimal solution (lines 3–19). Finally, obtain the best global optimal solution found (line 20).
The algorithm flowchart is shown as follows (Figure 5):
The pseudocode of the Quantum Firefly Algorithm for 2QAN quantum circuit scheduling optimization is shown (Algorithm 2). Create N firefly individuals, with each firefly Fi encompassing three attributes: positional attribute, wave function, and fitness function intensity. Initialize the fireflies, where position represents a randomly generated initial scheduling scheme, and the wave function is initialized to a uniform superposition state 1 / | G | , with G denoting the set of quantum gates requiring scheduling and ∣G∣ indicating the size of set G, i.e., the total number of quantum gates to be scheduled (lines 1–2). During each iteration, compare firefly Fi with all other fireflies Fj. If firefly Fi is brighter than firefly Fj, calculate the Euclidean distance r between the fireflies, compute the attraction coefficient β , construct the quantum potential field V, and solve the Schrödinger equation to update the wave function of Fi. The position of Fi is then updated through wave function collapse (lines 4–13). Randomly perturb the position of the firefly with probability α by randomly swapping the positions of gates to achieve perturbation, recalculate the fitness of the firefly, and update the best global solution (lines 14–20). Based on the optimal scheduling scheme identified, construct the final quantum circuit. The performance of the QFA is significantly influenced by its control parameters. The number of fireflies N, α, and γ are highly sensitive parameters, while ℏ, MaxIter, and β0 are moderately sensitive parameters. Among them, the speed of quantum evolution and the degree of wave function diffusion are affected by Planck’s constant ℏ, with an optimal value of approximately 1.0; the coverage of the search space and computational complexity are influenced by the number of fireflies N, and the recommended value range is set between 40 and 60; the convergence of the algorithm and the quality of the solution are affected by the maximum number of iterations MaxIter, with an optimal value between 100 and 150; the local search ability and algorithm stability are influenced by the random movement coefficient α, with a recommended value between 0.95 and 0.98; the global search ability and the interaction strength between individuals are affected by the maximum attractiveness β0, with an optimal value between 0.8 and 1.2; the search range and local search accuracy are influenced by the light absorption coefficient γ, with a recommended value between 0.8 and 1.2. Interactions exist among these parameters. For example, the algorithm’s performance is jointly affected by ℏ and N, and the global and local search capabilities are jointly balanced by α and γ. In practical applications, appropriate parameter values should be selected based on the problem scale, characteristics, and computational resource limitations.
Algorithm 2 Quantum Firefly Algorithm for 2QAN Scheduling
Input: G (gates), N (fireflies), M (max_iter), α, β0, γ, ℏ
Output: Optimized schedule S
1: // Initialize fireflies
  For i = 1 to N do
   f[i].p ← Rand_Sched(G) // position
   f[i].ψ ← 1/√|G|     // wave function
   f[i].I ← Fit(f[i].p)  // intensity
  End for
2: b ← Best(f)        // best firefly
3: while t < M do
4:  for i = 1 to N do
5:   for j = 1 to N do
6:    if f[j].I > f[i].I then
7:     r ← Dist(f[i], f[j])
8:     β ← β0*exp(−γr)
9:     V ← −β*f[j].I*exp(−γ|f[i].p − f[j].p|)
10:    f[i].ψ ← Schr(V, ℏ)  // solve Schrödinger
11:    f[i].p ← Update(f[i].ψ)
12:   end if
13:  end for
14:  if Rand(0,1) < α then
15:   Swap(f[i].p)       // random swap
16:  end if
17:  f[i].I ← Fit(f[i].p)
18:  if f[i].I > b.I then
19:   b ← f[i]
20:  end if
21: end for
22: t ← t + 1
23: end while
24: return Build(b.p)

4. Experimental Analysis

4.1. Experimental Evaluation Indicators

This paper uses the following metrics to evaluate the performance of different compilers: the total number of inserted SWAP gates and the total number of two-qubit gates executed on the hardware. Fewer gates indicate better performance. These tests can effectively measure the efficiency of algorithms when dealing with complex quantum circuits. The benchmark tests are selected from IBM’s Qiskit quantum programs and are decomposed and optimized using the Qiskit compiler for the CX/CNOT gate set. The benchmark testing method mainly focuses on the QAOA model. The evaluation scope covers the number of qubits from 4 to 22. The mapping process for each number of qubits is run five times, and the best results are selected for analysis.
The Quantum Firefly Algorithm is implemented in Python 3.9, and the laptop that executes all compilations is equipped with an Intel Core i7 processor (5.0 GHz and 16 GB RAM).

4.2. Experimental Result Analysis

Figure 6 and Table 1, Table 2, Table 3 and Table 4 are presented to show the comparison of compilation overheads after the QFA has been applied to 2QAN optimization with t|ket〉, Qiskit, HQAA, LCRA, LTSA, and the combined strategy of LCRA and LTSA. The “FullPass” t|ket〉 compiler (version 0.11.0) and the Qiskit compiler (version 0.26.2, with an optimization level of 3) are used in this paper to evaluate the compilation results on a quantum computer. The two compilers mentioned above are restricted to the CNOT or CZ gate set.
According to the comparison results presented in Figure 6, it can be observed that as the number of qubits increases, the effect of the optimization algorithm becomes increasingly evident.
In the t|ket〉 compiler, the quantum circuit optimization effect is significantly improved by the QFA through a mechanism that combines quantum wave function evolution and classical search. Since quantum wave functions can explore multiple possible states simultaneously and determine the optimal position through wave function collapse, the number of SWAP gates is reduced by approximately 42%, and the number of CNOT gates is reduced by about 15.6%, compared to the traditional t|ket〉.
Compared to 2QAN, quantum probability amplitudes are introduced by the QFA to guide the search direction, resulting in a reduction in SWAP gates by an average of approximately 6.7% and CNOT gates by about 10%. In large-scale circuits with 18–22 qubits, the global search capability of the quantum wave function becomes increasingly advantageous as the problem scale grows. As shown in Table 5, the waiting time of operation gates is reduced by the QFA, operational efficiency is improved, and algorithm performance is enhanced.
As shown in Table 1, Table 2, Table 3 and Table 4, the evolution characteristics of wave functions are utilized by the QFA to avoid local optima, leading to a reduction of approximately 11.2% in the number of SWAP gates and approximately 11.8% in CNOT gates when compared to HQAA. As the number of qubits increases, the superposition of quantum states provides a larger search space for the algorithm, enhancing the global search capability and improving the optimization effect.
Based on the data in Table 1, Table 2, Table 3 and Table 4, it can be concluded that the QFA outperforms the combined strategy of LCRA and LTSA by reducing the number of SWAP gates by approximately 3% in optimization. This improvement is due to the fact that these algorithms all employ relatively mature local search strategies. In terms of CNOT gate optimization, since these algorithms are all based on similar gate decomposition principles and have achieved optimization effects close to the theoretical lower bound, the gap between the algorithms is not significant, with the error falling within an acceptable range of ±2%.
The optimization performance of each algorithm shows little difference when the number of qubits is between 4 and 12. However, the QFA begins to demonstrate its advantages when the number of qubits reaches 14 to 18, and it performs optimally when there are 20 to 22 qubits. The QFA is better at processing large-scale circuits, excelling in the optimization of SWAP and CNOT gates, with smaller performance fluctuations and stronger stability. Additionally, the parallelism of quantum circuits is enhanced by the QFA. Compared to traditional algorithms, approximately 42% of SWAP gates are reduced, and when compared to other modern algorithms, a 5–10% reduction in SWAP gates is achieved. The reduction in SWAP gates allows more qubits to be executed in parallel, thereby reducing the circuit’s execution time and improving execution efficiency. Redundant operations are minimized by the QFA, significantly reducing unnecessary SWAP operations, optimizing data movement between qubits, and reducing the overhead of intermediate-state conversion. Moreover, the number of CNOT gates is also significantly reduced, indicating that the combination of quantum gates is optimized, redundant quantum gate operations are minimized, and the execution efficiency of quantum circuits is improved. The decrease in both SWAP and CNOT gates enables more efficient use of qubits, improving the utilization of quantum resources. The reduction in the number of gates effectively lowers the power consumption of the circuit and enhances its reliability.

5. Conclusions

This paper presents the Quantum Firefly Algorithm, which is designed to address the optimization problem of quantum circuit scheduling. Building upon the traditional firefly algorithm, quantum information is incorporated to enhance the algorithm’s optimization performance. When compared with traditional compilers, significant reductions in compilation overhead on IBM quantum computers are achieved by this algorithm. Additionally, the Quantum Firefly Algorithm demonstrates remarkable performance when compared with other modern algorithmic strategies. It not only offers excellent optimization results but also improves the stability of these results. An innovative and effective solution to the scheduling problem in quantum circuits is provided by the Quantum Firefly Algorithm.
Looking ahead, the integration of other quantum-inspired algorithms or the exploration of novel quantum–classical hybrid optimization algorithms is considered essential for the development of quantum computing. This is because distinct algorithms are recognized to possess unique advantages and optimization capabilities, which can complement one another. By combining these algorithms, their respective strengths can be leveraged to achieve superior overall performance. The quantum–classical hybrid approach is expected to effectively address the limitations of pure quantum or classical algorithms, providing more robust solutions for complex optimization problems. Through the combination of different algorithmic methods, computational complexity can potentially be reduced, and the efficiency of quantum circuit scheduling can be enhanced. Consequently, the application of these hybrid algorithms to quantum computing is anticipated to significantly improve both the performance and reliability of quantum computing systems, making them more suitable for practical applications.

Author Contributions

Conceptualization, Z.D.; software, J.W.; writing—original draft, J.W.; writing—review & editing, H.L. All authors have read and agreed to the published version of the manuscript.

Funding

This work was funded by the Natural Science Foundation in Heilongjiang Province of China, under Grant LH2024F042; the University Nursing Program for Young Scholars with Creative Talents in Heilongjiang Province, under Grant UNPYSCT-2020212; and the Science Foundation of Harbin Commerce University, under Grant 2023-KYYWF-0983.

Data Availability Statement

Data are contained within the article.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Preskill, J. Quantum Computing in the NISQ Era and Beyond. Quantum 2018, 2, 79. [Google Scholar] [CrossRef]
  2. Itoko, T.; Imamichi, T. Scheduling of Operations in Quantum Compiler. In Proceedings of the 2020 IEEE International Conference on Quantum Computing and Engineering (QCE), Denver, CO, USA, 12–16 October 2020; IEEE: Piscataway, NJ, USA, 2020; pp. 337–344. [Google Scholar]
  3. Alam, M.; Ash-Saki, A.; Ghosh, S. Circuit Compilation Methodologies for Quantum Approximate Optimization Algorithm. In Proceedings of the 2020 53rd Annual IEEE/ACM International Symposium on Microarchitecture (MICRO), Athens, Greece, 17–21 October 2020; IEEE: Piscataway, NJ, USA, 2020; pp. 215–228. [Google Scholar]
  4. Metodi, T.S.; Thaker, D.D.; Cross, A.W.; Chong, F.T.; Chuang, I.L. Scheduling Physical Operations in a Quantum Information Processor. In Proceedings of the Defense and Security Symposium, Orlando, FL, USA, 17–21 April 2006; Donkor, E.J., Pirich, A.R., Brandt, H.E., Eds.; SPIE: Bellingham, WA, USA, 2006; p. 62440T. [Google Scholar]
  5. Shi, Y.; Leung, N.; Gokhale, P.; Rossi, Z.; Schuster, D.I.; Hoffmann, H.; Chong, F.T. Optimized Compilation of Aggregated Instructions for Realistic Quantum Computers. In Proceedings of the Twenty-Fourth International Conference on Architectural Support for Programming Languages and Operating Systems, Providence, RI, USA, 4 April 2019; ACM: New York, NY, USA, 2019; pp. 1031–1044. [Google Scholar]
  6. Johnson, M.W.; Amin, M.H.S.; Gildert, S.; Lanting, T.; Hamze, F.; Dickson, N.; Harris, R.; Berkley, A.J.; Johansson, J.; Bunyk, P.; et al. Quantum Annealing with Manufactured Spins. Nature 2011, 473, 194–198. [Google Scholar] [CrossRef] [PubMed]
  7. Devitt, S.J. Performing Quantum Computing Experiments in the Cloud. Phys. Rev. A 2016, 94, 032329. [Google Scholar] [CrossRef]
  8. Barends, R.; Shabani, A.; Lamata, L.; Kelly, J.; Mezzacapo, A.; Heras, U.L.; Babbush, R.; Fowler, A.G.; Campbell, B.; Chen, Y.; et al. Digitized Adiabatic Quantum Computing with a Superconducting Circuit. Nature 2016, 534, 222–226. [Google Scholar] [CrossRef] [PubMed]
  9. Versluis, R.; Poletto, S.; Khammassi, N.; Tarasinski, B.; Haider, N.; Michalak, D.J.; Bruno, A.; Bertels, K.; DiCarlo, L. Scalable Quantum Circuit and Control for a Superconducting Surface Code. Phys. Rev. Appl. 2017, 8, 034021. [Google Scholar] [CrossRef]
  10. Sete, E.A.; Zeng, W.J.; Rigetti, C.T. A Functional Architecture for Scalable Quantum Computing. In Proceedings of the 2016 IEEE International Conference on Rebooting Computing (ICRC), San Diego, CA, USA, 17–19 October 2016; IEEE: Piscataway, NJ, USA, 2016; pp. 1–6. [Google Scholar]
  11. Guerreschi, G.G.; Park, J. Two-Step Approach to Scheduling Quantum Circuits. arXiv 2017, arXiv:1708.00023. [Google Scholar] [CrossRef]
  12. Lao, L.; Van Someren, H.; Ashraf, I.; Almudever, C.G. Timing and Resource-Aware Mapping of Quantum Circuits to Superconducting Processors. IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst. 2022, 41, 359–371. [Google Scholar] [CrossRef]
  13. Alam, M.; Saki, A.A.-; Ghosh, S. An Efficient Circuit Compilation Flow for Quantum Approximate Optimization Algorithm. In Proceedings of the 2020 57th ACM/IEEE Design Automation Conference (DAC), San Francisco, CA, USA, 20–24 July 2020; IEEE: Piscataway, NJ, USA, 2020; pp. 1–6. [Google Scholar]
  14. Liu, L.; Dou, X. QuCloud+: A Holistic Qubit Mapping Scheme for Single/Multi-Programming on 2D/3D NISQ Quantum Computers. ACM Trans. Archit. Code Optim. 2024, 21, 9. [Google Scholar] [CrossRef]
  15. Silva, A.; Zhang, X.; Webb, Z.; Kramer, M.; Yang, C.W.; Liu, X.; Lemieux, J.; Chen, K.-W.; Scherer, A.; Ronagh, P. Multi-Qubit Lattice Surgery Scheduling. In Proceedings of the Conference on the Theory of Quantum Computation, Communication and Cryptography (TQC), Okinawa, Japan, 9–13 September 2024; Volume 310, pp. 1–22. [Google Scholar] [CrossRef]
  16. Tang, W.; Tomesh, T.; Suchara, M.; Larson, J.; Martonosi, M. CutQC: Using Small Quantum Computers for Large Quantum Circuit Evaluations. In Proceedings of the 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Virtual, 19–23 April 2021; ACM: New York, NY, USA, 2021; pp. 473–486. [Google Scholar]
  17. Peng, T.; Harrow, A.W.; Ozols, M.; Wu, X. Simulating Large Quantum Circuits on a Small Quantum Computer. Phys. Rev. Lett. 2020, 125, 150504. [Google Scholar] [CrossRef] [PubMed]
  18. Nash, B.; Gheorghiu, V.; Mosca, M. Quantum Circuit Optimizations for NISQ Architectures. Quantum Sci. Technol. 2020, 5, 025010. [Google Scholar] [CrossRef]
  19. Chen, Z.-Y.; Zhou, Q.; Xue, C.; Yang, X.; Guo, G.-C.; Guo, G.-P. 64-Qubit Quantum Circuit Simulation. Sci. Bull. 2018, 63, 964–971. [Google Scholar] [CrossRef] [PubMed]
  20. Suzuki, Y.; Kawase, Y.; Masumura, Y.; Hiraga, Y.; Nakadai, M.; Chen, J.; Nakanishi, K.M.; Mitarai, K.; Imai, R.; Tamiya, S.; et al. Qulacs: A Fast and Versatile Quantum Circuit Simulator for Research Purpose. Quantum 2021, 5, 559. [Google Scholar] [CrossRef]
  21. Sim, S.; Johnson, P.D.; Aspuru-Guzik, A. Expressibility and Entangling Capability of Parameterized Quantum Circuits for Hybrid Quantum-Classical Algorithms. Adv. Quantum Technol. 2019, 2, 1900070. [Google Scholar] [CrossRef]
  22. Wille, R.; Burgholzer, L. MQT QMAP: Efficient Quantum Circuit Mapping. In Proceedings of the 2023 International Symposium on Physical Design, Virtual, 26–29 March 2023; ACM: New York, NY, USA, 2023; pp. 198–204. [Google Scholar]
  23. Cuomo, D.; Caleffi, M.; Krsulich, K.; Tramonto, F.; Agliardi, G.; Prati, E.; Cacciapuoti, A.S. Optimized Compiler for Distributed Quantum Computing. ACM Trans. Quantum Comput. 2023, 4, 15. [Google Scholar] [CrossRef]
  24. Liu, J.; Bello, L.; Zhou, H. Relaxed Peephole Optimization: A Novel Compiler Optimization for Quantum Circuits. In Proceedings of the 2021 IEEE/ACM International Symposium on Code Generation and Optimization (CGO), Seoul, Republic of Korea, 27 February–3 March 2021; IEEE: Piscataway, NJ, USA, 2021; pp. 301–314. [Google Scholar]
  25. Quetschlich, N.; Burgholzer, L.; Wille, R. Compiler Optimization for Quantum Computing Using Reinforcement Learning. In Proceedings of the 2023 60th ACM/IEEE Design Automation Conference (DAC), San Francisco, CA, USA, 9–13 July 2023; IEEE: Piscataway, NJ, USA, 2023; pp. 1–6. [Google Scholar]
  26. Chand, S.; Singh, H.K.; Ray, T.; Ryan, M. Rollout Based Heuristics for the Quantum Circuit Compilation Problem. In Proceedings of the 2019 IEEE Congress on Evolutionary Computation (CEC), Wellington, New Zealand, 10–13 June 2019; IEEE: Piscataway, NJ, USA, 2019; pp. 974–981. [Google Scholar]
  27. Seitz, P.; Geiger, M.; Ufrecht, C.; Plinge, A.; Mutschler, C.; Scherer, D.D.; Mendl, C.B. SCIM MILQ: An HPC Quantum Scheduler. In Proceedings of the 2024 IEEE International Conference on Quantum Computing and Engineering (QCE), Montreal, QC, Canada, 15–20 September 2024; IEEE: Piscataway, NJ, USA, 2024; pp. 292–298. [Google Scholar]
  28. Pan, D.; Long, G.-L.; Yin, L.; Sheng, Y.-B.; Ruan, D.; Ng, S.X.; Lu, J.; Hanzo, L. The Evolution of Quantum Secure Direct Communication: On the Road to the Qinternet. IEEE Commun. Surv. Tutor. 2024, 26, 1898–1949. [Google Scholar] [CrossRef]
  29. Tukel, Y.; Bozbey, A.; Tunc, C.A. Optimization of Single Flux Quantum Circuit Based Comparators Using PSO. J. Supercond. Nov. Magn. 2013, 26, 1837–1841. [Google Scholar] [CrossRef]
  30. Baioletti, M.; Rasconi, R.; Oddi, A. A Novel Ant Colony Optimization Strategy for the Quantum Circuit Compilation Problem. In Evolutionary Computation in Combinatorial Optimization; Lecture Notes in Computer Science; Zarges, C., Verel, S., Eds.; Springer International Publishing: Cham, Switzerland, 2021; Volume 12692, pp. 1–16. ISBN 978-3-030-72903-5. [Google Scholar]
  31. Lao, L.; Browne, D.E. 2QAN: A Quantum Compiler for 2-Local Qubit Hamiltonian Simulation Algorithms. In Proceedings of the 49th Annual International Symposium on Computer Architecture, New York, NY, USA, 18–22 June 2022. [Google Scholar]
  32. Johari, N.F.; Zain, A.M.; Noorfa, M.H.; Udin, A. Firefly Algorithm for Optimization Problem. Appl. Mech. Mater. 2013, 421, 512–517. [Google Scholar] [CrossRef]
Figure 1. Quantum circuit structure.
Figure 1. Quantum circuit structure.
Electronics 14 02123 g001
Figure 2. SWAP gate decomposition. The red gate operation indicates the SWAP gate for swapping operations. and represent the CNOT gate.
Figure 2. SWAP gate decomposition. The red gate operation indicates the SWAP gate for swapping operations. and represent the CNOT gate.
Electronics 14 02123 g002
Figure 3. Comparison before and after quantum circuit scheduling optimization. The red gate operation indicates the SWAP gate for swapping operations. and represent the CNOT gate. The blue dashed line represents the division of quantum circuit layers.
Figure 3. Comparison before and after quantum circuit scheduling optimization. The red gate operation indicates the SWAP gate for swapping operations. and represent the CNOT gate. The blue dashed line represents the division of quantum circuit layers.
Electronics 14 02123 g003
Figure 4. The evolutionary mode of quantum firefly individuals.
Figure 4. The evolutionary mode of quantum firefly individuals.
Electronics 14 02123 g004
Figure 5. Flowchart of the Quantum Firefly Algorithm.
Figure 5. Flowchart of the Quantum Firefly Algorithm.
Electronics 14 02123 g005
Figure 6. Comparison of the QFA optimization results. (a) Comparison of CNOT compilation costs on Qiskit; (b) comparison of CNOT compilation costs on t|ket〉; (c) comparison of SWAP compilation costs on Qiskit; (d) comparison of SWAP compilation costs on t|ket〉.
Figure 6. Comparison of the QFA optimization results. (a) Comparison of CNOT compilation costs on Qiskit; (b) comparison of CNOT compilation costs on t|ket〉; (c) comparison of SWAP compilation costs on Qiskit; (d) comparison of SWAP compilation costs on t|ket〉.
Electronics 14 02123 g006
Table 1. Comparison of CNOT compilation costs between the QFA and other algorithms on t|ket>.
Table 1. Comparison of CNOT compilation costs between the QFA and other algorithms on t|ket>.
Qubitst|ket>HQAALCRALTSACombinationQFA
221029381828080
20828372727272
18757166656663
16646754565454
14575347464546
12454540404040
10424037353738
8302626262626
6242020202020
4151313131313
Table 2. Comparison of CNOT compilation costs between the QFA and other algorithms on Qiskit.
Table 2. Comparison of CNOT compilation costs between the QFA and other algorithms on Qiskit.
QubitsQiskitHQAALCRALTSACombinationQFA
2210510980818183
20848375737172
18787368676863
16696156565554
14575748485046
12484740404040
10434038413838
8302826262626
6242020202020
4151313131313
Table 3. Comparison of SWAP compilation costs between the QFA and other algorithms on t|ket>.
Table 3. Comparison of SWAP compilation costs between the QFA and other algorithms on t|ket>.
Qubitst|ket>HQAALCRALTSACombinationQFA
22654037373837
20583632323532
18463029292928
16402824252424
14432422212321
12352018181818
10241717151717
8181212121212
61199999
4866666
Table 4. Comparison of SWAP compilation costs between the QFA and other algorithms on Qiskit.
Table 4. Comparison of SWAP compilation costs between the QFA and other algorithms on Qiskit.
QubitsQiskitHQAALCRALTSACombinationQFA
221234935364137
20934133333232
18753230303028
16552825262424
14682522222221
12422218181818
10281717171717
8181212121212
61099999
4866666
Table 5. Comparison of running time.
Table 5. Comparison of running time.
QubitsComplierRunning Time (t/s)
QFA2QAN
22t|ket>11.45612.304
Qiskit0.1030.134
18t|ket>5.5555.282
Qiskit0.0750.098
6t|ket>0.1400.154
Qiskit0.0310.061
4t|ket>0.0520.052
Qiskit0.0450.068
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Du, Z.; Wang, J.; Li, H. Quantum Firefly Algorithm: A Novel Approach for Quantum Circuit Scheduling Optimization. Electronics 2025, 14, 2123. https://doi.org/10.3390/electronics14112123

AMA Style

Du Z, Wang J, Li H. Quantum Firefly Algorithm: A Novel Approach for Quantum Circuit Scheduling Optimization. Electronics. 2025; 14(11):2123. https://doi.org/10.3390/electronics14112123

Chicago/Turabian Style

Du, Zuoqiang, Jiepeng Wang, and Hui Li. 2025. "Quantum Firefly Algorithm: A Novel Approach for Quantum Circuit Scheduling Optimization" Electronics 14, no. 11: 2123. https://doi.org/10.3390/electronics14112123

APA Style

Du, Z., Wang, J., & Li, H. (2025). Quantum Firefly Algorithm: A Novel Approach for Quantum Circuit Scheduling Optimization. Electronics, 14(11), 2123. https://doi.org/10.3390/electronics14112123

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop