A method for gate parameter optimization in quantum circuit parameterized decomposition

By combining Cartan decomposition and COBYLA optimization under Weyl room constraints with covering polyhedra and penalty terms, the high computational cost and local optima problems in the selection and parameter setting process of two-qubit gates are solved, achieving efficient and controllable quantum circuit decomposition and compilation.

CN122334533APending Publication Date: 2026-07-03NANTONG UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANTONG UNIV
Filing Date
2026-03-19
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

In existing quantum computing technologies, the selection and parameter setting process of two-qubit gates is computationally expensive, making it difficult to support a full design space search. Furthermore, it is prone to getting trapped in local optima, and the decomposition results are uncontrollable in terms of gate-level accuracy. It also lacks a measurement and reward mechanism for the coverage and diversity of the design space.

Method used

Cartan decomposition is used to parameterize the two-qubit gate into a local single-qubit gate and a non-local part, confined to the Weyl room. The COBYLA optimization algorithm is used for local search, and a surrogate cost function is constructed by combining the covering polyhedron and the penalty term to perform fast screening and true decomposition optimization, ensuring the stability of the decomposition depth and fidelity index.

Benefits of technology

It significantly improves the efficiency of design space search, ensures controllable gate-level precision of decomposition results, optimizes overall execution quality, and enhances the reliability and compilation efficiency of quantum circuits.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122334533A_ABST
    Figure CN122334533A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of quantum computing and quantum software engineering, and particularly relates to a gate parameter optimization method in quantum circuit parameterized decomposition. The method solves the problem that a large number of target gates need to be decomposed and optimized, the calculation cost is high, and it is difficult to support sufficient design space search. The technical scheme comprises the following steps: step S1: basic gate set definition and parameterized representation; step S2: quantum circuit preprocessing and benchmark parameter evaluation optimization; and step S3: quadratic optimization based on true value decomposition and decomposition circuit output. The present application has the beneficial effects that: by combining low-cost proxy screening with high-precision real decomposition, the parameter optimization efficiency is greatly improved under the premise of ensuring the decomposition accuracy, and the search space is widened through the exploration degree reward mechanism, and finally the basic gate parameters with better performance in fidelity and depth are output.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of quantum computing and quantum software engineering technology, and in particular to a method for optimizing gate parameters in the parameterization decomposition of quantum circuits. Background Technology

[0002] Quantum computing has already demonstrated its potential advantages in tasks such as combinatorial optimization and quantum chemical simulation. However, current mainstream hardware is still in the Noisy Intermediate-Scale Quantum (NISQ) stage. According to the paper (McKinney E, Bishop L S. Two-Qubit Gate Synthesis via Linear Programming for Heterogeneous Instruction Sets[J]. arXiv preprint arXiv:2505.00543,2025.), the gate error and depth accumulation effect of two-qubit (2Q) quantum qubits often become the main bottlenecks determining the usability of the algorithm. To achieve cross-platform and portable quantum software stacks, the industry generally adopts a layered structure of "front-end language / framework - quantum intermediate representation (QIR) - back-end compilation and execution". (See the paper "YAQQ: Yet Another Quantum Quantizer — Design SpaceExploration of Quantum Gate Sets using Novelty Search", arXiv:2406.17610,2024.). For example, intermediate representations such as QIR based on the Low-Level Virtual Machine (LLVM) ecosystem provide a unified platform for subsequent mapping, scheduling, gate set constraints, and optimization. The referenced paper (Javadi-Abhari A, Treinish M, Krsulich K, et al. Quantum computing with Qiskit[J]. arXiv preprint arXiv:2405.08810, 2024.) states that the intermediate representation layer still needs to be compiled into the processor's native instruction set (ISA). The selection and parameter settings of the two-qubit basic gates directly affect the circuit depth, number of gates, and process fidelity, and are a key link connecting the architecture and the compiler.

[0003] The referenced paper (Peterson EC, Crooks GE, Smith R S. Fixed-depth two-qubitcircuits and the monodromy polytope[J]. Quantum, 2020, 4: 247.) states that to stably and portablely deploy high-level quantum algorithms across different hardware platforms, modern quantum software stacks generally adopt a layered structure of "front-end language / framework → quantum intermediate representation → back-end compilation and execution". The referenced paper (Lao L, Murali P, Martonosi M, etal. Designing calibration and expressivity-efficient instruction sets for quantum computing[C] / / 2021 ACM / IEEE 48th Annual International Symposium on Computer Architecture (ISCA). IEEE, 2021: 846-859.) states that the intermediate representation layer carries the semantics of the quantum program and provides a unified interface for compilation processes such as optimization, mapping, scheduling, and gate set constraints, thereby reducing the redundant development costs between different languages ​​and different hardware back-ends. In recent years, intermediate representation layer architectures for interoperability and compilation infrastructure have continued to develop, such as QIR based on the LLVM ecosystem, and near-end quantum program description and other technologies, providing more standardized representation carriers for cross-platform compilation and optimization.

[0004] The referenced paper (Yang Z, Zhang K, Tian X, et al. Qubit Mapping and Routing tailored to Advanced Quantum ISAs: Not as Costly as You Think[J]. arXivpreprint arXiv:2511.04608, 2025.) states that regardless of how the intermediate representation layer evolves, the quantum circuits ultimately need to be compiled to the native gate set supported by the target processor. The choice of instruction set directly affects: circuit depth and number of gates, overall error and fidelity, and compilation and optimization complexity. Therefore, the instruction set design problem, which revolves around "how to select / set parameters / how to quickly evaluate and use the basic gates of two qubits for circuit decomposition," has become a key link connecting quantum architecture and quantum compilers.

[0005] The referenced paper (Peterson EC, Bishop LS, Javadi-Abhari A. Optimal synthesis into fixed xx interactions[J]. Quantum, 2022, 6: 696.) states that existing two-qubit gate decompositions are often based on Cartan / standard decompositions, representing any two-qubit unitary gate as a combination of "local single-qubit gate - non-local kernel - local single-qubit gate", and using numerical optimization to find local compensation to improve the decomposition fidelity; the referenced paper (Dawson CM, Nielsen M A. The solovay-kitaev algorithm[J]. arXiv preprintquant-ph / 0505030, 2005.) states that single-qubit gate discretization often uses Solovay-Kitaev-like algorithms or discrete basis search.

