Quantum circuit synthesis method and device based on generative model and gradient feedback

By combining generative models and gradient feedback methods with checking, gradient optimization, and local regeneration, the problem of unifying the calibration of discrete gate structures and continuous parameters in quantum circuit synthesis is solved, thus achieving efficient quantum circuit synthesis.

CN122242803APending Publication Date: 2026-06-19BEIJING ACAD OF QUANTUM INFORMATION SCI

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING ACAD OF QUANTUM INFORMATION SCI
Filing Date
2026-05-25
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

In existing quantum circuit synthesis technology, it is difficult to uniformly correct discrete gate structure errors and continuous parameter deviations, resulting in low synthesis efficiency.

Method used

By employing a generative model and gradient feedback-based approach, initial candidate quantum circuits are generated, and then checked, optimized, partitioned, and locally regenerated to achieve synergistic improvement of discrete gate structures and continuous parameters.

🎯Benefits of technology

It improves the overall coordination and convergence of the quantum circuit synthesis process, overcomes the problem of separation between structure search and parameter optimization, and generates high-quality target quantum circuits.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122242803A_ABST
    Figure CN122242803A_ABST
Patent Text Reader

Abstract

A quantum circuit synthesis method and apparatus based on generative models and gradient feedback, relating to the field of quantum circuit synthesis technology, is presented. The method includes: generating initial candidate quantum circuits based on a generative model and received synthesis task information; performing at least one step to generate updated candidate quantum circuits; and performing target screening on the updated candidate quantum circuits to obtain target quantum circuits. The step of generating updated candidate quantum circuits includes: checking the initial candidate quantum circuits according to preset checking conditions to determine repair candidate quantum circuits; performing gradient optimization on the continuous parameters corresponding to the repair candidate quantum circuits to determine the optimization result; determining the retained region and updated region of the repair candidate quantum circuits based on the optimization result; fixing the retained region and performing local regeneration on the updated region to obtain the updated candidate quantum circuits. This method achieves synergistic improvement of discrete gate structures and continuous parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of quantum circuit synthesis technology, and more specifically, to a quantum circuit synthesis method and apparatus based on generative models and gradient feedback. Background Technology

[0002] Quantum circuit synthesis, also known as quantum circuit compilation or quantum gate-level synthesis, refers to the process of constructing a sequence of quantum gates that meet the requirements under the constraints of a candidate gate set, given a target quantum state, target unitary transformation, target Hamiltonian evolution, or target algorithm function. With the rapid development of quantum hardware platforms such as superconducting, ion traps, and neutral atoms, significant differences exist between platforms in terms of available gate types, qubit connectivity, gate duration, error models, and parallel execution capabilities. Therefore, the optimal circuit form for the same target quantum operation often differs across platforms. As a crucial intermediate link connecting quantum algorithms and quantum hardware execution, the synthesis quality and efficiency of quantum circuit synthesis technology directly determine the actual execution performance of a quantum computing system.

[0003] Existing quantum circuit synthesis techniques have generally evolved from rule-driven and heuristic search to numerical optimization and machine learning-assisted generation. A common traditional approach combines heuristic rules, search algorithms, and parameter optimization: first, the circuit skeleton structure or candidate structure is determined, then continuous variables such as the rotation angle and phase of parameterized gates are optimized to gradually reduce the error between the candidate circuit and the target operation. This type of method typically achieves high synthesis accuracy, but its iterative process often requires repeated calculations of the distance function between the candidate circuit and the target operation, or multiple calls to quantum hardware or high-cost classical simulators. Therefore, as the number of qubits, gates, and constraint complexity increases, the computational cost increases rapidly, severely limiting synthesis efficiency.

[0004] In recent years, generative machine learning models have begun to be introduced into the field of quantum circuit synthesis. For example, the diffusion model (DM) can directly generate candidate quantum circuits given conditional information by modeling known circuit samples. Compared with traditional approaches that rely on the backpropagation of the objective function at each step, generative methods can avoid the high-cost comparison of each generated candidate during the training phase. Furthermore, they can incorporate prior information such as circuit length, number of qubits, connectivity constraints, and some known gate structures through conditional control, masking constraints, and local editing, thereby improving the flexibility in constrained circuit generation scenarios. Further, existing work has extended generative methods from handling only discrete gate structures to a multimodal generation framework that simultaneously handles discrete gate types and continuous gate parameters, enabling the generative model to simultaneously output the discrete structure of the quantum circuit and the continuous initial values ​​of the parameterized gate parameters.

[0005] For example, existing quantum circuit synthesis schemes based on generative models typically encode the quantum circuits into discrete labels or continuous embeddings suitable for neural network processing. Then, using the target unitary matrix, target task description, candidate gate set specification, or other conditional information as input, the generative model directly outputs candidate quantum circuits. Some schemes also support defining the placement of gates through masks or fixing parts of existing gate structures through editing to meet hardware connectivity or existing sub-circuit constraints. Some generative models can also employ multimodal mechanisms to jointly generate discrete gate structures and continuous parameters in the quantum circuits simultaneously, generating several candidate circuits at once given a target unitary operation and candidate gate set.

[0006] However, in the above-mentioned technical solutions, discrete structure search and continuous parameter optimization are usually carried out in stages. First, the circuit skeleton is determined, and then the gate parameters are optimized. It is difficult to use "structural information" and "gradient information" to correct the circuit in a single iteration. As a result, discrete gate structure errors and continuous parameter deviations often cannot be corrected in a unified and efficient manner.

[0007] The content of the background section is merely technology known to the public and does not necessarily represent existing technology in the field. Summary of the Invention

[0008] This application aims to provide a quantum circuit synthesis method and apparatus based on generative models and gradient feedback to solve the aforementioned technical problems that discrete gate structure errors and continuous parameter deviations cannot be uniformly corrected.

[0009] According to one aspect of this application, a quantum circuit synthesis method based on a generative model and gradient feedback is provided. The quantum circuit synthesis method includes: generating initial candidate quantum circuits based on a generative model and received synthesis task information, wherein the initial candidate quantum circuits include discrete gate structures and continuous parameters; performing at least one step to generate updated candidate quantum circuits; and, if the updated candidate quantum circuits satisfy a preset iteration termination condition, performing target screening on the updated candidate quantum circuits to obtain target quantum circuits. The step of generating updated candidate quantum circuits includes: checking the initial candidate quantum circuits according to preset checking conditions to determine repair candidate quantum circuits; performing gradient optimization on the continuous parameters corresponding to the repair candidate quantum circuits to determine the optimization result of the repair candidate quantum circuits; determining the reserved region and the updated region of the repair candidate quantum circuits based on the optimization result; fixing the reserved region and performing local regeneration on the updated region to obtain the updated candidate quantum circuits.

[0010] According to some embodiments of this application, generating initial candidate quantum circuits based on a generative model and the received integrated task information includes: encoding the integrated task information and preset circuit information into conditional inputs of the generative model; calling the generative model and outputting the conditional inputs to the generative model to obtain initial candidate quantum circuits.

