Quantum circuit optimization method and system
By optimizing the structure of quantum circuits and utilizing the relationship between Clifford gates and Pauli revolving doors, the problem of quantum computer resource limitations in the existing technology has been solved, and more efficient quantum computing has been achieved.
Patent Information
- Application Number
- CN202080025347.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-02-19
- Filing Date
- 2020-03-16
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2040-03-16
AI Technical Summary
Existing quantum computers are subject to resource constraints when implementing effective quantum algorithms, especially in terms of the number of physical qubits and calculation time, resulting in inefficient algorithms and difficulty in optimizing the T count and depth of quantum circuits.
By converting the initial quantum circuit into an intermediate quantum circuit, utilizing the relationship between Clifford gates and Pauli turnstiles, inserting new Pauli turnstiles, and scanning matching turnstiles to optimize the circuit structure and reduce T count and depth, Replacement of original Clifford doors with new ones to improve efficiency.
Significantly reducing the T count and depth of quantum circuits, improving the efficiency of quantum algorithms, reducing space and time complexity, and achieving more efficient quantum computing.
Smart Images

Figure CN114072817B_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This disclosure claims priority to U.S. Provisional Patent Application No. 62 / 825,949 filed on March 29, 2019 and U.S. Patent Application No. 16 / 795,416 filed on February 19, 2020, the entire contents of which are hereby incorporated by reference into this disclosure. Technical Field
[0003] The present disclosure relates to the field of quantum computing, and in particular to an optimization method, an optimization system and a non-volatile computer-readable medium for a quantum circuit. Background Art
[0004] Quantum computers offer the ability to perform tasks that are simply impossible for classical computers. These tasks will bring tremendous advances to many engineering disciplines and enable valuable goals such as discovering new materials, synthesizing better drugs, and creating more energy-dense batteries. However, current quantum computers have severe limitations on the algorithms they can successfully implement. Therefore, it is necessary to optimize quantum algorithms so that they have sufficient resources to solve useful problems when implemented on real-world quantum hardware. Summary of the invention
[0005] The present disclosure provides a method, system and non-volatile computer readable medium for optimizing quantum circuits. The method includes: converting an initial quantum circuit into an intermediate quantum circuit, wherein the intermediate quantum circuit is a first group of Pauli revolving door; and by Each of the Pauli revolving doors The Pauli rotation gate performs the following operations to generate an updated quantum circuit, which is the second group after the second Clifford gate. Pauli revolving door: In the second group Insert the new one after the Pauli revolving door Pauli revolving door, wherein the new The Pauli revolving door corresponds to the first group The current in the Pauli revolving door The Pauli rotation gate is realized by left-multiplying the second Clifford gate and right-multiplying the conjugate transpose of the second Clifford gate, scanning the second group Pauli revolving door to determine the noncommutative Is there a matching Pauli revolving door before? Pauli revolving door; in response to determining that there is a matching Pauli revolving door, from the second group Pauli revolving door removes the matching Pauli revolving door and the new Pauli revolving door, and if the matching Pauli revolving door and the new If the Pauli revolving gate has the opposite sign, the second Clifford gate is replaced by a new Clifford gate, wherein the new Clifford gate corresponds to the current second Clifford gate, and the new Clifford gate is obtained by left-multiplying twice Pauli revolving door realized.
[0006] Additional objects and advantages of the disclosed embodiments will be set forth in part in the following description, and in part will become apparent from the description, or may be learned by practicing these embodiments. The objects and advantages of the disclosed embodiments may be realized and obtained by the elements and combinations set forth in the claims.
[0007] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure, as claimed. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Embodiments and various aspects of the present disclosure are described in the following detailed description and drawings.The various features shown in the drawings are not drawn to scale.
[0009] Figure 1 A simplified diagram of the Bloch sphere for a single quantum bit (qubit).
[0010] Figure 2 is an exemplary Mod5 4 Quantum circuits.
[0011] Figure 3 is a flow chart of an exemplary method of how to update a quantum circuit according to some embodiments of the present disclosure.
[0012] Figure 4 are benchmark results of an exemplary embodiment according to some embodiments of the present disclosure against existing solutions.
[0013] Figure 5 is an exemplary quantum circuit update system according to some embodiments of the present disclosure. DETAILED DESCRIPTION
[0014] Reference will now be made in detail to exemplary embodiments, examples of which are shown in the accompanying drawings. The following description refers to the accompanying drawings, in which the same numbers in different drawings represent the same or similar elements, unless otherwise stated. The implementations set forth in the following description of exemplary embodiments do not represent all implementations that conform to the present disclosure. Instead, they are merely examples of devices and methods consistent with the aspects related to the present disclosure described in the appended claims. Specific aspects of the present disclosure are described in more detail below. In the event of a conflict with terms and / or definitions incorporated by reference, the terms and definitions provided herein shall prevail.
[0015] Computers are ubiquitous in modern society. In any case, computers are involved in every aspect of life. This includes direct involvement (such as smartphones and laptops) and indirect involvement (such as microcontrollers in cars or control systems in water purification plants). The ubiquity and importance of computers are similarly reflected in almost every industry. Due to this importance, computers as a class of things are very valuable to society. To a large extent, this importance is conditioned by the capabilities of computers, that is, what these computers can do. In particular, if a computer can perform a task, it can perform it faster and on a larger scale than a human can perform the task. This is particularly beneficial to society because these tasks can now be completed without human involvement (and usually at a lower cost), freeing humans to focus on other tasks. Therefore, an extremely important aspect of computers is what tasks they can perform.
[0016] Generally speaking, the capabilities of a computer are constrained by (or, viewed from the opposite perspective, supported by) two things: hardware and software. Essentially, a computer (in the abstract sense, an idealized machine that can perform "computations") must be implemented on a certain type of hardware (e.g., a physical configuration of matter) to be used. Because it is physical, whatever hardware is used to implement a computer is subject to various limitations imposed by physics. In particular, physics imposes limitations such that any hardware used to implement a computer will necessarily impose an upper limit on the performance characteristics of the computer, such as the amount of memory available or the number of operations per second.
[0017] Once a computer is physically implemented, it is essentially idle until it is given something to "compute". In other words, the computer does not do anything until it is instructed otherwise. Therefore, in order for a computer to solve a task, a set of instructions must be provided to the computer to complete the desired task when the instructions are followed. This set of instructions is called a program, which together constitutes software. Conversely, the ability to create a program to solve a task is largely constrained by two aspects: mathematical algorithms and knowledge of how to solve a given task. Although somewhat vague, mathematical algorithms can be considered the basic building blocks of a program, which is a series of steps to solve a mathematical problem. This is different from a program, which is a series of steps to solve some (not necessarily mathematical) "real world" problems. In order to create a program to solve a task, the programmer uses some combination of algorithms to provide a series of steps that, if followed, solve the desired task. This requires computer programmers to know what algorithm (when used) can perform the desired steps. Crucially, it is also required that computer programmers know what steps are needed to solve the desired task. Lack of this knowledge will not be able to create a program to solve a given task.
[0018] Generally, each of these three areas incrementally advances the shrinking of transistors, making computers a little faster, and the design of new algorithms, making programs a little more efficient. This means that generally increases in computer power are similarly incremental. However, occasionally there is an advance in one area that dramatically increases computer power. One such advance is the rise of machine learning, which involves creating systems that can autonomously find ("learn") the steps necessary to solve a problem. This has led to the ability to solve tasks that were not previously understood well enough to create explicit programs. Another extremely promising avenue for similar advances is the creation of quantum computers.
[0019] Quantum computers offer the ability to perform certain tasks (equivalent to solving certain problems) that are thought to be intractable for classical computers (including any possible future classical computers). To understand why, an overview of computational complexity theory is needed. Computational complexity theory is a branch of theoretical computer science that focuses on classifying "computational problems" according to their "difficulty." "Computational problems" can be conceptualized as determining specific properties of any instance of a certain class of mathematical objects (such as graphs, numbers, or strings). Although it seems abstract, any real-world task can ultimately be decomposed into determining specific properties of some corresponding mathematical objects. In addition, the specific instance of the mathematical object being solved (with respect to some computational problem) is usually conceptualized as a sequence of bits of length n, such as: a number of 1s and a number of 0s, where the size of n depends on the specific instance being solved.
[0020] The "difficulty" of a "computational problem" is then defined by the number of resources that an optimal algorithm needs to determine a particular property of interest given an input (i.e., an instance of the relevant mathematical object). In general, the amount of resources an algorithm needs to solve a computational problem for some input typically varies as a function of n. For example, for an input of size n, an algorithm might take 5n 3 +12n 2 +2n+logn+113 steps. However, the so-called Big O notation is often used to evaluate the asymptotic complexity of an algorithm. As n approaches infinity, Big O notation focuses on the asymptotic behavior of an algorithm. More specifically, Big O notation focuses on the rate at which a function grows as n approaches infinity. Because when x n <x m hour And because any coefficient is a constant, with respect to algorithms in Big O notation, only the fastest growth factor of n is considered. For example, in Big O notation, the number of steps used by the algorithm considered above would be O(n 3 If the algorithm has O(n) for some k (e.g., has no more than polynomial growth), k An algorithm is usually considered useful if it has an asymptotic complexity of O(k) steps and if it takes O(k) for some k (e.g., has more than polynomial growth). n ), then the algorithm is generally considered impractical. If the best possible algorithm for any "computational problem" has O(k n ) or greater asymptotic complexity, the “computational problem” is said to be intractable (i.e., mathematically possible, but physically unrealizable).
[0021] By far the two most relevant resources measured are the amount of "time" and "memory" an algorithm requires to solve a particular "computational problem" for a particular input. However, because an algorithm must be implemented on some system to be useful, and because the primitives available to the algorithm depend on the system being used, the amount of "time" or "memory" used by the algorithm must be measured against some "model of computation", which in basic terms is an idealized model of some computer system. The default model used for this purpose is called a Turing machine. While the exact amount of resources consumed by an algorithm will vary between a Turing machine and the real-world computer that implements it, this change in exact amounts is usually unimportant when evaluating algorithms using big-O notation, because architectural differences do not usually affect the asymptotic behavior of an algorithm, the reason being that, in general, a Turing machine can implement the primitives of any real-world system using only a constant number of its own primitives. Thus, a real-world computer may be slightly more or less efficient than a Turing machine only by a constant factor.
[0022] Quantum computers, however, undermine this assertion. The result is that, by taking advantage of certain aspects of quantum mechanics, the primitives available in quantum computers cannot be implemented on Turing machines by using a fixed number of Turing machine primitives. This means that for certain problems, a quantum computer (or its idealized mathematical counterpart, a quantum Turing machine) is able to solve a problem in a polynomial number of steps, while a classical computer can only solve the problem in an exponential number of steps. This means that for certain "computational problems", the computational complexity of a quantum computer (whose idealized analog is a quantum Turing machine) is polynomial with respect to the size of the input, rather than exponential as it is for a classical Turing machine. This allows quantum computers to solve problems that are essentially unsolvable by classical computers.
[0023] Quantum computers can bring huge benefits to society, given their ability to solve problems that are essentially intractable with classical computers. As an example, quantum computers can greatly simulate the dynamics of molecules (which are quantum in nature), which can bring huge advances to any engineering discipline that relies on the properties of small molecules. This can lead to the creation of new materials, the synthesis of better drugs, and the creation of higher energy density batteries, to name just a few areas.
[0024] In order to understand the advantages of quantum computers, it is useful to understand how they contrast with classical computers. Classical computers operate according to digital logic. Digital logic refers to a type of logic system that operates on information units called bits. Bits can have one of two values, usually represented as 0 and 1, and are the smallest information units in digital logic. Logic gates are used to perform operations on bits, and logic gates take one or more bits as input and provide one or more bits as output. Typically, a logic gate usually only outputs one bit (although the single bit can be sent as input to multiple other logic gates), and the value of the bit usually depends on the value of at least some of the input bits. In modern computers, logic gates are usually composed of transistors, and bits are usually represented as the level of wires connected to the transistors. A simple example of a logic gate is an AND gate, which (in its simplest form) takes two bits as input and provides one bit as output. If the value of both inputs is 1, the output of the AND gate is 1, otherwise the output of the AND gate is 0. By connecting the inputs and outputs of various logic gates together in a specific way, classical computers can implement arbitrarily complex algorithms to complete various tasks.
[0025] On the surface, quantum computers operate in a similar way to classical computers. Quantum computer logic systems operate. The logic system operates on units of information called qubits (a composite of "quantum" and "bit"). A qubit is the smallest unit of information in a quantum computer, and a qubit can have any linear combination of two values, usually denoted |0> and |1>. In other words, for any combination of α and β, the value of the qubit denoted |ψ> can be equal to α|0>+β|1>, where α and β are complex numbers and |α| 2 +|β| 2 =1. Quantum logic gates are used to perform operations on qubits. A quantum logic gate takes one or more qubits as input and provides one or more qubits as output. Quantum gates are almost always reversible. This means that it is technically possible (although not necessarily practically possible) to recover the input to the gate using only the output from the gate and knowledge of the transformation applied by the gate. This requires that the number of outputs equals (or exceeds) the number of input gates. Therefore, a quantum gate typically has the same number of output qubits as the number of input qubits that the quantum gate has. A quantum gate can be represented by a matrix.
[0026] The power of quantum computers to solve certain problems stems in large part from the large number of values that qubits can take, or in other words, from their ability to be in a superposition of states. In addition, the number of values that a set of qubits can jointly assume grows exponentially with the number of qubits. For example, consider a system with two qubits. Individually, the first qubit can be in the state α|0>+β|1> for some α and β, and the second qubit can be in the state γ|0>+δ|1> for some γ and δ. However, putting the qubits together, that is, considering when the two qubits are entangled, the joint system of qubits can be in a linear combination of states αγ|00>+αδ|01>+βγ|10>+βδ|11> (and |αγ| 2 +|αδ| 2 +|βγ| 2 +|βδ| 2 =1). Thus, the two qubits can be in a linear combination of four states instead of two. Similarly, involving a third qubit (which can be in the state ζ|0>+η|1> for some ζ and η) allows the joint system of qubits to be in a linear combination of eight states, for example: the states αγζ|000>+αγη|001>+αδζ|010>+αδη|011>+βγζ|100>+βγη|101>+βδζ|110>+βδη|111> (and |αγζ| 2 +|αγη| 2 +|αδζ| 2+|αδη| 2 +|βγζ| 2 +|βγη| 2 +|βδζ| 2 +|βδη| 2 =1). In general, a system with n involved qubits can be 2 n A linear combination of states, for example: This capability, combined with the ability of qubits (or groups of entangled qubits) to interfere with each other constructively and destructively, allows quantum computers to have exponential speed advantages over classical computers for some problems.
[0027] However, while powerful, it is difficult to maintain qubits in necessary states (e.g., involved in other qubits) because these states are fragile and easily disturbed by external environmental factors. Once disturbed, any calculations being performed are lost and must be restarted. In the process of improvement, the current ability to prepare individual qubits in the necessary state and perform the necessary sequence operations on them is limited. For example, most existing systems can only prepare and involve dozens of qubits, and can only perform a few rounds of operations on these qubits before the system is disturbed by external factors. In order to help combat the fragility of the necessary quantum states, many quantum computer systems implement a form of fault tolerance. The main form of fault tolerance is to create a "logical qubit", which is composed of several redundant physical qubits and is therefore more robust.
[0028] However, given the need to build systems that can harness actual quantum properties, today's quantum computer systems have very limited size and capabilities. First theorized as superior to classical computers in the early 1980s, actual physical implementations of quantum computers have only been developed in recent years. While slowly improving, current and recent quantum computers strive to provide improvements over their classical counterparts. This further increases the importance of designing and implementing effective quantum algorithms. The two main ways to measure the efficiency of quantum circuit implementations are the number of physical qubits required (which can be called space cost) and the protocol (algorithm / circuit) implementation time (which can be called time cost). These two metrics are sometimes considered together as the time and space cost of a specific quantum protocol / algorithm / circuit. Therefore, existing quantum computers are limited in two key aspects. First, existing quantum computers typically have only a small number of qubits, limiting the complexity of the calculations that existing quantum computers can perform. Second, existing quantum computers are also limited by the amount of time (or equivalently, the number of sequence steps) that may be spent on calculations before the calculation must be completed (i.e., read and obtain a classical value). Therefore, quantum algorithms for existing quantum computers should use as little calculation as possible and complete as quickly as possible. In other words, quantum algorithms should be as efficient as possible.
[0029] Given the low-level nature of most current quantum systems, quantum algorithms are often represented by their underlying quantum circuits. Next, quantum circuits are made up of quantum gates, which are the basic components that directly manipulate quantum bits. Unlike classical logic gates, which have only a finite number of types (for a given number of input bits and output bits), an infinite number of quantum gates can act on any particular number of quantum bits, because the values of quantum bits can be continuous, for example, infinite values, while the values of bits are finite, for example, 2 values. Quantum gates can therefore be used to transform quantum bits in an infinite number of ways. In fact, there is an uncountably infinite number of unitary transformations that can be represented by quantum gates (i.e., there are an uncountably infinite number of quantum gates). Despite this variation, there are finite sets of quantum gates (e.g., a set containing 5 quantum gates) that have the property of universality, which means that a set of quantum gates (given enough quantum gates) can approximately implement any other set of quantum gates to arbitrary precision. Although the existence of a set of infinite numbers of quantum gates is universal, some sets are particularly popular in the field of quantum computing. One such set of universal quantum gates is called Clifford+T circuits, which include various combinations of Clifford gates and T gates.
[0030] To understand the Clifford+T circuit, it is helpful to understand some background in quantum computing. A popular way to visualize the value of a qubit is through a Bloch sphere. As the name suggests, a Bloch sphere is a sphere where the value of a qubit is represented as a point on the surface of the sphere. A location on the surface of the sphere is represented by two values (e.g., the latitude and longitude of a coordinate on Earth). For qubits whose values are imaginary numbers (e.g., a+bi), the two values are the real part (e.g., a) and the imaginary part (e.g., bi). A specific group of important quantum gates called Pauli operators or Pauli gates can be understood as rotations about the three principal axes of the Bloch sphere. The four Pauli operators are called I, X, Y, and Z. I is the unit operator, and X, Y, and Z represent 180° rotations about the x-axis, y-axis, and z-axis of the Bloch sphere, respectively. The Pauli matrix / operator for a single qubit is as well as The set of Pauli operators on n qubits can be defined as and For a set of n qubits, there are 4 n Pauli matrices; The Pauli matrix of a single quantum bit is in the form of (σ i ∈[I, X, Y, Z]), each possible tensor product corresponds to a Pauli matrix. Subscripts are often used to indicate the qubit on which the operator acts. For example, in a 3-qubit system, the qubit 1 , quantum bits 2 and quantum bits 3 To represent the Pauli X gate acting on the first qubit and the Pauli Z operator acting on the second qubit, write
[0031] Figure 1 is a simplified diagram of the Bloch sphere of the above single quantum bit. Figure 1 As shown, the value of a quantum bit can be represented as a point on the surface of a sphere, shown here as Ψ. The value of a point on the surface of the sphere is determined by the angle and θ. The Bloch sphere can be conceptualized as existing in three-dimensional space, with coordinate axes x, y, and z. The Pauli X-gate, Pauli Y-gate, and Pauli Z-gate can then be understood as moving the point representing the value of the qubit around the x-axis, y-axis, and z The axis rotates 180°.
[0032] As relevant here, the Clifford gate (or Clifford operator) is defined with respect to the Pauli operator. For an operation on n qubits, denoted C n The Clifford Group, which consists of the Clifford clan Basically, a Clifford gate for a particular number of qubits is a gate that, when multiplied by the Pauli gate on the left and by the Hermitian adjoint of the Clifford gate on the right, yields a gate that is also a Pauli matrix. This property is useful for designing error-correcting quantum codes. For a Clifford group operating on 1 qubit, C 1 . A Hadamard gate (denoted as H) and a phase gate (denoted as S) are used to generate the Clifford group, where and In other words, the combination of Hadamard gate and phase gate is sufficient to realize all Clifford group C 1 For Clifford groups operating on two or more qubits (e.g. C 2 ), the Clifford group can be generated by a Hadamard gate, a phase gate and a controlled NOT gate (denoted as CNOT), where (For example
[0033] However, for a universal quantum computer, the Clifford gate alone is not enough. Adding a gate called a T-gate (also known as a π / 4 gate) makes the complete circuit universal. The T-gate is defined as The gate can also be defined as a π / 4 phase rotation Z around a single-qubit Pauli: Basically, quantum circuits consisting only of Hadamard gates, phase gates, controlled NOT gates, and T gates are universal and sufficient to realize universal quantum computers. Because circuits consisting of gates U∈{H, S, CNOT, T} are universal and have multiple beneficial properties, many proposed and implemented existing real-world quantum circuits consist of these types of gates. Such circuits can be called Clifford+T circuits.
[0034] An important consideration for Clifford+T circuits is the number of T-gates used in the circuit. In general, in the context of quantum circuits, the "efficiency" of a quantum circuit depends on the metric used (e.g., the "selection function" used). Next, the metric used (e.g., the "selection function") can depend on the architecture of the hardware (e.g., gate group) under consideration. For Clifford+T circuits, a common measure of efficiency is the number of T-gates, which is called the T-count. The reason for the importance of the T-count in measuring the efficiency of Clifford+T circuits is that the T-gates tend to be several orders of magnitude more than the Clifford gates (in terms of the logical number of physical qubits required to implement). Therefore, the T-count of a quantum circuit tends to have a greater impact on efficiency than any other quantum gate. Therefore, optimizing the T-gate is usually the main focus of optimizing the Clifford+T circuit.
[0035] For example, some previous solutions (such as some existing compilers) attempt to reduce the T count of quantum circuits by using auxiliary qubits. However, existing quantum hardware makes the use of auxiliary qubits expensive, thus limiting the complexity of actual quantum algorithms (and therefore limiting the use of actual quantum algorithms). Therefore, auxiliary qubits have a significant impact on the efficiency of quantum algorithms, and minimizing this impact is called "qubit allocation" or "quantum scheduling". Given the changes in the reliability (e.g., error rate) of a given qubit, the transfer between gates, or even the entire quantum system, it is already very complex to implement a given circuit on recent hardware. This complexity has increased when trying to optimize a given circuit to achieve better performance on recent hardware. On the basis of the reduced efficiency that will result in any quantum circuit that deploys auxiliary qubits, the problem of increasing qubit allocation makes it more difficult to solve the problem of reduced efficiency.
[0036] Other previous solutions have attempted to exploit m ee t-in-th e -middl e (i.e., meet in the middle) algorithms perform brute force searches to accurately calculate the best possible. Although these solutions technically ensure optimality, they have exponential running times, making them inefficient and unsuitable for practical or useful quantum circuits. Other previous solutions, such as Tpar, attempt to optimize the T depth of quantum circuits by resynthesizing T gates in each CNOT+T part and by eliminating T gate pairs that are moved adjacent to each other. However, this algorithm can only produce suboptimal quantum circuits because: the algorithm processes the Hadamard gate H by synthesizing all uncomputable T gates before synthesizing the H gate. This results in suboptimal circuits because some T gates become "computable" again after the next Hadamard gate.
[0037] In addition, other previous solutions, such as RM, also try to optimize the T count of the quantum circuit by optimizing the CNOT+T part. This scheme attempts to take advantage of the fact that optimizing the T count in the Clifford+T circuit can be equivalent to the minimum distance decoding problem of some Reed-Muller codes. This decoding problem is difficult, meaning that there is only an approximate Reed-Muller decoder to guide the solution. In addition, this scheme also suffers from the same Hadamard gate processing as in the previous scheme, resulting in a further reduction in the efficiency of the generated quantum circuit. Other previous solutions, such as T-Opt, try to use gadgetization to process the Hadamard gate. This scheme attempts to eliminate the Hadamard gate from the first part of the circuit using an appendage starting with the |+> state, which is later measured and used to classically control the Clifford gate (which may not be a Pauli gate, so the quantum controlled version may not be a Clifford gate). However, this method is based on heuristics and produces suboptimal quantum circuits.
[0038] An overall disadvantage of these existing systems is that they rely on explicit transformations to try to reduce the T count of quantum circuits. However, by relying on explicit transformations, the representation of the circuit affects the results. In other words, equivalent quantum circuits described in different terms are optimized differently from each other by existing systems. For example, the existing solution Tpar attempts to optimize the T depth of a quantum circuit by resynthesizing T gates in each CNOT+T section and by eliminating T gate pairs that are moved adjacent to each other, which is an explicit transformation.
[0039] Figure 2 Is to implement Mod5 4 A simplified diagram of one possible series of quantum gates for a circuit. Figure 2 As shown, Mod5 4 The circuit can be implemented as a sequence of 15 gates operating on 5 qubits. Specifically, these 15 gates consist of a Pauli X-gate (X), a Pauli Z-gate (Z), a Hadamard gate (H), and a Toffoli gate (T). These 15 gates operate on the states of qubits A, B, C, D, and E to generate a signal when the qubit is input to the circuit (shown as A). I , B I , C I , D I and E I ) changes the qubit to the qubit input state by Mod5 4 The corresponding output state indicated by the circuit (shown as A 0 , B 0 , C 0 , D 0 and E 0 ).
[0040] If you use Tpar to optimize Mod54 Circuits (e.g. Figure 2 Mod5 4 circuit), the T-count is reduced to 16, which is suboptimal. However, in Mod5 4 In the circuit, there are several It is a real CZ door in disguise (e.g. If before using Tpar to optimize the Mod54 circuit, use the conversion Each time it appears Rewrite as (CNOT+S circuit), the T-count is reduced to 8. This is because this conversion allows the explicit conversion Tpar to identify is truly equivalent to a CZ gate. The present disclosure overcomes these limitations of existing methods and demonstrates a way to obtain quantum circuits with optimal T counts or T depths. The present disclosure does this by non-explicitly using methods such as Instead, embodiments of the present disclosure may transform quantum circuits into the form of (or which essentially represents the circuit as a series of Pauli operators bound around the Clifford operator Rotation product. By using relations available to this form of circuit, such as the commutative relation [R(P), and (P)R(-P)=I, Embodiments of the present disclosure can reduce the T count. This means that equivalent gates and combinations of gates in a quantum circuit are treated in the same way, thereby ensuring that the representation of the circuit does not affect the optimization results.
[0041] To understand how the present disclosure can reduce the T-count of a quantum circuit, it is helpful to understand how to modify the Clifford+T circuit without changing the algorithm implemented by the Clifford+T circuit (e.g., without changing its black-box behavior). First, assume that any unitary gate U in an n-qubit system has an exact representation of the Clifford+T gate set. Then, there exists a Clifford operator C′ 0 , C′ 1 ,…,C′ k , so that Each m i ∈{1, 2, ..., n}, and each Based on the properties of the Clifford operator, the formula can be rewritten as:
[0042] Again based on the properties of the Clifford operator, there exists a Clifford gate C 0 , C 1, ..., C k Make C 0 =C′ 0 , C 1 =C′ 0 C′ 1 , …, C k =C′ 0 C′ 1 …C′ k Using these new Clifford gates, gate U can be rewritten as
[0043] To reduce the number of T-gates (which are much more expensive than other gates), we can rely on the fact that when a T-gate (e.g., T i ) when combined with any multi-qubit Clifford C, this T-gate can maintain a π / 4 phase rotation around the multi-qubit Pauli: in According to the definition of the Clifford group, in Also note that R(I) = I, R(-I) = e iπ / 4 I. Although these are not π / 4 rotations, they all include identities up to the phase, so embodiments of the present disclosure may use them in some circuit transformations. These π / 4 phase rotation gates around the multi-qubit Pauli R(P) may also be referred to as Pauli revolving door. It should be noted that if P x =P y , then R(P x )=R(P y ). In other words, The only difference between Pauli rotating gates is the Pauli operator they rotate around (resulting in the value of the qubit). So, for simplicity, R(P x ) match It can be simply called R(P match ).
[0044] Another way to think of R(P) is that the set {R(P)} is invariant under any Clifford exchange: Using this formula, we can shift all Clifford gates backwards (e.g., to the far right). This means that any Clifford+T circuit can be represented as a series of π / 4 rotations after Clifford (ignoring the global phase): in and m is the number of T gates in the circuit. Although the Clifford+T circuit U is converted to the form does not reduce the T-count by itself, but this transformation allows several other useful rules that reduce the T-count to be applied. For example, R(P)R(-P)=I, That is, two opposite π / 4 rotations can cancel each other, and two identical π / 4 rotations can be combined into a π / 2 rotation, which is the Clifford gate (i.e. For any Clifford C makes ), and can be used to be shifted to the rightmost side of the circuit. Applying any of the above transformations can reduce the T count of the circuit by 2. Further, reordering T gates can be independently useful when considering other goals of circuit optimization (such as reducing T depth).
[0045] It may be rare for a Clifford gate + T circuit to have two π / 4 rotations about the same Pauli directly adjacent to each other. However, many Clifford + T circuits can have two adjacent π / 4 rotations that swap with each other. In particular, T-gates operating on different qubits can perform their operations simultaneously, which means that they swap. Each set of swapping T-gates can be called a T-cycle, and the minimum number of T-cycles is usually defined as the T-depth. Similarly, a CNOT count can be defined.
[0046] For example, if a set of T gates (e.g., T loops) can be executed in parallel, then their corresponding π / 4 rotations are usually swapped in pairs. In the R(P) representation, the following rotations can be swapped: When this is taken into account, the embodiments of the present disclosure can find more opportunities to be applied. Allows interchanging of adjacent π / 4 rotations (e.g., T gates or Pauli revolving door) without affecting the results of the quantum circuit.
[0047] Repeatedly applying this rotation to adjacent swapped T-gates may be equivalent to applying some permutation to all π / 4 rotations in a circuit (e.g., T-gates or Pauli rotation door). While it may not be immediately obvious which permutations are allowed, there is a simple description of the set of permutations that can be obtained by viewing the structure of a π / 4 rotation as a directed acyclic graph (DAG). More specifically, it is of the form The T diagram of the circuit U can be defined as G T (U) = (V, E), where for j∈{1, 2, ..., m}, V = {v j} and E={(v i , v j )|[P i , P j ]≠0∧i<j}, that is, GT (U) can have a vertex for each π / 4 rotation in U, and an edge for each pair of π / 4 rotations that Pauli anticommutes with each other, with the direction of the edge determined by the order in which the two rotations appear in the original circuit. T (U) is usually a DAG, because v 1 , ..., v m The order is G T (U). In fact, by applying only the relation If and only if It's G T The topological sorting of (U) can be transformed into The circuit is converted to
[0048] Use T graph G T (U), it can be shown that although groups of pairwise swapping π / 4 rotations cannot always be converted to T-gates (or Pauli revolving door), but if (i) all P j exchange with each other, and (2) there is no non-empty subset S of {1, ..., m} such that Π j∈S P j = ±I, then the group of π / 4 rotations (e.g. ) can be converted into a Clifford+T circuit with a T depth of 1 (i.e., a circuit in which all T gates can be applied in parallel). Specifically, as long as all P j Interchange each other, π / 4 rotation group can be converted into a Clifford+T circuit with m auxiliary qubits and T depth 1.
[0049] However, in order to use auxiliary qubits to implement unitary gates, the auxiliary qubits should return to a constant state at the end of the circuit, otherwise the output state will have auxiliary carryover rather than a pure state. One way to satisfy this condition is to ensure that when the circuit is converted to In the form of , all auxiliary qubits remain in the state |0> throughout the circuit. To understand how this works, first let in and Then, the following statements are equivalent: (1) (2) (3) and (4)
[0050] By reusing hint (For example The form is The circuit can be expanded to the form of using t auxiliary bits in It is important to note that this extension satisfies for all |ψ> In addition, it is also important to note that adding auxiliary qubits to the circuit U using the above method does not change the circuit T graph G T U).
[0051] For some Clifford+T circuits, if all P j If we exchange with each other, we will have an exchange relationship This combined with the ability to reduce the T-depth of a circuit to 1 by using only m can provide a powerful tool for optimizing the T-depth (with an unlimited number of auxiliary qubits). j For those circuits that are all interchangeable, the minimum T depth that circuit U can achieve is exactly equal to G T (U) is the length of the longest path (i.e., the number of vertices on the longest path). Assume G T The longest path in (U) is The minimum T depth that can be achieved in this way is k, which is the length of the longest path.
[0052] A depth of k is actually achievable. T The vertices of (U) are first sorted in ascending order by the length of the longest path ending at each vertex. Since the minimum length of such a path is 1 and the maximum is k, this essentially converts G T The vertices of (U) are divided into k layers. T Edges of (U) can go only from one layer to a later layer, not to any previous layer, nor to the same layer. Thus, this sorting includes a topological ordering, and the π / 4 rotations can be reordered in U accordingly. The absence of any edges between vertices in the same layer also means that the rotations corresponding to those vertices interchange with each other, so each layer can be transformed into a T-layer. The end result is a Clifford+T circuit with T depth k. Note that the minimum T depth that can be achieved for circuit U is exactly equal to G T The length of the longest path in (U) (i.e., the number of vertices in the longest path), in G T (U) The conversion rule is allowed.
[0053] Therefore, embodiments of the present disclosure can reduce the space and time complexity of the Clifford+T quantum circuit by reducing the T count of the circuit. To achieve this optimization, some embodiments of the present disclosure can start by converting the initial quantum circuit (the circuit to be optimized) into an intermediate quantum circuit. This can involve, for example, modifying the initial quantum circuit into an equivalent Clifford+T circuit (e.g., modified to a circuit that utilizes quantum gates from the set {H, S, CNOT, T}), which can utilize quantum gates from the set G lnitial The quantum gate, where G Initial Contains a finite number of quanta. Converting the initial quantum circuit to an equivalent Clifford+T circuit can involve converting the circuit to a series of Clifford gates and T gates, such as: for m i ∈{1, 2, ..., n}, transform the initial quantum circuit into And each Then, some embodiments may further configure each T gate (e.g., each ) is converted to the corresponding Pauli revolving door (for example, converted to the corresponding R (P j )). Then, some embodiments may further combine the Clifford gate and The sequence of Pauli revolving doors (e.g., for m i ∈{1,2,...,n}, sequence And each A series of conversions after Clifford Gate Pauli revolving door (for example, series in And m is the number of T gates in the circuit.
[0054] In some embodiments, the initial quantum circuit is converted into a corresponding intermediate quantum circuit (e.g. In some embodiments, each T-gate can first be converted into a Pauli Z gate around a single qubit. Pauli rotation gates are used to transform the initial quantum circuit into an equivalent (i.e., performing the same rotation / transformation on its input qubits) intermediate quantum circuit. The fact that the set {R(P)} is invariant when commuted with any Clifford C (e.g. Shift all Clifford gates to the end of the equation (e.g., to the far right). Since Clifford+T circuits use only Clifford gates and T gates, having all Clifford gates on the far right means that the equation includes a sequence of T gates following the sequence of Clifford gates. Finally, based on the properties of Clifford gate circuits, there is always a single Clifford gate circuit that is equivalent to a sequence of Clifford gate circuits (e.g., if the sequence of Clifford gate circuits at the end of the quantum circuit is C 0 C 1 ...C k , then there exists a Clifford gate C′ such that C′=C 0 C 1 ...C k ). Using this fact, a single Clifford gate can be employed to replace the sequence of Clifford gates, thereby transforming the initial quantum circuit into an equivalent quantum circuit that is a sequence of T gates followed by a Clifford gate.
[0055] After converting the initial quantum circuit to the intermediate quantum circuit, some embodiments may continue to generate an optimized quantum circuit. In some embodiments, the optimized quantum circuit is in the form of a series of Pauli revolving door (e.g. ). In some embodiments, the process of generating an optimized quantum circuit may involve first initializing an empty optimized quantum circuit, wherein the empty optimized quantum circuit is constructed using the Clifford operator (which implements the unit gate ) The empty set of Pauli revolving doors (i.e., no doors or only unit doors) ). In other words, the circuit is initialized to make no changes to the input.
[0056] After initializing the optimized quantum circuit, some embodiments may continue to select the leftmost Some embodiments may then continue based on the selected Pauli revolving door generates new Pauli revolving door. Specifically, some embodiments can be based on the selected Pauli revolving door R(P selected ) Generate a new Pauli revolving door R(P new ),in, (For example, for the selected The Pauli operator of the Pauli rotation gate is multiplied by the Clifford gate of the optimized quantum circuit on the left. The Pauli rotation gate is multiplied by the conjugate transpose of the Clifford gate of the optimized quantum circuit on the right side to obtain the new The Pauli operator around which the Pauli revolving door is built. After the Pauli revolving door, some embodiments can The Pauli revolving gate is inserted into a series of optimized quantum circuits. The rightmost side of the Pauli revolving door (for example, in a series of The end of the Pauli twisting gate, just before the Clifford gate of the optimized quantum circuit).
[0057] In the new After the Pauli rotating gate is inserted into the optimized quantum circuit, some embodiments may continue to scan the optimized quantum circuit from right to left. Pauli revolving door (except for the new one just inserted Pauli revolving door) (e.g., from the nearest Pauli revolving door (and in the new Pauli revolving door on the left) Some embodiments can scan the optimized quantum circuit Pauli revolving door to find the Pauli revolving door before matching Pauli revolving door. In other words, some embodiments can Pauli revolving door to search for matching Pauli revolving door, the matching Pauli revolving door does not come with the new Pauli revolving door separation. In some embodiments, the matching Pauli revolving door means new Pauli revolving door Pauli revolving door, except possibly with a different sign. In other words, if New The Pauli revolving door is R(P), (e.g., the new The Pauli revolving door is For Matched The Pauli revolving door is R(±Q), (e.g., matched The Pauli revolving door is
[0058] In some implementations, if a match is found Pauli revolving door, then remove the matching Pauli revolving door and new Pauli revolving door. In some embodiments, if the matching Pauli revolving door with new Pauli revolving doors have the same sign (for example, if the new The Pauli revolving door is R(+P), then the matching The Pauli revolving door is R(+P), and if the new The Pauli revolving door is R(-P), then the matching The Pauli rotation gate is R(-P)), then the Clifford gate of the optimized quantum circuit can be modified to a new Clifford gate, where the new Clifford gate is equivalent to the current Clifford gate, multiplied twice by the left matching Pauli revolving door (for example, if (C Optimized ) new is the new Clifford gate of the optimized quantum circuit, and (C Optimized ) Current is the current Clifford gate of the optimized quantum circuit, then (C Optimized ) new =R(Q) 2 (C Optimized ) Current , where R(Q) 2 =R(Q)R(Q))).
[0059] In some embodiments, for the currently selected Pauli revolving door, in scan matching After the Pauli revolving door process is completed, the next leftmost quantum circuit from the middle quantum circuit can be selected. Pauli rotating gate, and the above process can be repeated. For each The Pauli revolving door will continue the above process until the middle quantum circuit The Pauli revolving door is completely processed. In some embodiments, when a matching Pauli revolving door, for matching The scanning process of the Pauli revolving door is then completed (and the search for a matching In some embodiments, when a non-commutative Pauli revolving door (no matching results found yet Pauli revolving door), the above process is completed. In some embodiments, when the entire series of optimized quantum circuits are scanned Pauli revolving door without finding a match Pauli revolving door (in any non-commutative The above process is completed. It should be noted that the last two cases mean that one or more iterations may fail to find a matching The case of the Pauli revolving door.
[0060] In some embodiments, in the intermediate quantum circuit After all the Pauli rotation gates are processed, the Clifford gate of the optimized quantum circuit can be modified to a new Clifford gate, where the new Clifford gate is equivalent to the current Clifford gate. The Clifford gate of the middle quantum circuit on the right makes the current Clifford gate conjugate (for example, if (C Optimized ) new is the new Clifford gate of the optimized quantum circuit, (C Optimized ) Current is the current Clifford gate of the optimized quantum circuit, and (C Intermediate ) Current is the current Clifford gate of the intermediate quantum circuit, then (C Optimized ) new =(C Optimized ) current (C Intermediate ) current ).
[0061] Figure 3 is a flow chart of an exemplary method of how to optimize a quantum circuit according to some embodiments of the present disclosure. Figure 3 As shown, in step 302, the initial quantum circuit (shown as U 1 ) is converted into the following form: For example, it is converted into a series of rotating gates around the Clifford gate of the Pauli operator. In step 302, the (empty) optimized quantum circuit (shown here as U 0 ), the (empty) optimized quantum circuit is of the form k is initially equal to 0, i.e., the set of turnstiles is initially empty, and C 0 Initially equal to For U 0 and U 1 The phase factor e iφ is ignored, and U 0 U 1 It should be loop-invariant. Then, in step 303, from U 1 Remove the leftmost revolving gate (factor) R(P) from U, for example, remove the remaining next revolving gate from the initial quantum circuit. As shown in step 303, remove the leftmost revolving gate R(P) from U 1 After removal, the new revolving door Insert to U 0 Middle C 0 on the left side, e.g. to insert a new revolving door As U 0 The revolving door on the far right.
[0062] After step 303, in step 304, the evaluation is performed on U 0 The rightmost unevaluated factor R(Q) in (from the revolving door just inserted In step 305, it is determined whether the factor R(Q) found has If the R(Q) found does have Then in step 306, from U 0 Remove R(Q) and After step 306, the method proceeds to step 311. Optionally, if in step 305, if the factor R(Q) found does not Then in step 307, it is determined whether the found factor R(Q) has If the factor R(Q) found does have Then in step 308, from U 0 Remove (Q) and And with the new Clifford door R (Q) 2 C 0 Replace C 0 (For example, C 0 ←R(Q) 2 C 0 ). After step 308, the method proceeds to step 311. Optionally, if the factor R(Q) found in step 307 does not exist Then in step 309, it is determined whether the found factor R(Q) has Q such that (or equivalently,
[0063] If the factor R(Q) found does have Q such that The method then proceeds to step 311. Optionally, if it is determined in step 309 that the factor R(Q) found does not have Q such that Then in step 310, determine U 0 All unevaluated factors R(Q) in have been processed. 0 Each unevaluated factor R(Q) in has not been processed, the method returns to step 304 to evaluate U 0 Optionally, if U is determined in step 310 0 Each unevaluated factor R(Q) in has been processed, then in step 311, U 1 Has each product part R(P) in been processed? 1 If each product part R(P) in U has not been processed, the method returns to step 303 to manage 1Optionally, if U is determined in step 311 1 Each product part R(P) in has been processed, then in step 312, a new Clifford gate C is used. 0 C 1 Replace C 0 (For example, C 0 ←C 0 C 1 ), and adopt the new Clifford door Replace C 1 (For example, C 1 ←I). Then, in step 313, U 0 Convert back to Clifford+T circuit and return as the optimized quantum circuit.
[0064] about Figure 3 The efficiency of the exemplary method discussed in 1 Each factor R(P) in U 0 The action of scanning each factor R(Q) in the initial quantum circuit (until one of the stopping conditions is met) is usually the limiting factor of the efficiency of this exemplary algorithm. In the worst case, for each R(P) factor in the initial quantum circuit, the algorithm can scan U 0 Each R(Q) factor in , checks equality and commutativity each time. Therefore, the worst case complexity is O(m 2 n), where n is the number of qubits and m is the number of T gates in the original circuit.
[0065] Figure 4 Describes the present disclosure (e.g., Figure 3 Benchmark results of an exemplary embodiment of the algorithm described in ) in optimizing quantum circuits. Figure 4 As shown, the benchmark test results of the exemplary embodiment of the present disclosure (shown as T optimizer in the rightmost column) show that the output circuit optimized by the algorithm has an average reduction of 42.67% in T count compared to the original unoptimized circuit, and for some circuits it is reduced by 71.43%. Figure 4 It is also shown that, unlike other T-count optimizers, these T-count optimizers typically result in a significant increase in the CNOT count of the optimized circuit compared to the original unoptimized circuit. The embodiments of the present disclosure typically do not increase the CNOT count in the process of reducing the T count. Further, the exemplary embodiment can be applied to optimized quantum circuits generated by other quantum circuit optimization tools, regardless of whether the quantum circuit optimization tool optimizes the CNOT count or the T count, and the circuit can be further optimized (e.g., to produce an even smaller T count) without affecting other performance parameters (such as the CNOT count).
[0066] Figure 5 is a depiction of an exemplary system 501 for optimizing quantum circuits consistent with some embodiments of the present disclosure. Figure 5 , but the system 500 may include a server configured to perform, for example, Figure 4 Any computer, such as a desktop computer, laptop computer, tablet computer, etc., that can perform the optimization method described in Figure 5 As shown, system 501 may have a processor 502. Processor 502 may include a single processor or multiple processors. For example, processor 502 may include a CPU, a GPU, a reconfigurable array (e.g., an FPGA or other ASIC), etc. Processor 502 may be operably connected to memory 503, an input / output module 507, and a network interface controller (NIC) 509.
[0067] The memory 503 may include a single memory or multiple memories. In addition, the memory 503 may include a volatile memory, a non-volatile memory, or a combination of the two. Figure 5 As shown, the memory 503 may store one or more operating systems 504 and optimizers 505. For example, the optimizer 505 may include instructions for optimizing quantum circuits (e.g., as explained above). Thus, the optimizer 505 may simulate and optimize one or more quantum circuits according to any of the methods described above. An input / output module (I / O) 507 may store and retrieve data from one or more databases 508. For example, the database 508 may include a data structure describing a quantum circuit and a data structure describing an equivalent T-gate and Clifford gate group used for replacement in the quantum circuit. The NIC 509 may connect the system 501 to one or more computer networks. Figure 5 As shown, NIC 509 can connect system 501 to the Internet 510. System 501 can receive data and instructions over the network using NIC 509, and can send data and instructions over the network using NIC 509.
[0068] In some embodiments, the initial quantum circuit (the quantum circuit to be optimized) can be obtained by various means. For example, in some embodiments, the initial quantum circuit can be obtained as an input to the program. The input can appear in a variety of forms, including how the input is represented (e.g., the data structure involved) and what the input represents (e.g., what quantum circuit is used to represent the input). In other embodiments, the quantum circuit can be created directly within the program that performs the optimization. In addition, as described above, how to represent the quantum circuit can vary. For example, the quantum circuit can be represented as a collection of quantum gates and connections between quantum gates, as a graph, or using some other representation. In addition, equivalent quantum circuits can be described by using different types of gates (or gates of the same type but different numbers and / or connections).
[0069] It should be noted that, as used herein, terms such as "convert," "generate," "insert," "remove," etc. do not necessarily imply changes to physical quantum circuits, devices, or objects. For example, in some embodiments, the initial quantum circuit and the optimized quantum circuit may be graphs or other representations of the quantum circuit, rather than physical objects. In some embodiments, the representation of the quantum circuit may be of various types. For example, the quantum circuit may be represented using various data structures, may be represented graphically, may be represented as a series of matrices, etc. In addition, some embodiments may optimize the layout of the physical quantum circuit, such as by manipulating quantum simulations of a field programmable gate array (FPGA).
[0070] In addition, some embodiments may optimize quantum circuits appropriately, while other embodiments may use auxiliary quantum circuits as part of the optimization process. For example, in some embodiments, converting an initial quantum circuit to an intermediate quantum circuit may involve changing the initial quantum circuit to an intermediate quantum circuit (e.g., rewriting a representation of the initial quantum circuit as an intermediate quantum circuit). Conversely, in some embodiments, converting an initial quantum circuit to an intermediate quantum circuit may involve generating a new quantum circuit, which is then converted to an intermediate quantum circuit (e.g., by using the initial quantum circuit as a template). Similarly, in some embodiments, generating an optimized quantum circuit may involve editing an intermediate quantum circuit appropriately, while in other embodiments, generating an optimized quantum circuit may involve generating a new quantum circuit, which is then converted to an optimized quantum circuit. This same process can be applied to any quantum circuit conversion.
[0071] Relatedly, in some embodiments, the leftmost The Pauli revolving gate can involve removing the leftmost Pauli revolving door. In some embodiments, the leftmost The Pauli revolving gate is not removed from the middle quantum circuit, and the optimization continues using the leftmost one that has not yet been selected. Pauli revolving door. Similarly, in the middle quantum circuit After the Pauli rotation gate is processed and the Clifford gate of the optimized quantum circuit is modified to the new Clifford gate, the current Clifford gate of the intermediate quantum circuit can be modified to the unit gate (for example, if (C Intermediate ) Current is the current Clifford gate of the intermediate quantum circuit, then In other embodiments, the current Clifford gate of the intermediate quantum circuit may not be modified. The Pauli rotation gate is removed when selected, and the Clifford gate of the intermediate quantum circuit is modified to a unit gate. Then the intermediate quantum circuit can be a blank quantum circuit (e.g., a Clifford operator (which implements the unit gate ) The empty set of Pauli revolving doors (i.e., no doors or only unit doors) )).
[0072] In some embodiments, the optimized quantum circuit can be returned as an optimized version of the initial quantum circuit. In some embodiments, this can involve rewriting the initial quantum circuit with the optimized quantum circuit. In other embodiments, this can involve writing or otherwise providing the optimized quantum circuit as a new circuit. In some embodiments, the optimized quantum circuit can be returned without further conversion. In some embodiments, the optimized quantum circuit can be converted before returning. In some embodiments, the optimized quantum circuit can have some additional optimizations applied to it before returning. For example, in some embodiments, the optimized quantum circuit can be converted to a Clifford+T circuit before returning. In some embodiments, after conversion to a Clifford+T circuit, or instead of conversion to a Clifford+T circuit, the optimized quantum circuit can be converted to a pre-initialized quantum circuit.
[0073] In some embodiments, the initial quantum circuit may be modified before being converted into an intermediate quantum circuit. In some embodiments, the initial quantum circuit may be converted into a different representation before being converted into an intermediate quantum circuit. Additionally, in some embodiments, other optimizations may be applied to the initial quantum circuit before being converted into an intermediate quantum circuit. For example, in some embodiments, the initial quantum circuit may be represented as (e.g., capable of being approximated to arbitrary precision) a Clifford+T circuit. However, in some embodiments, the initial quantum circuit may not be accurately represented using a Clifford+T circuit (e.g., cannot be approximated to arbitrary precision using only Clifford gates and T gates).
[0074] In some embodiments, when the initial quantum circuit is not accurately represented by the Clifford + T circuit, the initial quantum circuit can first be modified to the form of the Clifford + T circuit representation using auxiliary quantum bits. The modified initial quantum circuit can then be converted into an intermediate quantum circuit as described above. The process of modifying the initial quantum circuit that is not accurately represented by the Clifford + T circuit to the Clifford + T circuit representation using auxiliary quantum bits can include multiple methods. For example, in some embodiments, an exhaustive search can be used to find the Clifford + T circuit representation using auxiliary quantum bits. In some embodiments, if the initial quantum circuit is based on phase evaluation, the phase retracement technique can introduce auxiliary quantum bits to perform phase gate selection. In addition, in some embodiments, the Soloviev-Kitayev algorithm can be used to find the Clifford + T circuit representation using auxiliary bits, which Clifford + T circuit representation can achieve the accuracy of the initial quantum circuit to reach the accuracy. ∈ .
[0075] In some embodiments, the intermediate quantum circuit may have some additional optimizations applied to it during the optimization process. In some examples of these embodiments, the intermediate quantum circuit is converted back to the appropriate form before continuing the optimization process. In other words, if the intermediate quantum circuit is converted or otherwise optimized during the optimization process and is in a form of , the circuit is converted back to form.
[0076] Some embodiments may reduce the number of T-gates in a quantum circuit by converting the representation of the initial quantum circuit into a ZX diagram and then employing phase telemanipulation techniques.
[0077] Some embodiments may utilize the restrictions imposed on the quantum circuit by the target quantum hardware to modulate the optimization of the quantum circuit to improve efficiency (e.g., reduce the T-count of the initial quantum circuit). For example, some embodiments may actively consider specific hardware constraints of the target hardware when optimizing, such as considering connectivity mapping and error variance, utilizing additional auxiliary qubits to further reduce the T-count (because it is often worth sacrificing a few qubits to reduce cost and further improve performance on the hardware), etc.
[0078] In some embodiments, a non-volatile computer-readable storage medium including instructions is also provided, and these instructions can be executed by a device for performing the above method (e.g., the disclosed encoder and decoder). Common forms of non-volatile media include, for example, floppy disks, flexible disks, hard disks, solid-state drives, tapes or any other magnetic data storage media, CD-ROMs, any other optical data storage media, any physical media with hole patterns, RAM, PROM and EPROM, FLASH-EPROM or any other flash memory, NVRAM, cache, registers, any other memory chip or box, and networked versions thereof. The device may include one or more processors (CPUs), input / output interfaces, network interfaces, and / or memories.
[0079] The above description has been given for the purpose of illustration. They are not exhaustive and are not limited to the precise forms or embodiments disclosed. Modifications and adjustments to the embodiments will be apparent in view of the description and practice of the disclosed embodiments. For example, the described implementation includes hardware, but systems and methods consistent with the present disclosure may be implemented with hardware and software. In addition, although certain components are described as being coupled to each other, these components may be integrated with each other or distributed in any suitable manner.
[0080] In addition, although illustrative embodiments have been described herein, the scope includes any and all embodiments having equivalent elements, modifications, omissions, combinations (e.g., combinations of aspects of various embodiments), modifications, or variations based on the present disclosure. The elements of the claims are to be interpreted broadly based on the language used in the claims, and are not limited to the examples described in this specification or during the application process, which are to be interpreted as non-exclusive. In addition, the steps of the disclosed methods may be modified in any way, including reordering steps or inserting or deleting steps.
[0081] It should be noted that relational terms such as "first" and "second" herein are used only to distinguish an entity or operation from another entity or operation, and do not require or imply any actual relationship or order between these entities or operations. In addition, the words "comprise", "have", "contain", and "include" and other similar forms are intended to be equivalent in meaning and open-ended, in that one or more items following any of these words are not meant to be an exhaustive list of such one or more items, or to be limited to the one or more items listed.
[0082] The features and advantages of the present disclosure are apparent from the detailed description. As used herein, the indefinite articles "a" and "an" mean "one or more". Similarly, the use of plural terms does not necessarily indicate a plural number unless it is clear in a given context. In addition, since numerous modifications and variations will readily occur by studying the present disclosure, it is not desirable to limit the present disclosure to the exact configuration and operation illustrated and described, and therefore, all suitable modifications and equivalents falling within the scope of the present disclosure may be adopted.
[0083] As used herein, unless specifically stated otherwise, the term "or" encompasses all possible combinations unless not feasible. For example, if it is stated that a database may include A or B, then unless specifically stated or not feasible, the database may include A or B, or A and B. As a second example, if it is stated that a database may include A, B, or C, then unless specifically stated or not feasible, the database may include A, or B, or C, or A and B, or A and C, or B and C, or A, B, and C.
[0084] It should be understood that the above-mentioned embodiments can be implemented by hardware or software (program code) or a combination of hardware and software. If implemented by software, it can be stored in the above-mentioned computer-readable medium. When executed by a processor, the software can execute the disclosed method. The computing unit and other functional units described in this disclosure can be implemented by hardware, or software, or a combination of hardware and software. It will also be understood by those of ordinary skill in the art that a plurality of the above-mentioned modules / units can be combined into one module / unit, and each of the above-mentioned modules / units can be further divided into a plurality of submodules / subunits.
[0085] In the foregoing description, embodiments have been described with reference to many specific details that may vary with implementation. Certain adjustments and modifications may be made to the described embodiments. In view of the description and practice of the present disclosure disclosed herein, other embodiments will be apparent to those skilled in the art. The description and embodiments are considered to be exemplary only. The sequence of steps shown in the accompanying drawings is also intended to be used only for illustrative purposes and is not intended to be limited to any particular sequence of steps. Therefore, it will be appreciated by those skilled in the art that these steps may be performed in different orders to implement the same method.
[0086] The following terms may be used to further describe the embodiments:
[0087] 1. A method for optimizing a quantum circuit, the method comprising the following steps:
[0088] The initial quantum circuit is converted into an intermediate quantum circuit, wherein the intermediate quantum circuit is a first Clifford gate followed by a first group Pauli revolving door; and
[0089] By the first group Each of the Pauli revolving doors The Pauli rotation gate performs the following operations to generate an updated quantum circuit, which is the second group after the second Clifford gate. Pauli revolving door:
[0090] In the second group Insert the new one after the Pauli revolving door Pauli revolving door, wherein the new The Pauli revolving door corresponds to the first group The current in the Pauli revolving door The Pauli rotation gate is realized by left-multiplying the second Clifford gate and right-multiplying the conjugate transpose of the second Clifford gate,
[0091] Scan the second group Pauli revolving door to determine the noncommutative Is there a matching Pauli revolving door before? Pauli revolving door;
[0092] In response to determining that there is a matching Pauli revolving door, from the second group Pauli revolving door removes the matching Pauli revolving door and the new Pauli revolving door, and
[0093] If the matching Pauli revolving door and the new If the Pauli revolving gate has the opposite sign, the second Clifford gate is replaced by a new Clifford gate, wherein the new Clifford gate corresponds to the current second Clifford gate, and the new Clifford gate is obtained by left-multiplying twice Pauli revolving door realized.
[0094] 2. The method according to clause 1, further comprising:
[0095] The second Clifford gate is replaced by a new second Clifford gate, wherein the new second Clifford gate is a current second Clifford gate conjugated with the first Clifford gate.
[0096] 3. The method according to any one of clauses 1 and 2, wherein converting the initial quantum circuit into the intermediate quantum circuit comprises:
[0097] Convert each T gate in the initial quantum circuit into a corresponding Pauli revolving door;
[0098] use The invariance of the exchange between the Pauli rotation gate and the Clifford gate is to shift all the Clifford gates in the initial quantum circuit to the rear of the equation; and
[0099] All Clifford gates in the initial quantum circuit are merged into a single Clifford gate.
[0100] 4. The method according to any of clauses 1 to 3, wherein the initial quantum circuit is converted or optimized before converting the initial quantum circuit into the intermediate quantum circuit.
[0101] 5. The method according to clause 4, wherein the initial quantum circuit is represented by a non-Clifford+T circuit, and the method further comprises:
[0102] Before converting the initial quantum circuit into the intermediate quantum circuit, the initial quantum circuit is converted into a form represented by a Clifford+T circuit.
[0103] 6. A method according to clause 5, wherein the initial quantum circuit is converted into a form represented by the Clifford+T circuit, the Clifford+T circuit using auxiliary quantum bits.
[0104] 7. The method according to any one of clauses 1 to 6, wherein the method further comprises:
[0105] The returned updated quantum circuit serves as an updated version of the initial quantum circuit.
[0106] 8. The method of clause 7, wherein the updated quantum circuit is transformed or optimized before being returned.
[0107] 9. The method of clause 8, further comprising: converting the updated quantum circuit into an equivalent Clifford+T circuit before returning the updated quantum circuit as the updated version of the initial quantum circuit.
[0108] 10. A method according to any one of clauses 1 to 6, wherein determining the existence of the matching Pauli revolving door includes:
[0109] Evaluate the use of the matching balanced with the constraints of the target quantum hardware Efficiency gains from Pauli revolving doors.
[0110] 11. A quantum circuit update system, comprising:
[0111] Memory to store the instruction set: and
[0112] One or more processors configured to execute the instruction set to cause the system to perform the following processing:
[0113] The initial quantum circuit is converted into an intermediate quantum circuit, wherein the intermediate quantum circuit is a first Clifford gate followed by a first group Pauli revolving door; and
[0114] By the first group Each of the Pauli revolving doors The Pauli rotation gate performs the following operations to generate an updated quantum circuit, which is the second group after the second Clifford gate. Pauli revolving door:
[0115] In the second group Insert the new one after the Pauli revolving door Pauli revolving door, wherein the new The Pauli revolving door corresponds to the first group The current in the Pauli revolving door The Pauli rotation gate is used to make the first group Pauli revolving door conjugation,
[0116] Scan the second group Pauli revolving door to determine the noncommutative Is there a matching Pauli revolving door before? Pauli revolving door;
[0117] In response to determining that there is a matching Pauli revolving door, from the second group Pauli revolving door removes the matching Pauli revolving door and the new Pauli revolving door, and
[0118] If the matching Pauli revolving door and the new The Pauli revolving door has the opposite sign, then a new Clifford door is used to replace the second Clifford door, wherein the new Clifford door corresponds to the current second Clifford door, and the new The Pauli revolving gate conjugates the current to the second Clifford gate.
[0119] 12. The system of clause 11, wherein the set of instructions is executed by the one or more processors to cause the system to further perform the following processing:
[0120] The second Clifford gate is replaced by a new second Clifford gate, wherein the new second Clifford gate is a current second Clifford gate conjugated with the first Clifford gate.
[0121] 13. The system of any one of clauses 11 and 12, wherein converting the initial quantum circuit into the intermediate quantum circuit comprises:
[0122] Convert each T gate in the initial quantum circuit into a corresponding Pauli revolving door;
[0123] use The invariance of the exchange between the Pauli rotation gate and the Clifford gate is to shift all the Clifford gates in the initial quantum circuit to the rear of the equation; and
[0124] All Clifford gates in the initial quantum circuit are merged into a single Clifford gate.
[0125] 14. A system according to any one of clauses 11 to 13, wherein the initial quantum circuit is represented by a non-Clifford+T circuit, and the instruction set is executed by the one or more processors to cause the system to further perform the following processing:
[0126] Before converting the initial quantum circuit into the intermediate quantum circuit, the initial quantum circuit is converted into a form represented by a Clifford+T circuit.
[0127] 15. A system according to any one of clauses 11-14, wherein the set of instructions is executed by the one or more processors to cause the system to further perform the following processing:
[0128] Before returning the updated quantum circuit as the updated version of the initial quantum circuit, the updated quantum circuit is converted into an equivalent Clifford+T circuit.
[0129] 16. A non-volatile computer-readable medium storing a set of instructions, the set of instructions being executed by at least one processor of a computer system to cause the computer system to perform a method for updating a quantum circuit, the method comprising:
[0130] The initial quantum circuit is converted into an intermediate quantum circuit, wherein the intermediate quantum circuit is a first Clifford gate followed by a first group Pauli revolving door; and
[0131] By the first group Each of the Pauli revolving doors The Pauli rotation gate performs the following operations to generate an updated quantum circuit, which is the second group after the second Clifford gate. Pauli revolving door:
[0132] In the second group Insert the new one after the Pauli revolving door Pauli revolving door, wherein the new The Pauli revolving door corresponds to the first group The current in the Pauli revolving door The Pauli rotation gate is used to make the first group Pauli revolving door conjugation,
[0133] Scan the second group Pauli revolving door to determine the noncommutative Is there a matching Pauli revolving door before? Pauli revolving door;
[0134] In response to determining that there is a matching Pauli revolving door, from the second group Pauli revolving door removes the matching Pauli revolving door and the new Pauli revolving door, and
[0135] If the matching Pauli revolving door and the new The Pauli revolving door has the opposite sign, then a new Clifford door is used to replace the second Clifford door, wherein the new Clifford door corresponds to the current second Clifford door, and the new The Pauli revolving gate conjugates the current to the second Clifford gate.
[0136] 17. The non-transitory computer-readable medium of clause 16, wherein the set of instructions is executable by the at least one processor of the computer system to cause the computer system to further:
[0137] The second Clifford gate is replaced by a new second Clifford gate, wherein the new second Clifford gate is a current second Clifford gate conjugated with the first Clifford gate.
[0138] 18. The non-transitory computer-readable medium of any of clauses 16 and 17, wherein converting the initial quantum circuit into the intermediate quantum circuit comprises:
[0139] Convert each T gate in the initial quantum circuit into a corresponding Pauli revolving door;
[0140] use The invariance of the exchange between the Pauli rotation gate and the Clifford gate is to shift all the Clifford gates in the initial quantum circuit to the rear of the equation; and
[0141] All Clifford gates in the initial quantum circuit are merged into a single Clifford gate.
[0142] 19. The non-transitory computer-readable medium according to any one of clauses 16 to 18, wherein the initial quantum circuit is represented by a non-Clifford+T circuit, and the instruction set is executed by the at least one processor of the computer system to cause the computer system to further perform the following processing:
[0143] Before converting the initial quantum circuit into the intermediate quantum circuit, the initial quantum circuit is converted into a form represented by a Clifford+T circuit.
[0144] 20. The non-transitory computer-readable medium of any one of clauses 16-19, wherein the set of instructions is executable by the at least one processor of the computer system to cause the computer system to further perform the following processing:
[0145] Before returning the updated quantum circuit as the updated version of the initial quantum circuit, the updated quantum circuit is converted into an equivalent Clifford+T circuit.
[0146] In the drawings and description, exemplary embodiments have been disclosed. However, many variations and modifications may be made to these embodiments. Therefore, although specific terms are employed, they are used only in a general and descriptive sense and not for the purpose of limiting or defining the scope of the embodiments, which scope is defined by the appended claims.
Claims
1. A method for optimizing a quantum circuit, the method comprising the following steps: The initial quantum circuit is converted into an intermediate quantum circuit, wherein the intermediate quantum circuit is a first Clifford gate followed by a first group Pauli revolving door; and By the first group Each of the Pauli revolving doors The Pauli rotation gate performs the following operations to generate an updated quantum circuit, which is the second group after the second Clifford gate. Pauli revolving door: In the second group Insert the new one after the Pauli revolving door Pauli revolving door, wherein the new The Pauli revolving door corresponds to the first group The current in the Pauli revolving door The Pauli rotation gate is realized by left-multiplying the second Clifford gate and right-multiplying the conjugate transpose of the second Clifford gate, Scan the second group Pauli revolving door to determine the noncommutative Is there a matching Pauli revolving door before? Pauli revolving door; In response to determining that there is a matching Pauli revolving door, from the second group Pauli revolving door removes the matching Pauli revolving door and the new Pauli revolving door, and If the matching Pauli revolving door and the new If the Pauli revolving gate has the opposite sign, the second Clifford gate is replaced by a new Clifford gate, wherein the new Clifford gate corresponds to the current second Clifford gate, and the new Clifford gate is obtained by left-multiplying twice Pauli revolving door realized.
2. The method according to claim 1, further comprising: The second Clifford gate is replaced by a new second Clifford gate, wherein the new second Clifford gate is a current second Clifford gate conjugated with the first Clifford gate.
3. The method according to claim 1, wherein: Converting the initial quantum circuit into the intermediate quantum circuit comprises: Convert each T gate in the initial quantum circuit into a corresponding Pauli revolving door; use The invariance of the exchange between the Pauli rotation gate and the Clifford gate is to shift all the Clifford gates in the initial quantum circuit to the rear of the equation; and All Clifford gates in the initial quantum circuit are merged into a single Clifford gate.
4. The method according to claim 1, wherein: Before converting the initial quantum circuit into the intermediate quantum circuit, the initial quantum circuit is converted or optimized.
5. The method according to claim 4, wherein: If the initial quantum circuit cannot be accurately represented by a non-Clifford+T circuit, the method further comprises: Before converting the initial quantum circuit into the intermediate quantum circuit, the initial quantum circuit is converted into a form that can be represented by a Clifford+T circuit.
6. The method according to claim 5, wherein: The initial quantum circuit is converted into a form represented by the Clifford+T circuit, which uses auxiliary quantum bits.
7. The method according to claim 1, wherein: The method further comprises: The returned updated quantum circuit serves as an updated version of the initial quantum circuit.
8. The method according to claim 7, wherein: Before returning the updated quantum circuit, the updated quantum circuit is transformed or optimized.
9. The method according to claim 8, further comprising: Before returning the updated quantum circuit as the updated version of the initial quantum circuit, the updated quantum circuit is converted into an equivalent Clifford+T circuit.
10. The method according to any one of claims 1 to 9, wherein: Determine if there is a match Pauli revolving door includes: Evaluate the use of the matching balanced with the constraints of the target quantum hardware Efficiency gains from Pauli revolving doors.
11. A quantum circuit update system, comprising: Memory to store the instruction set: and One or more processors configured to execute the instruction set to cause the system to perform the following processing: The initial quantum circuit is converted into an intermediate quantum circuit, wherein the intermediate quantum circuit is a first Clifford gate followed by a first group Pauli revolving door; and By the first group Each of the Pauli revolving doors The Pauli rotation gate performs the following operations to generate an updated quantum circuit, which is the second group after the second Clifford gate. Pauli revolving door: In the second group Insert the new one after the Pauli revolving door Pauli revolving door, wherein the new The Pauli revolving door corresponds to the first group The current in the Pauli revolving door The Pauli rotation gate is realized by left-multiplying the second Clifford gate and right-multiplying the conjugate transpose of the second Clifford gate, Scan the second group Pauli revolving door to determine the non-commutative Is there a matching Pauli revolving door before? Pauli revolving door; In response to determining that there is a matching Pauli revolving door, from the second group Pauli revolving door removes the matching Pauli revolving door and the new Pauli revolving door, and If the matching Pauli revolving door and the new If the Pauli revolving gate has the opposite sign, the second Clifford gate is replaced by a new Clifford gate, wherein the new Clifford gate corresponds to the current second Clifford gate, and the new Clifford gate is obtained by left-multiplying twice Pauli revolving door realized.
12. The system according to claim 11, wherein: The instruction set is executed by the one or more processors to cause the system to further perform the following processing: The second Clifford gate is replaced by a new second Clifford gate, wherein the new second Clifford gate is a current second Clifford gate conjugated with the first Clifford gate.
13. The system according to claim 11 or 12, wherein: Converting the initial quantum circuit into the intermediate quantum circuit comprises: Convert each T gate in the initial quantum circuit into a corresponding Pauli revolving door; use The invariance of the exchange between the Pauli rotation gate and the Clifford gate is to shift all the Clifford gates in the initial quantum circuit to the rear of the equation; and All Clifford gates in the initial quantum circuit are merged into a single Clifford gate.
14. The system according to any one of claims 11 to 12, wherein: The initial quantum circuit is represented by a non-Clifford+T circuit, and the instruction set is executed by the one or more processors to enable the system to further perform the following processing: Before converting the initial quantum circuit into the intermediate quantum circuit, the initial quantum circuit is converted into a form represented by a Clifford+T circuit.
15. The system according to any one of claims 11 to 12, wherein: The instruction set is executed by the one or more processors to cause the system to further perform the following processing: Before returning the updated quantum circuit as an updated version of the initial quantum circuit, the updated quantum circuit is converted into an equivalent Clifford+T circuit.
16. A non-volatile computer readable medium storing an instruction set, the instruction set being executed by at least one processor of a computer system to cause the computer system to perform a method for updating a quantum circuit, the method comprising: The initial quantum circuit is converted into an intermediate quantum circuit, wherein the intermediate quantum circuit is a first Clifford gate followed by a first group Pauli revolving door; and By the first group Each of the Pauli revolving doors The Pauli rotation gate performs the following operations to generate an updated quantum circuit, which is the second group after the second Clifford gate. Pauli revolving door: In the second group Insert the new one after the Pauli revolving door Pauli revolving door, wherein the new The Pauli revolving door corresponds to the first group The current in the Pauli revolving door The Pauli rotation gate is realized by left-multiplying the second Clifford gate and right-multiplying the conjugate transpose of the second Clifford gate, Scan the second group Pauli revolving door to determine the noncommutative Is there a matching Pauli revolving door before? Pauli revolving door; In response to determining that there is a matching Pauli revolving door, from the second group Pauli revolving door removes the matching Pauli revolving door and the new Pauli revolving door, and If the matching Pauli revolving door and the new If the Pauli revolving gate has the opposite sign, the second Clifford gate is replaced by a new Clifford gate, wherein the new Clifford gate corresponds to the current second Clifford gate, and the new Clifford gate is obtained by left-multiplying twice Pauli revolving door realized.
17. The non-transitory computer readable medium of claim 16, wherein: The instruction set is executed by the at least one processor of the computer system to cause the computer system to further perform the following processing: The second Clifford gate is replaced by a new second Clifford gate, wherein the new second Clifford gate is a current second Clifford gate conjugated with the first Clifford gate.
18. The non-transitory computer readable medium of claim 16, wherein: Converting the initial quantum circuit into the intermediate quantum circuit comprises: Convert each T gate in the initial quantum circuit into a corresponding Pauli revolving door; use The invariance of the exchange between the Pauli rotation gate and the Clifford gate is to shift all the Clifford gates in the initial quantum circuit to the rear of the equation; and All Clifford gates in the initial quantum circuit are merged into a single Clifford gate.
19. The non-transitory computer readable medium of claim 16, wherein: The initial quantum circuit is represented by a non-Clifford+T circuit, and the instruction set is executed by the at least one processor of the computer system so that the computer system further performs the following processing: Before converting the initial quantum circuit into the intermediate quantum circuit, the initial quantum circuit is converted into a form represented by a Clifford+T circuit.
20. The non-transitory computer readable medium of claim 16, wherein: The instruction set is executed by the at least one processor of the computer system to cause the computer system to further perform the following processing: Before returning the updated quantum circuit as an updated version of the initial quantum circuit, the updated quantum circuit is converted into an equivalent Clifford+T circuit.