[0006] Reference paper (Wu A, Leng J, Guo M. Design the quantum instruction set with the cartan coordinate analysis framework[J]. arXiv preprint arXiv:2410.04008,2024.) With the improvement of device control capabilities, non-standard or continuously parameterized two-qubit gates are gradually becoming achievable and being used to reduce implementation costs. Related research proposes an analytical analysis framework based on Cartan coordinates to accelerate the conversion between two-qubit gates and the exploration of the instruction set design space. Other works explore the gate set design space from multiple objective perspectives such as "depth-fidelity-novelty," employing strategies such as novelty search and providing comparative evaluation tools. Reference paper (Lin SF, Sussman S, Duckering C, et al. Let each quantum bit choose its basis gates[C] / / 2022 55thIEEE / ACM International Symposium on Microarchitecture (MICRO). IEEE, (2022:1042-1058.) Meanwhile, at the experimental level, verification of unified control and efficient implementation of arbitrary two-qubit gates has emerged, further strengthening the feasibility of "instruction set design for hardware-calibrable gate families".

[0007] The referenced paper (AL Ajmi NA, Shoaib M. Optimization Strategies in QuantumMachine Learning: A Performance Analysis[J]. Applied Sciences, 2025, 15(8):4493.) compares the performance of three optimizers—COBYLA, L-BFGS-B, and ADAM—for quantum classification model systems in the field of quantum machine learning. COBYLA, representing derivative-free optimization methods, approximates the objective function through a linear interpolation model, making it suitable for handling quantum indices such as fidelity that are difficult to directly differentiate. L-BFGS-B, representing quasi-Newton methods, relies on gradient information for parameter updates and has the advantage of fast convergence in scenarios where the objective function is smooth and differentiable. This research verifies the significant advantages of the COBYLA algorithm over gradient-based methods in balancing accuracy and efficiency in quantum machine learning tasks, and also provides an important methodological reference for optimizing the basic gate parameters of two qubits involving complex indices such as fidelity and depth in quantum compilation.

[0008] In summary, the automatic design and compilation of parameterized two-qubit fundamental gates still has three shortcomings:

[0009] Firstly, if the depth / fidelity statistics after complete decomposition are directly used as the cost function, a large number of target gates need to be decomposed and optimized for each set of parameters, which is computationally expensive and difficult to support sufficient design space search.

[0010] Secondly, existing searches mostly focus on depth or fidelity as a single objective, lacking a measurement and reward mechanism for the coverage and diversity of the design space, and are prone to converge to similar basic gate regions and get trapped in local optima;

[0011] Third, the evaluation results often rely on average statistics. A small number of "difficult gates" may have significantly lower gate-level fidelity but are masked by the average value, resulting in uncontrollable gate-level precision in the final decomposition. Summary of the Invention

[0012] The purpose of this invention is to provide a method for optimizing gate parameters in the parameterization decomposition of quantum circuits: firstly, a low-cost candidate evaluation is constructed and the candidate parameters are quickly optimized within the feasible region to improve search efficiency and encourage exploration of a wider design space; then, the candidate parameters are subjected to true decomposition and gate-level verification, and the truth value evaluation is performed on indicators such as depth and process fidelity, which can be further optimized, thereby achieving better decomposition depth and more stable overall execution quality while ensuring gate-level accuracy constraints.

[0013] To achieve the above-mentioned objectives, the present invention adopts the following technical solution:

[0014] A method for gate parameter optimization in quantum circuit parameterization decomposition includes the following steps:

[0015] Step S1: Definition and parameterized representation of the basic gate set;

[0016] To address the issues of non-standard parameter representation and redundant search space in the optimization process of parameterized two-qubit basic gates, this invention first employs Cartan decomposition. That is, any two-qubit gate can be decomposed into a local single-qubit gate and a non-local part described by three real parameters, which is called the standard canonical gate. The definition is as shown in formula (1):

[0017] (1);

[0018] By using the standard specification representation of the nonlocal part, the basic gate is parameterized and restricted to the uniquely feasible geometric space, the Weyl chamber. The corresponding Cartan coordinates in equation (1) A basic domain, namely the Weyl room, is selected under symmetric equivalence to ensure that "the same local equivalence class corresponds to only one unique point", which provides a foundation for subsequent efficient and standardized parameter optimization and line decomposition.

[0019] Step S11: Definition and parameterized representation of the basic gate set

[0020] This invention addresses the task of quantum circuit decomposition and defines a candidate instruction set: the set of basic single-qubit gates is given by a string sequence, and four basic gate types are defined as H1, T1, S1, and Z1, thereby ensuring that the same set of basic gates maintains a consistent discrete encoding method in different operations. The definitions of single-qubit gates are shown in Table 1.

[0021] Table 1. Gate symbol representation and description for single qubits

[0022]

[0023] Step S12: Standard gauge representation of parameterized two-qubit fundamental gates and Weyl room feasible region constraints

[0024] To ensure that the nonlocal gate corresponding to the parameters is in a canonically unique standard domain, this invention uses the canonical coordinates of the nonlocal part of the two-qubit gate. The selection is confined to the Weyl chamber, and any candidate points outside the Weyl chamber are projected and repaired before being evaluated and optimized; the Weyl chamber constraint is expressed by formula (2):

[0025] (2);

[0026] Furthermore, this invention employs a nonlinear constrained optimization algorithm (COBYLA) as the optimization method, which is applicable to nonlinear constrained optimization problems without gradient information. By explicitly imposing these constraints in the form of inequality constraints, the search process is ensured to remain feasible at all times.

[0027] Step S2: Quantum circuit preprocessing and benchmark parameter evaluation and optimization;

[0028] Considering that performing full circuit decomposition directly on each candidate parameter would be too costly, this invention preprocesses the quantum circuits to construct a fast proxy cost evaluation function. This step is used to optimize the objective function of each circuit before evaluation, adjusting the parameters of each quantum gate while ensuring the fidelity and depth requirements of the target quantum circuit.

[0029] By using a local search method based on the COBYLA optimization algorithm, the parameter configuration of each quantum gate is progressively improved, balancing computational cost, number of qubits, depth, and degree of parameter exploration. The optimization process follows these steps in sequence:

[0030] Step S21: Preprocess the quantum circuit, including each two-qubit gate in the target circuit. The non-local portion of the canonical coordinates is extracted as shown in formula (3):

[0031] (3);

[0032] in Mapping a gate to the Weyl room basic domain requires satisfying the following constraints: ;

[0033] Candidate two-qubit gates are represented using standard nonlocal gates, and the definitions of some two-qubit gates are given in Table 2. Basic gates for candidate two-qubit gates are also provided. Similarly, extract the corresponding standard coordinates. ;

[0034] Table 2. Notation and Description of Two-Qubit Gates

[0035]

[0036] Step S22: Calculate the overall score of the candidate parameters using the evaluation cost function. The cost function takes into account four dimensions, as shown in formula (4):

[0037] (4);

[0038] in Penalty term for the deviation of the basic gate parameters from the target. The weighting coefficients, Estimating the number of calls for a two-qubit gate The weighting coefficients, The weighting coefficients for novelty are used to explore its degree. This is the penalty coefficient for the boundary and special point penalty term ill;

[0039] In this step, the present invention uses the baseline parameters as the initial point and calls the COBYLA optimizer to perform a local search under the Weyl room constraint; the maximum number of iterations and the initial exploration radius are set. The output of this stage is the candidate parameters that minimize the evaluation cost, which are used to enter the truth evaluation and optimization of the next stage. The construction method of the four dimensions is shown in steps S221~S224;

[0040] Step S221: Design a penalty term for deviations of the basic gate parameters from the target.

[0041] To accurately reflect the geometric folding and symmetry equivalence classes of Weyl chambers, basic gates are defined. The set of all equivalent points that can be reached by the Cartan coordinates under the Weyl indoor symmetry transformation is the Weyl orbital. As shown in formula (5):

[0042] (5);

[0043] in To standardize coordinate points, This represents a symmetric transformation of the coordinate points. Let be the set of finite symmetric transformations corresponding to the Weyl chamber. This indicates that the transformed points will be folded back into the Weyl chamber basic domain;

[0044] Based on this, the target gate is defined. With basic gates Minimum distance between orbits As shown in formula (6):

[0045] (6);

[0046] in, Refers to the basic gate The set of all equivalent points achievable under the Weyl indoor symmetry transformation. Refers to a set One of the equivalent points;

[0047] min refers to the Weyl interior target door. Set of Equivalence Points The minimum distance;

[0048] Construct a weighted distance penalty set for:

[0049] (7);

[0050] The physical meaning of this term is: if the Weyl cell coordinates of the candidate fundamental gate are closer to the two-qubit gate distribution of the target circuit in the sense of symmetry equivalence, then subsequent two-qubit gate decomposition is easier to achieve higher fidelity with fewer layers; otherwise, deeper layers are required or it is more difficult to achieve high fidelity. Therefore, a penalty term is used. This suppresses the situation where candidate basic gates deviate too far from the target distribution, thereby improving reachability and decomposition efficiency.

[0051] Step S222: Estimating the number of calls to the two-qubit gate Construction

[0052] To sum the lower bound estimates of the number of basic two-qubit gate calls required to decompose each two-qubit gate in the circuit, this invention uses a coverage polytope approximation. ;

[0053] For candidate basic gates Construct its orbital point set in the Weyl chamber. The covering polyhedron is obtained using the standard convex hull algorithm. Its construction is shown in formula (8):

[0054] (8);

[0055] in For convex hull operators;

[0056] In calculation, it is converted into an inequality, as shown in formula (9):

[0057] (9);

[0058] Where x represents all points that satisfy the inequality. Each row corresponds to a plane of the polyhedron. Each row represents a normal vector of the plane. For the corresponding bias term;

[0059] The set covered by using k basic gates is considered to be approximately equivalent to formula (10):

[0060] (10);

[0061] Linear scaling is applied to the covering polyhedron obtained from the convex hull of the basic gate orbit. Coverage for approximating k basic gate calls ;

[0062] However, to truly achieve this The cost is too high, requiring the intercepts and inequality coefficients of all faces to be rewritten according to the rules. Therefore, x / k is calculated and it is determined whether it is within the inequality to avoid repeatedly constructing the enlarged polyhedron, thereby improving the efficiency and numerical stability of the surrogate evaluation.

[0063] In implementation, the target gate's Weyl coordinates are equivalently scaled by 1 / k and then tested to see if it falls within the range. For any target gate of the target line ,make Then, an approximate determination can be made as shown in formula (11):

[0064] (11);

[0065] The maximum violation in a half-space is defined as in formula (12):

[0066] (12);

[0067] When viol <= 0, it means exist Therefore, it is assumed that k basic gate calls are sufficient to cover the target gate;

[0068] When void > 0, it is considered that k basic gate calls are insufficient to cover the target gate, and a lower bound estimate of the number of two-qubit gate calls is constructed. As shown in formula (13):

[0069] (13);

[0070] Give the estimated number of calls for the full-line two-qubit gate. As in formula (14):

[0071] (14);

[0072] Since each additional layer of two-qubit basic gates in the two-qubit gate decomposition typically introduces a corresponding single-qubit local gate layer, therefore, using The lower bound of the decomposition depth of the circuit is derived, thereby imposing a constraint on the trend of decomposition depth in the cost evaluation function;

[0073] Step S223: Construct the novelty to avoid over-convergence to the baseline solution.

[0074] To avoid getting stuck in local optima or over-converging to the initial benchmark solution during the optimization of basic gate parameters of nonlocal two-qubit quantum bits, this invention introduces an exploration degree incentive term into the proxy cost function. This term is used to encourage candidate parameters to maintain a moderate difference from the benchmark parameters while ensuring a decrease in execution overhead such as depth, thereby improving the search space coverage and the probability of obtaining better decomposition results.

[0075] Let the current candidate basic gates The Cartan coordinates are Set the basic gate for the first optimization. The Cartan coordinates are ;

[0076] The formula for calculating novelty is shown in formula (15):

[0077] (15);

[0078] Among them, novelty_scale is a constant used to balance novelty within the range of 0 to 1;

[0079] Step S224: Constructing the boundary and special point penalty term ill;

[0080] However, coverage and geometric distance alone are insufficient to characterize the differences in numerical difficulty when approaching the boundary of the Weyl cell and special points. In practical two-qubit gate decomposition, candidate fundamental gates often exhibit gradient degradation, condition number deterioration, and slower convergence when close to the boundary of the Weyl cell or special degenerate points. To reflect this difference without performing a real decomposition, this invention introduces a penalty term, i11;

[0081] Define candidate basic gates Minimum distance to the boundary of the Weyl chamber As shown in formula (16):

[0082] (16);

[0083] The penalty term Ill is defined as shown in formula (17):

[0084] (17);

[0085] in Furthermore, since it is a stable constant, Ill is used to suppress candidate basic gates from falling near the boundary of the Weyl chamber or special points, thereby improving the convergence probability and efficiency of the subsequent real decomposition stage.

[0086] Step S23: After evaluating the baseline parameters using the above-described evaluation cost function, this invention can more accurately reflect the geometric boundaries, symmetrical folding characteristics, and numerical difficulty differences caused by special points of the Weyl chamber without performing a true decomposition, thereby significantly reducing the cost of candidate parameter screening. The baseline parameters are then optimized using the COBYLA optimizer. Perform optimization and obtain the optimized parameters. ; to provide higher quality parameters for the true decomposition verification in step S3;

[0087] Step S3: Secondary optimization and decomposition of circuit output based on truth decomposition

[0088] This step, after preliminary screening, performs truth-based circuit decomposition, evaluation, and re-optimization of candidate basic gate parameters. By performing realistic two-qubit gate decomposition and single-qubit gate discretization on the target circuit, the decomposition depth, gate count, and fidelity are directly obtained. Based on this, the truth cost function is calculated. Thus, while ensuring functional equivalence, the optimal parameter solution with the best real-world performance is selected and further optimized, providing a more reliable optimal input for subsequent overall compilation / execution. Constraint optimization is combined with local search under Weyl room parameter constraints to balance decomposition depth, gate count overhead, and fidelity. The method is implemented sequentially by the following steps:

[0089] Step S31: Apply reference parameters to the two-qubit gate of the target circuit. With optimization parameters The decomposition is performed using a template for two-qubit gate decomposition, involving enumeration and parameter optimization. The decomposition steps are as follows:

[0090] In the decomposition of two-qubit gates, a layer-by-layer search strategy is adopted;

[0091] For any two-qubit target unitary matrix U and a given two-qubit basic gate (BG), the number of layers increases from k=1 to a set threshold.

[0092] For any single-qubit gate, there are three parameters. ;

[0093] For each layer, enumerate all templates composed of single-qubit gates, two-qubit basic gates, or the conjugate transpose of two-qubit basic gates, and perform multiple random restarts on each template to finally generate a circuit composed of k+1 layers of single-qubit gates and k layers of two-qubit basic gates or the conjugate transpose of two-qubit basic gates.

[0094] The parameters of the single-qubit gates that make up the template are searched to achieve a given fidelity threshold and increase the probability of escaping local optima.

[0095] This invention sets continuous variables as parameter vectors of all local single-qubit gates in the template, with a parameter dimension of 6 (k+1), and minimizes the loss function within the boundary using a finite-memory quasi-Newton method (L-BFGS-B). As shown in formula (18):

[0096] (18);

[0097] in, The decomposed unitary matrix is ​​obtained by combining templates. This refers to the unitary matrix corresponding to the conjugate transpose of the target gate, where d represents the dimension of the quantum gate;

[0098] When the fidelity of a candidate decomposition reaches the threshold, it is determined that the accuracy requirement has been met at the current level, so the number of levels is stopped and the corresponding two-qubit gate decomposition circuit is output.

[0099] Using this decomposition template enables high-precision decomposition of two-qubit gates under threshold constraints, significantly improving the problem of unstable decomposition accuracy in existing methods. However, in cases of weak coupling or difficult parameter gate decomposition, increasing the number of layers is often necessary to meet the accuracy threshold, leading to higher gate depths and longer optimization time, thus creating an efficiency bottleneck. Therefore, step S2 can reduce the required number of layers through cost prediction and parameter optimization strategies to improve overall decomposition efficiency.

[0100] Step S32: Perform Solovay-Kitaev decomposition on the single-qubit gates and the single-qubit gates derived from the two-qubit gates of the target circuit. The decomposition steps are as follows:

[0101] In terms of single-qubit gate decomposition, this invention constructs a Solovay-Kitaev decomposer: given a list of basic gates for a single-qubit gate, a recursion depth, and a depth for generating basic approximate sequences, a numbered gate set is first generated, then the gate set is converted into a list of basic gate objects required by Solovay-Kitaev, and finally a Solovay-Kitaev decomposer object is constructed; the sequence library in this process is obtained by a sequence generation and deduplication mechanism, which enables Solovay-Kitaev decomposition to run stably at a specified depth.

[0102] To quantify the quality of single-qubit gate decomposition, this invention uses the process fidelity based on Choi representation as the fidelity index and the depth of the decomposed quantum circuit as the depth index.

[0103] For any single-qubit gate target unitary matrix U, construct a circuit and a decomposed circuit containing only that gate. After converting the original circuit and the decomposed circuit into Choi matrices, calculate the fidelity and read the depth of the decomposed circuit as the output evaluation.

[0104] Step S33: In order to ensure that the final parameters are indeed better than the benchmark in the true sense of decomposition, this invention uses a cost function to evaluate the process fidelity and depth distribution.

[0105] Let the fidelity and depth distribution obtained from the reference gate set be... The fidelity and depth distribution of the candidate gate set are as follows The truth evaluation function is composed of a weighted average of fidelity and depth, where the average fidelity is expressed as a negative number to maximize fidelity; its calculation formula is shown in equation (19):

[0106] (19);

[0107] in To maintain the fidelity of the average decomposition process of each quantum gate The average decomposition depth for each quantum gate. The weighting coefficients for the fidelity average term. The weighting coefficients for the depth-average term;

[0108] Step S34: Use the COBYLA optimizer to perform local optimization based on the parameters obtained in step S2, and set a criterion to stop once the optimization result is better than the baseline parameters:

[0109] Define the minimum improvement amount `improve_tol` for any two-qubit basis gate. Make Less than -improve_tol means determining if improvements are found and ending the process early;

[0110] If no improvement is found, return the parameters obtained in step S2.

[0111] Meanwhile, the present invention proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed, it implements the steps of the method described in the present invention.

[0112] Furthermore, the present invention proposes a computer-readable storage medium having a computer program stored thereon, the computer program being configured to implement the steps of the method described in the present invention when invoked by a processor.

[0113] Finally, the present invention provides a computer program product comprising a computer program / instructions that, when executed by a processor, implement the steps of the method described in the present invention.

[0114] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0115] (1) Significantly improves design space search efficiency: In step S2, this invention introduces a fast surrogate cost evaluation function based on Weyl geometry. This function only needs to extract the Cartan coordinates of the two-qubit gates in the target circuit and use geometric quantities such as the covering polyhedron and orbital distance to estimate the lower bound of the number of calls to the two-qubit basic gate and the numerical difficulty, without performing complete quantum circuit decomposition and single-qubit gate discretization. This efficient screening capability provides a high-quality initial solution for subsequent fine optimization and significantly accelerates the overall parameter optimization process. In a test circuit containing 20 random two-qubit gates, screening 500 sets of candidate parameters using the surrogate function takes only a few seconds, while using the real decomposition would take several hours.