[0011] According to some embodiments of this application, calling a generative model and sending conditional inputs and outputs to the generative model to obtain initial candidate quantum circuits includes: calling a generative model and sending conditional inputs and outputs to the generative model to obtain the discrete gate structure of the first branch output and the continuous parameters of the second branch output.

[0012] According to some embodiments of this application, the preset check conditions include preset check constraints and preset repair conditions; checking the initial candidate quantum circuit according to the preset check conditions to determine the repair candidate quantum circuit includes: determining whether the initial candidate quantum circuit meets the preset check constraints; if the initial candidate quantum circuit does not meet the preset check constraints, determining whether the initial candidate quantum circuit meets the preset repair conditions; if the initial candidate quantum circuit meets the preset repair conditions, repairing the initial candidate quantum circuit that meets the preset repair conditions to determine the repair candidate quantum circuit.

[0013] According to some embodiments of this application, gradient optimization of the continuous parameters corresponding to the repair candidate quantum circuit to determine the optimization result of the repair candidate quantum circuit includes: performing gradient optimization of the continuous parameters corresponding to the repair candidate quantum circuit through a preset gradient method to determine the optimization result.

[0014] According to some embodiments of this application, determining the reserved region and updated region of the candidate quantum circuit for repair based on the optimization results includes: determining the feedback score of the current quantum circuit unit of the candidate quantum circuit for repair based on the optimization results; determining the corresponding quantum circuit unit as a reserved unit or an updated unit based on the feedback score and preset scoring conditions; traversing all quantum circuit units to obtain all reserved units and all updated units; and determining the reserved region and updated region based on all reserved units and all updated units.

[0015] According to some embodiments of this application, fixing the reserved region and performing local regeneration on the updated region to obtain the updated candidate quantum circuit includes: fixing the reserved region and performing local regeneration on the updated region through a preset local regeneration method to obtain the updated candidate quantum circuit; wherein, the preset local regeneration method is at least one of mask regeneration, editing regeneration, replacement regeneration, candidate gate set switching regeneration, and gate-to-gate block-level regeneration.

[0016] According to some embodiments of this application, before generating initial candidate quantum circuits based on the received synthesis task information using a generative model, the quantum circuit synthesis method further includes a step of training a generative model. The step of training a generative model includes: acquiring a training dataset; constructing an initial generative model; and inputting the training dataset into the initial generative model to train the initial generative model, thereby obtaining a trained generative model.

[0017] According to some embodiments of this application, inputting a training dataset into an initial generative model to train the initial generative model and thereby obtain a trained generative model includes: inputting a training dataset into the initial generative model so that the initial generative model outputs training discrete gate structures through a first branch and training continuous parameters through a second branch, thereby obtaining a trained generative model.

[0018] According to one aspect of this application, a quantum circuit synthesis device based on a generative model and gradient feedback is provided. The quantum circuit synthesis device may include an initial candidate generation module, a candidate generation module, and a result output module. The initial candidate generation module, based on a generative model, generates initial candidate quantum circuits according to received synthesis task information. The initial candidate quantum circuits include discrete gate structures and continuous parameters. The candidate generation module performs at least one step to generate updated candidate quantum circuits, including: checking the initial candidate quantum circuits according to preset checking conditions to determine repair candidate quantum circuits; performing gradient optimization on the continuous parameters corresponding to the repair candidate quantum circuits to determine the optimization result of the repair candidate quantum circuits; determining the retained region and updated region of the repair candidate quantum circuits based on the optimization result; fixing the retained region and performing local regeneration on the updated region to obtain the updated candidate quantum circuits; and the result output module, if the updated candidate quantum circuits meet preset iteration termination conditions, performing target screening on the updated candidate quantum circuits to obtain target quantum circuits.

[0019] The technical solution of this application can generate initial candidate quantum circuits through generative models and integrated task information. The technical solution of this application can check the initial candidate quantum circuits using preset check conditions to determine repair candidate quantum circuits. The technical solution of this application can determine the optimization result of the repair candidate quantum circuits by performing gradient optimization on the continuous parameters corresponding to the repair candidate quantum circuits. The technical solution of this application can determine the retained region and the updated region of the repair candidate quantum circuits based on the optimization result. The technical solution of this application can obtain the updated candidate quantum circuits by fixing the retained region and performing local regeneration on the updated region. The technical solution of this application can perform target screening on the updated candidate quantum circuits if the updated candidate quantum circuits meet the preset termination conditions of the iteration to obtain the target quantum circuits.

[0020] The technical solution of this application unifies the rapid candidate generation capability of generative models with the refinement capability of gradient optimization into a closed-loop process of "inspection—gradient optimization—region partitioning—local regeneration—iterative screening". The optimization results generated by gradient optimization are not only used for the refinement of continuous parameters, but also directly used to drive the local regeneration of discrete gate structures, thereby realizing the synergistic improvement of discrete gate structures and continuous parameters. This improves the overall coordination and convergence capability in the circuit synthesis process and overcomes the problem of the separation between structure search and parameter optimization in the prior art. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 A schematic flowchart of a quantum circuit synthesis method 1000 according to an embodiment of this application is shown; Figure 2 A flowchart illustrating step S120 according to an embodiment of this application is shown; Figure 3 A flowchart illustrating step S110 according to an embodiment of this application is shown; Figure 4 A flowchart illustrating step S121 according to an embodiment of this application is shown; Figure 5 A flowchart illustrating step S123 according to an embodiment of this application is shown; Figure 6 A schematic flowchart of a quantum circuit synthesis method 2000 according to an embodiment of this application is shown; Figure 7 A flowchart illustrating step S210 according to an embodiment of this application is shown; Figure 8 A schematic diagram of the structure of a quantum circuit synthesis device according to an embodiment of this application is shown.

[0023] Explanation of reference numerals in the attached figures: Quantum circuit synthesis device 30; initial candidate generation module 31; candidate generation module 32; result output module 33; training module 34. Detailed Implementation

[0024] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, they are provided so that this application will be thorough and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted.

[0025] The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced without one or more of these specific details, or other methods, components, materials, devices, etc. In these cases, well-known structures, methods, devices, implementations, materials, or operations will not be shown or described in detail.

[0026] Furthermore, the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.

[0027] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order.

[0028] The technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0029] The technical terms used in this application have the following meanings: Quantum circuit synthesis / quantum circuit compilation refers to the process of automatically or semi-automatically constructing a sequence of quantum gates that meets the requirements, given a target quantum operation, a set of candidate gates, and constraints.

[0030] Qubit: The basic information unit in quantum computing, which can exist in superposition and can evolve and be controlled through quantum gates.

[0031] A quantum gate is a basic unit of operation that operates on one or more qubits and is used to implement logical operations in quantum state transformations or quantum computing processes.

[0032] Abstract Gate Set: Refers to a standard set of gates defined at the algorithmic or logical level, such as Hadamard gates, CNOT gates (Controlled-NOT gates), and rotation gates. Abstract gates do not necessarily correspond one-to-one with specific hardware platforms.

[0033] Native gate set: refers to the set of gates that can be directly implemented or invoked by a specific quantum hardware platform. Native gates are usually directly related to the physical interactions, control methods, and calibration parameters of the specific hardware.

