A derivative method for verifying the equivalence of quantum circuits based on truth tables
Quantum circuit operations are expressed in the form of unitary matrix operations and tables, which solves the problems of imaginary number processing and data complexity in quantum circuit equivalence verification, achieves a more intuitive and accurate verification process, and simplifies the verification of multi-qubit circuits.
Patent Information
- Application Number
- CN202210565085.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-23
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-05-23
AI Technical Summary
Existing quantum circuit equivalence verification methods, especially truth table verification and Boolean matrix representation, have the problem of being unable to handle imaginary parameters and overly complex data, resulting in a cumbersome and error-prone verification process.
Adopt a derivative method based on unitary matrix operation, express the operation process and results of each step in the form of a table, integrate the rules in the quantum gate library, including the NCV gate library and Clifford+T gate library, decompose the V gate and verify its correctness. Use tensor product to represent the entangled state output to simplify the verification process.
It enables easy verification of equivalence in quantum circuits, simplifies the matrix representation of large-scale multi-qubit circuits, avoids the complexity of imaginary number operations, improves the intuitiveness and accuracy of verification, and reduces the complexity and complexity of manual verification. error rate.
Smart Images

Figure CN114925839B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of quantum circuit equivalence verification, and in particular to a derivative method for verifying quantum circuit equivalence based on a truth table. Background Art
[0002] In recent years of research and development, actual quantum computers have gradually become feasible, and more and more algorithms have emerged to improve quantum computers, and quantum computing has gained considerable momentum. At the same time, the realization of truly meaningful quantum computing requires a thorough understanding of quantum circuits. Quantum circuits are a representation method of a logical category on the operation of specific physical machines. They are circuits that operate quantum storage units (such as quantum bits). Just as circuits are important models of computers in classical Turing computers, quantum circuits are also a description method that can visualize and understand quantum computers. However, unlike traditional circuits that use metal wires to connect to transmit voltage or current signals; in quantum circuits, the entire circuit uses time as the overall standard for circuit operation, that is, the state of the quantum bit evolves naturally over time, and the process is in accordance with the instructions of the Hamiltonian operator until it encounters a logic gate (single quantum gate, multi-quantum gate) and is operated. At the end of the circuit, a measured quantum bit is needed to transmit the information of the entire circuit. With the rapid development of quantum circuit synthesis and optimization research in recent years, quantum processors realized by ion trap and superconducting technologies have appeared one after another. At the same time, these processors uniformly adopt quantum circuits composed of Clifford+T gate libraries.
[0003] Quantum bits, compared to classical bits, can be in a superposition of states 0 and 1 before measurement. When measured, they collapse to 0 or 1. The state of a quantum bit, |ψ〉, can be expressed as |ψ〉=α|0〉+β|1〉, where α and β are complex-valued amplitudes indicating the probability of measuring |ψ〉 in their respective basis states |0〉 and |1〉. Because human thought is obviously classical in physics, the problems we want to solve usually have classical expressions; these states form the basis of the quantum bit Hilbert space, called the computational basis. The computational basis states of quantum bits are usually labeled |0〉 and |1〉. The 2n states obtained by putting each quantum bit in |0〉 or |1〉 form the computational basis of the 2n-dimensional Hilbert space of the entire system [1].
[0004] Fault tolerance plays an important role in quantum circuits. Unlike classical logic circuits, there are entangled states between quantum circuits, and the input and output sometimes cannot be obtained through logical AND or NOR in classical computing. Therefore, the verification of quantum circuits cannot be verified through simple binary 0 and 1 logic truth tables.
[0005] At the same time, in terms of data format, there is another form of representing quantum circuits: Boolean matrix. The matrix order corresponds to the number of qubits. Each row of the matrix represents a qubit, and each column represents an input variable. For a certain column, when there is an input variable with the current column qubit as the control bit, the row where the target bit is located is 1, otherwise it is 0. The following representation (a) is an example quantum circuit. (b) is the Boolean matrix of its quantum circuit, which is the inverse product of the Boolean matrix of each CNOT gate in the circuit. However, this method has some problems. Usually a circuit will usually have 100 or even 1000 gates. At this time, the scale of this matrix is very large, 2 100 Even 2 1000 In the form of a matrix, not only does data processing present huge data problems, but when machines are used to describe it, manual observation of some important issues can also cause trouble.
[0006] There are currently two methods for verifying the equivalence of quantum circuits, both of which have the following disadvantages:
[0007] (1) Truth table verification
[0008] Truth table verification uses logical AND or NOT in classical computing to represent the circuit, but there are imaginary parameters such as V, V+, T, T+, S, S+ in the circuit, which cannot be processed using traditional truth tables.
[0009] (2) Quantum circuit representation and verification using Boolean matrix expression
[0010] Boolean matrices represent quantum circuits. The size of the matrix becomes more complex as the number of qubits increases. n The linear model increases. At the same time, in the case of manual verification, the data will become huge. When the code is used to represent the circuit, the expression of each matrix becomes complicated and logical, and data errors will occur if you are not careful.
[0011] How to solve the above technical problems is the subject faced by the present invention. Summary of the invention
[0012] The purpose of the present invention is to provide a derivative method for verifying the equivalence of quantum circuits based on truth tables. The present invention utilizes unitary matrix operations of quantum circuits to integrate rules and apply the rules, and refines the quantum circuit to the operation of each quantum bit. In a single quantum operation, the entire quantum circuit is not expressed by a unitary matrix, but the operation process and results of each step are expressed in the form of a table (invention content).
[0013] The inventive concept of the present invention is: the present invention is to integrate rules based on the quantum gate library, which has many different types of quantum gate sets in quantum logic synthesis. The quantum gate library mainly includes the NCV gate library and the Clifford+T gate library [2]. The NCV gate library includes a single-qubit gate (NOT gate), a double-qubit CNOT gate, a controlled-V gate, and a controlled-+ gate. The symbols, icons, and matrix definitions of quantum gates in the NCV gate library are shown in Table 2-1:
[0014] Table 2-1 NCV Door Library
[0015]
[0016] The Clifford+T gate library includes single quantum gates NOT gate, Hadamard gate, T gate, T+ gate, S gate, S+ gate, and double quantum bit gate CNOT gate; the symbols, icons, and matrix definitions of quantum gates in the Clifford+T gate library are shown in Table 2-2.
[0017] Table 2-2 Clifford+T Door Library
[0018]
[0019] In order to achieve the above-mentioned invention object, the technical solution adopted by the present invention is specifically: a derivative method for verifying the equivalence of quantum circuits based on a truth table, comprising the following steps:
[0020] S1. Expression of entangled states |0> and |1> generated based on matrix operations
[0021] When a quantum state encounters an operation gate on a quantum circuit, that is, a single gate, a double gate, or more, it is necessary to change and transmit the state and information. Six rules are sorted out based on the single quantum gate and double quantum gate in the NCV gate library and the Clifford+T gate library. These six rules are based on the entangled state output obtained by phase deflection through the T gate, T+ gate, S gate, S+ gate, NOT gate, and H gate as follows:
[0022]
[0023] S2. Decompose the V gate and use the above rules to verify the correctness of the rules. The decomposition verification of the V gate is as follows:
[0024]
[0025] The |10> entangled state with a more complicated calculation process in the dual-qubit is selected for verification and explanation. The above expression is the output form of the V gate on the left, and the details of each step of the specific verification process on the right. Finally, the tensor product of the verification result is given and compared with the data on the left to verify its correctness.
[0026] When the present invention is actually used, the complex unitary matrix budget is abandoned, each budget process can be clearly seen, and the circuit is represented in the form of a matrix, which is ultimately more intuitive than processing in the form of a table.
[0027] Compared with the prior art, the present invention has the following beneficial effects:
[0028] (1) The present invention uses a table to replace the traditional truth table without the concept of imaginary numbers, and establishes a new operation rule for it. It can complete the operation of circuit equivalence in quantum circuits, and can easily solve the problem of too complex matrix data when representing large-scale multi-qubit circuits with Boolean matrices. In terms of specific applications, it can more conveniently and quickly understand the changes in various states during circuit operation, providing a new idea for future circuit optimization.
[0029] (2) Provide the table format
[0030] Traditional verification forms include truth table verification and Boolean matrix verification. The disadvantage of truth table is that it cannot perform calculation rules with imaginary numbers. Based on this, a table form is proposed. The establishment of the table can add imaginary numbers to the calculation and judgment results in the table, which makes up for the verification method that the previous truth table could not do.
[0031] (3) Comparison with Boolean Matrix
[0032] When verifying a circuit with a Boolean matrix, it is necessary to use the parallel circuit method to represent the matrix circuit. The longer the circuit length, the more complex the circuit represented by the Boolean matrix, the deeper the circuit depth, and the larger the scale of the matrix, which will make code verification more troublesome; when manually verifying the Boolean matrix, the above problems will be magnified, which will make manual verification more complicated, or even impossible to operate, and unnecessary calculation errors will occur. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.
[0034] Figure 1 Schematic diagram of quantum circuit and corresponding Boolean matrix expression in the prior art.
[0035] Figure 2 Schematic diagram of the quantum circuit decomposition process of the Toffoli gate in the present invention.
[0036] Figure 3 (a) is an example quantum circuit diagram; Figure 3 (b) is a schematic diagram of the Boolean matrix of its quantum circuit. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. Of course, the specific embodiments described here are only used to explain the present invention and are not used to limit the present invention.
[0038] Example 1
[0039] The embodiment of the present invention uses the quantum circuit of decomposing the Toffoli gate as an example to verify the application rules of the table. Figure 2 The entire process of decomposing the entire Toffoli door.
[0040] (1) Select the entangled state of |110> to input the circuit, and finally get [0 0 0 0 0 0 0 1] after calculation. T The output result is:
[0041] The entangled state of |110> is selected to input the Toffoli gate decomposition circuit (the decomposition verification of the V gate is shown on the right). The above circuit diagram shows the detailed process of each step of the operation, and finally gives the entangled state results of the operation, which are Perform tensor product on these three states and get the final result [0 0 00 0 0 0 1] T ,in This step is the operation rule, which can be verified in many literatures.
[0042] After experimental verification, the use of the evolution table of the truth table can be used in the verification and proof of most quantum circuits containing single quantum, double quantum, or even multi-quantum combinations.
[0043] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A derivative method for verifying the equivalence of quantum circuits based on truth tables, characterized in that: The following steps are involved: S1. Expression of entangled states |0> and |1> generated based on matrix operations When a quantum state encounters an operation gate on a quantum circuit, that is, a single gate, a double gate, or more, it is necessary to change and transmit the state and information. Six rules are sorted out based on the single quantum gate and double quantum gate in the NCV gate library and the Clifford+T gate library. These six rules are based on the entangled state output obtained by phase deflection through the T gate, T+ gate, S gate, S+ gate, NOT gate, and H gate as follows: S2. Decompose the V gate and use the above rules to verify the correctness of the rules. The decomposition verification of the V gate is as follows: The |10> entangled state with a more complicated calculation process in the dual-qubit is selected for verification and explanation. The left side of the above expression is the output expression of the V gate, and the right side is the details of each step of the specific verification process. Finally, the tensor product of the verification result is given and compared with the data on the left to verify its correctness.