[0116] (2) Ensuring controllable gate-level precision of the decomposition results: In step S3, the present invention adopts a two-qubit gate decomposition method based on template enumeration and numerical optimization. For each target gate, a preset fidelity threshold is used as a hard constraint. By progressively increasing the number of base gate layers and optimizing the parameters of local single-qubit gates, the decomposition error of each two-qubit gate is strictly controlled within the threshold, thereby significantly improving the overall circuit execution reliability. Experimental data show that in a test circuit containing 30 random two-qubit gates, the optimized parameters make the decomposition fidelity of all gates reach above 0.999999, while in the traditional method, about 5% of the gates have a fidelity below 0.999, thus significantly improving the overall circuit execution reliability.

[0117] (3) The optimization results are closer to the actual compilation quality indicators: In step S3, this invention further introduces a secondary optimization based on the true decomposition. By performing complete two-qubit gate decomposition and single-qubit gate discretization on a small number of sampled gates, the distribution of process fidelity and line depth is directly statistically analyzed, and a truth cost function is constructed accordingly. This cost function can comprehensively reflect the indicators of actual compilation that are of concern, such as average fidelity and average depth, and uses the COBYLA optimizer to perform local search until a solution with better parameters than the baseline is found. After the secondary optimization, the overall average fidelity of the target line can be improved by about 5% to 10%, and the average depth can be reduced by about 8% to 15%.