[0034] Hybrid Gate Set: refers to a set of gates that simultaneously contains abstract gates and native gates, or simultaneously contains multiple types of gate representations at different levels.

[0035] Parameterized gate: refers to a quantum gate with continuously variable parameters, such as quantum gates with adjustable parameters like rotation angle, phase, pulse amplitude, and pulse duration.

[0036] Discrete Gate Structure: refers to the discrete information of gates in a quantum circuit, such as their type, order, position, and control / target relationship, excluding specific continuous parameter values.

[0037] Continuous parameters refer to the continuous variables carried by the parameterization gates in a quantum circuit, such as angle, phase, coupling strength, detuning, pulse width, and pulse amplitude.

[0038] Target quantum operation: refers to a target object that needs to be realized through quantum circuits. It can be a target unitary transformation, a target quantum state preparation task, a target Hamiltonian evolution, a target algorithm functional module, or other operations that can be represented by quantum circuits.

[0039] Unitary transformation: A linear transformation that satisfies the unitary condition, and is a mathematical description of the evolution of a closed quantum system. Unitary transformations are often used as one of the important target forms for quantum circuit synthesis.

[0040] Hamiltonian: An operator that describes the energy structure and dynamical evolution of a quantum system. Hamiltonians can be used to define evolutionary objectives or as conditional inputs.

[0041] Hardware constraints refer to the execution restrictions imposed on a specific quantum hardware platform, including but not limited to qubit connectivity, parallel execution capability, gate duration, gate error, crosstalk, pulse limits, calibration parameters, and resource budget.

[0042] See Figure 8 The quantum circuit synthesis device 30 based on generative model and gradient feedback of this application may include an initial candidate generation module 31, a candidate generation module 32 and a result output module 33.

[0043] The following is combined Figure 8 This application describes a quantum circuit synthesis method 1000 based on a generative model and gradient feedback. See also... Figure 1 The quantum circuit synthesis method 1000 may include steps S110-S130.

[0044] In step S110, based on the generative model, an initial candidate quantum circuit is generated according to the received integrated task information.

[0045] According to the example embodiment, the generative model can be a probabilistic model capable of generating new samples based on the input. For example, the generative model may include a diffusion model, an autoregressive model, a variational autoencoder, a stream model, an adversarial generative model, a retrieval-enhanced generative model, or a combination of several of the above models.

[0046] The comprehensive task information can include all relevant information describing this quantum circuit synthesis task. This information may include the target quantum operation, candidate gate set, hardware constraints, and optimization preference parameters.

[0047] The input form of the target quantum operation can be a unitary matrix, the target quantum state and the initial state, the Hamiltonian and the evolution time, a known sub-circuit or logic function description, a text description, a label description or a task category identifier, or any combination of the above.

[0048] Candidate gate sets can be defined according to the use case. For example, a candidate gate set can be a gate set containing only abstract gates, a gate set containing only native gates, a gate set that mixes abstract and native gates, or a family of gate sets consisting of multiple candidate gate sets.

[0049] The initial candidate quantum circuit can be a sequence of quantum gates generated for the first time by the generative model and not yet refined by gradients. The initial candidate quantum circuit includes discrete gate structures and continuous parameters. The initial candidate quantum circuit can include a preset number of gate units, which can be set according to the complexity of the integrated task information.

[0050] Discrete gate structures refer to the discrete information in quantum circuits, such as the type of gate units, their activation order, the number of active bits, and the control relationship (or target relationship). Continuous parameters refer to the adjustable continuous variables carried by parameterized gate units, such as rotation angle, phase, pulse amplitude, and pulse width.

[0051] For example, in step S110, the initial candidate generation module 31 generates initial candidate quantum circuits based on the generative model and the received integrated task information. The initial candidate generation module 31 can receive integrated task information from user input or upper-layer software interface input. The initial candidate generation module 31 calls the generative model to output the initial candidate quantum circuits.

[0052] The candidate generation module 32 executes step S120 at least once. Step S120 is the step for generating updated candidate quantum circuits. See also... Figure 2 Step S120 may include steps S121-S124.

[0053] In step S121, the initial candidate quantum circuit is checked according to preset check conditions to determine the candidate quantum circuit to be repaired.

[0054] According to an example embodiment, the preset check conditions can be the legality check conditions and repairability evaluation conditions of the initial candidate quantum circuit. The preset check conditions can include preset check constraints and preset repair conditions. The repaired quantum circuit can be the repaired quantum circuit.

[0055] For example, in step S121, the candidate generation module 32 checks the initial candidate quantum circuit according to preset check conditions to determine the repairable candidate quantum circuit. The candidate generation module 32 can determine whether the initial candidate quantum circuit meets the legality check and repairability assessment based on the preset check conditions. If the initial candidate quantum circuit does not meet the legality check but meets the repairability assessment, the candidate generation module 32 can repair the initial candidate quantum circuit to obtain the repairable quantum circuit.

[0056] In step S122, gradient optimization is performed on the continuous parameters corresponding to the candidate quantum circuit for repair to determine the optimization result of the candidate quantum circuit for repair.

[0057] According to the example embodiment, gradient optimization can be a gradient-based optimization method that iteratively updates continuous parameters. The optimization result can include the optimized continuous parameters.

[0058] For example, in step S122, the candidate generation module 32 performs gradient optimization on the continuous parameters corresponding to the repair candidate quantum circuit to determine the optimization result of the repair candidate quantum circuit.

[0059] The candidate generation module 32 can perform gradient optimization on the continuation parameters by optimizing the minimization of the comprehensive objective function, gradient descent, adaptive second-order optimization, etc., in order to determine the optimization result of the repair candidate quantum circuit.

[0060] In step S123, based on the optimization results, the reserved region and the updated region of the candidate quantum circuit for repair are determined.

[0061] According to the example embodiment, the reserved region can be the gate units and local sub-circuit units in the candidate quantum circuit that have high quality, significant contribution, or have well met the hardware constraints. The updated region can be the gate units and local sub-circuit units in the candidate quantum circuit that have low quality, large error, or conflict with the hardware constraints.

[0062] For example, in step S123, the candidate generation module 32 determines the reserved region and the updated region of the repair candidate quantum circuit based on the optimization results.

[0063] The candidate generation module 32 can score the gate units according to the optimization results, assign gate units with scores higher than the threshold to a fixed region, and assign gate units with scores lower than the threshold to an updated region.

[0064] In step S124, the reserved region is fixed, and local regeneration is performed on the updated region to obtain the updated candidate quantum circuit.

[0065] According to the example embodiment, local regeneration can be a method of targeted local generation of discrete gate structures or continuous parameters of the updated region.

[0066] For example, in step S124, the candidate generation module 32 fixes the reserved region and performs local regeneration on the updated region to obtain the updated candidate quantum circuit.

[0067] The candidate generation module 32 can inform the generative model which positions (i.e., the reserved regions) are fixed and which positions (i.e., the updated regions) need to be regenerated, while keeping the reserved regions unchanged, through mask form, edit template form, or replacement block form. Then, the generative model performs targeted local generation of the updated regions under the target quantum operation, candidate gate set, hardware constraints, and optimization results, thereby obtaining the updated candidate quantum circuit.

