2025 Volume 34 Issue 5
Article Contents

Zilu Chen, Zhijin Guan, Shuxian Zhao, Xueyun Cheng. Distributed quantum circuit partitioning and optimization based on combined spectral clustering and search tree strategies[J]. Chinese Physics B, 2025, 34(5): 050305. doi: 10.1088/1674-1056/adbada
Citation: Zilu Chen, Zhijin Guan, Shuxian Zhao, Xueyun Cheng. Distributed quantum circuit partitioning and optimization based on combined spectral clustering and search tree strategies[J]. Chinese Physics B, 2025, 34(5): 050305. doi: 10.1088/1674-1056/adbada

Distributed quantum circuit partitioning and optimization based on combined spectral clustering and search tree strategies

  • Received Date: 24/12/2024
    Accepted Date: 24/02/2025
    Available Online: 01/04/2025
通讯作者: 陈斌, bchen63@163.com
  • 1. 

    沈阳化工大学材料科学与工程学院 沈阳 110142

  1. 本站搜索
  2. 百度学术搜索
  3. 万方数据库搜索
  4. CNKI搜索

Figures(10)  /  Tables(7)

Article Metrics

Article views(964) PDF downloads(2) Cited by(0)

Access History

Distributed quantum circuit partitioning and optimization based on combined spectral clustering and search tree strategies

Abstract: In the current noisy intermediate-scale quantum (NISQ) era, a single quantum processing unit (QPU) is insufficient to implement large-scale quantum algorithms; this has driven extensive research into distributed quantum computing (DQC). DQC involves the cooperative operation of multiple QPUs but is concurrently challenged by excessive communication complexity. To address this issue, this paper proposes a quantum circuit partitioning method based on spectral clustering. The approach transforms quantum circuits into weighted graphs and, through computation of the Laplacian matrix and clustering techniques, identifies candidate partition schemes that minimize the total weight of the cut. Additionally, a global gate search tree strategy is introduced to meticulously explore opportunities for merged transfer of global gates, thereby minimizing the transmission cost of distributed quantum circuits and selecting the optimal partition scheme from the candidates. Finally, the proposed method is evaluated through various comparative experiments. The experimental results demonstrate that spectral clustering-based partitioning exhibits robust stability and efficiency in runtime in quantum circuits of different scales. In experiments involving the quantum Fourier transform algorithm and Revlib quantum circuits, the transmission cost achieved by the global gate search tree strategy is significantly optimized.