[0118] (4) Widely applicable to various quantum circuits and hardware platforms: The gate parameter optimization method in the parameterized decomposition of quantum circuits proposed in this invention does not depend on a specific gate set or hardware topology. It only requires the parameterized representation of the two-qubit basic gate and the list of single-qubit gates to automatically adapt to the distribution characteristics of different target circuits. Whether it is a structured circuit or a random Haar circuit, this method can stably find better basic gate parameters. At the same time, the Weyl geometric constraints and surrogate functions used in the optimization process can be extended to other parameterized two-qubit gates, such as XY2 and Sqrt_iSwap2, and have good versatility. Therefore, this invention can be integrated into a quantum compiler as a core module for instruction set design, gate parameter calibration, and cross-platform optimization, providing key technical support for the reliability and portability of quantum software in the NISQ era.

[0119] In summary, this invention combines low-cost proxy screening with high-precision real decomposition, which significantly improves the efficiency of parameter optimization while ensuring decomposition accuracy. At the same time, it expands the search space through an exploration reward mechanism, and finally outputs basic gate parameters with better performance in both fidelity and depth. Attached Figure Description

[0120] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.

[0121] Figure 1 This is a schematic diagram of the steps of the present invention.

[0122] Figure 2 This is a schematic diagram of a partial two-qubit gate representation of the Weyl cell of the present invention.

[0123] Figure 3 This is a schematic diagram of the two-qubit gate decomposition template of the present invention.

[0124] Figure 4 This is a schematic diagram of a two-qubit QV circuit for the test reference circuit of this invention.

[0125] Figure 5 This is a comparison chart showing the fidelity of the decomposition results on a two-qubit QV circuit according to the present invention.

[0126] Figure 6 This is a comparison diagram of the depth of the decomposition results on a two-qubit QV line according to the present invention.

[0127] Figure 7 This is a schematic diagram of a two-qubit random Haar circuit, which is the test reference circuit of this invention.

[0128] Figure 8This is a schematic diagram comparing the fidelity of the decomposition results on a two-qubit random Haar circuit according to the present invention.

[0129] Figure 9 This is a schematic diagram showing the depth comparison of the decomposition results on a two-qubit random Haar circuit according to the present invention. Detailed Implementation

[0130] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. Of course, the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0131] Example 1

[0132] A method for gate parameter optimization in quantum circuit parameterization decomposition, the specific workflow is shown in the figure below. Figure 1 This includes the following steps:

[0133] Step S1: Definition and parameterized representation of the basic gate set;

[0134] To address the issues of non-standard parameter representation and redundant search space in the optimization process of parameterized two-qubit basic gates, this invention first employs Cartan decomposition. That is, any two-qubit gate can be decomposed into a local single-qubit gate and a non-local part described by three real parameters, which is called the standard canonical gate. The definition is as shown in formula (1):

[0135] (1);