[0068] The candidate generation module 32 can iterate the updated candidate quantum circuits and repeat steps S121-S124.

[0069] In step S130, if the updated candidate quantum circuit meets the preset iteration termination condition, the updated candidate quantum circuit is subjected to target screening to obtain the target quantum circuit.

[0070] According to the example embodiment, the preset iteration termination condition can be the criterion for stopping the iteration of the updated candidate quantum circuit. For example, the preset iteration termination condition can be that the number of iteration rounds reaches the upper limit, the error in the optimization result is lower than the threshold, the improvement of the updated region in several consecutive rounds is lower than the threshold, the computing resources or time budget reaches the upper limit, and a quantum circuit that satisfies the comprehensive task information (target quantum operation, candidate gate set, hardware constraints) has been obtained.

[0071] For example, the number of iteration rounds can be set to 1 to 200 rounds, preferably 2 to 50 rounds, or 3 to 15 rounds. The number of continuous parameter optimization steps per round can be 1 to 5000 steps, preferably 10 to 1000 steps, or 50 to 300 steps. The proportion of the locally regenerated updated region to the entire updated quantum circuit length can be 1% to 80%, preferably 5% to 60%, or 10% to 30%.

[0072] Objective screening can be used to comprehensively screen updated candidate quantum circuits. For example, objective screening methods can include: selecting several updated candidate quantum circuits with the optimal comprehensive objective function; selecting updated candidate quantum circuits that meet hardware constraints and have a fidelity exceeding a threshold; selecting updated candidate quantum circuits on the Pareto front; selecting updated candidate quantum circuits that balance multiple objectives among circuit depth, number of gates, execution time, and fidelity; and retaining updated candidate quantum circuits with high diversity to avoid premature convergence.

[0073] The target quantum circuit can be a candidate quantum circuit after the target screening. The parameters of the target quantum circuit can include: discrete gate structure (e.g., gate unit sequence, active qubit of each gate unit, etc.), continuous parameters (e.g., rotation angle, phase, pulse amplitude and pulse width carried by the gate unit), native / abstract gate set labels corresponding to the gate unit, circuit depth, gate count, expected execution time, expected fidelity, constraint satisfaction report, candidate ranking information and local structure interpretation information, etc.

[0074] For example, in step S130, if the updated candidate quantum circuit meets the preset iteration termination condition, the result output module 33 performs target screening on the updated candidate quantum circuit to obtain the target quantum circuit.

[0075] If the updated candidate quantum circuits meet the preset iteration termination conditions, the result output module 33 calculates the fidelity, circuit depth and number of gates of each updated candidate quantum circuit. According to the multi-objective scoring (Pareto front screening or weighted summation can be used), the optimal result is selected as the target quantum circuit output from the updated candidate quantum circuits corresponding to each iteration round.

[0076] The output module 33 can also output several alternative target quantum circuits simultaneously, allowing users to make secondary selections based on hardware calibration status, noise levels at different execution periods, or different resource preferences. Target quantum circuits can also be used to train generative models.

[0077] Through the above embodiments, the technical solution of this application can generate initial candidate quantum circuits using generative models and integrated task information. The technical solution of this application can check the initial candidate quantum circuits using preset check conditions to determine repair candidate quantum circuits. The technical solution of this application can determine the optimization result of the repair candidate quantum circuits by performing gradient optimization on the continuous parameters corresponding to the repair candidate quantum circuits. The technical solution of this application can determine the retained region and the updated region of the repair candidate quantum circuits based on the optimization result. The technical solution of this application can obtain updated candidate quantum circuits by fixing the retained region and performing local regeneration on the updated region. The technical solution of this application can perform target screening on the updated candidate quantum circuits when the updated candidate quantum circuits meet the preset iteration termination conditions to obtain the target quantum circuits.

[0078] The technical solution of this application unifies the rapid candidate generation capability of generative models with the refinement capability of gradient optimization into a closed-loop process of "inspection—gradient optimization—region partitioning—local regeneration—iterative screening". The optimization results generated by gradient optimization are not only used for the refinement of continuous parameters, but also directly used to drive the local regeneration of discrete gate structures, thereby realizing the synergistic improvement of discrete gate structures and continuous parameters. This improves the overall coordination and convergence capability in the circuit synthesis process and overcomes the problem of the separation between structure search and parameter optimization in the prior art.

[0079] The technical solution of this application can accurately locate the preserved region and the updated region through gradient optimization, while the local regeneration based on the optimization results only repairs the structure of the low-quality updated region, avoiding the computational waste caused by overall resampling and a large number of invalid searches in existing methods. Through multiple rounds of iteration, the discrete gate structure and continuous parameters of the updated candidate quantum circuit are continuously and synergistically improved, and finally, a high-quality target quantum circuit that meets the comprehensive objective is output.

[0080] Optionally, see Figure 3 Step S110 may include steps S111-S112.

[0081] In step S111, the integrated task information and the preset route information are encoded as the conditional inputs of the generative model.

[0082] According to the example embodiment, the preset circuit information can be prior circuit structure information related to the current quantum circuit synthesis task. For example, the preset circuit information includes fixed sub-circuit gate sequences (such as error correction modules that need to be retained), known local gate pairs, hardware-specific baseline circuit templates, etc. The conditional input can be an encoding that satisfies the input form of the generative model.

[0083] For example, in step S111, the initial candidate generation module 31 encodes the integrated task information and the preset route information into the conditional input of the generative model.

[0084] The initial candidate generation module 31 can encode the target quantum operation into matrix encoding, tensor encoding, graph structure encoding, Hamiltonian term encoding, text prompt encoding, existing circuit encoding, or multimodal joint encoding.

[0085] The initial candidate generation module 31 can encode candidate gate sets into forms such as gate type dictionary, gate parameter field, gate connection method, gate cost label, and native label. For gate set scenarios with native gates, the initial candidate generation module 31 prioritizes retaining the native gate representation, without first compiling to abstract gates and then back-translating, thereby avoiding the increase in gate number, depth, or fidelity caused by additional decomposition. For gate set scenarios with a mixture of abstract and native gates, the initial candidate generation module 31 can allow parallel sampling between different candidate gate sets, followed by unified comparison and encoding.

[0086] Hardware constraints can be encoded as a connected graph adjacency matrix, a qubit location graph, a parallel collision matrix, a forbidden gate location mask, a gate duration vector, a crosstalk penalty matrix, etc. Preset line information can be encoded as sub-line information.

[0087] In step S112, the generative model is invoked, and the conditional inputs and outputs are sent to the generative model to obtain the initial candidate quantum circuits.

[0088] For example, in step S112, the initial candidate generation module 31 calls the generative model, sending conditional inputs and outputs to the generative model to obtain initial candidate quantum circuits. The initial candidate generation module 31 can call the generative model, sending conditional inputs and outputs to the generative model, so that the generative model outputs initial candidate quantum circuits.

[0089] For example, the initial candidate quantum circuit can be represented as:

[0090] Where C is an initial candidate quantum circuit; L is the circuit length. Indicates the first l Each door unit. It should include at least one or more of the following information: gate type, set of active qubits, relationship between control qubits and target qubits, continuous parameter vector, time slot of the gate, gate duration, gate cost label, and a flag indicating whether parallel execution is allowed.

[0091] For discrete gates, the continuous parameter vector can be an empty vector or a zero vector. For parameterized gates, the continuous parameter vector can include one or more components such as rotation angle, phase, pulse amplitude, pulse width, detuning, and coupling strength. The initial candidate quantum circuit is not limited to gate-level abstract circuits and can also be compatible with pulse parameterized representations or hybrid representations of half-gate and half-pulse levels.

[0092] Through the above embodiments, the technical solution of this application can encode comprehensive task information and preset circuit information into conditional inputs for a generative model. The technical solution of this application can then call the generative model, outputting the conditional inputs to the generative model to obtain initial candidate quantum circuits.

[0093] The technical solution of this application can encode the integrated task information and the preset circuit information into conditional inputs. The generative model can perceive the characteristics of the target quantum operation, the constraints of the candidate gate set and the topological restrictions of the hardware constraints in the generation stage, thereby directly generating initial candidate quantum circuits with high quality within the constraints, without having to spend a lot of money to deal with large-scale structural violations in the subsequent repair stage.

[0094] Optionally, step S112 can be specifically as follows: the initial candidate generation module 31 calls the generative model, inputs and outputs the conditions to the generative model, so as to obtain the discrete gate structure of the first branch output and the continuous parameters of the second branch output.

[0095] According to the example embodiment, the first branch and the second branch can be two different output branches of the generative model. Discrete gate structures and continuous parameters can be generated using a two-branch method, with the first branch responsible for generating the discrete gate structure and the second branch responsible for generating the continuous parameters. The discrete gate structure and continuous parameters can share the target quantum operation, the candidate gate set, and hardware constraints.

[0096] For example, generative models employ diffusion models, autoregressive models, variational autoencoders, stream models, adversarial generative models, retrieval-enhanced generative models, etc. The initial candidate generation module 31 can set different noise processes, different sampling strategies, or different decoding methods for discrete gate structures and continuous parameters respectively, so as to improve the modeling accuracy of discrete gates and continuous parameters.

[0097] For example, a generative model can be a combination of diffusion models, autoregressive models, variational autoencoders, streaming models, adversarial generative models, and retrieval-enhanced generative models. The first branch is one of the diffusion models, autoregressive models, variational autoencoders, streaming models, adversarial generative models, and retrieval-enhanced generative models, while the second branch is a different model from the first branch.

[0098] Through the above embodiments, the technical solution of this application can generate discrete gate structures and continuous parameters through dual-branch generation. Since the discrete gate structure and continuous parameters are mutually constrained in the same generation process, dual-branch generation can avoid the problem of parameter optimization getting trapped in local optima due to improper structure selection when fixing the structure first and then optimizing the parameters separately, thereby improving the overall quality of the initial candidate quantum circuit.

[0099] Optionally, the preset check conditions include preset check constraints and preset repair conditions.

[0100] See Figure 4 Step S121 may include steps S1211-S1213.

[0101] In step S1211, it is determined whether the initial candidate quantum circuit meets the preset check constraints.

[0102] According to the example embodiment, the preset check constraints can be the legality check conditions for the initial candidate quantum circuit. For example, the preset check constraints may include: whether the gate cell type belongs to the candidate gate set, whether the two-bit or multi-bit gate falls on the allowed connected edge, whether the continuous parameters fall within the preset range, whether there is illegal overlap in the same time slot, whether the maximum depth or maximum duration constraint is violated, whether there is inconsistency between the control flag and the target flag, and whether there is an unacceptable gate sequence or pulse conflict.

[0103] For example, in step S1211, the candidate generation module 32 determines whether the initial candidate quantum circuit meets the preset check constraints.

[0104] If the initial candidate quantum circuit meets the preset check constraints, the candidate generation module 32 can directly perform gradient optimization on the continuous parameters of the initial candidate quantum circuit to obtain the corresponding optimization results, and then execute the subsequent steps S123-S124.

[0105] If the initial candidate quantum circuit does not meet the preset check constraints, the candidate generation module 32 executes step S1212. In step S1212, it is determined whether the initial candidate quantum circuit meets the preset repair conditions.

[0106] According to an example embodiment, the preset repair condition can be the repairability evaluation condition of the initial candidate quantum circuit. The preset repair condition can be that the parts of the initial candidate quantum circuit that do not meet the preset check constraints are repairable and the repair cost is low.

[0107] For example, preset repair conditions may include whether the following can be repaired: replacing illegal double-bit gates with equivalent gate sequences on adjacent available edges, performing projection pruning on continuous parameters, truncating the tail of excessively long lines, deleting obviously redundant gates using a rule base, and inserting barriers or reordering some local areas.

[0108] For example, in step S1212, the candidate generation module 32 determines whether the initial candidate quantum circuit meets the preset repair conditions.

[0109] If the initial candidate quantum circuit does not meet the preset repair conditions, the candidate generation module 32 directly discards the initial candidate quantum circuit.

[0110] If the initial candidate quantum circuit meets the preset repair conditions, the candidate generation module 32 executes step S1213.

[0111] In step S1213, the initial candidate quantum circuits that meet the preset repair conditions are repaired to determine the repair candidate quantum circuits.

[0112] According to the example embodiment, the candidate generation module 32 repairs the initial candidate quantum circuits that meet the preset repair conditions to determine the repair candidate quantum circuits. The repair content that the candidate generation module 32 can repair may include: replacing illegal two-bit gates with equivalent gate sequences on adjacent available edges, performing projection pruning on continuous parameters, truncating the tail of excessively long circuits, deleting obviously redundant gates using a rule base, and inserting barriers or reordering some local regions.

[0113] Through the above embodiments, the technical solution of this application can determine whether an initial candidate quantum circuit meets a preset check constraint. The technical solution of this application can determine whether an initial candidate quantum circuit meets a preset repair condition if the initial candidate quantum circuit does not meet the preset check constraint. The technical solution of this application can repair the initial candidate quantum circuit that meets the preset repair condition if the initial candidate quantum circuit meets the preset repair condition, thereby determining the repair candidate quantum circuit.

[0114] The technical solution of this application ensures that the candidate quantum circuits entering the gradient optimization stage have met the basic execution constraints of the hardware by performing constraint checks and legality repairs before gradient optimization. This enables gradient optimization to converge effectively in the legal parameter space and avoids the problem of the objective function not being calculated correctly due to structural violations or the waste of computational resources in invalid regions during gradient optimization.

[0115] The technical solution of this application pre-judges the repairability of candidate quantum circuits by setting preset repair conditions, which can eliminate low-quality candidate quantum circuits that do not have repair value as early as possible, and only optimize candidate quantum circuits with repair potential, thereby further improving the computational efficiency of the overall process.

[0116] Optionally, step S122 can specifically be: the candidate generation module 32 performs gradient optimization on the continuous parameters corresponding to the candidate quantum circuit for repair using a preset gradient method to determine the optimization result.