1.   Introduction
  • Quantum computing represents a revolution in the field of computational science, leveraging the superposition and entanglement properties of qubits to demonstrate tremendous potential in solving complex problems that are challenging for classical computing.[1,2] Although current quantum computers are making continuous progress in the number and performance of qubits, single devices remain limited in scale and performance due to experimental and engineering constraints,[3,4] making it difficult to meet the demands of large-scale quantum algorithms. To overcome these limitations, distributed quantum computing has been proposed as a viable solution.[5] Distributed quantum computing achieves the collaborative completion of large-scale quantum computational tasks by assigning quantum tasks to multiple quantum processing units (QPUs).[6] Establishing classical or quantum channels between multiple QPUs can optimize the interactions and control of qubits. This enables efficient quantum information transmission and entanglement management in a distributed environment, enhancing system stability and reliability. The distributed quantum computing model provides a key pathway to surpass the qubit number limitations, promoting the broader development of quantum computing in practical applications.[7–9]

    Distributed quantum computing (DQC) holds significant potential for enhancing the scale and performance of quantum computations, but it faces a major challenge in the form of high communication costs.[10] Since distributed quantum computing requires the transmission of qubits and global gate operations between multiple QPUs, it necessitates the establishment and maintenance of entangled states to ensure accurate quantum information transfer. However, these operations are often accompanied by substantial generation delays and the risk of coherence loss,[11] significantly increasing the system’s communication cost. Therefore, reducing communication cost in DQC has become a crucial research direction.

    Numerous studies have proposed various DQC partitioning methods to reduce the frequency of quantum communication and enhance computational efficiency. Reference [12] proposed the two-step DQC algorithm, which solves the balanced k-min-cut problem on an edge-weighted graph and then calculates communication cost using an approximation algorithm. Building upon Ref. [12], Ref. [13] further considered the allocation of quantum circuits on quantum networks of heterogeneous quantum computers, using a tabu search algorithm to find the allocation of qubits. Reference [14] converted quantum circuits into bipartite graph models and then used dynamic programming methods to partition the models into smaller-capacity quantum circuits. The automatic window partitioning method introduced in Ref. [15] utilized temporal information, adjusting partitioning based on changes in qubit connection patterns during circuit execution. Reference [16] introduced a genetic algorithm-based circuit partitioning method aimed at minimizing the communication cost between two partitions in distributed quantum circuit design. Reference [17] proposed a connection matrix model for quantum circuits and used NSGA-III to divide the quantum circuit into two balanced parts with an equal number of qubits and the fewest global gates. In Ref. [18], quantum circuits were reordered based on qubit positions and combined genetic algorithms with an improved tabu search algorithm to partition the quantum circuit graph model. Reference [19] employed an integer linear programming model to distribute a single quantum system into K balanced partitions. Reference [20] proposed an automated design framework called AutoArch for quantum chip networks (QCNs). Its aim is to reduce the number of remote Einstein–Podolsky–Rosen (EPR) pairs and additional local SWAP gates required during the execution of quantum algorithms. Furthermore, in Ref. [21], the focus was on how to effectively assign logical qubits to different QPUs in compiler design, utilizing a multi-level hybrid simulated annealing algorithm for qubit allocation. However, existing studies still have some limitations, such as unbalanced qubit distributions after partitioning or they rely solely on minimum cut results in graph partitioning, making it difficult to obtain more optimal distributed quantum circuit partitioning schemes.

    This paper employs direct quantum state transmission as the transmission technique within distributed quantum circuits. The number of state transmissions is used as the transmission cost and serves as the optimization objective. The primary contributions of this work are as follows.

    (i) The problem of partitioning distributed quantum circuits is transformed into a minimum cut problem on a graph. A quantum circuit partitioning method based on spectral clustering is proposed, which selects several partition schemes with different total cut edge weights.

    (ii) An analysis of the obstacles encountered during the search for merged transmissions is conducted. Based on this analysis, a global gate search tree strategy is introduced to identify the optimal partition scheme.

    (iii) Various partitioning methods are simulated and compared in terms of runtime under different partitioning scenarios. Through experimental numerical simulations, the transmission cost of distributed quantum circuits is evaluated, and the impact of different partition cut edge weights on transmission cost is investigated. Comparative experimental results validate the effectiveness of the proposed method.

    The remaining sections of this paper are organized as follows. Section 2 introduces the basic concepts; Section 3 proposes quantum circuit partitioning based on spectral clustering methods; Section 4 presents the global gate search tree merged transmission optimization strategy; Section 5 verifies the effectiveness of the proposed method through experiments; Section 6 concludes the paper.

2.   Background
  • This section briefly introduces distributed quantum circuits and quantum state transmission.

  • Distributed quantum circuits are composed of multiple sub-circuits with limited capacities, which collaborate to achieve the overall functionality of large-scale quantum circuits. Each sub-circuit can be regarded as an independent partition within the distributed quantum circuit, and each partition is mapped to a QPU. However, this allocation method may result in the execution of two-qubit gate operations where the two qubits are distributed across different QPUs. In such cases, these two-qubit gates are referred to as global gates; otherwise, they are considered as local gates.

    In distributed quantum circuits, local gates and single-qubit gates can be executed directly within their respective partitions. However, for global gate operations, the quantum states of the involved qubits must be moved to the same QPU to ensure that both quantum states can be operated on within the same QPU. To adhere to the no-cloning theorem[22] and ensure the integrity of quantum information, when a quantum state is transferred from the original QPU to the target QPU it must be returned to the original QPU after the operation to avoid interfering with subsequent operations in the original QPU and to maintain the consistency of the quantum state.

    In the example of a distributed quantum circuit illustrated in Fig. 1, a six-qubit quantum circuit is divided into two partitions, P1 and P2. The target and control qubits of gates G1 and G2 are within the same partition, so G1 and G2 are local gates. The H gate is located in P2 and can be executed within its respective partition alongside G1 and G2. Gates G3 and G4 have their target and control qubits in P1 and P2, respectively, classifying them as global gates. Therefore, the quantum states of the qubits involved in G3 and G4 need to be transferred to the same partition for execution. Additionally, since both global gates G3 and G4 act on q2 and the other qubits are all within P2, the merged transfer model[23] can be utilized to reconstruct them into local gates through a single transmission and execute them accordingly.

  • Global gate transmission operations require quantum communication to transfer the relevant qubit information to a single QPU for computation. Unlike classical distributed computing systems, quantum information cannot be easily shared between QPUs due to the constraints of the no-cloning theorem. This means that the transfer of quantum information must ensure that no irrecoverable errors are introduced. To overcome this challenge, various methods have been proposed to effectively transfer qubits between network nodes, including techniques such as quantum teleportation,[24] cat-state entanglement[25] and direct transmission.[26]

    Quantum teleportation is a method of transferring qubit states through quantum entanglement rather than physical transfer. This process requires the pre-sharing of an EPR pair between two QPUs. By distributing the EPR pair and combining classical communication with local gate operations, the state of a qubit can be transferred between different QPUs. This process not only transfers the state of the qubit but also consumes and destroys the original EPR pair.

    Cat-state entanglement operations (such as cat-entanglers and cat-disentanglers) transfer qubit states by creating ‘linked copies’ of qubits. Similar to quantum teleportation, cat-state entanglement operations also require the pre-sharing of an EPR pair, allowing the state of a qubit to be shared in a read-only manner across multiple QPUs.

    Direct transfer involves connecting QPUs through devices such as superconducting coaxial lines, optical fibers and microwave resonators, establishing quantum channels between qubits separated by certain distances to facilitate interaction and transfer of quantum states. However, quantum communication technologies face numerous challenges, such as qubit stability, transmission loss and environmental noise. These limitations mean that excessive quantum communication during the execution of distributed quantum circuits can have a negative impact on the overall performance of the system. Therefore, reducing the number of quantum communications is an effective means of enhancing performance metrics such as system latency and fidelity in the design of distributed quantum circuits.