[0136] By using the standard specification representation of the nonlocal part, the basic gate is parameterized and restricted to the uniquely feasible geometric space, the Weyl chamber. The corresponding Cartan coordinates in equation (1) A basic domain, namely the Weyl room, is selected under symmetric equivalence to ensure that "the same local equivalence class corresponds to only one unique point", which provides a foundation for subsequent efficient and standardized parameter optimization and line decomposition.

[0137] Step S11: Definition and parameterized representation of the basic gate set

[0138] This invention addresses the task of quantum circuit decomposition and defines a candidate instruction set: the set of basic single-qubit gates is given by a string sequence, and four basic gate types are defined as H1, T1, S1, and Z1, thereby ensuring that the same set of basic gates maintains a consistent discrete encoding method in different operations. The definitions of single-qubit gates are shown in Table 1.

[0139] Table 1. Gate symbol representation and description for single qubits

[0140]

[0141] Step S12: Standard gauge representation of parameterized two-qubit fundamental gates and Weyl room feasible region constraints

[0142] To ensure that the nonlocal gate corresponding to the parameters is in a canonically unique standard domain, this invention uses the canonical coordinates of the nonlocal part of the two-qubit gate. The selection is confined to the Weyl chamber, and any candidate points outside the Weyl chamber are projected and repaired before being evaluated and optimized; the Weyl chamber constraint is expressed by formula (2):

[0143] (2);

[0144] Furthermore, this invention employs a nonlinear constrained optimization algorithm (COBYLA) as the optimization method, which is applicable to nonlinear constrained optimization problems without gradient information. By explicitly imposing these constraints in the form of inequality constraints, the search process is ensured to remain feasible at all times.

[0145] Step S2: Quantum circuit preprocessing and benchmark parameter evaluation and optimization;

[0146] Considering that performing full circuit decomposition directly on each candidate parameter would be too costly, this invention preprocesses the quantum circuits to construct a fast proxy cost evaluation function. This step is used to optimize the objective function of each circuit before evaluation, adjusting the parameters of each quantum gate while ensuring the fidelity and depth requirements of the target quantum circuit.

[0147] By using a local search method based on the COBYLA optimization algorithm, the parameter configuration of each quantum gate is progressively improved, balancing computational cost, number of qubits, depth, and degree of parameter exploration. The optimization process follows these steps in sequence:

[0148] Step S21: Preprocess the quantum circuit, including each two-qubit gate in the target circuit. The non-local portion of the canonical coordinates is extracted as shown in formula (3):

[0149] (3);

[0150] in Mapping a gate to the Weyl room basic domain requires satisfying the following constraints: ;

[0151] Candidate two-qubit gates are represented using standard nonlocal gates, and the definitions of some two-qubit gates are given in Table 2. Basic gates for candidate two-qubit gates are also provided. Similarly, extract the corresponding standard coordinates. ;

[0152] Table 2. Notation and Description of Two-Qubit Gates

[0153]

[0154] Step S22: Calculate the overall score of the candidate parameters using the evaluation cost function. The cost function takes into account four dimensions, as shown in formula (4):

[0155] (4);

[0156] in Penalty term for the deviation of the basic gate parameters from the target. The weighting coefficients, Estimating the number of calls for a two-qubit gate The weighting coefficients, The weighting coefficients for novelty are used to explore its degree. This is the penalty coefficient for the boundary and special point penalty term ill;

[0157] In this step, the present invention uses the baseline parameters as the initial point and calls the COBYLA optimizer to perform a local search under the Weyl room constraint; the maximum number of iterations and the initial exploration radius are set. The output of this stage is the candidate parameters that minimize the evaluation cost, which are used to enter the truth evaluation and optimization of the next stage. The construction method of the four dimensions is shown in steps S221~S224;

[0158] Step S221: Design a penalty term for deviations of the basic gate parameters from the target.

[0159] To accurately reflect the geometric folding and symmetry equivalence classes of Weyl chambers, basic gates are defined. The set of all equivalent points that can be reached by the Cartan coordinates under the Weyl indoor symmetry transformation is the Weyl orbital. As shown in formula (5):

[0160] (5);

[0161] in To standardize coordinate points, This represents a symmetric transformation of the coordinate points. Let be the set of finite symmetric transformations corresponding to the Weyl chamber. This indicates that the transformed points will be folded back into the Weyl chamber basic domain;

[0162] Based on this, the target gate is defined. With basic gates Minimum distance between orbits As shown in formula (6):

[0163] (6);

[0164] in, Refers to the basic gate The set of all equivalent points achievable under the Weyl indoor symmetry transformation. Refers to a set One of the equivalent points;

[0165] min refers to the Weyl interior target door. Set of Equivalence Points The minimum distance;

[0166] Construct a weighted distance penalty set for:

[0167] (7);

[0168] The physical meaning of this term is: if the Weyl cell coordinates of the candidate fundamental gate are closer to the two-qubit gate distribution of the target circuit in the sense of symmetry equivalence, then subsequent two-qubit gate decomposition is easier to achieve higher fidelity with fewer layers; otherwise, deeper layers are required or it is more difficult to achieve high fidelity. Therefore, a penalty term is used. This suppresses the situation where candidate basic gates deviate too far from the target distribution, thereby improving reachability and decomposition efficiency.

[0169] Step S222: Estimating the number of calls to the two-qubit gate Construction

[0170] To sum the lower bound estimates of the number of basic two-qubit gate calls required to decompose each two-qubit gate in the circuit, this invention uses a coverage polytope approximation. ;

[0171] For candidate basic gates Construct its orbital point set in the Weyl chamber. The covering polyhedron is obtained using the standard convex hull algorithm. Its construction is shown in formula (8):

[0172] (8);

[0173] in For convex hull operators;

[0174] In calculation, it is converted into an inequality, as shown in formula (9):

[0175] (9);

[0176] Where x represents all points that satisfy the inequality. Each row corresponds to a plane of the polyhedron. Each row represents a normal vector of the plane. For the corresponding bias term;

[0177] The set covered by using k basic gates is considered to be approximately equivalent to formula (10):

[0178] (10);

[0179] Linear scaling is applied to the covering polyhedron obtained from the convex hull of the basic gate orbit. Coverage for approximating k basic gate calls ;

[0180] However, to truly achieve this The cost is too high, requiring the intercepts and inequality coefficients of all faces to be rewritten according to the rules. Therefore, x / k is calculated and it is determined whether it is within the inequality to avoid repeatedly constructing the enlarged polyhedron, thereby improving the efficiency and numerical stability of the surrogate evaluation.

[0181] In implementation, the target gate's Weyl coordinates are equivalently scaled by 1 / k and then tested to see if it falls within the range. For any target gate of the target line ,make Then, an approximate determination can be made as shown in formula (11):

[0182] (11);

[0183] The maximum violation in a half-space is defined as in formula (12):

[0184] (12);

[0185] When viol <= 0, it means exist Therefore, it is assumed that k basic gate calls are sufficient to cover the target gate;

[0186] When void > 0, it is considered that k basic gate calls are insufficient to cover the target gate, and a lower bound estimate of the number of two-qubit gate calls is constructed. As shown in formula (13):

[0187] (13);

[0188] Give the estimated number of calls for the full-line two-qubit gate. As in formula (14):

[0189] (14);

[0190] Since each additional layer of two-qubit basic gates in the two-qubit gate decomposition typically introduces a corresponding single-qubit local gate layer, therefore, using The lower bound of the decomposition depth of the circuit is derived, thereby imposing a constraint on the trend of decomposition depth in the cost evaluation function;

[0191] Step S223: Construct the novelty to avoid over-convergence to the baseline solution.