[0117] According to the example embodiment, the preset gradient method can be a method that can update parameters using the gradient information of the objective function with respect to continuous parameters. For example, the preset gradient method can be an optimization objective that minimizes the comprehensive objective function. The comprehensive objective function can be expressed as follows:

[0118] in, The overall objective function; The target operation error term can be represented by fidelity error, trace distance, Frobenius norm distance, energy error, mission success rate loss, or other differentiable / approximately differentiable evaluation indicators. Indicates the cost of route depth; Indicates the cost of gate count; This indicates penalties for hardware violations; Indicates noise sensitivity or error propagation cost; This represents the costs associated with time budget, parallelism, and resource control. ~ Indicates weight, ~ It can be preset by the user, set by experience, or determined adaptively.

[0119] The preset gradient method can also be gradient descent, Adam (Adaptive Moment Estimation), adaptive second-order optimization, natural gradient, adjoint method, parameter offset method, mixed precision optimization or a combination thereof.

[0120] The candidate generation module 32 can temporarily fix the discrete gate structure and perform gradient optimization on the continuous parameters corresponding to the candidate quantum circuits to determine the optimization result by using a preset gradient method.

[0121] The optimization results may also include the gradients of each continuous parameter component, the sensitivity of each gate unit, the local contribution of the synthesized objective function to each gate unit or each local sub-circuit unit, the performance change after deleting a certain gate unit, the performance change after replacing a certain type of gate, and the main sources of hardware constraint penalties.

[0122] For discrete gate structures or non-parametric gates, although the general gradient cannot be directly calculated for their gate type, the candidate generation module 32 can still estimate the structural importance through local perturbation, deletion test, replacement test, continuous relaxation, or surrogate network. Therefore, the "gradient optimization" in this application is not limited to taking the derivative with respect to continuous parameters in a strict mathematical sense, but refers to any reflowable optimization signal that can be used to measure the quality of gate units or local sub-circuit units.

[0123] Through the above embodiments, the technical solution of this application can reduce the error between the candidate circuit and the target quantum operation by systematically optimizing the continuous parameters of the repair candidate quantum circuit through gradient optimization.

[0124] Optionally, see Figure 5 Step S123 may include steps S1231-S1234.

[0125] In step S1231, based on the optimization results, the feedback score of the current quantum circuit unit for repairing the candidate quantum circuit is determined.

[0126] According to the example embodiment, a quantum circuit unit is a basic structural unit in a repair candidate quantum circuit that can be independently evaluated. For example, a quantum circuit unit can be a gate unit or a local sub-circuit unit.

[0127] Feedback scores can be used as a quantitative indicator to measure the impact of a particular quantum circuit unit on the overall quality of the current candidate quantum circuit for repair. For example, a feedback score can be expressed as:

[0128] in, Rate it as feedback; Indicates deletion of the first l The objective function changes after each gate element; Indicates the first l The gradient norm corresponding to the continuous parameters of each gate unit; Indicates the first l The degree of hardware non-compliance or noise risk brought about by individual gate units; Indicates the first l The degree of instability, redundancy, or lack of diversity in the local window where each gate unit is located; ~ For weights.

[0129] For non-parametric abstract gate sets (e.g., Hadamard gates, CNOT gates), there is no direct gradient norm for continuous parameters. Feedback scoring may include deleting the... l The change term of the synthesized objective function after each gate unit, the first lThe degree of hardware non-compliance or noise risk brought about by each gate unit, and the first l The degree of instability, redundancy, or lack of diversity of the local window where each gate unit is located.

[0130] For example, in step S1231, the candidate generation module 32 determines the feedback score of the current quantum circuit unit for repairing the candidate quantum circuit based on the optimization results (e.g., the comprehensive objective function).

[0131] In step S1232, the corresponding quantum circuit unit is determined as a retained unit or an updated unit based on the feedback score and preset score conditions.

[0132] According to the example embodiment, the preset scoring condition can be a preset threshold for feedback scoring, used to determine whether the feedback score is high or low. The strategy for determining the preset scoring condition may include sorting the feedback scores from high to low, taking the median, average, or a certain percentage (e.g., 60%, 70%, etc.).

[0133] The strategy for determining the preset scoring conditions may also include setting a fixed threshold or dynamically adjusting the threshold.

[0134] The reserved unit can be a quantum circuit unit with a high feedback score (e.g., higher than or equal to a preset score condition). The updated unit can be a quantum circuit unit with a low feedback score (e.g., lower than a preset score condition).

[0135] For repairing the head, middle, and tail of candidate quantum circuits, the preset scoring conditions can be different to accommodate the differences in importance of the prefix preparation segment, core computation segment, and post-processing segment in different tasks.

[0136] For example, in step S1232, the candidate generation module 32 determines the corresponding quantum circuit unit as a retained unit or an updated unit based on the feedback score and preset scoring conditions. The candidate generation module 32 determines quantum circuit units with feedback scores higher than or equal to the preset scoring conditions as retained units. The candidate generation module 32 determines quantum circuit units with feedback scores lower than the preset scoring conditions as updated units.

[0137] In step S1233, all quantum circuit units are traversed to obtain all retained units and all updated units.

[0138] According to the example embodiment, in step S1233, the candidate generation module 32 traverses all quantum circuit units to obtain all retained units and all updated units.

[0139] In step S1234, the reserved area and the updated area are determined based on all the reserved units and all the updated units.

[0140] According to the example embodiment, in step S1234, the candidate generation module 32 determines the reserved region and the updated region based on all the reserved units and all the updated units. The candidate generation module 32 can aggregate all the reserved units to determine the reserved region. The candidate generation module 32 can aggregate all the updated units to determine the updated region.

[0141] The update region can be a discrete number of gate cell positions or a continuous window (e.g., a sub-line block formed from the m-th gate cell to the n-th gate cell).

[0142] Through the above embodiments, the technical solution of this application can determine the feedback score of the current quantum circuit unit for repairing candidate quantum circuits through optimization results. The technical solution of this application can determine the corresponding quantum circuit unit as a retained unit or an updated unit through the feedback score and preset scoring conditions. The technical solution of this application can traverse all quantum circuit units to obtain all retained units and all updated units. The technical solution of this application can determine the retained region and the updated region through all retained units and all updated units.

[0143] Since the continuous parameters have reached a local optimum under the current fixed structure after gradient optimization converges, the gradient norm and error contribution of each quantum circuit unit can truly reflect the rationality of the structure itself. For example, a region where the gradient norm approaches zero but the error is still large indicates that there is a problem with the structure itself, which needs to be repaired through local regeneration. On the other hand, a region where the gradient contribution is significant indicates that parameter optimization can effectively improve the region and is worth retaining.

[0144] The technical solution of this application establishes a feedback score based on the optimization results for each quantum circuit unit, which can accurately locate which quantum circuit units are the key weak areas (i.e., update areas) that cause the current comprehensive error to be large. Based on this accurately divided update area, local regeneration is performed, which makes the structural repair targeted and avoids the unnecessary computational overhead caused by resampling the entire circuit.

[0145] Optionally, step S124 can specifically be as follows: the candidate generation module 32 fixes the reserved area and performs local regeneration on the updated area through a preset local regeneration method to obtain the updated candidate quantum circuit.