3.   Circuit partitioning based on spectral clustering methods
  • To reduce the transmission cost of distributed quantum circuits, researchers have been dedicated to developing quantum circuit partitioning methods. The core issue lies in efficiently dividing qubits into multiple partitions while minimizing the number of quantum gates that span across partitions, namely global gates. The number of global gates has a direct impact on the complexity and computational overhead of distributed quantum computing. Therefore, this section focuses on the quantum circuit partitioning problem and employs spectral clustering methods to partition quantum circuits, aiming to achieve more optimal quantum circuit partitioning schemes.

  • Quantum circuit partitioning is the initial step in distributed quantum computing, and different partitioning methods often result in varying numbers of global gates. An excessive number of global gates can lead to frequent quantum state transmission between different quantum processing nodes, increasing the complexity and computational overhead of distributed quantum circuits. This manifests specifically as increased communication latency and a higher probability of data transmission errors. Partitioning a quantum circuit involves dividing the entire circuit into multiple sub-circuits, which is essentially a combinatorial problem in classical combinatorics, specifically the problem of how to partition a set into multiple subsets.

    Theorem 1 Let n denote the number of logical qubits in the quantum circuit and k represent the number of partitions. If the number of qubits in each pair of partitions is either equal or differs by one, then the total number of possible partitioning schemes W (n, k) is given by

    where m=⌊nk⌋ represents the base number of qubits per group and r = (n mod k) denotes the number of partitions that contain m + 1 qubits.

    Proof Consider the case of partitioning n qubits into k partitions, where the number of qubits in each partition is approximately equal. To simplify the problem, assume that the number of qubits in each partition is either m or m+1, where m=⌊nk⌋ represents the base number of qubits per partition.

    To calculate the total number of such partitioning schemes, two parts must be considered: first, select r partitions from n qubits, each containing m + 1 qubits; second, distribute the remaining n − r(m + 1) qubits into k – r partitions, each containing m qubits.

    Since partitions are interchangeable, meaning the order of partitions does not affect the partitioning result, the total number of partitioning schemes must also be divided by r! × (k – r)! to eliminate duplicate counts. Specifically, r! is used to eliminate the repetition in the order of partitions assigned to m + 1 qubits, and (k – r)! is used to eliminate the repetition in the order of partitions assigned to m qubits.

    If r = 0, meaning n is divisible by k, then all partitions have the same number of qubits, and W(n,k)=n!(m!)k.

    If r > 0, meaning n is not divisible by k, then r partitions contain m + 1 qubits and the remaining k – r partitions contain m qubits. In this case, multiplying by 1r!×(k−r)! is necessary to adjust for the order of the groups.

    As demonstrated by Eq. (1), when the number of logical qubits n in the quantum circuit increases and there exists a remainder r (i.e., n is not divisible by k), the number of ways to partition the sub-circuits becomes more complex. This complexity and diversity also reflect that, in practical distributed quantum circuit design, different partitioning methods lead to significantly different computational performance and resource utilization. Through the combinatorial mathematical analysis of the quantum circuit partitioning problem, it can be observed that as the number of qubits and the number of partitions increase, the search space grows rapidly, making the partitioning process exceptionally complex. This necessitates the consideration of more factors when seeking the optimal solution, thereby further enhancing the efficiency of distributed quantum computing.

    After a quantum circuit has been partitioned into multiple segments, the transmission cost between different partitions impacts computational efficiency. During the execution of global gates, because their qubits are allocated to different partitions, additional quantum state transmission is often required to complete the computation. These transmission operations not only increase the complexity of distributed quantum computing but may also lead to the accumulation of computational errors and delays. Therefore, devising a rational circuit partitioning strategy to reduce the number of global gates and the frequency of quantum state transmission becomes crucial for improving the performance of distributed quantum computing.

    The six-qubit quantum circuit shown in Fig. 2, which includes eight two-qubit gates, is partitioned into two sections as illustrated in Fig. 3. In Fig. 3(a), q3, q5 and q2 of the original circuit are grouped and assigned to partition P1, while q1, q4 and q0 are grouped and assigned to partition P2. After partitioning, there are three global gates: G2, G3 and G5. Due to the absence of merged transfer conditions, this configuration requires six quantum state transmission operations to complete the execution of the global gates and to return the quantum states. In Fig. 3(b), q1, q5 and q2 of the original circuit are assigned to partition P1, and q3, q4 and q0 are assigned to partition P2. After this partitioning, there are still three global gates: G1, G3 and G4. However, this grouping allows the global gates G1 and G3 to both act on q5, satisfying the conditions for merged transfer. Consequently, only two transmission operations are needed to complete the transfer and execution of gates G1 and G3, resulting in a total of four quantum state transmission operations.

    Although reducing the number of global gates is an important objective in quantum circuit partitioning, it does not necessarily mean that fewer global gates will always lead to a reduced transmission cost. In practice, the transmission cost depends not only on the number of global gates but also on the qubits involved in these global gates and their distribution. Through clever partitioning strategies, it is possible to reduce the transmission cost by utilizing a merged transfer model, even if this results in a greater number of global gates.

    Figure 4 shows two different partitioning methods for the same circuit. In Fig. 4(a), the partitioning approach results in two global gates, G0 and G3, which do not satisfy the conditions for merged transfer, requiring a total of four transmission operations. In Fig. 4(b), three global gates, G1, G2 and G3, are generated. However, since all three gates act on q0, a merged transfer model can be utilized, requiring only two transmission operations.

    In summary, different quantum circuit partitioning strategies have a significant impact on the number of global gates and the transmission cost. Simply reducing the number of global gates is not sufficient to optimize the transmission cost. To further enhance the efficiency of distributed quantum computing, it is necessary to explore more intelligent and efficient partitioning methods.

  • To effectively reduce the number of transmissions in distributed quantum computing it is often necessary to find an optimal qubit partitioning scheme. The minimum cut method for quantum circuits is one such common strategy, which minimizes the number of qubit transmissions across partitions by finding the set of minimum cut edge weights in the graph structure. The objective of the minimum cut problem is to identify a set of edges whose total weight represents the number of global gates generated by the partitioning, such that removing this set of edges divides the node set in the graph into several independent subsets, and the total weight of the removed edges is minimized. A minimum cut implies optimizing the partitioning of the quantum circuit by minimizing the transmission operations across partitions, specifically minimizing the number of global gates.

    However, the minimum cut method also has some limitations. For example, the minimum cut method only focuses on minimizing a single set of cut edges and does not fully consider the global characteristics of the overall structure of the quantum circuit. Therefore, in some complex quantum circuits the minimum cut method may not provide the best partitioning scheme. To address this issue, a spectral clustering-based partitioning method is introduced. This method maps the quantum circuit partitioning problem to the eigenvector space of the Laplacian matrix. This simplifies the high-dimensional structure of complex graphs into the analysis of a few eigenvectors. As a result, it avoids the need for repeated probing in a vast search space as traditional methods do, significantly reducing the amount of information that needs to be processed. Furthermore, the second smallest eigenvalue of the Laplacian matrix and its corresponding eigenvector provide key information about the global structure of the graph, avoiding the potential problem of getting trapped in locally optimal solutions.

    A graph G is generated based on the topological structure of the quantum circuit, where each node represents a qubit and edges represent the associated operations between two qubits (i.e., two-qubit gates). The weight of an edge reflects the number of two-qubit gates acting on the two qubits.

    Based on the generated graph G, its adjacency matrix A and degree matrix D are constructed. The elements Aij in the adjacency matrix represent the edge weights between nodes i and j in graph G. If there is no edge between node i and node j, then Aij = 0; otherwise, Aij equals the weight of the edge. The degree matrix D is a diagonal matrix, where Dii represents the degree of node i, i.e., the number of edges connected to node i. For the adjacency matrix A, the degree matrix D can be calculated using

    The Laplacian matrix L reflects the structure of the graph and is obtained by subtracting the adjacency matrix from the degree matrix, specifically, L = D – A. By performing eigenvalue decomposition on L, its eigenvalues and eigenvectors are computed. Suppose the eigenvalues of L are λ1, λ2, …, λn and the corresponding eigenvectors are v1, v2, …, vn. The spectral clustering algorithm requires selecting the eigenvector v2 corresponding to the second smallest eigenvalue λ2 (also known as the Fiedler value) as the basis for partitioning. The eigenvector corresponding to the second smallest eigenvalue reflects the ‘cutting’ properties of the graph, enabling effective graph partitioning.

    Ultimately, by clustering the data points in the eigenvector v2, they are divided into k clusters, each representing a set of qubits in the partitioned sub-circuits. The k-way spectral clustering partitioning algorithm is shown in Algorithm 1.

    Figure 5 illustrates the result of converting the quantum circuit from Fig. 2 into a graph structure. Based on the weighted graph of the quantum circuit shown in Fig. 5, the process of the spectral clustering method is detailed as follows. First, construct the adjacency matrix A of the graph, where each row and column represent a node and the elements in the matrix denote the weights of the edges between two nodes. Then, based on the adjacency matrix A, generate the degree matrix D.

    The Laplacian matrix L is obtained by subtracting the adjacency matrix from the degree matrix. The importance of the Laplacian matrix lies in the fact that its eigenvalues and eigenvectors contain structural information for the graph.

    Next, calculate the eigenvalues and eigenvectors of L. The eigenvalues are λ1 ≈ 0, λ2 = 1, λ3 = 1.58578644, λ4 = 3, λ5 = 4, λ6 = 4.41421356. The corresponding eigenvector matrix (represented by columns) is as follows:

    According to the theory of spectral clustering, the eigenvector corresponding to the second smallest eigenvalue is chosen as the basis for partitioning. Based on the calculation results, the second smallest eigenvalue is 1, and its corresponding eigenvector is (0.289, −0.289, −0.577, 0.577, 0.288, −0.288)T. Finally, by applying K-means clustering, two clusters are obtained: {0.289, 0.577, 0.288} and {−0.289, −0.577, −0.288}. These correspond to the node partitions {0, 3, 4} and {1, 2, 5}, and the resulting circuits are shown in Fig. 3(b).

    However, this preliminary partitioning method may present the following issues in practical applications: (i) imbalance in the number of logical qubits in each partition; (ii) a relatively small number of global gates but still a high number of transmission operations.

    To address these issues, the spectral clustering algorithm is optimized. This optimized algorithm further adjusts the subset partitions based on the initial partitioning, making the size of each subset more balanced while striving to minimize the weight of the cut edges. Additionally, in multiple iterations, candidate partitioning schemes with different cut edge weights are proportionally selected. The pseudocode for the proposed optimized k-way spectral clustering partitioning algorithm is presented in Algorithm 2.

    Algorithm 2 obtains the initial vertex set partition through the K-SGP algorithm, but K-SGP may cause a large difference in the number of qubits allocated between partitions. If this is abstracted as a weighted graph of the circuit, it is equivalent to having a large difference in the number of nodes between the partitions. The balance_partitions function is used to balance the initial vertex set, gradually reallocating nodes from partitions with a larger number of nodes to those with fewer nodes, ensuring that the size of each partition is balanced. The calculate_cut_weight function computes the cut edge weights for each partition to evaluate the quality of the partitioning. After completing all iterations, the algorithm uses the filter_partition function to select n unique partitioning solutions from the results, where the optimal weight accounts for 50%, the second-best for 30% and the third-best for 20%. This optimization algorithm combines the advantages of initial spectral clustering with subsequent optimization strategies, making it suitable for finding multiple relatively optimal partitioning solutions in complex networks while ensuring that the number of nodes in each partition is as balanced as possible and the cut edge weights are minimized.