[0192] To avoid getting stuck in local optima or over-converging to the initial benchmark solution during the optimization of basic gate parameters of nonlocal two-qubit quantum bits, this invention introduces an exploration degree incentive term into the proxy cost function. This term is used to encourage candidate parameters to maintain a moderate difference from the benchmark parameters while ensuring a decrease in execution overhead such as depth, thereby improving the search space coverage and the probability of obtaining better decomposition results.

[0193] Let the current candidate basic gates The Cartan coordinates are Set the basic gate for the first optimization. The Cartan coordinates are ;

[0194] The formula for calculating novelty is shown in formula (15):

[0195] (15);

[0196] Among them, novelty_scale is a constant used to balance novelty within the range of 0 to 1;

[0197] Step S224: Constructing the boundary and special point penalty term ill;

[0198] However, coverage and geometric distance alone are insufficient to characterize the differences in numerical difficulty when approaching the boundary of the Weyl cell and special points. In practical two-qubit gate decomposition, candidate fundamental gates often exhibit gradient degradation, condition number deterioration, and slower convergence when close to the boundary of the Weyl cell or special degenerate points. To reflect this difference without performing a real decomposition, this invention introduces a penalty term, i11;

[0199] Define candidate basic gates Minimum distance to the boundary of the Weyl chamber As shown in formula (16):

[0200] (16);

[0201] The penalty term Ill is defined as shown in formula (17):

[0202] (17);

[0203] in Furthermore, since it is a stable constant, Ill is used to suppress candidate basic gates from falling near the boundary of the Weyl chamber or special points, thereby improving the convergence probability and efficiency of the subsequent real decomposition stage.

[0204] Step S23: After evaluating the baseline parameters using the above-described evaluation cost function, this invention can more accurately reflect the geometric boundaries, symmetrical folding characteristics, and numerical difficulty differences caused by special points of the Weyl chamber without performing a true decomposition, thereby significantly reducing the cost of candidate parameter screening. The baseline parameters are then optimized using the COBYLA optimizer. Perform optimization and obtain the optimized parameters. ; to provide higher quality parameters for the true decomposition verification in step S3;

[0205] Step S3: Secondary optimization and decomposition of circuit output based on truth decomposition

[0206] This step, after preliminary screening, performs truth-based circuit decomposition, evaluation, and re-optimization of candidate basic gate parameters. By performing realistic two-qubit gate decomposition and single-qubit gate discretization on the target circuit, the decomposition depth, gate count, and fidelity are directly obtained. Based on this, the truth cost function is calculated. Thus, while ensuring functional equivalence, the optimal parameter solution with the best real-world performance is selected and further optimized, providing a more reliable optimal input for subsequent overall compilation / execution. Constraint optimization is combined with local search under Weyl room parameter constraints to balance decomposition depth, gate count overhead, and fidelity. The method is implemented sequentially by the following steps:

[0207] Step S31: Apply reference parameters to the two-qubit gate of the target circuit. With optimization parameters The decomposition is performed using a template for two-qubit gate decomposition, involving enumeration and parameter optimization. The decomposition steps are as follows:

[0208] In the decomposition of two-qubit gates, a layer-by-layer search strategy is adopted;

[0209] For any two-qubit target unitary matrix U and a given two-qubit basic gate (BG), the number of layers increases from k=1 to a set threshold.

[0210] For any single-qubit gate, there are three parameters. ;

[0211] For each layer, enumerate all templates composed of single-qubit gates, two-qubit basic gates, or the conjugate transpose of two-qubit basic gates, and perform multiple random restarts on each template to finally generate a circuit composed of k+1 layers of single-qubit gates and k layers of two-qubit basic gates or the conjugate transpose of two-qubit basic gates.

[0212] The parameters of the single-qubit gates that make up the template are searched to achieve a given fidelity threshold and increase the probability of escaping local optima.

[0213] This invention sets continuous variables as parameter vectors of all local single-qubit gates in the template, with a parameter dimension of 6 (k+1), and minimizes the loss function within the boundary using a finite-memory quasi-Newton method (L-BFGS-B). As shown in formula (18):

[0214] (18);

[0215] in, The decomposed unitary matrix is ​​obtained by combining templates. This refers to the unitary matrix corresponding to the conjugate transpose of the target gate, where d represents the dimension of the quantum gate;

[0216] When the fidelity of a candidate decomposition reaches the threshold, it is determined that the accuracy requirement has been met at the current level, so the number of levels is stopped and the corresponding two-qubit gate decomposition circuit is output.

[0217] Using this decomposition template enables high-precision decomposition of two-qubit gates under threshold constraints, significantly improving the problem of unstable decomposition accuracy in existing methods. However, in cases of weak coupling or difficult parameter gate decomposition, increasing the number of layers is often necessary to meet the accuracy threshold, leading to higher gate depths and longer optimization time, thus creating an efficiency bottleneck. Therefore, step S2 can reduce the required number of layers through cost prediction and parameter optimization strategies to improve overall decomposition efficiency.

[0218] Step S32: Perform Solovay-Kitaev decomposition on the single-qubit gates and the single-qubit gates derived from the two-qubit gates of the target circuit. The decomposition steps are as follows:

[0219] In terms of single-qubit gate decomposition, this invention constructs a Solovay-Kitaev decomposer: given a list of basic gates for a single-qubit gate, a recursion depth, and a depth for generating basic approximate sequences, a numbered gate set is first generated, then the gate set is converted into a list of basic gate objects required by Solovay-Kitaev, and finally a Solovay-Kitaev decomposer object is constructed; the sequence library in this process is obtained by a sequence generation and deduplication mechanism, which enables Solovay-Kitaev decomposition to run stably at a specified depth.

[0220] To quantify the quality of single-qubit gate decomposition, this invention uses the process fidelity based on Choi representation as the fidelity index and the depth of the decomposed quantum circuit as the depth index.

[0221] For any single-qubit gate target unitary matrix U, construct a circuit and a decomposed circuit containing only that gate. After converting the original circuit and the decomposed circuit into Choi matrices, calculate the fidelity and read the depth of the decomposed circuit as the output evaluation.

[0222] Step S33: In order to ensure that the final parameters are indeed better than the benchmark in the true sense of decomposition, this invention uses a cost function to evaluate the process fidelity and depth distribution.

[0223] Let the fidelity and depth distribution obtained from the reference gate set be... The fidelity and depth distribution of the candidate gate set are as follows The truth evaluation function is composed of a weighted average of fidelity and depth, where the average fidelity is expressed as a negative number to maximize fidelity; its calculation formula is shown in equation (19):

[0224] (19);

[0225] in To maintain the fidelity of the average decomposition process of each quantum gate The average decomposition depth for each quantum gate. The weighting coefficients for the fidelity average term. The weighting coefficients for the depth-average term;

[0226] Step S34: Use the COBYLA optimizer to perform local optimization based on the parameters obtained in step S2, and set a criterion to stop once the optimization result is better than the baseline parameters:

[0227] Define the minimum improvement amount `improve_tol` for any two-qubit basis gate. Make Less than -improve_tol means determining if improvements are found and ending the process early;

[0228] If no improvement is found, return the parameters obtained in step S2.

[0229] Example 2

[0230] Based on Example 1, two-quantum gate parameter optimization and circuit decomposition based on two-stage cost.

[0231] (1) Input: The test case is defined as a QV circuit composed of two qubit gates. The schematic diagram of the QV circuit is as follows. Figure 4 It contains two unitary matrices, given the basis gate set string gs_str="H1,T1,NL2", and the initial NL2 parameter p0=(0.5,0.3,0.2). See reference [example missing]. Figure 4 The diagram shown is a schematic of the baseline circuit.