[0146] According to the example embodiment, the preset local regeneration method is at least one of the following: mask-based regeneration, edit-based regeneration, replacement-based regeneration, candidate gate set switching-based regeneration, and gate-to-gate block-level regeneration.

[0147] Mask-based regeneration can apply a mask to the candidate generation module 32 at the updated region locations, indicating that the gate type, gate order, active bits, and parameter values ​​at these locations can be resampled; the reserved region locations are locked as conditional inputs. In this way, the generative model only needs to repair local areas, without having to redo the entire circuit. The candidate generation module 32 can input the mask locations into the generative model based on the optimization feedback score to invoke the generative model for local regeneration, thereby obtaining the updated candidate quantum circuit.

[0148] Editable regeneration allows the candidate generation module 32 to input a "partially fixed, partially editable" template into the generative model. The template explicitly includes the reserved gates, key gates, optimized continuous parameters, and unchangeable positions. The generative model is then required to add entirely new gate sequences and continuous parameters to the remaining positions. Based on the optimization feedback score, the candidate generation module 32 determines that the gates in the reserved region should be fixed, and the gates in the updated region should be edited. It then requires the generative model to add entirely new gate sequences and continuous parameters to the remaining positions to obtain the updated candidate quantum circuit.

[0149] Replacement-based regeneration allows the candidate generation module 32 to extract the region to be replaced into a local sub-circuit block and submit it to the generative model in the form of "preserving the prefix + the block to be replaced + preserving the suffix". The generative model then generates a new block to be replaced while keeping the prefix and suffix unchanged, thus obtaining an updated candidate quantum circuit. Replacement-based regeneration is suitable for scenarios where the intermediate local structure is obviously unreasonable, but the beginning and end are already relatively good for the overall task.

[0150] For scenarios involving a mixture of abstract and native gates, the candidate generation module 32 can employ a gate set switching regeneration approach, changing the allowed gate sets during the local regeneration phase. For example, during the initial candidate quantum circuit generation phase, the generative model quickly finds a superior structure on the abstract gate set. Then, during the local regeneration phase, the generative model switches to the native gate set or a hybrid gate set of abstract and native gates, rewriting the updated region in a "native" manner, thereby avoiding secondary compilation of the entire circuit.

[0151] Gate-to-gate-block level regeneration allows generative models to first extract high-frequency gate pairs, gate blocks, and gadgets (structural modules) from historical high-quality quantum circuits as reusable structural units, and then preferentially insert these high-quality reusable structural units during local regeneration.

[0152] The updated candidate quantum circuit can be represented as:

[0153] in, These represent different updated candidate quantum circuits; 'a' represents the iteration number in round a; and 'K' represents the number of updated candidate quantum circuits. K can be set according to the complexity of the comprehensive task information; for example, K can be from 2 to 10000. Preferably, K can be from 8 to 2048, or from 32 to 512.

[0154] Through the above embodiments, the technical solution of this application can perform local regeneration on the updated region using a preset local regeneration method to obtain the updated candidate quantum circuit. The technical solution of this application provides multiple local regeneration strategies, enabling flexible selection of the most suitable method based on the structural characteristics of the specific updated region, task type, and hardware constraints.

[0155] See Figure 8 The quantum circuit synthesis device of this application may also include a training module 34. The following is in conjunction with... Figure 8 This application describes a quantum circuit synthesis method based on a generative model and gradient feedback, as provided in document 2000. See also... Figure 6 The quantum circuit synthesis method 2000 may include steps S210-S240.

[0156] Step S210 is the step for training the generative model. See also... Figure 7 Step S210 includes steps S211-S213.

[0157] In step S211, the training dataset is obtained.

[0158] According to the example embodiment, the training dataset can be used as a sample set for training a generative model. For example, in step S211, the training module 34 obtains the training dataset. The sources of the training dataset may include: randomly sampled circuits and their corresponding target operations, high-quality circuits generated by existing search or compilers, standard sub-circuits designed manually or constructed by experts, and native gate impulse templates obtained through hardware calibration.

[0159] Each sample in the training dataset can be constructed as a training pair, which may include the target operation representation, the corresponding gate set conditions, the hardware constraints, and the reference circuit.

[0160] In step S212, an initial generative model is constructed.

[0161] According to the example embodiment, the initial generative model can be an initial generative model architecture and initialized model parameters. For example, in step S212, the training module 34 constructs an initial generative model. The training module 34 can construct an initial generative model architecture (including discriminators and generators) such as a diffusion model, an autoregressive model, a variational autoencoder, a streaming model, an adversarial generative model, and a retrieval-enhanced generative model, and initialize the model parameters.

[0162] In step S213, the training dataset is input into the initial generative model to train the initial generative model, thereby obtaining the trained generative model.

[0163] For example, in step S213, the training module 34 inputs the training dataset into the initial generative model to train the initial generative model, thereby obtaining a trained generative model. The training module 34 can preprocess the training dataset (e.g., encode it). The training module 34 inputs the preprocessed training dataset into the initial generative model, the generator outputs candidate lines, and the discriminator compares the loss of the candidate lines with that of the reference lines, and re-inputs the data into the generator for multiple rounds of iterative training, thereby obtaining a trained generative model.

[0164] See Figure 6 Steps S220-S240 are the same as steps S110-S130, so they will not be described again.

[0165] Through the above embodiments, the technical solution of this application can improve the accuracy of the output of the generative model by training the generative model.

[0166] Step S213 can be specifically described as follows: the training module 34 inputs the training dataset into the initial generative model so that the initial generative model outputs the training discrete gate structure through the first branch and the training continuous parameters through the second branch, thereby obtaining the trained generative model.

[0167] According to the example implementation, the initial generative model can be a diffusion model structure with two branches, an autoregressive model, a variational autoencoder, a stream model, an adversarial generative model, a retrieval-enhanced generative model, etc. For example, the first branch is a classification diffusion branch that processes discrete gate types (using a discrete denoising network to output the conditional probability distribution of each gate type), and the second branch is a regression diffusion branch that processes continuous parameters (using a continuous denoising network to output the mean and variance of the parameters). The two branches share a Transformer encoder layer to extract the conditional features of the target operation representation.

[0168] For example, a generative model can be a combination of diffusion models, autoregressive models, variational autoencoders, streaming models, adversarial generative models, and retrieval-enhanced generative models. The first branch is one of the diffusion models, autoregressive models, variational autoencoders, streaming models, adversarial generative models, and retrieval-enhanced generative models, while the second branch is a different model from the first branch.

[0169] According to the example embodiment, the training module 34 can encode the reference circuit as a bimodal object consisting of a "discrete gate structure representation + continuous parameter representation". The discrete gate structure is used to characterize the gate type and connection relationship, while the continuous parameters are used to characterize angle, phase, or pulse parameters.

[0170] Training module 34 inputs the training dataset into the initial generative model, enabling the initial generative model to adopt a separate diffusion training process for discrete gate structures and continuous parameters. This allows the generative model to learn the distribution patterns of both discrete gate structures and continuous parameters simultaneously. The cross-fusion of features from the two branches allows the generative model to establish the correlation between the selection of discrete structures and the values ​​of continuous parameters during the training phase, thereby obtaining the trained generative model.