4.   Transmission cost optimization of the global gate search tree strategy
  • In distributed quantum computing, the number of transmission operations for global gates across partitions has a significant impact on computational efficiency. This section presents a global gate search tree strategy that generates nodes based on the qubits involved in global gate operations and systematically identifies opportunities for merged transfers, facilitating the selection of the optimal partitioning.

  • In distributed quantum computing, because qubits are distributed across multiple QPUs, quantum information transmission between QPUs is required to complete computational tasks. The scale of transmission operations is given by

    where TC denotes the number of transmission operations required for executing global gates in a distributed quantum circuit. Tmerged refers to the number of transmission operations using the merged transfer model, Specifically, this refers to global gates in the circuit that can utilize the merged transmission model, which subsequently reduces the transmission cost. Tunmerged represents the number of transmission operations required for the remaining global gates that do not use the merged transmission model. These gates cannot be merged transfer and must be executed through single transmission operations. The sum of Tmerged + Tunmerged stands for the total number of transmission operations obtained by searching for as many merged transfer opportunities as possible. Numglobal represents the number of global gates present in the distributed quantum circuit. The significance of merged transfer lies in its ability to reduce the total transmission cost by combining multiple global gate transmission requests into a single transmission operation. In contrast, not using merged transfer requires multiple independent transmission operations, leading to a significant increase in transmission cost, with an upper bound reaching twice the number of global gates. Therefore, identifying global gates that can be merged for transmission in the partitioned distributed quantum circuit is of great importance for reducing the transmission cost of computational tasks.

    From the merged transfer model, it can be observed that global gates acting on the same qubit and whose remaining qubits belong to the same partition can be reconstructed into local gates and executed through a single transmission operation. However, when searching for global gates that can be merged for transfer in actual circuits, the following situations often arise: (i) The subsequent quantum gate is a local gate. (ii) The subsequent quantum gate is a global gate, and the qubits it acts on are different from those of the global gate for which merged transfer is being sought.

    These two scenarios cause the search for merged transfer to terminate prematurely, missing many opportunities for merged transfer. As shown in Fig. 6(a), when transferring the qubit q0 for the global gate G0, because gate G1 is a local gate, even if global gate G2 also acts on q0, the conditions for merged transfer are not met. In Fig. 6(b), the transfer of q0 for the global gate G0 is still required, but the subsequent gate is a global gate that acts on different qubits from those of gate G0, hindering the opportunity to merge transfer G2 and G0.

    Therefore, it is necessary to utilize the quantum gate movement rules to move subsequent global gates that act on the same qubits behind the required global gates for transmission as much as possible, so that merged transfers can cover more global gates. Figure 7 illustrates the movement rules that need to be used. In Fig. 7(a), if two two-qubit gates act on different qubits, the positions of these two gates can be swapped. In Fig. 7(b), if two two-qubit gates have the same control qubit but different target qubits, the positions of these two gates can be swapped. In Fig. 7(c), if two two-qubit gates have the same target qubit but different control qubits, the positions of these two gates can be swapped.

    According to the aforementioned gate movement rules, more opportunities for merged transfer can be created. In Fig. 6(a), gate G1 can be swapped with gate G2 based on the rule in Fig. 7(b). At this point, if qubit q0 is transferred, G0 and G2 can be merged for transfer. In Fig. 6(b), the rule in Fig. 7(a) is satisfied. After swapping the positions of gates G1 and G2, gates G0 and G2 meet the conditions for merged transfer.

  • In distributed quantum computing, effectively reducing the number of quantum state transmissions is crucial for optimizing computational efficiency. To this end, this paper proposes a method using a global gate search tree to calculate the number of transfers. This method generates corresponding nodes based on the qubits involved in global gate operations and utilizes movement rules to identify as many subsequent global gates that can be merged for transfer as possible. The distributed quantum circuit is continuously updated until no global gates remain in the circuit.

    Definition 1 A tree generated by using the global gates in the quantum circuit as root nodes and by progressively moving and updating the states of qubits is called a global gate search tree.

    Each node in the global gate search tree contains the following information: (i) Current global gate (Global_gate): represents the first global gate that appears among all quantum gates. (ii) Qubit allocation (Trans_qubit): records the qubits on which the current global gate acts. (iii) Merged transfer list (Trans_list): stores the set of global gates that meet the conditions for merged transfer.

    Through this progressive search strategy, the layout of quantum gates in the circuit can be analyzed in greater detail, effectively reducing the number of transmission operations and ultimately achieving the optimal number of transmission operations.

    The method for finding merged transfers is proposed as described in Algorithm 3. It starts at the index position of the first global gate in the circuit and traverses to the last global gate that acts on the transmission qubit. It then retrieves the partition of the other qubits involved in the gate, referred to as other_partition. When encountering a global gate that acts on Trans_qubit, the function qubit_interacts_partition is used to determine whether the other qubits involved in that global gate belong to the same partition as other_partition. If they are the same, it initially satisfies the conditions for merged transfer, and it can be further determined whether to use the movement rules to move it to the next position after the first global gate index. If the conditions are met, it is added to Trans_list. It should be noted that the function can_move_to_position ignores the global gates in Trans_list to prevent gates already added to the list from affecting the movement of subsequent global gates. After the traversal is complete, the first global gate is also added to Trans_list. This list provides the index of quantum gates that need to be removed for updating the quantum circuit in the node.

    To prevent the global gate search tree from growing excessively during the search process, which would lead to high computational complexity, the following pruning measures are adopted: (i) Construct a global variable min_depth, and stop generating nodes once the depth exceeds its value. (ii) Use a dictionary to record the depth of each circuit relative to the root node and the current circuit. When constructing a new node, if the current circuit already exists and has a greater depth, the node is not generated. These measures can limit the size of the tree and prevent its overexpansion while ensuring search efficiency.

  • Taking the six-qubit circuit shown in Fig. 8 as an example, the global gate search tree strategy is elaborated, and the resulting tree diagram is shown in Fig. 9.

    Step 1 The current circuit is taken as the root node (0,0), and the first global gate G0 in the circuit is identified, with its associated qubits being q1 and q4, meaning the Trans_qubit are q1 and q4. Next, the subsequent quantum circuit is traversed to determine whether each global gate satisfies the conditions for merged transfer with G0, generating child nodes (1,0) and (1,1). Each node stores the updated circuit based on the transfer of the current qubit.

    In node (1,0), considering the transfer of qubit q1, i.e., Trans_qubit is q1, the other qubit of G0 belongs to the partition P2(other_partition). Gate G1 is a local gate, and G2 is a global gate acting on q1. The other qubit affected by G2 is in the same partition as other_partition. According to the movement rules, G2 can be moved before G1 to meet the merged transmission condition. Similarly, G3 also acts on q1, and its other_partition is P2, so it can be swapped with G1. Continuing the traversal, after no more global gates act on qubit q1, gates G0, G2 and G3 are added to Trans_list. These gates are then removed from the original circuit as shown in Fig. 10(a), and the circuit in node (1,0) is updated. Subsequently, in node (1,1), considering the transfer of qubit q4, i.e., Trans_qubit is q4, the other_partition of the qubit affected by G0 is P1. Since there are no global gates acting on qubit q4 in the circuit, G0 is added to Trans_list and removed, and the circuit is updated accordingly as shown in Fig. 10(b).

    Step 2 Taking node (1,0) as the root, as shown in Fig. 10(a), the first global gate in the circuit is gate G1. It acts on qubits q2 and q3, leading to the generation of nodes (2,0) and (2,1). In node (2,0), when transferring q2, i.e., Trans_qubit is q2, the other_partition of the qubit affected by G1 is P2. The movement rules allow the global gate G3 to be swapped with the local gate G2, adding G1 and G3 to the Trans_list, removing them and updating the circuit. After the update, there are no remaining global gates in the circuit, thus completing the path composed of nodes (0,0), (1,0), and (2,0) with a path length of 2. If subsequent path lengths exceed 2, no further nodes are generated. In node (2,1), when considering the transfer of q3, i.e., Trans_qubit is q3 and the other_partition is P1, there are no global gates that can be merged for transfer, so G1 is added to the list and the circuit is updated. As shown in Fig. 10(a), the global gate G3 still exists, but the path has already been completed, so node (2,1) does not need to generate new child nodes by repeating the above steps.

    Step 3 Continuing with node (1,1), as shown in Fig. 10(b), global gate G1 acts on qubits q5 and q1, generating nodes (2,2) and (2,3). In node (2,2), when transferring q5, i.e., Trans_qubit is q5 and the other_partition is P1, only the target qubit of global gate G2 acts on q5, and its other_partition is P1, which is adjacent to G1, thus satisfying the conditions for merged transfer. After removing these two gates and updating the circuit, global gates G3 and G5 still exist in the updated circuit, so no new child nodes are generated. In node (2,3), global gate G2 meets the conditions for merged transfer, but the target qubit of global gate G5 and the control qubit of G3 both act on q2, preventing G5 from being moved to the left of G3, thus making merged transfer impossible. Similarly, no new nodes are generated for this node.

    Ultimately, the path composed of nodes (0,0), (1,0) and (2,0) is the shortest path, with a total of four transmission operations including the transfer back of quantum states. The process information of the global gate search strategy is shown in Table 1.