[0232] (2) Set weights: w2=1, wDist=0.3, wNov=0.8, wHard=0.3; set the maximum number of layers in the two-qubit gate decomposition template max_layers, and give the decomposition precision as 1-1e -6 .

[0233] (3) Execute S2: Call the COBYLA optimizer to minimize score_est within the Weyl feasible region, set the number of iterations for the first optimization parameter to 400, and output the optimal parameters for the first optimization. During the optimization process, cache the evaluated parameters and their corresponding evaluation costs.

[0234] (4) After obtaining the optimal parameters for the first optimization, prepare for the second optimization and set the cost weight.

[0235] (5) Construct a reference gate set GS1 and a candidate gate set GS2. The reference gate set is the initial parameter gate set, and the candidate gate set is the optimal gate set in the first optimization.

[0236] (6) Perform single-gate decomposition on each sample gate under GS1 and GS2 respectively to obtain two sets of fidelity distribution and depth distribution; according to The cost function calculates the cost.

[0237] (7) Perform a second optimization using the optimal parameters from the first optimization as initial values, setting the number of iterations for the second iteration to 5. If a candidate parameter is found to make... If at least improve_tol is decreased, then the parameters for this optimization will be updated.

[0238] (8) Re-decompose the entire line using the final optimized parameters to obtain the final output line, and save the decomposition results as follows: Figure 5 and Figure 6 As shown:

[0239] (9) On low-scale quantum circuits, by optimizing the parameters according to the present invention, the process fidelity of the optimized parameter decomposition is improved by about 9% compared with the initial parameter decomposition, while the average circuit depth is reduced by about 12%. This result shows that the proposed optimization method can effectively improve the fidelity of low-scale quantum circuits and significantly reduce the circuit depth, demonstrating the superiority and potential of the method in quantum circuit optimization.

[0240] Example 3

[0241] Based on Example 1, two-quantum gate parameter optimization and circuit decomposition based on two-stage cost.

[0242] (1) Input: The test case is defined as a random Haar circuit composed of two qubit gates. The schematic diagram of the random Haar circuit is shown below. Figure 7 As shown, the circuit contains 20 random Haar unitary gates. Given the base gate set string gs_str="H1,T1,NL2", and setting the initial NL2 parameter p0=(0.5,0.3,0.2). See the circuit diagram below. Figure 6 As shown;

[0243] (2) Set weights: w2=1, wDist=0.3, wNov=0.8, wHard=0.3; set the maximum number of layers in the two-qubit gate decomposition template max_layers, and give the decomposition precision as 1-1e -6 .

[0244] (3) Execute S2: Call COBYLA to minimize score_est within the Weyl feasible region, set the number of iterations for the first optimization parameter to 400, and output the optimal parameters for the first optimization. During the optimization process, cache the evaluated parameters and their corresponding evaluation costs.

[0245] (4) After obtaining the optimal parameters for the first optimization, prepare for the second optimization and set the cost weight.

[0246] (5) Construct a reference gate set GS1 and a candidate gate set GS2. The reference gate set is the initial parameter gate set, and the candidate gate set is the optimal gate set in the first optimization.

[0247] (6) Perform single-gate decomposition on each sample gate under GS1 and GS2 respectively to obtain two sets of fidelity distribution and depth distribution; according to The cost function calculates the cost.

[0248] (7) Perform a second optimization using the optimal parameters from the first optimization as initial values, setting the number of iterations for the second iteration to 5. If a candidate parameter is found to make... If at least improve_tol is decreased, then the parameters for this optimization will be updated.

[0249] (8) Re-decompose the entire line using the final optimized parameters to obtain the final output line, and save the decomposition results as shown in Figure 8. Figure 9 As shown:

[0250] (9) On higher-scale quantum circuits, the optimized parameters, as determined by this invention, maintain the stability of process fidelity compared to the initial parameter decomposition, while reducing the average circuit depth by approximately 9%. This result demonstrates that the proposed optimization method can effectively stabilize the fidelity of circuit decomposition and significantly reduce the circuit depth, showcasing the superiority and potential of this method in quantum circuit optimization.

[0251] This invention combines low-cost proxy screening with high-precision real decomposition, significantly improving parameter optimization efficiency while ensuring decomposition accuracy. Simultaneously, it expands the search space through an exploration reward mechanism, ultimately outputting basic gate parameters with superior performance in both fidelity and depth. These results have been verified in multiple test cases, fully demonstrating the practicality and advancement of this invention.

[0252] Example 4: This example proposes a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the steps of the method described in this invention, which will not be repeated here.

[0253] Example 5: This example proposes a computer program product, including a computer program / instructions. When the computer program / instructions are executed by a processor, they implement the steps of the method described in this invention, which will not be repeated here.

[0254] It should be noted that the processing flow of embodiments 2-5 corresponds to the specific steps of the method provided in embodiment 1 of the present invention, and has the corresponding functional modules and beneficial effects of the method. Technical details not described in detail in this embodiment can be found in the method provided in embodiment 1 of the present invention.

[0255] The program code used to implement the methods of this application may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0256] 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 gate parameter optimization in parameterized decomposition of a quantum circuit, characterized in that, Includes the following steps: Step S1: Definition and parameterized representation of the basic gate set; Step S2: Quantum circuit preprocessing and benchmark parameter evaluation and optimization; Step S3: Secondary optimization and decomposition of line output based on truth value decomposition.

2. The method of claim 1, wherein, The specific steps of step S1 are as follows: Cartan decomposition is used, meaning that any two-qubit gate can be decomposed into a local one-qubit gate and a nonlocal part described by three real parameters, which is called the standard gauge gate. The definition is shown in formula (1): (1); By standard gauge representation of the non-local part, the elementary gates are parameterized and confined in the unique feasible geometric space, Weyl chamber; the corresponding Cartan coordinates in equation (1) A fundamental domain, Weyl chamber, is chosen under symmetry equivalence; Step S11: Definition and parameterized representation of the basic gate set; Define candidate instruction set: the set of basic gates for a single quantum bit is given by a string sequence, and the four basic gate types are defined as H1, T1, S1 and Z1, so as to ensure that the same set of basic gates maintains a consistent discrete encoding method in different operations; Step S12: Parameterize the standard gauge representation of the two-qubit fundamental gate and the Weyl room feasible region constraint; Non-local part of a two-qubit gate in normal coordinates Limit in Weyl chamber, and project any candidate point outside the Weyl chamber back into the Weyl chamber before evaluating and optimizing; the Weyl chamber constraint is expressed by equation (2): (2); A nonlinear constraint optimization algorithm is used as the optimization method.

3. The method of claim 2, wherein, The definition of the single-qubit gate is described as follows: H1: 1-qubit Hadamard gate: ; T1: 1-qubit Tgate∶= ; S1: 1-qubit Sgate = 1 - 2p2 ; Z1:1-qubit Zgate∶= 。 4. The method of claim 1, wherein, Step S2: The specific steps are as follows: Preprocess the quantum circuits to construct a fast proxy cost evaluation function; By using a local search method based on the COBYLA optimization algorithm, the parameter configuration of each quantum gate is progressively improved, balancing computational cost, number of qubits, depth, and degree of parameter exploration. The optimization process follows these steps in sequence: Step S21: preprocessing the quantum circuit, for each double quantum bit gate in the target circuit The non-local part of the normed coordinates is extracted as shown in equation (3): (3); wherein denotes the mapping of the gates to the Weyl chamber base domain, subject to the respective constraints: ; For candidate two-qubit gates, the standard non-local gate representation is used, and the definitions of partial two-qubit gates are given; for candidate two-qubit basic gates The corresponding canonical coordinates are also extracted ; Step S22: Calculate the overall score of the candidate parameters using the evaluation cost function. The cost function takes into account four dimensions, as shown in formula (4): (4); in Penalty term for the deviation of the basic gate parameters from the target. The weighting coefficients, Estimating the number of calls for a two-qubit gate The weighting coefficients, The weighting coefficients for novelty are used to explore its potential. This is the penalty coefficient for the boundary and special point penalty term ill; Step S23: After obtaining the baseline parameters and the estimated cost of the target route, use the COBYLA optimizer to optimize the parameters. Optimize and obtain the optimized parameters.

