Distributed quantum circuit intelligent cutting method based on large model
By learning quantum circuit structure and von Neumann entropy law through large-scale modeling, efficient and low-loss quantum circuit cutting schemes are automatically generated, solving the problems of low efficiency and poor generalization in existing technologies and realizing the large-scale application of quantum computing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-14
AI Technical Summary
In existing parallel distributed quantum computing technologies, quantum circuit cutting schemes rely on manual design or traditional heuristic algorithms, resulting in low efficiency, large losses, poor generalization ability, and difficulty in adapting to diverse quantum computing tasks and hardware environments.
A distributed quantum circuit intelligent cutting method based on a large model is adopted. By constructing a cutting loss estimation model and a large model with a classical Transformer architecture, the structural characteristics of quantum circuits and the von Neumann entropy law are learned, and efficient and low-loss cutting schemes are automatically generated.
It achieves precise quantization of quantum circuit cutting and improves hardware adaptability, significantly shortens the generation time, has good generalization ability, adapts to diverse quantum computing tasks and hardware environments, and promotes the large-scale deployment of quantum computing.
Smart Images

Figure CN121860080A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of quantum computing and artificial intelligence intersection, specifically to quantum circuit processing technology in parallel distributed quantum computing, and particularly to a method for intelligent cutting of distributed quantum circuits based on a large model. Background Technology
[0002] As quantum computing technology advances towards large-scale deployment, the resources of a single quantum processor (QPU), such as the number of qubits and coherence time, are no longer sufficient to meet the demands of complex quantum algorithms. Therefore, parallel distributed quantum computing has become a key direction for overcoming resource limitations. The core of parallel distributed quantum computing is to divide a large-scale quantum circuit into multiple sub-circuits, allocate them to different QPUs for execution, and then achieve coordination between the sub-circuits through technologies such as quantum entanglement distribution and quantum teleportation, ultimately completing the overall computational task. In the actual deployment of such a distributed architecture, it is first necessary to perform reasonable qubit allocation based on the hardware characteristics of the QPU, such as the coupling graph topology and the division of data qubits and communication qubits, to ensure that each sub-circuit is compatible with the local connectivity of the target node, thereby reducing additional swap gate (SWAP) operations caused by hardware incompatibility. Meanwhile, remote operation scheduling requires distinguishing between two modes: TeleGate and TeleData. TeleGate achieves multiple remote gate reuse of shared control qubits through Cluster-state Entanglement (Cat-Ent) and Cluster-state Disentanglement (Cat-DisEnt) primitives. Its core principle is to leverage the high connectivity and local operability of cluster states to multiplex multiple remote gate operations using the same set of entangled resources. TeleData, on the other hand, utilizes quantum teleportation to transfer data qubits. The choice between these two modes directly impacts the efficiency of Einstein-Podolsky-Rosen pairs (EPR pairs). A highly connected network topology can effectively reduce the number of line layers required for remote operations, thereby reducing communication latency.
[0003] However, the performance of parallel distributed quantum computing depends on the quality of quantum circuit cutting. Current quantum circuit cutting schemes mainly rely on manual design or traditional heuristic algorithms, including the Kernighan-Lin algorithm based on graph partitioning and local search algorithms based on greedy strategies. Manually designed schemes are extremely inefficient and difficult to adapt to dynamically changing quantum circuit structures and distributed hardware architectures. While traditional heuristic algorithms can achieve automated cutting, they suffer from two major problems. First, the cutting loss assessment relies on simplified models, such as considering only the number of cutting points while ignoring the entropy increase loss of quantum state evolution, which leads to a significant decrease in quantum state fidelity during actual execution. Second, the algorithms have weak generalization ability. For quantum circuits with different topologies such as deep circuits and sparse circuits, repeated parameter adjustments are required to adapt them, making it difficult to meet the diverse needs of parallel distributed computing scenarios. For example, when facing a QPU with a heavily hexagonal coupled graph, traditional algorithms cannot automatically match the optimal path of its local route, nor can they combine the structured subspaces such as the coding subspace and symmetric sectors defined by the reference set to evaluate the integrity of the logical information after cutting, easily leading to resource waste.
[0004] In recent years, large-scale models have demonstrated powerful learning and generalization capabilities in areas such as code generation and complex task optimization. However, their application in the field of parallel distributed quantum circuit segmentation remains unexplored. Current technologies have not yet utilized large-scale models to learn the structural characteristics and segmentation loss patterns of quantum circuits, thus failing to achieve efficient circuit segmentation that integrates "structure awareness, loss minimization, and hardware adaptation." Specifically, existing technologies do not enable large-scale models to learn segmentation strategies under different distributed architectures, such as the difference in segmentation granularity between 3-QPU and 5-QPU networks. This prevents large-scale models from automatically generating platform-independent quantum circuit representations like OpenQASM 3.0, making it difficult to adapt to QPUs from multiple vendors. Furthermore, they do not incorporate information theory tools such as von Neumann entropy to enable large-scale models to learn segmentation losses in a structured context, such as the relative entropy between the reference and target states. This makes it difficult for segmentation schemes to simultaneously consider both logical information integrity and hardware resource efficiency. In addition, large-scale models do not incorporate local routing optimization logic in distributed scenarios, failing to simultaneously plan the gate sequence rearrangement of sub-circuits on the target QPU during the segmentation process. These shortcomings collectively constrain the large-scale deployment of parallel distributed quantum computing. Summary of the Invention
[0005] This invention proposes a distributed quantum circuit intelligent cutting method based on a large model. By allowing the large model to learn the cutting loss evaluation logic based on von Neumann entropy, it automatically generates the quantum circuit cutting scheme with the minimum loss, thereby solving the problems of low efficiency, large loss and poor generalization of existing technologies.
[0006] To achieve the above objectives, the technical solution of this invention is as follows: a method for intelligent cutting of distributed quantum circuits based on a large model, comprising the following steps:
[0007] S1. Determine the target quantum computing task and obtain the initial quantum circuit corresponding to the target quantum computing task, wherein the initial quantum circuit contains the set of quantum gates required to realize the target quantum computing task;
[0008] S2. Construct a cutting loss estimation model based on classical von Neumann entropy, and use the cutting loss estimation model to simulate multiple cutting schemes for the initial quantum circuit to generate multiple candidate cutting quantum circuits.
[0009] S3. Select a set of target quantum circuits that meet the preset better conditions from multiple candidate quantum circuits, and divide the set of target quantum circuits into a training set and a test set according to a preset ratio;
[0010] S4. Construct a pre-defined large model, using the input features of the target quantum circuit cutting in the training set as input and the corresponding cutting scheme as output, to train the pre-defined large model; use the test set to verify the generation accuracy of the trained large model, and obtain the target large model;
[0011] S5. Obtain the quantum circuit to be cut for the new quantum computing task to be processed, input the input features of the quantum circuit to be cut into the target large model, and the target large model directly outputs the cutting scheme and the quantum circuit after cutting.
[0012] S6. Assign each sub-circuit in the cut quantum circuit to the corresponding processing unit in the distributed quantum computing architecture, control each processing unit to execute the sub-circuit, and realize quantum state transmission and cooperative operation between processing units through the quantum network.
[0013] Preferably, the quantum gate includes a single-qubit gate, a two-qubit entanglement gate (imaginary commutation gate, square root commutation gate, controlled Z gate), a multi-qubit gate, and a three-qubit Toveley gate;
[0014] The initial quantum circuit uses a sequence of quantum gates. This indicates that m is the total number of quantum gates. Represent the i-th quantum gate; select the initial quantum state. n is the total number of qubits. This represents tensor product operations; the initial quantum circuitry satisfies the fidelity constraints of the target quantum computing task. ;in, To ensure fidelity, To preset the fidelity threshold, , The ideal output state required for the target quantum computing task. The output state is the result of the initial quantum state evolving through a quantum circuit. It is the Dirac symbol.
[0015] Preferably, the step of constructing a cutting loss estimation model based on classical von Neumann entropy includes:
[0016] The quantum state density matrix corresponding to the initial quantum circuit The initial states of qubits are obtained by evolution gate by gate through quantum simulation;
[0017] The degree of information disorder in the initial quantum state is quantized by von Neumann entropy as follows: ;in, Represents von Neumann entropy. Represents the trace operation of a matrix;
[0018] When the initial quantum circuit is divided into k sub-circuits, the subsets of qubits in each sub-circuit do not overlap, and the corresponding density matrices are as follows: density matrix The overall quantum state is obtained by evolving the allocated bit subset from the gate sequence of the i1th sub-circuit and then cutting it. For all k sub-lines, the direct product state is given.
[0019] The overall quantum state after cutting The von Neumann entropy satisfies additivity;
[0020] The cutting loss is determined by the difference in von Neumann entropy of the quantum state before and after the cutting.
[0021] Preferably, the method for generating multiple sets of candidate quantum circuit cuts is as follows:
[0022] S2.1. Based on the correlation effect of quantum gates on qubits, determine the candidate cutting points, and generate multiple different cutting position combinations based on the quantum gate positions and qubit combinations corresponding to the correlation effect;
[0023] S2.2. For each combination of cutting positions, decompose the initial quantum circuit into at least two sub-circuits, and calculate the density matrix of the quantum states corresponding to each sub-circuit. k is the number of sub-circuits, and the cut quantum states are constructed according to the quantum state combination rules. The combination rules include tensor product and other legal forms that conform to quantum state superposition or direct product;
[0024] S2.3. Solving the von Neumann entropy of the initial quantum state based on the von Neumann entropy. and the von Neumann entropy of the overall quantum state after cutting The cutting loss value of the cutting scheme is obtained;
[0025] S2.4. Repeat steps S2.1-S2.3 to generate multiple sets of candidate cut quantum circuits containing cut positions, sub-circuit divisions, and cut loss values.
[0026] Preferably, the method for determining the candidate cutting points is as follows: constructing an undirected weighted graph corresponding to the sample quantum circuit. ,in, Let be the set of vertices containing n quantum gates, where n is the total number of quantum gates in the target quantum circuit. Let be a set of edges, where each edge represents an action of a cross-qubit gate on two quantum gates. Let G1 be the set of edge weights, where the edge weights are the total number of cross-qubit gates acting on two quantum gates. The undirected weighted graph G1 is partitioned using a multi-level k-way graph partitioning algorithm, and the partitions must satisfy the parallel distributed simulation constraints. The quantum gate dependency matrix D and the qubit entanglement strength matrix E1 are combined to further screen cutting candidate points from the partition boundaries.
[0027] Preferably, the quantum state density matrix is: ;in, For the i-th quantum gate unitary matrix, unitary matrix The conjugate transpose of the matrix. It is the Dirac symbol;
[0028] The overall quantum state after cutting ;
[0029] The overall quantum state after cutting The von Neumann entropy satisfies: ;
[0030] The cutting loss L is characterized by the difference in von Neumann entropy of the quantum state before and after the cutting, and the absolute difference is: ;in, This represents the quantum state density matrix of the initial quantum circuit before cutting. The overall quantum state after cutting; the overall quantum state after cutting Satisfy cutting loss This is the loss threshold;
[0031] The constraints of the parallel distributed simulation include the number of simulation computing nodes M and the maximum number of qubits supported by a single simulation computing node. By iteratively optimizing and minimizing the sum of edge weights across partitions, the need for quantum state data interaction between subsequent sub-lines is reduced, ensuring that each partition... satisfy And the number of partitions ;
[0032] If adjacent quantum gates and Quantum bits that satisfy the condition of no co-operation correspond to the quantum gate dependency coefficient. And corresponding qubits Entanglement strength The location was determined as a candidate cutting point. The preset entanglement threshold is used;
[0033] The quantum gate dependency matrix m is the total number of quantum gates; only adjacent quantum gates are considered. If adjacent quantum gates The quantum gate dependency coefficient is calculated when there are no interacting qubits. The location is a candidate cutting point;
[0034] Highly entangled bit pairs in the entanglement strength matrix E1, where the entanglement strength of any two qubits is greater than or equal to a preset threshold, restrict the cutting behavior within the quantum gate interval.
[0035] Based on the total number of distributed processing units K, the range of the number of sub-lines k is defined as follows: For each k, randomly select from the candidate cutting points. A set of non-overlapping cutting positions is formed to filter out invalid combinations that exceed the upper limit of the distributed processing unit for the number of sub-circuit qubits and quantum gates, thereby generating multiple different cutting position combinations.
[0036] Preferably, the preset preferred conditions include cutting loss. A preset loss threshold is set, and the resource requirements of each sub-line are adapted to the resource constraints of the processing units in the distributed quantum computing architecture.
[0037] The resource constraints include: qubit number constraint: the number of qubits in the i1th sub-circuit is set to be less than or equal to the qubit capacity of a single processing unit. Quantum gate number constraint: The number of quantum gates in the i1th sub-circuit is set to be less than or equal to the maximum quantum gate capacity of a single processing unit. ; Execution time constraint: Set the execution time of the i1th sub-line to be less than or equal to the maximum execution time allowed by the processing unit; Constraint adjustment logic: If the task fidelity threshold is ≥0.995, the constraint can be tightened to reserve hardware redundancy; If the task prioritizes efficiency, the constraint can be relaxed within the hardware limits.
[0038] The preset preferred conditions should also include: the depth of each sub-circuit is ≤ the maximum supported circuit depth of the corresponding processing unit; the circuit depth is the maximum number of quantum gates connected in series on a single quantum bit in the quantum circuit;
[0039] The number of new remote quantum operations required after the cutting is less than or equal to a preset operation threshold. The remote quantum operations include, but are not limited to, EPR pair generation, quantum teleportation, and other cross-unit quantum state interaction operations.
[0040] The quantum gate ratio of each sub-circuit is adapted to the quantum gate execution efficiency of the corresponding processing unit. The quantum gate ratio includes the ratio of the number of single-qubit quantum gates to the number of multi-qubit quantum gates or the ratio of operation time.
[0041] Preferably, the target cutting line set D1 that meets the preset better condition constraints is divided according to a preset ratio. Divided into training set With test set Each data entry In this context, the input feature X is a concatenated vector of quantum circuit features and classical hardware features, encompassing circuit topology, gate operation parameters, and parallel distributed simulation constraints, while also including the original core features. Where K is the total number of distributed processing units. R represents the quantum bit capacity of a single processing unit, and R represents the quantum channel transmission rate; output tag This includes the placement of the cutting scheme at the cutting point, sub-circuit division, sub-circuit-processing unit mapping, and multi-type quantum gate combination circuits;
[0042] A stratified sampling strategy is adopted to ensure that the proportion of samples with different line types and hardware constraints is consistent between the training set and the test set;
[0043] The pre-defined large model is a classic Transformer architecture, including an encoder and a decoder. The encoder is responsible for jointly extracting and associating the input features X to output a unified feature representation; the decoder is responsible for generating a constraint-compliant segmentation scheme based on the feature representation; the encoder performs splitting and preprocessing on the input features X: for quantum circuit features, for quantum gates... The eigenvalue vector and eigenvector matrix of the unitary matrix are vectorized and then concatenated to obtain the embedded vector; the t-th position in the quantum gate sequence G is encoded by rotation position encoding to obtain the quantum circuit features;
[0044] For classical hardware features, the capacity of a single processing unit's qubits is vectorized. The adjacency matrix A of the processing unit coupling graph and the quantum channel transmission rate R are concatenated with the total number of distributed processing units K using one-hot encoding to obtain a unified dimension feature vector; the quantum circuit features are then concatenated with the unified dimension feature vector to form a unified input vector. The input is the multi-head attention layer of the encoder in the classic Transformer architecture. The outputs of the multi-head attention layers are combined through concatenation and linear transformation to obtain the multi-head attention output, which is then processed by a feedforward network to obtain the feature vector. The decoder employs a classic autoregressive decoding structure, with the input being a feature vector. The causal mask matrix is added to the attention score matrix of the decoder's self-attention layer. The decoder integrates a legality verification layer to determine the legality of the sub-line. If the legality is not satisfied, a backtracking adjustment is triggered to regenerate the bit AND gate set of the sub-line.
[0045] The training loss function of the preset large model is a weighted combination of multi-dimensional loss terms, including but not limited to: the deviation loss between the cut loss corresponding to the output cut scheme and the actual cut loss; the structural difference loss between the output sub-line topology and the actual sub-line topology; and the autoregressive loss of the cut scheme sequence, including but not limited to cross-entropy loss and KL divergence loss based on the sequence generation probability.
[0046] The weight coefficients of the weighted combination are dynamically adjusted according to the training objective, so that the sum of the weights is either a preset fixed value or adaptively optimized.
[0047] Gradient descent-type optimization algorithms are used, with input feature-output segmentation scheme pairs in the training set as training samples, to iteratively update the parameters of the preset large model until the value of the training loss function converges to the preset convergence threshold or reaches the preset number of iterations.
[0048] The iterative update of the parameters of the preset large model also includes preprocessing the training samples: normalizing or standardizing the numerical input features of the target quantum circuits in the training set, mapping the numerical features to the preset range of the model input; encoding the non-numerical input features of the target quantum circuits in the training set, converting them into vector forms that the model can recognize; removing samples in the training set whose cutting loss exceeds the preset anomaly threshold, or processing anomaly samples by means of data smoothing and outlier correction; if the average cutting loss ≤ the test loss threshold and the average sub-circuit fitness ≥ the fitness threshold, then the trained model is determined to be the target large model.
[0049] Preferably, a reinforcement learning fine-tuning strategy is adopted to optimize the trained pre-set large model through an iterative loop of "policy generation - reward feedback - policy update": policy initialization and action space definition are performed, using the pre-set large model of the classic Transformer architecture as the initial policy network. , The model parameters are used, and the policy input is a uniform input vector. The output is the probability distribution of the cutting scheme. The cutting scheme is generated by decomposing it into discrete action sequences: selecting the number of sub-circuits k, and allocating a set of qubits to each sub-circuit. Each sub-circuit is assigned a set of quantum gates. Establish a sub-line-processing unit mapping M; design a multi-dimensional weighted reward function. Guided strategy to generate cutting scheme; perform reinforcement learning strategy update: from training set Sampling batches of data requires configuration based on hardware computing power; the advantage function for each sample is calculated using a multi-dimensional weighted reward function and the baseline reward predicted by the value network. Introducing a clipping threshold The policy loss function is obtained as follows:
[0050]
[0051] Where B is the batch size and the strategy ratio. To update the ratio of conditional probabilities in the policy network before and after, This represents the clipping function;
[0052] The AdamW optimizer is used to synchronously update the parameters of the policy network and the value network;
[0053] Employ a gradient accumulation strategy: Set the accumulation step count s, and the effective batch size. Each time B samples are loaded, the gradient is calculated and accumulated to the cache. After s times, the total gradient is used to perform a parameter update.
[0054] Define a three-dimensional convergence criterion: the change in the average batch reward of the training set across consecutive preset rounds. ,in, The average batch reward for the training set in round t is: The training set batch average reward for round t-Δt; the test set splitting loss error rate. ,in, Set a preset error rate threshold; test the resource adaptation rate of the sub-line. ,in, A preset fit rate threshold is set; when all three conditions are met simultaneously, a target large model for inference is obtained. .
[0055] Preferably, the sequence length of the cutting scheme Where 1 corresponds to the encoding length of the number of sub-lines k. The total length of the bit AND gate encoding for all sub-circuits. This represents the set of qubits in the i1-th sub-circuit of the new task to be processed. This represents the set of quantum gates for the i1-th sub-circuit in the new task to be processed. The encoding length for processing unit mapping relationships; sequence length. It must not exceed the maximum generation length of the target large model. If the sequence length Then, the superscale sub-circuit is split in descending order of the number of quantum gates in the sub-circuit until the sequence length is satisfied. The sequence length needs to be adapted to the total number of processing units in the distributed architecture. Ensure the number of sub-lines And the coding length of a single sub-line , The maximum encoding length supported by a single processing unit;
[0056] The input features of the quantum circuit to be cut are extracted, and the quantum circuit features and classical hardware features are preprocessed and concatenated into a unified input vector. Secondly, the input vector Input target large model It directly outputs a better cutting scheme through autoregressive inference using the classic Transformer structure. This includes the segmented sub-circuits, bit sets, and mapping relationships. The segmented sub-circuits are converted into a standardized quantum circuit format executable by distributed processing units, containing qubit initialization instructions, quantum gate execution instructions, and measurement instructions. Distributed execution and result integration are performed: processing units execute their mapped sub-circuits, and remote operations between processing units are implemented based on the EPR quantum teleportation protocol. Real-time monitoring of quantum state fidelity is also conducted. ;in, It is a fidelity calculation function. , These are the density matrix corresponding to the actual quantum state received by the target processing unit after cross-processing unit transmission and the density matrix corresponding to the ideal target quantum state that should theoretically be obtained during cross-processing unit quantum state transmission; if the quantum state fidelity is lower than the preset transmission fidelity threshold, the EPR pair regeneration process is triggered; after each processing unit completes the sub-line, the measurement results are aggregated to the control node through the classical communication network, and the control node integrates them according to the calculation logic of the target task to obtain the final output;
[0057] The method for verifying the cut quantum circuit output by the target large model is as follows: calculate the actual cutting loss using the cutting loss estimation model, and calculate the quantum state density matrix of the complete circuit before cutting. Product state density matrix of the cut sub-circuit Substitute the values into the von Neumann entropy formula to calculate the actual cutting loss. If the actual cutting loss... Preset verification threshold This will result in the quantum circuit being cut and the actual cutting loss. Feedback is fed back to the training set to incrementally train the target large model and update the model parameters.
[0058] The incremental training sample size and iteration count are adapted to the loss optimization requirements: the sample size is determined based on the deviation between the actual splitting loss and the preset validation threshold. If the actual splitting loss... One incremental sample is generated for each out-of-specification scheme; if the actual cutting loss Incremental samples were generated for three different sub-line splitting variants; if the actual cutting loss Generate 5 incremental samples; the number of iterations for incremental training. The initial number of training iterations 20%-30%, and must meet the average splitting loss of 3 consecutive rounds of validation sets. Stop iteration when the number of iterations reaches a certain threshold; If the conditions are still not met, new candidate cutting scheme samples are generated based on the characteristics of the current over-cutting circuit, and training continues until convergence; if the actual cutting loss is less than or equal to the preset verification threshold, the cut quantum circuit is determined to be the final execution circuit.
[0059] A two-dimensional determination method based on quantum gate dependence and entanglement strength is employed to process qubits that need to be associated across processing units after slicing: analyzing the bit subset allocation and processing unit mapping table fields in the slicing scheme output by the target large model; and traversing the set of quantum gates of the original quantum circuit. Multi-qubit gates that act on two or more qubits are selected to form a multi-qubit gate set. For each multi-bit gate Read the gate operation data of the original quantum circuit to obtain the set of active qubits; if the qubits in the set of qubits are assigned to different processing units, then the qubits are determined to be qubits that need to be associated across processing units; supplementary verification: if the entanglement strength of the cross-unit qubit pair is greater than or equal to the preset entanglement threshold, control the corresponding processing unit to generate a quantum entangled state through the quantum channel to establish a quantum entangled link.
[0060] The technical solution of this invention includes: first, acquiring the initial quantum circuit data to be processed, which covers the topology, gate operation parameters, and parallel distributed hardware constraints of the quantum circuit; then, calling a pre-trained large-scale cutting model to output a cutting scheme, which is obtained by constructing a training dataset labeled with von Neumann entropy loss, designing a double-loss function, and training an initial model based on the Transformer architecture; finally, verifying the effectiveness of the cutting scheme. If the actual von Neumann entropy loss value exceeds a preset threshold, the loss information is fed back to the large-scale cutting model for fine-tuning until a scheme that meets the requirements is output. This invention learns the quantum circuit structure and the von Neumann entropy loss law through a large model, achieving automated low-loss cutting of circuits. It has strong generalization ability and can adapt to diverse hardware environments, providing technical support for the large-scale deployment of parallel distributed quantum computing. Compared with existing technologies, this invention has the following advantages: First, it achieves precise quantization of cutting loss. By jointly applying von Neumann entropy and quantum relative entropy, it solves the problem of relying on experience to judge information loss in traditional methods, ensuring the information fidelity of the quantum state after cutting. Second, it improves the adaptability of cutting schemes to hardware. The collaborative processing of quantum circuit features and classical hardware features under the classical Transformer architecture, combined with the dynamic reward feedback of Group Relative Policy Optimization (GRPO) reinforcement learning fine-tuning, enables large models to learn quantum circuit rules and hardware constraints simultaneously, avoiding the problem of repeated adjustments in traditional schemes. Third, it significantly improves the efficiency of cutting scheme generation. Large models can directly output better schemes through autoregressive inference without iterative search. When dealing with circuits of 10-12 qubit scale, the scheme generation time is significantly reduced compared to the iterative methods of traditional methods. Fourth, it has good generalization ability. The training dataset covers a variety of quantum gate types and hardware parameters, and the model can be adapted to different quantum computing tasks (such as Variational Quantum). This invention combines Eigensolver (VQE), Quantum Approximate Optimization Algorithm (QAOA), Quantum Fourier Transform (QFT), and distributed hardware with different architectures. In summary, this invention provides an efficient, accurate, and adaptable solution for quantum circuit cutting in distributed quantum computing by combining a quantization model with a large-scale "classical Transformer + GRPO reinforcement learning" model, thus promoting the development of quantum computing from small-scale experiments to large-scale practical applications. Attached Figure Description
[0061] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0062] Figure 1 This is a flowchart of the present invention. Detailed Implementation
[0063] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0064] like Figure 1 As shown, a distributed quantum circuit intelligent cutting method based on a large model is proposed. This method constructs a cutting loss quantization model by combining classical von Neumann entropy with quantum information theory, generating high-quality training data containing optimal cutting schemes. Then, based on the classical Transformer architecture, the large model learns the cutting rules and hardware adaptation logic, ultimately achieving the direct generation of optimally cut quantum circuits corresponding to new quantum computing tasks. This significantly improves the resource utilization and execution efficiency of distributed quantum computing. The entire process of this invention is completed in a traditional computer simulation environment. Its core lies in generating labeled cutting schemes using classical algorithms to construct training data, then fine-tuning the large model to master the circuit cutting rules, ultimately achieving efficient cutting and parallel distributed simulation of actual quantum circuits. The core logic and execution flow of each step can be intuitively understood through the accompanying drawings. This invention includes the following steps:
[0065] S1. Determine the target quantum computing task and obtain the initial quantum circuit corresponding to the target quantum computing task. The initial quantum circuit contains a set of quantum gates required to realize the target quantum computing task. The quantum gates include single-qubit gates (such as the Hadamard gate, Y-axis rotation gate, RY gate), two-qubit entanglement gates (such as the SWAP gate, imaginary SWAP gate, square root SWAP gate, controlled-Z gate, CZ gate), multi-qubit gates (such as the controlled-NOT gate, CNOT gate), and three-qubit Toffoli gate (CCX gate).
[0066] Specifically, this application first obtains the initial quantum circuitry required to achieve the target quantum computing task, which consists of a sequence of quantum gates. This indicates that m is the total number of quantum gates. This represents the i-th quantum gate, encompassing single-qubit rotation gates, two-qubit entanglement gates, and multi-qubit gates, among others. These quantum gates collectively construct the quantum evolution process required for the task. It exists in the form of a graph relating to the qubits, and the initial state of the qubit is selected. n is the total number of qubits. This represents the tensor product operation. This represents the initial quantum state, which is chosen because it is simple to prepare and meets the default initial conditions of most quantum hardware. Simultaneously, the initial quantum circuit must satisfy the fidelity constraints of the target task.
[0067]
[0068] in, To ensure fidelity, To preset the fidelity threshold, preset the fidelity threshold. It is usually not lower than 0.99, but can be adjusted according to task requirements; , It is the Dirac notation, represented as a right vector (ket), the column vector form of a quantum state. This represents the ideal output state required for the task. The purpose of this fidelity constraint is to ensure that the initial quantum circuit itself has sufficient computational accuracy to lay a reliable foundation for subsequent cutting operations.
[0069] S2. A cutting loss estimation model is constructed based on the classical von Neumann entropy. This model is then used to simulate multiple cutting schemes for the initial quantum circuit, generating multiple candidate cutting quantum circuits. The cutting loss estimation model determines the cutting loss by calculating the difference in von Neumann entropy between the quantum states before and after the cutting.
[0070] To accurately quantify the information loss caused by the separation of factor circuits during the cutting process, this application constructs a cutting loss estimation model based on the classical von Neumann entropy. Its core technical details are gradually revealed through a combination of formulas and textual descriptions: First, the quantum state density matrix corresponding to the initial quantum circuit... The initial state of the qubit is obtained by gate-by-gate evolution through quantum simulation, and the expression is:
[0071]
[0072] in, For quantum gates The corresponding unitary matrix, unitary matrix The conjugate transpose of . Represents the initial quantum state The conjugate transpose of . This is the Dirac notation, representing the left vector (bra), which is the conjugate transpose of the right vector. Due to the unitarity of the quantum gate, it acts successively on the initial pure state (i.e., the initial quantum state). It can accurately reproduce the quantum state evolution of the circuit, and finally obtain the quantum state density matrix. This contains complete information about the quantum state of the initial quantum circuit, providing a data foundation for subsequent entropy calculations. Secondly, the degree of disorder in the initial quantum state is quantified using von Neumann entropy, calculated as follows:
[0073]
[0074] in, Represents von Neumann entropy. The trace operation represents the operation on a matrix, used to sum the diagonal elements of a density matrix. It is a base-2 logarithm, ensuring that the unit of entropy is bits, which conforms to the commonly used unit in information theory. When the initial quantum circuit is divided into k sub-circuits, the subsets of qubits of each sub-circuit do not overlap, and their corresponding density matrices are as follows: Each density matrix The overall quantum state is obtained by evolving the allocated bit subset from the gate sequence of the corresponding sub-circuit. The direct product states of each sub-circuit:
[0075]
[0076] Since the sub-line bits are non-overlapping, each subsystem is independent, and the entropy of the direct product state satisfies the additivity:
[0077]
[0078] This property significantly simplifies the calculation of the total entropy after slicing. Furthermore, the slicing loss L is defined as the difference between the von Neumann entropy of the quantum state before and after slicing, including but not limited to the absolute difference, i.e.:
[0079]
[0080] in, This represents the quantum state density matrix of the initial quantum circuit before cutting. This represents the direct product of the quantum state density matrices of each sub-circuit after slicing, or other representations that conform to the quantum state combination rules. A smaller value for the slicing loss L indicates less information loss during the slicing process; ensuring that the quantum states after slicing satisfy the slicing loss... The specific value needs to be set in conjunction with the hardware error tolerance range.
[0081] The method for simulating multiple cutting schemes of the initial quantum circuit using a cutting loss estimation model is as follows:
[0082] S2.1. Determining candidate cutting points based on the correlation effect of quantum gates on qubits, wherein the quantum gates include single-qubit rotation gates, two-qubit entanglement gates, and multi-qubit gates, and the specific steps for determining the candidate cutting points are as follows: Based on the quantum gate positions and qubit combinations corresponding to the correlation effect, multiple different combinations of cutting positions are generated. Specifically, to accurately screen candidate cutting points that meet hardware constraints and low-loss requirements, an undirected weighted graph corresponding to the sample quantum circuit is first constructed. , where the vertex set , The corresponding sample quantum circuit contains a single qubit, where n is the total number of qubits in the target quantum circuit, and its specific value is determined by the circuit structure corresponding to the quantum computing task to be solved; edge set. , Let edge weights be the set of edge weights. ,in, For operation of qubit gates and The total number of cross-qubit gates is used to quantize the degree of correlation between qubits. Next, a multi-level k-way graph partitioning algorithm is used to partition the undirected weighted graph G. The partitioning process must satisfy the constraints of parallel distributed simulation, namely the number of simulation computing nodes M and the maximum number of qubits supported by a single simulation computing node. The sum of edge weights across partitions is minimized through iterative optimization. ,in , These represent two distinct partitions after partitioning the undirected weighted graph, with each partition corresponding to a subset of qubits in subsequent sub-circuits. This reduces the need for quantum state data interaction between subsequent sub-circuits and ensures that each partition... (The subset of qubits corresponding to the sub-circuit) satisfies And the number of partitions Finally, combining the quantum gate dependency matrix D and the qubit entanglement strength matrix E, further screening is performed from the partition boundaries (i.e., the quantum gate positions corresponding to the cross-partition edges): if adjacent quantum gates... and Quantum gate dependency coefficients (Weakly dependent, no co-operating qubits), and the entanglement strength of the corresponding qubit pairs. ( If a preset entanglement threshold is set, then this position is determined as a candidate cutting point. Based on this, a quantum gate dependency matrix is constructed. (m is the total number of quantum gates), focusing only on adjacent quantum gates. If the two do not interact, the qubit (Weak dependency), this position is a candidate cutting point; simultaneously, construct the entanglement strength matrix E of the qubits, for those satisfying ( Highly entangled bit pairs (with a preset threshold) are used to restrict the cutting behavior within their respective quantum gate intervals; finally, based on the total number of distributed processing units K, the range of the number of sub-circuits k is set ( For each k, randomly select from the candidate points. A set of non-overlapping cutting positions is formed, while invalid combinations that exceed the upper limit of the processing unit are filtered out. This process is repeated to generate multiple different cutting position combinations to meet the needs of subsequent simulations.
[0083] Based on the above-mentioned cutting loss estimation model, multiple cutting schemes were simulated for the initial quantum circuit. The simulation process quantifies key technical details through formulas and explains its engineering logic in words: First, to determine reasonable cutting positions, a quantum gate dependency matrix is defined:
[0084]
[0085] The rules for its element values are as follows:
[0086]
[0087] in, Representing quantum gates The set of qubits that are active, when the elements When the entanglement is strong, it indicates that the i-th and i+1-th quantum gates have no co-operating bits (weak dependency). Such positions are preferred as candidate positions for splitting because splitting strongly dependent gates requires remote operation to achieve coordination, which increases EPR consumption and operation latency. On the other hand, splitting weakly dependent gates results in fewer gate dependency conflicts within the sub-circuits, facilitating parallel execution. Secondly, to optimize the grouping logic of quantum bits, a quantum bit entanglement strength matrix is constructed, where any two quantum bits... Entanglement strength:
[0088]
[0089] in, The von Neumann entanglement entropy of a two-bit subsystem. For qubits The reduced density matrix, , They represent qubits respectively. and The joint quantum state and representation of the two-qubit composite subsystem constituted by the qubit The partial trace operation.
[0090] Entanglement strength matrix The middle satisfies: The qubit pairs are preferentially allocated to the same sub-line because splitting high-entanglement-strength qubits into different sub-lines requires frequent remote entanglement operations to maintain quantum correlation, significantly increasing hardware resource consumption. High-entanglement qubits within the same sub-line can achieve coordination through local operations, reducing resource requirements. A preset entanglement strength threshold is used. The value can be set according to the hardware resource consumption requirements.
[0091] S2.2. For each combination of cutting positions, decompose the initial quantum circuit into at least two sub-circuits, and calculate the density matrix of the quantum states corresponding to each sub-circuit. k is the number of sub-circuits, and the cut quantum states are constructed according to the quantum state combination rules. The combination rules include tensor product and other legal forms that conform to quantum state superposition or direct product;
[0092] S2.3. Solve the von Neumann entropy of the initial quantum circuit quantum state based on the von Neumann entropy calculation formula. and the von Neumann entropy of the quantum state after cutting Substituting these values into the cutting loss characterization formula yields the cutting loss value for this set of cutting schemes;
[0093] S2.4. Repeat steps S2.1-S2.3 to generate multiple sets of candidate quantum circuits containing cutting positions, sub-circuit divisions, and corresponding cutting loss values. The number of candidate circuits is adapted to the sample size requirements of subsequent model training.
[0094] S3. Select a set of target quantum circuits that meet the preset better conditions from the multiple sets of candidate quantum circuits, and divide the set of target quantum circuits into a training set and a test set according to a preset ratio.
[0095] Among them, the preset preferred conditions include cutting loss. A preset loss threshold is set, and the resource requirements of each sub-line are adapted to the resource constraints of the processing units in the distributed quantum computing architecture. The resource requirements include the number of qubits occupied (the set of qubits of the i-th sub-line). The number of elements), the number of quantum gates, etc. Specifically, resource constraints include: 1. Quantum bit number constraint: setting the number of qubits in the i-th sub-circuit. ,in 1. Quantum bit capacity of a single processing unit (hardware physical design parameter): Ensure that the number of bits in the sub-circuit does not exceed the hardware capacity limit; 2. Quantum gate number constraint: Set the number of quantum gates for the i-th sub-circuit. ,in The maximum number of quantum gates a single processing unit can handle (determined by hardware computing resources and coherence time limits) is set to avoid excessive gate counts leading to execution timeouts or quantum state distortion. 3. Execution time constraint: Set the execution time of the i-th sub-circuit. ,in, The average execution time (hardware performance parameter) of quantum gate g. To ensure the maximum allowed execution time for each processing unit (set in conjunction with the total task time limit and parallel scheduling requirements), the execution of each sub-line is guaranteed to be completed synchronously; 4. Constraint adjustment logic: If the task fidelity threshold is ≥0.995 (high precision requirement), the constraint can be tightened. Reserve hardware redundancy; if efficiency is the priority for the task, constraints can be relaxed within the hardware limits. ).
[0096] To ensure that the sub-circuit is compatible with hardware resources, calculate the resource requirements of the i-th sub-circuit: number of quantum gates. , The set of quantum gates and the number of qubits contained in the sub-circuit The set of qubits contained in the sub-circuit, execution time , The average execution time of quantum gate g is determined by the performance parameters of the specific hardware. This represents the set of quantum gate subsets contained in the i-th sub-circuit. This represents the subset of qubits contained in the i-th sub-circuit. This represents the total number of qubits in the initial complete quantum circuit.
[0097] To ensure quantum state fidelity, improve parallel execution efficiency, and adapt to hardware physical limitations, the preset optimal conditions should also include:
[0098] The depth of each sub-circuit is less than or equal to the maximum supported circuit depth of the corresponding processing unit to ensure quantum state fidelity, improve parallel execution efficiency, and adapt to hardware physical limitations. The circuit depth is the maximum number of quantum gates cascaded on a single quantum bit in the quantum circuit (i.e., the maximum number of serial layers of quantum gates), calculated using the following formula:
[0099]
[0100] in, q represents the number of quantum gates on the q-th qubit, and n represents the total number of qubits in the quantum circuit.
[0101] The number of new remote quantum operations required after the split is less than or equal to a preset operation threshold, in order to reduce hardware resource consumption, reduce communication latency, and improve system stability. The remote quantum operations include, but are not limited to, EPR pair generation, quantum teleportation, and other cross-unit quantum state interaction operations.
[0102] The quantum gate ratio of each sub-circuit is adapted to the quantum gate execution efficiency of the corresponding processing unit to maximize hardware execution efficiency, avoid hardware performance bottlenecks, and reduce operational errors. The quantum gate ratio includes the ratio of the number of single-qubit quantum gates to multi-qubit quantum gates or the ratio of operation time.
[0103] Finally, to construct the dataset required for training the large model, the target cut line set D1 that satisfies the above constraints is divided according to a preset ratio. ( The value typically ranges from 0.6 to 0.8 (the specific value can be adjusted depending on the size of the dataset) and is used to divide the dataset into training sets. With test set Each data point In this context, the input feature X is a concatenated vector of quantum circuit features and classical hardware features, specifically covering the circuit topology. Door operation parameters and parallel distributed simulation constraints It also includes the original core features. Where K is the total number of distributed processing units. R represents the qubit capacity of a single processing unit, and R represents the EPR pair transmission rate of the quantum channel between processing units; output tag Specifically, this includes the cutting point location C and the sub-line division. Sub-line-processing unit mapping M (i.e. In order to improve the model's generalization ability, the dataset needs to meet the diversity requirements: it should cover deep lines (such as QAOA lines, depth according to...). The dataset includes 10-50 layers, sparse circuits (such as VQE circuits, where the gate operation density is the ratio of the number of operations across qubit gates in the circuit to the theoretical maximum number of operations across qubit gates, which can be adjusted as needed), and multi-type quantum gate combination circuits (including H, CZ, RY, and CNOT gates). A stratified sampling strategy is used in the partitioning process to ensure that the sample proportions of different circuit types and hardware constraints are consistent between the training and testing sets, avoiding the impact of data distribution deviations on model training performance and testing accuracy. The construction of this dataset provides high-quality supervision signals for large models to learn the segmentation rules and hardware adaptation logic.
[0104] S4. Construct a pre-defined large model, using the input features of the target quantum circuit cutting in the training set as input and the corresponding cutting scheme as output, to train the pre-defined large model; use the test set to verify the generation accuracy of the trained large model, and obtain the target large model.
[0105] The input features include, but are not limited to, the number of qubits in the quantum circuit, the type of quantum gate, and the topology (specifically: 1. Quantum gate dependency: the intersection of the action bits of adjacent gates in the quantum gate sequence (corresponding to the quantum gate dependency matrix in S2.1)). (Core information); 2. Quantum bit entanglement topology: Quantum bit entanglement strength matrix based on S2.1 1. Characterizing the distribution of entanglement tightness of different qubit pairs; 2. Quantum gate action topology: the scope and connection mode of single-qubit gates, two-qubit gates, and multi-qubit gates on the qubit set; 3. Circuit hierarchy structure: the serial / parallel hierarchy relationship formed by quantum gates according to the execution time order) and quantum gate parameters. The cutting scheme includes, but is not limited to, the sub-circuit partitioning method (specifically including: 1. Definition of cutting point position: clearly defining the specific position of the split in the initial quantum gate sequence, identified by the quantum gate index; 2. Qubit subset allocation: the qubit set of the initial circuit is divided into sub-circuit partitions). Non-overlapping partitioning of k subsets Each subset corresponds to a sub-circuit; Quantum gate subset allocation: the initial quantum gate set Based on the relationship between the cut point position and the bit subset, it is split into k subsets. Only applies to the corresponding ), the mapping relationship M between sub-circuits and processing units, and the generation rules of the segmentation scheme sequence (specifically including: generation timing rules: according to "sub-circuit number k → qubit subset"). →Quantum gate subsets → The processing unit mapping M is generated step by step in sequence to ensure that the result of each step is adapted to the preceding constraints; Validity verification rules: The validity verification layer built into the decoder is called in real time during the generation process (formula). If the constraints are not met, the current generation step is backtracked and adjusted; Hardware adaptation rules: Generation and When referencing the adjacency matrix A of the processing unit coupling graph and the quantum channel transmission rate R in classical hardware characteristics, priority is given to assigning highly entangled bit pairs and strongly dependent quantum gates to the same sub-circuit; sequence termination rule: when all sub-circuits... No overlap The sequence generation terminates when all initial quantum gates are covered and mapping M covers all sub-circuits.
[0106] To enable large-scale models to efficiently learn the intrinsic rules of quantum circuit cutting and their adaptation logic to distributed hardware, a large-scale model based on the classic Transformer architecture is constructed. Through the collaborative input processing of quantum circuit features and classic hardware features, accurate learning of the cutting rules is achieved. The architectural details are gradually explained through a fusion of formulas and text: This architecture follows the classic Transformer "encoder-decoder" structure, meaning the large-scale model is pre-defined as an encoder-decoder model based on the classic Transformer architecture. The encoder is responsible for jointly extracting and associating the concatenated vector X of the input quantum circuit features and classic hardware features, used to extract and integrate these features to output a unified feature representation. The decoder is responsible for generating a cutting scheme that meets the constraints based on this feature representation. In the encoder part, the mixed input features are first split and preprocessed: for quantum circuit features (including n, G, and E), the quantum gates are first... For embedding, the expression is:
[0107]
[0108] in, To preset the embedding dimension, it is necessary to balance information preservation and model redundancy control; the value is typically in the range of 32-128. For quantum gates Corresponding unitary matrix eigenvectors, The eigenvector matrix, For vectorization operations, This is represented as a vector concatenation operation. The eigenvalue vector and eigenvector matrix are chosen as the embedding basis because the quantum operational properties of a unitary matrix are uniquely determined by its spectral information. Simultaneously, to capture the temporal information of the quantum gate sequence, rotational position encoding is used to encode the t-th position in the quantum gate sequence G. The expression for this encoding is:
[0109]
[0110] in, , The preset model dimension is used, and the specific dimension value needs to match the subsequent feature processing dimension. It is usually taken as an integer multiple of the preset embedding dimension. This encoding method can effectively distinguish quantum gates at different positions and avoid the model from confusing the execution order of the gates.
[0111] For classic hardware features (including K) R, A (where A is the adjacency matrix of the coupled graph of the processing unit) are converted into a unified dimension feature vector through vectorization and one-hot encoding, i.e.:
[0112]
[0113] in, For one-hot encoding operations, A is obtained by parsing the hardware topology parameters of the distributed processing units, used to characterize the connection relationships between processing units. This ensures dimensionality matching with the processed quantum circuit features; subsequently, the preprocessed quantum circuit features (i.e., + Features of classical hardware feature quantization Concatenate into a unified input vector Input the multi-head attention layer of the encoder in the classic Transformer architecture; the encoder is configured with a preset number of general attention heads (this number needs to be set according to the requirements of multi-feature association capture, and is usually in the range of 4-8), and the query / key / value matrices are as follows:
[0114]
[0115] in, For a learnable projection matrix, The feature dimension of a single attention head is typically 1. The ratio to the number of attention heads. The output of a single attention head is:
[0116]
[0117] Among them, divided by To avoid gradient vanishing, the outputs of the multi-attention head are integrated with a linear transformation through concatenation, i.e.:
[0118]
[0119] Where h is the total number of attention heads. To integrate the matrix, this design allows the model to simultaneously capture multi-dimensional correlations between quantum gates and bits, gate-to-gate relationships, and quantum features and hardware features. In the decoder section, a classic autoregressive decoding structure is employed, with the input being the feature vector output from the encoder. (The multi-attention head output of the encoder is obtained after processing by a feed-forward network (FFN). The feed-forward network consists of two linear transformation layers and an intermediate ReLU activation function, expressed as follows:) ,in It is a linear transformation matrix. As a bias term, the final output is a unified feature representation feature vector with the same dimension as the multi-attention head output. To prevent the model from utilizing future sequence information, a causal mask matrix is introduced: Where T is the length of the output sequence and satisfies When j > I, add the causal mask matrix to the attention score matrix of the decoder's self-attention layer, i.e. This ensures that when calculating the output at position t of the output sequence, the position j > i in the attention score matrix is assigned a value. After softmax, the weights approach 0, thus preventing the model from focusing on the positional information of subsequent ungenerated sequences.
[0120] Meanwhile, the decoder integrates a validity verification layer, using the formula: The validity of a sub-circuit is determined. If it does not meet the requirements, a backtracking adjustment is triggered, and the bit AND gate set of that sub-circuit is regenerated to ensure the feasibility of the output scheme. The maximum number of quantum gates that a single processing unit can handle. This represents the maximum qubit capacity of a single processing unit (such as a QPU). This represents the total number of qubits contained in the i1th sub-circuit. This represents the total number of quantum gates contained in the i1th sub-circuit. This is an indicator function; it is 1 if the condition is met, and 0 otherwise.
[0121] Construct a training loss function, which is a weighted combination of multi-dimensional loss terms, including but not limited to:
[0122] Loss Item 1: The deviation loss between the cutting loss corresponding to the cutting scheme calculated by the model based on the cutting loss formula in step S2 and the actual cutting loss. The deviation loss can take the form of mean square error, absolute error, Huber loss, etc.; to realize the precise quantization logic of the cutting loss that forces the model to learn, reduce the deviation between the predicted loss and the actual loss, and ensure the information fidelity of the quantum state after cutting.
[0123] Loss Item 2: Structural difference loss between the sub-line topology output by the large model and the actual sub-line topology. The structural difference loss can take the form of edit distance, Hamming distance, topology similarity deviation, etc.; Implementation: Guide the model to generate sub-line partitions that are consistent with the optimal topology structure, and avoid hardware compatibility degradation or remote operation redundancy caused by unreasonable topology.
[0124] Loss Item 3: Autoregressive loss of the cutting scheme sequence, used to optimize the generation coherence of the cutting scheme sequence, including but not limited to cross-entropy loss and KL divergence loss based on sequence generation probability, to improve the smoothness and logic of cutting scheme generation, ensure that the generation order of sub-line number, bit allocation, gate allocation, and processing unit mapping conforms to the engineering execution logic, and reduce invalid backtracking.
[0125] The weight coefficients of the weighted combination can be dynamically adjusted according to the training objective, satisfying the requirement that the weight sum is a preset fixed value or adaptively optimized, thereby flexibly balancing the three major training objectives of loss accuracy, topological rationality, and generation coherence. For example, high-precision tasks can increase the weight of loss item one, while hardware adaptation priority tasks can increase the weight of loss item two.
[0126] Gradient descent optimization algorithms, including but not limited to Adam, SGD, and RMSprop, are used. The input feature-output segmentation scheme pairs in the training set are used as training samples to iteratively update the parameters of the preset large model until the value of the training loss function converges to the preset convergence threshold or reaches the preset number of iterations.
[0127] The iterative update of the parameters of the pre-defined large model also includes a preprocessing step for the training samples:
[0128] The numerical input features of the target quantum circuit segmentation in the training set are normalized or standardized, mapping these features to a preset interval for the model input. This preset interval can be dynamically set based on the feature type or a general standardized interval can be used. Specifically, Z-score standardization is employed, with the formula: Where x is the original numerical feature, To obtain the mean of this feature in the training set, The standard deviation of this feature in the training set; if the feature distribution is non-normal, use Min-Max normalization, the formula is: ,in To find the minimum value of this feature in the training set, The maximum value is mapped to a uniform interval of [0,1]. Non-numerical input features of the target quantum circuits in the training set are encoded, including but not limited to one-hot encoding and embedded vector encoding, to transform them into vector forms recognizable by the model. Samples in the training set whose cutting loss exceeds a preset anomaly threshold are removed, or abnormal samples are processed using data smoothing, outlier correction, etc., to avoid interference from abnormal samples on model training. The anomaly threshold can be determined based on the statistical distribution of sample loss. The average cutting loss and average sub-circuit fitness of the model output cutting scheme are calculated using the test set. The average sub-circuit fitness includes the matching rate between the sub-circuit and processing unit resources, the remote operation optimization rate, etc. If the average cutting loss ≤ the test loss threshold and the average sub-circuit fitness ≥ the fitness threshold, then the trained model is determined to be the target large model.
[0129] The technical details of the large-scale model training process are presented in a coordinated manner using formulas and text to ensure rigor and reproducibility. It should be noted that the autoregressive sequence generation method is only used for the final output of the segmentation scheme and is not the core training method of this application. This application actually employs a joint training strategy of gradient descent pre-training followed by GRPO reinforcement learning fine-tuning to train the model. This strategy optimizes the model through an iterative loop of "policy generation - reward feedback - policy update," making the generated segmentation scheme more closely match the actual hardware constraints and segmentation loss requirements. First, policy initialization and action space definition are performed, using a pre-defined large-scale model based on the classic Transformer architecture as the initial policy network. ( The model parameters include those of the encoder's attention layer and the decoder's generation layer. The policy input consists of quantum circuit-hardware hybrid features. The output is the probability distribution of the cutting scheme. Simultaneously, the cutting scheme is generated and decomposed into discrete action sequences: First, the number of sub-lines k (action space) is selected. (This refers to the maximum number of hardware processing units); secondly, allocating a set of qubits to each sub-circuit. (The action space is a legal combination of subsets of qubits); then, a set of quantum gates is assigned to each sub-circuit. (The action space is a legal combination of quantum gate subsets); finally, a mapping M between sub-circuits and processing units is established (the action space is a legal mapping of processing unit indices). Next, a multi-dimensional weighted reward function is designed. The guiding strategy generates a "low-loss, highly adaptable" cutting scheme, using the following formula:
[0130]
[0131] in, For the preset weighting coefficients, satisfy The specific value can be adjusted according to the priority of task impact on loss, adaptability, and execution time. The weighting is higher to prioritize loss and adaptability. The cutting loss is calculated as follows: ,in, Let X represent the von Neumann entropy of the initial intact quantum circuit (denoted as X) before cutting. For sub-line resource adaptation rate, This represents the maximum execution time of the sub-line. This represents the maximum execution time allowed by the hardware. This represents the execution time of the i-th sub-line obtained based on the cutting scheme Y and the original line X.
[0132] Next, the reinforcement learning strategy is updated, starting with the training set. Sample batch data B represents the batch size, which needs to be set in conjunction with the hardware's computing power; calculate the dominance function for each sample:
[0133]
[0134] in, Let b represent the actual reward value of the b-th sample, where b = 1 - B. As the baseline reward for the value network prediction, the value network adopts an MLP structure with a preset number of layers, minimizing the mean squared error. optimization.
[0135] Redefining the strategy ratio:
[0136]
[0137] in, To update the old strategy parameters, Indicates the current policy network (parameter is) conditional probability, These represent the old policy network (with parameters as follows). The conditional probability of ) is used to introduce the clipping threshold. The value typically ranges from 0.1 to 0.3, resulting in the policy loss function:
[0138]
[0139] in, , They are respectively , abbreviation, This represents the clipping function, used to prevent excessively large policy updates from causing training instability.
[0140] Finally, the AdamW optimizer is used to simultaneously update the policy network and the value network. The parameter update formulas are as follows:
[0141]
[0142]
[0143] in, To preset the learning rate, Usually less than To ensure the stability of strategy updates, the specific value needs to be adjusted according to the model's convergence speed; This is the weight decay coefficient, used to prevent overfitting, and is typically set to a value of [value missing]. To adapt to hardware memory constraints, a gradient accumulation strategy can be adopted: set the accumulation step count s (determined in conjunction with hardware memory capacity), and the effective batch size. (B is the size of a single micro-batch). Specifically: after loading B samples each time, the gradient is calculated and accumulated to the cache. After accumulating s times, the total gradient is used to perform a parameter update. Simulates the effects of large-scale batch training, balancing hardware compatibility and training stability. Among these, , , , , , Let represent the policy loss function at time t with respect to the policy network parameters. The gradient, the parameter set of the policy network at time t, the new parameter set of the policy network at time t+1 after the parameter update at time t, the parameter set of the value network at time t, the new parameter set of the value network at time t+1 after the parameter update at time t, and the value loss function at time t with respect to the value network parameters. The gradient is then calculated. Finally, the three-dimensional convergence criterion is set: the average reward of the training set batch is:
[0144]
[0145] Variation over a series of preset rounds (usually 5-15 rounds) (usually) ).in, This represents the average batch reward of the training set in rounds t-Δt.
[0146] Test set splitting loss error rate:
[0147]
[0148] This represents the cut loss predicted by the model. This represents the actual cutting loss corresponding to cutting scheme Y. Set a preset error rate threshold (based on the hardware error tolerance range, usually 1%-5%).
[0149] Test the compatibility of the sub-line resources:
[0150]
[0151] in A preset adaptation rate threshold is set (to balance resource utilization and feasibility, typically 95%-99%).
[0152] When all three conditions are met simultaneously, a large target model that can be used for reasoning is obtained. .
[0153] S5. For a new quantum computing task to be processed, obtain the corresponding quantum circuit to be cut, input the input features of the quantum circuit to be cut into the target large model, and the target large model directly outputs the better cutting scheme and the corresponding cut quantum circuit. The sequence length of the cutting scheme is adapted to the model generation capability and the distributed architecture requirements.
[0154] Specifically: the sequence length of the cutting scheme The formula is: "Number of sub-circuits k + Number of qubits in each sub-circuit" +Number of quantum gates in each sub-circuit It consists of four parts: "+processing unit mapping relationship length", and the formula is as follows: Where 1 corresponds to the encoding length of the number of sub-lines k. The total length of the bit AND gate encoding for all sub-circuits. This represents the set of qubits in the i1-th sub-circuit of the new task to be processed. This represents the set of quantum gates for the i1-th sub-circuit in the new task to be processed. The encoding length is used to handle unit mapping relationships. Adaptation rule: 1. The sequence length must not exceed the maximum generation length of the target large model. (Determined by the number of decoder layers and hidden layer dimensions in the Transformer architecture, typically preset to 1024 or 2048); 2. If Then, the superscale sub-circuit is split in descending order of the number of quantum gates in the sub-circuit until the condition is met. 3. The sequence length needs to be adapted to the total number of processing units in the distributed architecture. ,make sure (The number of sub-lines does not exceed the upper limit of the hardware processing unit), and the encoding length of a single sub-line is... , The maximum encoding length supported by a single processing unit is set by hardware storage resources.
[0155] When tackling a new quantum computing task to be divided, a combination of formulas and textual explanations ensures operability: First, extract the input features of the circuit to be divided, namely the quantum circuit features and the classical hardware features. The quantum circuit features include the number of qubits in the circuit to be divided. Its quantum gate sequence and entanglement strength ,in This represents the joint quantum state of the two-qubit composite subsystem consisting of the a-th qubit and the b-th qubit in the new circuit to be cut. Classical hardware characteristics include the parameters of current distributed hardware. and the current hardware's coupling graph adjacency matrix The vectors are then concatenated into a unified input vector according to the preprocessing methods used in the training phase. Secondly, the input vector Input target large model It directly outputs a better cutting scheme through classic Transformer autoregressive inference. Including the cut sub-circuit Bit set Mapping relationship Here, 'u' represents the processing unit index, and the segmented sub-circuits need to be converted into a standardized quantum circuit format executable by the distributed processing unit (such as the OpenQASM series format, with the specific version depending on the target hardware support). This format includes qubit initialization instructions, quantum gate execution instructions (including gate parameters), and measurement instructions. This format ensures that quantum hardware from different manufacturers can execute the commands. Finally, distributed execution and result integration are performed: processing unit 'u' executes the sub-circuit it is mapped to. Remote operations between processing units are implemented based on the EPR quantum teleportation protocol, the protocol expression of which is:
[0156]
[0157] in, For the quantum state to be transmitted, In EPR state, , It is the quantum state to be transmitted In the calculation base ( The complex expansion coefficients, CNOT, and H gates are used to construct entanglement, and measurements are used to transmit classical information to complete quantum state reconstruction. The fidelity of the quantum state is monitored in real time during the execution process.
[0158]
[0159] in, This refers to fidelity calculation. , These refer to the density matrix corresponding to the actual quantum state received by the target processing unit after cross-processing unit transmission and the density matrix corresponding to the ideal target quantum state that should theoretically be obtained during cross-processing unit quantum state transmission. If the fidelity is lower than the preset transmission fidelity threshold, the EPR pair regeneration process is triggered; after each processing unit completes the sub-line, the measurement results are... The data is aggregated through a classic communication network and sent to the control node, which then processes it according to the computational logic of the target task. The final output is obtained through integration. Specifically: After each processing unit finishes executing its assigned sub-line, it processes the data it carries. Projection measurements are performed on each qubit, resulting in a binary set of results (each qubit's measurement result is either 0 or 1). Then, according to task requirements (e.g., VQE calculates the ground state energy, QAOA optimizes the target value), the dispersed classical measurement results are integrated into a unified output (based on the defined logical rules of the target quantum computing task). This completes the overall computational objective of the distributed quantum circuit. Where n u This represents the number of qubits in the sub-circuit carried by the u-th processing unit (where u is the index of the processing unit), i.e., the total number of qubits allocated to processing unit u, as mentioned earlier regarding "qubit capacity of a single processing unit". "The definitions are consistent." This represents the set of qubit measurement results for each of the 1st to Kth processing units, where K is the total number of processing units in the distributed quantum computing architecture.
[0160] The cleaved quantum circuit output by the target large model is verified by calculating the actual cleaving loss using the cleaving loss estimation model in step S2. Verification can be performed using open-source quantum simulation tools (such as Qiskit, Cirq, TensorFlow Quantum). The OpenQASM code of the cleaved sub-circuit is imported to simulate the quantum state evolution process. The quantum state density matrix of the complete circuit before cleaving is obtained through the built-in density matrix calculation function of the tool. Product state density matrix of the cut sub-circuit Substitute the values into the von Neumann entropy formula to calculate the actual cutting loss. This enables the early screening of invalid cutting schemes, avoiding the failure of distributed computing tasks due to excessive losses. The verification results can be used as a supervision signal for incremental training of the model, continuously improving the cutting performance of the model under specific hardware environments or line types, reducing the trial and error costs of actual hardware execution, and reducing the coherence time consumption of qubits and the waste of hardware resources.
[0161] If the actual cutting loss Preset verification threshold ( Compared with the loss threshold in step S2 (Consistent, set according to the hardware error tolerance range), then the cut quantum circuit and the corresponding loss information (actual cutting loss) will be displayed. Feedback is fed back to the training set to perform incremental training on the target large model, updating the model parameters. The sample size and number of iterations in the incremental training are adapted to the loss optimization requirements. Specifically, the implementation is as follows: 1. Sample size setting: determined based on the deviation between the actual splitting loss and the preset validation threshold. (Slightly exceeding the limit), one incremental sample is generated for each exceeding the limit scheme; if (Moderate over-limit), generate incremental samples for 3 different sub-circuit split variants; if (Seriously exceeded the limit), generate 5 incremental samples to ensure the model fully learns error patterns; 2. Iteration count setting: the number of iterations for incremental training. The initial number of training iterations 20%-30% (initial training iterations are typically 100-300 rounds), and must meet the average splitting loss of 3 consecutive validation sets. Stop iteration when the number of iterations reaches a certain threshold; If the conditions are still not met, new candidate cutting scheme samples generated in step S2 need to be added based on the characteristics of the current over-limit cutting circuit (such as the number of qubits, gate topology, and hardware constraints) before training continues until convergence.
[0162] If the actual cutting loss is less than or equal to the preset verification threshold, then the quantum circuit after cutting is determined to be the final execution circuit, which can be directly used for distributed quantum computing tasks.
[0163] S6. Assign each sub-circuit in the cut quantum circuit to the corresponding processing unit in the distributed quantum computing architecture, control each processing unit to execute the sub-circuit, and realize quantum state transmission and cooperative operation between processing units through the quantum network to complete the new quantum computing task to be processed.
[0164] For qubits that need to be associated across processing units after being cut, a two-dimensional determination method of "quantum gate dependence + entanglement strength" is adopted. The specific steps are as follows: 1. Analyze the "qubit subset allocation" and "processing unit mapping table" fields in the cutting scheme output by the target large model, and the qubit set of each sub-line. Mapping relationship between sub-line and processing unit 2. Traversing the set of quantum gates of the original quantum circuit. Multi-qubit gates (such as CNOT gate, CZ gate, CCX gate) that act on two or more qubits are selected and denoted as... 3. For each multi-bit gate By reading the gate operation data of the original quantum circuit, which already records the bit index corresponding to each gate, the set of qubits that affect it can be obtained. 4. If The qubits in the memory are allocated to different processing units (i.e., there exist...) ,and If these qubits are identified as "qubits that need to be associated across processing units", then they are determined to be "qubits that need to be associated across processing units"; 5. Supplementary verification: Combine the qubit entanglement strength matrix constructed in S2.1 If the entanglement strength of cross-unit qubit pairs , To preset the entanglement threshold, consistent with step S2.1, a value typically between 0.6 and 0.8 is set. Subsequently, the corresponding processing unit is controlled to generate quantum entangled states through the quantum channel to establish a quantum entangled link. The quantum entangled states include, but are not limited to, EPR pairs and GHZ states.
[0165] Based on quantum teleportation protocols or other quantum state remote transmission protocols, and relying on the aforementioned quantum entanglement links, quantum states that need to be interacted across processing units in the sub-line are transmitted to the target processing unit. During the transmission process, measurement results are fed back through classical channels, including measurement basis selection and measurement value correction information, to ensure the accuracy of quantum state transmission.
[0166] During the execution of sub-circuits in each processing unit, the execution progress of each sub-circuit is synchronized through classical channels. This progress includes the number of execution steps and the quantum gate completion rate. Synchronization operations are triggered at steps requiring collaborative computation. These operations include execution timing calibration and state consistency verification to ensure the consistency of distributed computation. The steps for determining whether collaborative computation is required are as follows: Using the cross-processing unit associated qubits connected by the quantum entanglement link as the core, the cross-unit multi-qubit gate corresponding to this type of qubit is identified. The execution position of this multi-qubit gate in the gate sequence of each sub-circuit is tracked, and an execution step index is established. ( , (This refers to the total number of quantum gates in the corresponding sub-circuit), and the difference in the execution step index of different processing units carrying out the local operation of the multi-bit gate. ( When the execution progress is close, it is determined to be a step that requires collaborative calculation.
[0167] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for intelligent segmentation of distributed quantum circuits based on a large model, characterized in that, Includes the following steps: S1. Determine the target quantum computing task and obtain the initial quantum circuit corresponding to the target quantum computing task, wherein the initial quantum circuit contains the set of quantum gates required to realize the target quantum computing task; S2. Construct a cutting loss estimation model based on classical von Neumann entropy, and use the cutting loss estimation model to simulate multiple cutting schemes for the initial quantum circuit to generate multiple candidate cutting quantum circuits. S3. Select a set of target quantum circuits that meet the preset better conditions from multiple candidate quantum circuits, and divide the set of target quantum circuits into a training set and a test set according to a preset ratio; S4. Construct a pre-defined large model, using the input features of the target quantum circuit cutting in the training set as input and the corresponding cutting scheme as output, to train the pre-defined large model; The accuracy of the generated large model after training is verified using the test set, and the target large model is obtained. S5. Obtain the quantum circuit to be cut for the new quantum computing task to be processed, input the input features of the quantum circuit to be cut into the target large model, and the target large model directly outputs the cutting scheme and the quantum circuit after cutting. S6. Assign each sub-circuit in the cut quantum circuit to the corresponding processing unit in the distributed quantum computing architecture, control each processing unit to execute the sub-circuit, and realize quantum state transmission and cooperative operation between processing units through the quantum network.
2. The intelligent segmentation method for distributed quantum circuits based on a large model according to claim 1, characterized in that, The quantum gates include single-qubit gates, two-qubit entanglement gates (imaginary commutation gate, square root commutation gate, controlled Z gate), multi-qubit gates, and three-qubit Toveley gates. The initial quantum circuit uses a sequence of quantum gates. This indicates that m is the total number of quantum gates. Represent the i-th quantum gate; select the initial quantum state. n is the total number of qubits. This represents tensor product operations; the initial quantum circuitry satisfies the fidelity constraints of the target quantum computing task. ;in, To ensure fidelity, To preset the fidelity threshold, quantum state , The ideal output state required for the target quantum computing task. The output state is the result of the initial quantum state evolving through a quantum circuit. It is the Dirac symbol.
3. The intelligent segmentation method for distributed quantum circuits based on a large model according to claim 1 or 2, characterized in that, The cut loss estimation model based on classical von Neumann entropy includes: The quantum state density matrix corresponding to the initial quantum circuit The initial states of qubits are obtained by evolution gate by gate through quantum simulation; The degree of information disorder in the initial quantum state is quantized by von Neumann entropy as follows: ;in, Represents von Neumann entropy. Represents the trace operation of a matrix; When the initial quantum circuit is divided into k sub-circuits, the subsets of qubits in each sub-circuit do not overlap, and the corresponding density matrices are as follows: density matrix The overall quantum state is obtained by evolving the allocated bit subset from the gate sequence of the i1th sub-circuit and then cutting it. For all k sub-lines, the direct product state is given. The overall quantum state after cutting The von Neumann entropy satisfies additivity; The cutting loss is determined by the difference in von Neumann entropy of the quantum state before and after the cutting.
4. The intelligent segmentation method for distributed quantum circuits based on a large model according to claim 3, characterized in that, The method for generating multiple sets of candidate quantum circuit cuts is as follows: S2.
1. Based on the correlation effect of quantum gates on qubits, determine the candidate cutting points, and generate multiple different cutting position combinations based on the quantum gate positions and qubit combinations corresponding to the correlation effect; S2.
2. For each combination of cutting positions, decompose the initial quantum circuit into at least two sub-circuits, and calculate the density matrix of the quantum states corresponding to each sub-circuit. k is the number of sub-circuits, and the cut quantum states are constructed according to the quantum state combination rules. The combination rules include tensor product and other legal forms that conform to quantum state superposition or direct product; S2.
3. Solving the von Neumann entropy of the initial quantum state based on the von Neumann entropy. and the von Neumann entropy of the overall quantum state after cutting The cutting loss value of the cutting scheme is obtained; S2.
4. Repeat steps S2.1-S2.3 to generate multiple sets of candidate cut quantum circuits containing cut positions, sub-circuit divisions, and cut loss values.
5. The intelligent segmentation method for distributed quantum circuits based on a large model according to claim 4, characterized in that, The method for determining candidate cutting points is as follows: constructing an undirected weighted graph corresponding to the sample quantum circuit. ,in, Let be the set of vertices containing n qubits, where n is the total number of qubits in the target quantum circuit. Let be a set of edges, where each edge represents a cross-qubit gate acting on two qubits. Let G1 be the set of edge weights, where the edge weight is the total number of cross-qubit gates acting on two qubits. The undirected weighted graph G1 is partitioned using a multi-level k-way graph partitioning algorithm, and the partitioning must satisfy the parallel distributed simulation constraint. The quantum gate dependency matrix D and the qubit entanglement strength matrix E1 are combined to further screen cutting candidate points from the partition boundaries.
6. The intelligent segmentation method for distributed quantum circuits based on a large model according to claim 5, characterized in that, The quantum state density matrix: ;in, For the i-th quantum gate unitary matrix, unitary matrix The conjugate transpose of the matrix. It is the Dirac symbol; The overall quantum state after cutting ; The overall quantum state after cutting The von Neumann entropy satisfies: ; The cutting loss L is characterized by the difference in von Neumann entropy of the quantum state before and after the cutting, and the absolute difference is: ;in, This represents the quantum state density matrix of the initial quantum circuit before cutting. The overall quantum state after cutting; the overall quantum state after cutting Satisfy cutting loss This is the loss threshold; The constraints of the parallel distributed simulation include the number of simulation computing nodes M and the maximum number of qubits supported by a single simulation computing node. By iteratively optimizing and minimizing the sum of edge weights across partitions, the need for quantum state data interaction between subsequent sub-lines is reduced, ensuring that each partition... satisfy And the number of partitions ; If adjacent quantum gates and Quantum bits that satisfy the condition of no co-operation correspond to the quantum gate dependency coefficient. And corresponding qubits Entanglement strength The location was determined as a candidate cutting point. The preset entanglement threshold is used; The quantum gate dependency matrix m is the total number of quantum gates; only adjacent quantum gates are considered. If adjacent quantum gates The quantum gate dependency coefficient is calculated when there are no interacting qubits. The location is a candidate cutting point; Highly entangled bit pairs in the entanglement strength matrix that satisfy any two qubits having an entanglement strength greater than or equal to a preset threshold restrict the cutting behavior within the quantum gate interval; Based on the total number of distributed processing units K, the range of the number of sub-lines k is defined as follows: For each k, randomly select from the candidate cutting points. By using non-overlapping positions to form a set of cutting position combinations, invalid combinations that exceed the upper limit of the distributed processing unit are filtered out, thereby generating multiple different cutting position combinations.
7. The method for intelligent segmentation of distributed quantum circuits based on a large model according to any one of claims 4-6, characterized in that, The preset optimal conditions include cutting loss. A preset loss threshold is set, and the resource requirements of each sub-line are adapted to the resource constraints of the processing units in the distributed quantum computing architecture. The resource constraints Includes: Qubit number constraint: the number of qubits in the i1th sub-circuit is set to be less than or equal to the qubit capacity of a single processing unit. Quantum gate number constraint: The number of quantum gates in the i1th sub-circuit is set to be less than or equal to the maximum quantum gate capacity of a single processing unit. ; Execution time constraint: Set the execution time of the i1th sub-line to be less than or equal to the maximum execution time allowed by the processing unit; Constraint adjustment logic: If the task fidelity threshold is ≥0.995, the constraint can be tightened to reserve hardware redundancy; If the task prioritizes efficiency, the constraint can be relaxed within the hardware limits. The preset preferred conditions should also include: the depth of each sub-circuit is ≤ the maximum supported circuit depth of the corresponding processing unit; the circuit depth is the maximum number of quantum gates connected in series on a single quantum bit in the quantum circuit; The number of new remote quantum operations required after the cutting is less than or equal to a preset operation threshold. The remote quantum operations include, but are not limited to, EPR pair generation, quantum teleportation, and other cross-unit quantum state interaction operations. The quantum gate ratio of each sub-circuit is adapted to the quantum gate execution efficiency of the corresponding processing unit. The quantum gate ratio includes the ratio of the number of single-qubit quantum gates to the number of multi-qubit quantum gates or the ratio of operation time.
8. The intelligent segmentation method for distributed quantum circuits based on a large model according to claim 7, characterized in that, The target cutting line set D1 that meets the preset optimal condition constraints is divided according to the preset proportion. Divided into training set With test set Each data entry In this context, the input feature X is a concatenated vector of quantum circuit features and classical hardware features, encompassing circuit topology, gate operation parameters, and parallel distributed simulation constraints, while also including the original core features. Where K is the total number of distributed processing units. R represents the quantum bit capacity of a single processing unit, and R represents the quantum channel transmission rate; output tag This includes the placement of cutting points in the cutting scheme, sub-circuit division, sub-circuit-processing unit mapping, and multi-type quantum gate combination circuits; A stratified sampling strategy is adopted to ensure that the proportion of samples with different line types and hardware constraints is consistent between the training set and the test set; The pre-defined large model is a classic Transformer architecture, including an encoder and a decoder. The encoder is responsible for jointly extracting and associating the input features X to output a unified feature representation; the decoder is responsible for generating a constraint-compliant segmentation scheme based on the feature representation; the encoder performs splitting and preprocessing on the input features X: for quantum circuit features, for quantum gates... The eigenvalue vector and eigenvector matrix of the unitary matrix are vectorized and then concatenated to obtain the embedded vector; the t-th position in the quantum gate sequence G is encoded by rotation position encoding to obtain the quantum circuit features; For classical hardware features, the capacity of a single processing unit's qubits is vectorized. The adjacency matrix A of the processing unit coupling graph and the quantum channel transmission rate R are concatenated with the total number of distributed processing units K through one-hot encoding to obtain a unified dimension feature vector; the quantum circuit features are then concatenated with the unified dimension feature vector to form a unified input vector. The input is the multi-head attention layer of the encoder in the classic Transformer architecture. The outputs of the multi-head attention layers are combined through concatenation and linear transformation to obtain the multi-head attention output, which is then processed by a feedforward network to obtain the feature vector. The decoder employs a classic autoregressive decoding structure, with the input being a feature vector. The causal mask matrix is added to the attention score matrix of the decoder's self-attention layer. The decoder integrates a legality verification layer to determine the legality of the sub-line. If the legality is not satisfied, backtracking adjustment is triggered to regenerate the bit AND gate set of the sub-line. The training loss function of the preset large model is a weighted combination of multi-dimensional loss terms, including but not limited to: the deviation loss between the cut loss corresponding to the output cut scheme and the actual cut loss; the structural difference loss between the output sub-line topology and the actual sub-line topology; and the autoregressive loss of the cut scheme sequence, including but not limited to cross-entropy loss and KL divergence loss based on the sequence generation probability. The weight coefficients of the weighted combination are dynamically adjusted according to the training objective, so that the sum of the weights is either a preset fixed value or adaptively optimized. Gradient descent-type optimization algorithms are used, with input feature-output segmentation scheme pairs in the training set as training samples, to iteratively update the parameters of the preset large model until the value of the training loss function converges to the preset convergence threshold or reaches the preset number of iterations. The iterative update of the parameters of the preset large model also includes preprocessing the training samples: normalizing or standardizing the numerical input features of the target quantum circuits in the training set, mapping the numerical features to the preset range of the model input; encoding the non-numerical input features of the target quantum circuits in the training set, converting them into vector forms that the model can recognize; removing samples in the training set whose cutting loss exceeds the preset anomaly threshold, or processing anomaly samples by means of data smoothing and outlier correction; if the average cutting loss ≤ the test loss threshold and the average sub-circuit fitness ≥ the fitness threshold, then the trained model is determined to be the target large model.
9. The intelligent segmentation method for distributed quantum circuits based on a large model according to claim 8, characterized in that, The model training is achieved through a fine-tuning strategy using reinforcement learning. The pre-trained large model is optimized through an iterative loop of "policy generation - reward feedback - policy update": policy initialization and action space definition are performed, using a pre-trained large model with a classic Transformer architecture as the initial policy network. , The model parameters are used, and the policy input is a uniform input vector. The output is the probability distribution of the cutting scheme. The cutting scheme is generated by decomposing it into discrete action sequences: selecting the number of sub-circuits k, and allocating a set of qubits to each sub-circuit. Each sub-circuit is assigned a set of quantum gates. Establish a sub-line-processing unit mapping M; design a multi-dimensional weighted reward function. The guidance strategy generates a cutting scheme; Update reinforcement learning strategies: from the training set Sampling batches of data requires configuration based on hardware computing power; the advantage function for each sample is calculated using a multi-dimensional weighted reward function and the baseline reward predicted by the value network. Introducing a clipping threshold The policy loss function is obtained as follows: Where B is the batch size and the strategy ratio. To update the ratio of conditional probabilities in the policy network before and after, This represents the clipping function; The AdamW optimizer is used to synchronously update the parameters of the policy network and the value network; Employ a gradient accumulation strategy: Set the accumulation step count s, and the effective batch size. Each time B samples are loaded, the gradient is calculated and accumulated to the cache. After s times, the total gradient is used to perform a parameter update. Define a three-dimensional convergence criterion: the change in the average batch reward of the training set across consecutive preset rounds. ,in, The average batch reward for the training set in round t is shown below: The training set batch average reward for round t-Δt; the test set splitting loss error rate. ,in, Set a preset error rate threshold; test the resource adaptation rate of the sub-line. ,in, A preset fit rate threshold is set; when all three conditions are met simultaneously, a target large model for inference is obtained. .
10. The intelligent segmentation method for distributed quantum circuits based on a large model according to claim 9, characterized in that, Sequence length of the cutting scheme Where 1 corresponds to the encoding length of the number of sub-lines k. The total length of the bit AND gate encoding for all sub-circuits. This represents the set of qubits in the i1th sub-circuit of the new task to be processed. This represents the set of quantum gates for the i1-th sub-circuit in the new task to be processed. The encoding length for processing unit mapping relationships; sequence length. It must not exceed the maximum generation length of the target large model. If the sequence length Then, the superscale sub-circuits are split in descending order of the number of quantum gates until the sequence length is satisfied. The sequence length needs to be adapted to the total number of processing units in the distributed architecture. Ensure the number of sub-lines And the coding length of a single sub-line , The maximum encoding length supported by a single processing unit; The input features of the quantum circuit to be cut are extracted, and the quantum circuit features and classical hardware features are preprocessed and concatenated into a unified input vector. Secondly, the input vector Input target large model It directly outputs a better cutting scheme through autoregressive inference using the classic Transformer structure. This includes the segmented sub-circuits, bit sets, and mapping relationships. The segmented sub-circuits are converted into a standardized quantum circuit format executable by distributed processing units, containing qubit initialization instructions, quantum gate execution instructions, and measurement instructions. Distributed execution and result integration are performed: processing units execute their mapped sub-circuits, and remote operations between processing units are implemented based on the EPR quantum teleportation protocol. Real-time monitoring of quantum state fidelity is also conducted. ;in, It is a fidelity calculation function. , These are the density matrix corresponding to the actual quantum state received by the target processing unit after cross-processing unit transmission and the density matrix corresponding to the ideal target quantum state that should theoretically be obtained during cross-processing unit quantum state transmission; if the quantum state fidelity is lower than the preset transmission fidelity threshold, the EPR pair regeneration process is triggered; after each processing unit completes the sub-line, the measurement results are aggregated to the control node through the classical communication network, and the control node integrates them according to the calculation logic of the target task to obtain the final output; The method for verifying the cut quantum circuit output by the target large model is as follows: calculate the actual cutting loss using the cutting loss estimation model, and calculate the quantum state density matrix of the complete circuit before cutting. The product density of states matrix of the cut sub-circuit Substitute the values into the von Neumann entropy formula to calculate the actual cutting loss. If the actual cutting loss... Preset verification threshold This will result in the quantum circuit being cut and the actual cutting loss. Feedback is fed back to the training set to incrementally train the target large model and update the model parameters. The incremental training sample size and iteration count are adapted to the loss optimization requirements: the sample size is determined based on the deviation between the actual splitting loss and the preset validation threshold. If the actual splitting loss... One incremental sample is generated for each out-of-specification scheme; if the actual cutting loss Incremental samples were generated for three different sub-line splitting variants; if the actual cutting loss Generate 5 incremental samples; the number of iterations for incremental training. The initial number of training iterations 20%-30%, and must meet the average splitting loss of 3 consecutive rounds of validation sets. Stop iteration when the number of iterations reaches a certain threshold; If the conditions are still not met, new candidate cutting scheme samples are generated based on the characteristics of the current over-cutting circuit, and training continues until convergence; if the actual cutting loss is less than or equal to the preset verification threshold, the cut quantum circuit is determined to be the final execution circuit. A two-dimensional determination method based on quantum gate dependence and entanglement strength is employed to process qubits that need to be associated across processing units after slicing: analyzing the bit subset allocation and processing unit mapping table fields in the slicing scheme output by the target large model; and traversing the set of quantum gates of the original quantum circuit. Multi-qubit gates that act on two or more qubits are selected to form a multi-qubit gate set. For each multi-bit gate Read the gate operation data of the original quantum circuit to obtain the set of active qubits; if the qubits in the set of qubits are assigned to different processing units, then the qubits are determined to be qubits that need to be associated across processing units; supplementary verification: if the entanglement strength of the cross-unit qubit pair is greater than or equal to the preset entanglement threshold, control the corresponding processing unit to generate a quantum entangled state through the quantum channel to establish a quantum entangled link.
Citation Information
Cited By
Quantum circuit cutting and fusing distributed quantum computing method and system of classical computing
CN122222071A