5.   Experiential results and analysis
  • The proposed method is implemented using Python, with experiments conducted on a system equipped with an Intel i5-8300H CPU @ 2.30 GHz and 16 GB of memory. The experiments selected circuits from the reversible circuit test set RevLib, quantum circuits of the QFT algorithm and randomly generated circuits encompassing various sizes and structures as experimental subjects. In the experiment, the algorithm iterates 1000 times in different test circuits. The number of quantum state transmissions between partitions is used as the transmission cost, serving as a performance metric for comparing distributed quantum circuits. This study is based on a superconducting distributed architecture and employs direct quantum state transmission for transferring quantum states, using the number of quantum state transmissions as the transmission cost. Therefore, even though different methods of quantum state transmission may be used, the counting method remains consistent with the comparative references, ensuring the comparability of experimental data.

  • As shown in Table 2, the proposed global gate search tree strategy is compared with those in Refs. [27,28] regarding the optimization of transmission cost for QFT circuits under different partitioning scenarios. In the table, Circuit denotes the name of the quantum circuit, Qubits represents the number of qubits involved in the circuit, Gates indicates the number of gates present in the circuit, K signifies the number of partitions, Global_gates refers to the number of global gates generated after partitioning, TC denotes the transmission cost required to execute the distributed quantum circuit and Imp represents the improvement rate of the proposed method compared to the comparative results in terms of transmission cost metrics.

    Reference [27] employs a genetic algorithm to find the optimal allocation scheme of quantum gates across different partitions. This is achieved by encoding possible allocation schemes as chromosomes and applying genetic operations such as selection, crossover and mutation to reduce the number of required transmission operations. Reference [28] adopts a lookahead strategy based on gate commutativity, identifying commutable global gates within the distributed quantum circuit and optimizing the execution order of these gates to lower the transmission cost.

    As observed in Table 2, the global gate search tree strategy proposed in this paper outperforms the methods in Refs. [27,28] in reducing transmission cost, achieving an average improvement rate of 10.2%. This optimized performance is attributed to the proposed method’s utilization of gate movement rules combined with continuous optimization and updating of the distributed quantum circuit through tree generation. This progressive search strategy allows for a more detailed analysis of the distribution of global gates within the distributed quantum circuit, thereby attaining the optimal number of transmission operations.

  • This experiment selected quantum circuits from the RevLib library for testing, comparing the impact of different cut edge weights under two partitions on the transmission cost of distributed quantum circuits. Table 3 presents a comparison of transmission cost between the method proposed in this paper and those in Refs. [17,19]. In this table, Min_weight denotes the minimum sum of cut edge weights during the quantum circuit partitioning process, reflecting the number of global gates generated, while Weight represents the sum of cut edge weights corresponding to achieving the optimal transmission cost. Reference [19] introduced a hierarchical method for constructing distributed quantum systems, applying recursive functions to minimize the number of transmission operations. Reference [17], on the other hand, abstracted distributed quantum circuits into matrix models and scheduled quantum gates by optimizing these matrices.

    Prior to the experiment, because the quantum circuits under comparison included multi-controlled Toffoli (MCT) gates, which are unfavorable for subsequent routing tasks, the decomposition algorithm provided by Qiskit is employed to break down MCT gates into several two-qubit gates. Although this process increased the number of global gates, Table 3 shows that the proposed method still significantly reduced the transmission cost compared with Refs. [17,19] when handling distributed quantum circuits with greater depth after decomposition, achieving an average improvement rate of 25.6% and a maximum improvement rate of 62.5%. This result demonstrates that the global gate search tree strategy proposed in this paper can meticulously analyze each opportunity for merged transfer, allowing more global gates to be completed through a single transmission, effectively reducing the overall transmission cost.

    Further analysis reveals that although the Weight corresponding to the optimal transmission cost may be higher than Min_weight, solely relying on the minimum sum of cut edge weights for circuit partitioning does not necessarily achieve the lowest transmission cost. This highlights the advantage of the proposed algorithm in comprehensively considering both the number of global gates and the optimization of transmission cost.

  • As shown in Table 4, the partitioning times required for quantum circuits of different sizes under two partitions are compared with the partitioning methods in Refs. [29–32]. The experiment randomly generated quantum circuits ranging from 5 to 1000 qubits, each size containing 1000 two-qubit gates, to compare the performance of the proposed quantum circuit partitioning method with other graph partitioning methods in terms of runtime.

    As the number of qubits increases, the runtime of all methods also grows. The KL method, however, shows a rapid increase in runtime for circuits with more than 300 qubits, indicating its poor scalability for large-scale quantum circuit partitioning. The K-means method incurs higher time overhead for small-scale qubits but maintains a relatively stable growth rate as the number of qubits increases. The hypergraph method performs consistently across different qubit scales, but its runtime is generally longer compared with other methods. In contrast, the partitioning method proposed in this paper exhibits a relatively moderate growth rate in runtime, demonstrating better partitioning efficiency for large-scale circuits. It maintains a low runtime across various qubit scales, offering a more efficient solution for quantum circuit partitioning.

6.   Conclusion
  • In distributed quantum computing, the number of quantum state transmissions required for global gates operating across partitions is a critical factor affecting computational efficiency. This paper introduces a quantum circuit partitioning method based on spectral clustering, which efficiently balances the number of qubits in each partition while reducing the number of global gates, thereby selecting candidate partition schemes. By employing a global gate search tree strategy, the distribution of global gates within distributed quantum circuits is analyzed in greater detail, facilitating the identification of more opportunities for merged transfers. This approach effectively reduces transmission cost and enables the selection of the most optimal partitioning scheme for distributed quantum circuits. Experimental results demonstrate that the proposed method achieves optimization across various metrics. Future research may explore partitioning schemes that involve cutting qubit lines, integrate advanced quantum state transmission technologies and consider the impact of noise on the fidelity of distributed quantum computing.

Figure (10)  Table (7) Reference (32)

Catalog

    /

    DownLoad:  Full-Size Img  PowerPoint
    Return
    Return