5. The gate parameter optimization method in quantum circuit parameterization decomposition according to claim 4, characterized in that, The definition of a two-qubit gate is as follows: NL2:2qubit Canonical gate= ; CNOT2:2-qubit CNOT gate = ; Sqrt_iSwap2:2-qubit gate= ; XY2:2qubit XXPlusYY gate= 。 6. The gate parameter optimization method in quantum circuit parameterization decomposition according to claim 4, characterized in that, The construction method of the four dimensions is shown in steps S221 to S224; Step S221: Design a penalty term for deviations of the basic gate parameters from the target. ; Define basic gates The set of all equivalent points that can be reached by the Cartan coordinates under the Weyl indoor symmetry transformation is the Weyl orbital. As shown in formula (5): (5); in To standardize coordinate points, This represents a symmetric transformation of the coordinate points. Let be the set of finite symmetric transformations corresponding to the Weyl chamber. This indicates that the transformed points will be folded back into the Weyl chamber basic domain; Based on this, the target gate is defined. With basic gates Minimum distance between orbits As shown in formula (6): (6); in, Refers to the basic gate The set of all equivalent points achievable under the Weyl indoor symmetry transformation. Refers to a set One of the equivalent points; min refers to the Weyl interior target door. Set of Equivalence Points The minimum distance; Construct a weighted distance penalty set for: (7); Step S222: Estimating the number of calls to the two-qubit gate The construction; Approximation using covering polyhedra ; For candidate basic gates Construct its orbital point set in the Weyl chamber. The covering polyhedron is obtained using the standard convex hull algorithm. Its construction is shown in formula (8): (8); in For convex hull operators; In calculation, it is converted into an inequality, as shown in formula (9): (9); Where x represents all points that satisfy the inequality. Each row corresponds to a plane of the polyhedron. Each row represents a normal vector of the plane. For the corresponding bias term; The set covered by using k basic gates is considered to be approximately equivalent to formula (10): (10); Linear scaling is applied to the covering polyhedron obtained from the convex hull of the basic gate orbit. Coverage for approximating k basic gate calls ; In implementation, the target gate's Weyl coordinates are equivalently scaled by 1 / k and then tested to see if it falls within the range. For any target gate of the target line ,make Then, an approximate determination can be made as shown in formula (11): (11); The maximum violation in a half-space is defined as in formula (12): (12); When viol <= 0, it means exist Therefore, it is assumed that k basic gate calls are sufficient to cover the target gate; When void > 0, it is considered that k basic gate calls are insufficient to cover the target gate, and a lower bound estimate of the number of two-qubit gate calls is constructed. As shown in formula (13): (13); Give the estimated number of calls for the full-line two-qubit gate. As in formula (14): (14); use The lower bound of the decomposition depth of the circuit is derived, thereby imposing a constraint on the trend of decomposition depth in the cost evaluation function; Step S223: Construct the novelty level; Let the current candidate basic gates The Cartan coordinates are Set the basic gate for the first optimization. The Cartan coordinates are ; The formula for calculating novelty is shown in formula (15): (15); Among them, novelty_scale is a constant used to balance novelty within the range of 0 to 1; Step S224: Constructing the boundary and special point penalty term ill; Define candidate basic gates Minimum distance to the boundary of the Weyl chamber As shown in formula (16): (16); The penalty term Ill is defined as shown in formula (17): (17); in Furthermore, it is a stability constant, and is used to suppress candidate basic gates from falling near the boundary of the Weyl chamber or at special points.

7. The method for gate parameter optimization in quantum circuit parameterization decomposition according to claim 1, characterized in that, The specific steps of step S3 are as follows: Step S31: Decompose the two-qubit gate of the target circuit using baseline parameters and optimized parameters. Use the template for two-qubit gate decomposition for enumeration and parameter optimization. The decomposition steps are as follows: In the decomposition of two-qubit gates, a layer-by-layer search strategy is adopted; For any two-qubit target unitary matrix U and a given two-qubit basic gate, BG, the layer number is increased from k=1 to a set threshold. For any single-qubit gate, there are three parameters. ; For each layer, enumerate all templates composed of single-qubit gates, basic gates, or conjugate transposes of basic gates, and randomly restart each template multiple times to finally generate a circuit composed of k+1 layers of single-qubit gates and k layers of basic gates or conjugate transposes of basic gates. The parameters of the single-qubit gates that make up the template are searched to achieve a given fidelity threshold and increase the probability of escaping local optima. The continuous variables are set as parameter vectors of all local single-qubit gates in the template, with a parameter dimension of 6(k+1). The loss function is minimized within the boundary using a quasi-Newton method with finite memory. As shown in formula (18): (18); in, The decomposed unitary matrix is ​​obtained by combining templates. This refers to the unitary matrix corresponding to the conjugate transpose of the target gate, where d represents the dimension of the quantum gate; When the fidelity of a candidate decomposition reaches the threshold, it is determined that the accuracy requirement has been met at the current level, so the number of levels is stopped and the corresponding two-qubit gate decomposition circuit is output. Step S32: Perform Solovay-Kitaev decomposition on the single-qubit gates and the single-qubit gates derived from the two-qubit gates of the target circuit. The decomposition steps are as follows: In terms of single-qubit gate decomposition, the Solovay-Kitaev decomposer is constructed as follows: given a list of basic gates for single-qubit gates, the recursion depth and the depth when generating basic approximate sequences, first generate and number the gate set, then convert the gate set into a list of basic gate objects required by Solovay-Kitaev, and finally construct the Solovay-Kitaev decomposer object. To quantify the quality of single-qubit gate decomposition, the process fidelity based on Choi representation is used as the fidelity index, and the depth of the decomposed quantum circuit is used as the depth index. For any single-qubit gate target unitary matrix U, construct a circuit and a decomposed circuit containing only the gate. After converting the original circuit and the decomposed circuit into Choi matrices, calculate the fidelity and read the depth of the decomposed circuit as the output evaluation. Step S33: Use a cost function to evaluate process fidelity and depth distribution; Let the fidelity and depth distribution obtained from the reference gate set be... The fidelity and depth distribution of the candidate gate set are as follows The truth evaluation function is composed of a weighted average of fidelity and depth, where the average fidelity is expressed as a negative number to maximize fidelity; its calculation formula is shown in equation (19): (19); in To maintain the fidelity of the average decomposition process of each quantum gate The average decomposition depth for each quantum gate. The weighting coefficients for the fidelity average term. The weighting coefficients for the depth-average term; Step S34: Use the COBYLA optimizer to perform local optimization based on the parameters obtained in step S2, and set a criterion to stop once the optimization result is better than the baseline parameters: Define the minimum improvement amount `improve_tol` for any two-qubit basis gate. Make Less than -improve_tol means determining if improvements are found and ending the process early; If no improvement is found, return the parameters obtained in step S2.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is executed, it implements the steps of the method as described in any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer program is configured to implement the steps of the method according to any one of claims 1 to 7 when invoked by a processor.

10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 7.