[0171] For example, training module 34 also trains auxiliary networks for the generative model. These auxiliary networks include: a legitimacy prediction network, a local error estimation network, a gate importance estimation network, and a hardware executability scoring network. The auxiliary networks can provide fast scoring for steps S121 and S123 without having to solve the entire cost function each time.

[0172] For example, the training module 34 can also add the high-quality target quantum circuit output in step S130 to the training dataset to further fine-tune the generative model, thereby forming a self-reinforcing mechanism of "learning in use".

[0173] The technical solution of this application uses a dual-branch joint training mechanism to make the initial values ​​of continuous parameters in the subsequent gradient optimization stage closer to the local optimum, thereby reducing the number of iteration steps required for gradient optimization, thus reducing the computational overhead of the overall synthesis process, and improving the quality of the initial candidate quantum circuits.

[0174] According to another aspect of this application, this application also provides a non-volatile computer-readable storage medium storing a computer program thereon, which, when executed by a processor, is capable of implementing the quantum circuit synthesis method based on generative models and gradient feedback as described above.

[0175] According to another aspect of this application, this application also provides an electronic device, including: one or more processors; and a storage device for storing one or more programs, which, when executed by one or more processors, enable the one or more processors to implement the quantum circuit synthesis method based on generative models and gradient feedback as described above.

[0176] According to another aspect of this application, this application also provides a computer program product, including: a computer program stored on a computer-readable storage medium; the computer program includes program instructions that, when executed by a computer, cause the computer to perform the quantum circuit synthesis method based on generative models and gradient feedback as described above.

[0177] Finally, it should be noted that the above description is merely a preferred embodiment of this application and is not intended to limit this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions of the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A quantum circuit synthesis method based on generative models and gradient feedback, characterized in that, The quantum circuit synthesis method includes: Based on the generative model, an initial candidate quantum circuit is generated according to the received integrated task information, wherein the initial candidate quantum circuit includes discrete gate structure and continuous parameters; Perform the step of generating updated candidate quantum circuits at least once, including: The initial candidate quantum circuits are checked according to preset check conditions to determine the candidate quantum circuits to be repaired; Gradient optimization is performed on the continuous parameters corresponding to the candidate quantum circuit for repair to determine the optimization result of the candidate quantum circuit for repair. Based on the optimization results, the reserved region and the updated region of the candidate quantum circuit for repair are determined; The reserved region is fixed, and a local regeneration is performed on the updated region to obtain the updated candidate quantum circuit; If the updated candidate quantum circuits meet the preset iteration termination conditions, the updated candidate quantum circuits are subjected to target screening to obtain the target quantum circuits.

2. The quantum circuit synthesis method according to claim 1, characterized in that, The generation of initial candidate quantum circuits based on the generative model and the received integrated task information includes: The integrated task information and the preset route information are encoded as the conditional inputs of the generative model; The generative model is invoked, and the conditional inputs and outputs are fed into the generative model to obtain the initial candidate quantum circuit.

3. The quantum circuit synthesis method according to claim 2, characterized in that, The step of calling the generative model and sending the conditional inputs and outputs to the generative model to obtain the initial candidate quantum circuits includes: The process involves calling the generative model, inputting the conditional inputs into the generative model, and obtaining the discrete gate structure output by the first branch and the continuous parameters output by the second branch.

4. The quantum circuit synthesis method according to claim 1, characterized in that, The preset inspection conditions include preset inspection constraints and preset repair conditions; The step of checking the initial candidate quantum circuits according to preset check conditions to determine the candidate quantum circuits for repair includes: Determine whether the initial candidate quantum circuit satisfies the preset check constraint; If the initial candidate quantum circuit does not meet the preset check constraint, determine whether the initial candidate quantum circuit meets the preset repair condition; If the initial candidate quantum circuit meets the preset repair conditions, the initial candidate quantum circuit that meets the preset repair conditions is repaired to determine the repair candidate quantum circuit.

5. The quantum circuit synthesis method according to claim 1, characterized in that, The step of performing gradient optimization on the continuous parameters corresponding to the candidate quantum circuit for repair to determine the optimization result of the candidate quantum circuit for repair includes: The continuous parameters corresponding to the candidate quantum circuit for repair are optimized by a preset gradient method to determine the optimization result.

6. The quantum circuit synthesis method according to claim 1, characterized in that, The step of determining the reserved region and updated region of the candidate quantum circuit for repair based on the optimization results includes: Based on the optimization results, the feedback score of the current quantum circuit unit of the candidate quantum circuit to be repaired is determined; Based on the feedback score and the preset score conditions, the corresponding quantum circuit unit is determined as a retained unit or an updated unit; Traverse all quantum circuit units to obtain all retained units and all updated units; The reserved region and the updated region are determined based on all the reserved units and all the updated units.

7. The quantum circuit synthesis method according to claim 1, characterized in that, The process of fixing the reserved region and performing local regeneration on the updated region to obtain the updated candidate quantum circuit includes: The reserved region is fixed, and the updated region is locally regenerated using a preset local regeneration method to obtain the updated candidate quantum circuit; The preset local regeneration method is at least one of the following: mask-based regeneration, edit-based regeneration, replacement-based regeneration, candidate gate set switching-based regeneration, and gate-to-gate block-level regeneration.

8. The quantum circuit synthesis method according to claim 1, characterized in that, Before generating initial candidate quantum circuits based on the generative model and the received synthesis task information, the quantum circuit synthesis method further includes: The steps for training the generative model include: Obtain the training dataset; Construct an initial generative model; The training dataset is input into the initial generative model to train the initial generative model, thereby obtaining the trained generative model.

9. The quantum circuit synthesis method according to claim 8, characterized in that, The step of inputting the training dataset into the initial generative model to train the initial generative model and thereby obtain the trained generative model includes: The training dataset is input into the initial generative model, so that the initial generative model outputs training discrete gate structures through the first branch and training continuous parameters through the second branch, thereby obtaining the trained generative model.

10. A quantum circuit synthesis device based on generative models and gradient feedback, characterized in that, The quantum circuit synthesis device includes: An initial candidate generation module, based on the generative model, generates initial candidate quantum circuits according to the received integrated task information, wherein the initial candidate quantum circuits include discrete gate structures and continuous parameters; The candidate generation module performs at least one step to generate updated candidate quantum circuits, including: The candidate generation module checks the initial candidate quantum circuits according to preset check conditions to determine the candidate quantum circuits to be repaired. The candidate generation module performs gradient optimization on the continuous parameters corresponding to the repair candidate quantum circuit to determine the optimization result of the repair candidate quantum circuit; The candidate generation module determines the reserved region and the updated region of the repair candidate quantum circuit based on the optimization results; The candidate generation module fixes the reserved region and performs local regeneration on the updated region to obtain the updated candidate quantum circuit; The result output module performs target screening on the updated candidate quantum circuits to obtain the target quantum circuits when the updated candidate quantum circuits meet the preset iteration termination conditions.