Method and device for measuring similarity of quantum circuit corresponding matrix, and storage medium
Patent Information
- Application Number
- CN202210241553.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-11
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2042-03-11
AI Technical Summary
[0004]相关技术中,由于矩阵相似度的度量方法在计算时,要求矩阵是密度矩阵,因此,不适合应用于衡量哈密顿量模拟效果的判断
[0065] Based on the aforementioned methods, devices, and storage media for measuring the similarity of quantum circuit matrices, this application designs a method for measuring matrix similarity. This method calculates the process fidelity from the matrix corresponding to the exponential Hamiltonian to the matrix corresponding to the quantum circuit, thereby obtaining the similarity between the two matrices. The similarity value is then used to determine whether the exponential Hamiltonian can be simulated by the quantum circuit. Since this method only requires the matrix to be a square matrix, without other requirements such as the matrix being a density matrix or a Hermitian matrix, it solves the technical problem that matrix similarity measurement methods in related technologies are not suitable for judging the simulation effect of Hamiltonians, and can effectively measure the simulation effect of Hamiltonians.
Smart Images

Figure CN116796668B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of quantum computing technology, and in particular to a method, apparatus and storage medium for measuring the similarity of corresponding matrices of quantum circuits. Background Technology
[0002] A quantum computer is a physical device that performs high-speed mathematical and logical operations, stores and processes quantum information in accordance with the laws of quantum mechanics. When a device processes and calculates quantum information and runs quantum algorithms, it is a quantum computer. Therefore, quantum computers have a much higher efficiency in processing mathematical problems than ordinary computers.
[0003] Currently, quantum computing algorithms are typically represented using quantum circuits, which include quantum logic gate operations. For any t>0, ε>0, including... The quantum circuit U of the quantum logic gate satisfies ||Ue -iHt If || < ε, and ε is a very small positive number, then the Hamiltonian H acting on n bits can be effectively simulated. Since ε cannot be exhaustively calculated, a method is defined to measure the similarity of matrices, thereby judging the effectiveness of the simulation.
[0004] In related technologies, the matrix similarity measurement methods require the matrix to be a density matrix during calculation, making them unsuitable for evaluating the effectiveness of Hamiltonian simulations. Therefore, defining a matrix similarity method that can effectively measure the effectiveness of simulations has been a hot research topic in this field and urgently needs to be addressed. Summary of the Invention
[0005] This application provides a method, apparatus, and storage medium for measuring the similarity of corresponding matrices of quantum circuits, thereby solving the technical problem that the matrix similarity measurement methods in related technologies are not suitable for judging the simulation effect of Hamiltonians. It can effectively measure the simulation effect of Hamiltonians.
[0006] To achieve the above objectives, this application adopts the following technical solution:
[0007] Firstly, a method for measuring the similarity of quantum circuit corresponding matrices is provided, the method comprising:
[0008] Obtain simulation data of a quantum circuit simulating Hamiltonian H; wherein, the simulation data includes the circuit matrix U corresponding to the quantum circuit and the calculation result matrix A of Hamiltonian H on the exponent; both the circuit matrix U and the calculation result matrix A are square matrices;
[0009] Based on the dimensions of the line matrix U or the calculated result matrix A, the line matrix U and the calculated result matrix A, the process fidelity from the calculated result matrix A to the line matrix U is obtained;
[0010] The similarity between the line matrix U and the calculated result matrix A is calculated based on the dimension of the line matrix U or the calculated result matrix A and the fidelity of the process from the calculated result matrix A to the line matrix U.
[0011] Optionally, the method further includes:
[0012] Based on the similarity between the circuit matrix U and the calculated matrix A, it is confirmed that the Hamiltonian H is effectively simulated by the quantum circuit.
[0013] Optionally, confirming that the Hamiltonian H is effectively simulated by the quantum circuit based on the similarity between the circuit matrix U and the calculated result matrix A includes:
[0014] Determine the similarity F between the line matrix U and the calculated result matrix A. ave_fid Do (A,U) satisfy the following inequality:
[0015] |F ave_fid (A,U)-1|<α
[0016] Where α is the threshold; A = e -iHt ;
[0017] If yes, it confirms that the Hamiltonian H is effectively simulated by the quantum circuit; otherwise, the Hamiltonian H cannot be effectively simulated by the quantum circuit.
[0018] Optionally, the process of obtaining the fidelity from the calculated result matrix A to the line matrix U based on the dimension of the line matrix U or the calculated result matrix A, the line matrix U, and the calculated result matrix A includes:
[0019] Calculate A1; where, dim(A) represents the dimension of the calculated matrix A;
[0020] Calculate the conjugate matrix U1 of the line matrix U;
[0021] Obtain the norm value of the dot product of A1 and the conjugate matrix U1. The norm value is the process fidelity from the calculated result matrix A to the line matrix U.
[0022] Optionally, obtaining the norm value of the dot product of A1 and the conjugate matrix U1 includes:
[0023] The norm value is obtained through the following formula:
[0024] res=A1·U1
[0025] res_vec = (res1, res2, ..., res i ,…res n )
[0026]
[0027] Where res is the dot product of A1 and the conjugate matrix U1, res_vec is the vector after res is expanded by rows, n is the square of the dimension of the calculated matrix A, and ‖res‖2 is the norm of the dot product of A1 and the conjugate matrix U1.
[0028] Optionally, calculating the similarity between the line matrix U and the calculated result matrix A based on the dimension of the line matrix U or the calculated result matrix A and the fidelity of the process from the calculated result matrix A to the line matrix U includes:
[0029] The similarity between the route matrix U and the calculated matrix A is obtained using the following formula:
[0030]
[0031] F state_fid (A,U)=‖res‖2
[0032] Among them, F ave_fid (A,) represents the similarity between the line matrix U and the calculated result matrix A, F state_fid (A,U) represents the process fidelity from the calculated result matrix A to the line matrix U.
[0033] Optionally, the method further includes:
[0034] Before obtaining the process fidelity from the calculated result matrix A to the line matrix U, confirm that the dimensions of the line matrix U and the calculated result matrix A are consistent.
[0035] Secondly, an apparatus for measuring the similarity of corresponding matrices of quantum circuits is provided, the apparatus comprising:
[0036] The first acquisition module is used to acquire simulation data of the quantum circuit simulating Hamiltonian H; wherein, the simulation data includes the circuit matrix U corresponding to the quantum circuit and the calculation result matrix A of Hamiltonian H on the exponent; both the circuit matrix U and the calculation result matrix A are square matrices;
[0037] The second acquisition module is used to obtain the process fidelity from the calculation result matrix A to the line matrix U based on the dimension of the line matrix U or the calculation result matrix A, the line matrix U and the calculation result matrix A.
[0038] The calculation module is used to calculate the similarity between the line matrix U and the calculation result matrix A based on the dimension of the line matrix U or the calculation result matrix A and the process fidelity from the calculation result matrix A to the line matrix U.
[0039] Optionally, the device further includes:
[0040] The first confirmation module is used to confirm that the Hamiltonian H is effectively simulated by the quantum circuit based on the similarity between the circuit matrix U and the calculation result matrix A.
[0041] Optionally, the first confirmation module is further configured to:
[0042] Determine the similarity F between the line matrix U and the calculated result matrix A. ave_fid Do (A,U) satisfy the following inequality:
[0043] |F ave_fid (A,U)-1|<α
[0044] Where α is the threshold; A = e -iHt ;
[0045] If yes, it confirms that the Hamiltonian H is effectively simulated by the quantum circuit; otherwise, the Hamiltonian H cannot be effectively simulated by the quantum circuit.
[0046] Optionally, the second acquisition module includes:
[0047] The first calculation unit is used to calculate A1; where, dim(A) represents the dimension of the calculated matrix A;
[0048] The second calculation unit is used to calculate the conjugate matrix U1 of the line matrix U;
[0049] The acquisition unit is used to acquire the norm value of the dot product of A1 and the conjugate matrix U1, wherein the norm value is the process fidelity of the calculation result matrix A to the line matrix U.
[0050] Optionally, the obtaining unit is further configured to obtain the norm value using the following formula:
[0051] res=A1·U1
[0052] res_vec = (res1, res2, ..., res i ,…res n )
[0053]
[0054] Where res is the dot product of A1 and the conjugate matrix U1, res_vec is the vector after res is expanded by rows, n is the square of the dimension of the calculated matrix A, and ‖res‖2 is the norm of the dot product of A1 and the conjugate matrix U1.
[0055] Optionally, the calculation module obtains the similarity between the line matrix U and the calculated result matrix A using the following formula:
[0056]
[0057] F state_fid (A,U)=‖res‖2
[0058] Among them, F ave_fid (A,U) represents the similarity between the line matrix U and the calculated result matrix A, F state_fid (A,U) represents the process fidelity from the calculated result matrix A to the line matrix U.
[0059] Optionally, the device further includes:
[0060] The second confirmation module is used to confirm that the dimension of the line matrix U is consistent with the dimension of the calculation result matrix A before obtaining the process fidelity from the calculation result matrix A to the line matrix U.
[0061] Thirdly, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the method described in any of the first aspects above.
[0062] Fourthly, a storage medium is provided, wherein a computer program is stored therein, wherein the computer program is configured to execute the method described in any of the first aspects above when it is run.
[0063] Fifthly, a quantum computer operating system is provided, wherein the quantum computer operating system implements the measurement of the similarity of quantum circuit corresponding matrices according to the method described in any one of the first aspects above.
[0064] In a sixth aspect, a quantum computer is provided, the quantum computer comprising the quantum computer operating system described in the fifth aspect above.
[0065] Based on the aforementioned methods, devices, and storage media for measuring the similarity of quantum circuit matrices, this application designs a method for measuring matrix similarity. This method calculates the process fidelity from the matrix corresponding to the exponential Hamiltonian to the matrix corresponding to the quantum circuit, thereby obtaining the similarity between the two matrices. The similarity value is then used to determine whether the exponential Hamiltonian can be simulated by the quantum circuit. Since this method only requires the matrix to be a square matrix, without other requirements such as the matrix being a density matrix or a Hermitian matrix, it solves the technical problem that matrix similarity measurement methods in related technologies are not suitable for judging the simulation effect of Hamiltonians, and can effectively measure the simulation effect of Hamiltonians. Attached Figure Description
[0066] Figure 1 This is a hardware structure block diagram of a computer terminal for a method of measuring the similarity of quantum circuit correspondence matrices provided in an exemplary embodiment of this application;
[0067] Figure 2 A schematic diagram illustrating a quantum circuit as provided in an exemplary embodiment of this application;
[0068] Figure 3 This is a flowchart illustrating a method for measuring the similarity of quantum circuit corresponding matrices provided in an exemplary embodiment of this application;
[0069] Figure 4 This is a schematic block diagram of an apparatus for measuring the similarity of quantum circuit corresponding matrices, provided as an exemplary embodiment of this application. Detailed Implementation
[0070] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0071] This application first provides a method for measuring the similarity of quantum circuit corresponding matrices. This method can be applied to electronic devices, such as computer terminals, specifically ordinary computers, quantum computers, etc.
[0072] The following detailed explanation uses a computer terminal as an example. Figure 1 This is a hardware block diagram of a computer terminal for a method of measuring the similarity of quantum circuit correspondence matrices, provided in an embodiment of this application. Figure 1 As shown, computer terminal 10 may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. Optionally, the computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the computer terminal described above. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0073] The memory 104 can be used to store software programs and modules for application software, such as the program instructions / modules corresponding to the method for measuring the similarity of quantum circuit corresponding matrices in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0074] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0075] It's important to note that a true quantum computer has a hybrid structure, comprising two main parts: a classical computer responsible for performing classical computations and control, and a quantum device responsible for running quantum programs to achieve quantum computation. A quantum program is a sequence of instructions written in a quantum language such as QRunes that can run on a quantum computer, supporting operations on quantum logic gates and ultimately enabling quantum computing. Specifically, a quantum program is a sequence of instructions that operates on quantum logic gates according to a specific timing order.
[0076] In practical applications, due to limitations in the development of quantum device hardware, quantum computing simulations are typically required to verify quantum algorithms, quantum applications, and so on. Quantum computing simulation is the process of simulating the execution of a quantum program corresponding to a specific problem using a virtual architecture (i.e., a quantum virtual machine) built with the resources of a conventional computer. Typically, it is necessary to construct a quantum program corresponding to a specific problem. The quantum program referred to in the embodiments of this application is a program written in a classical language that represents qubits and their evolution, wherein qubits, quantum logic gates, etc., related to quantum computing all have corresponding classical code representations.
[0077] Quantum circuits, also known as quantum logic circuits, are a common manifestation of quantum programming and are the most widely used general-purpose quantum computing model. They represent circuits that operate on qubits under an abstract concept. They consist of qubits, circuits (timelines), and various quantum logic gates. Finally, the results are often read out through quantum measurement operations.
[0078] Quantum circuits can be represented as a sequence of quantum logic gates arranged in a specific time order. For example:
[0079] q0:RX(q0),H(q0),CNOT(q0,q2),X(q0)
[0080] q1:X(q1), RY(q1), H(q1), CNOT(q2,q1)
[0081] q2:H(q2),X(q2),CNOT(q0,q2),CNOT(q2,q1),RZ(q2)
[0082] A more intuitive representation of the quantum circuits corresponding to the aforementioned quantum logic gate sequence is shown below. Figure 2 As shown.
[0083] Unlike traditional circuits that use metal wires to transmit voltage or current signals, in quantum circuits, the circuits can be seen as being connected by time. That is, the state of a quantum bit evolves naturally over time, following the instructions of the Hamiltonian operator, until it encounters a quantum logic gate and is manipulated.
[0084] A quantum program corresponds to a single quantum circuit. The quantum program described in this application refers to this single quantum circuit, where the total number of qubits in the single quantum circuit is the same as the total number of qubits in the quantum program. This can be understood as follows: a quantum program can consist of a quantum circuit, measurement operations on the qubits within the quantum circuit, registers storing the measurement results, and control flow nodes (jump instructions). A single quantum circuit can contain dozens, hundreds, or even thousands of quantum logic gate operations. The execution of a quantum program is the process of executing all the quantum logic gates in a specific timing order. It should be noted that the timing order refers to the chronological sequence in which individual quantum logic gates are executed.
[0085] It's important to note that in classical computing, the most basic unit is the bit, and the most fundamental control mode is the logic gate. Circuit control can be achieved through combinations of logic gates. Similarly, the way to process qubits is through quantum logic gates. Quantum logic gates enable the evolution of quantum states and are the foundation of quantum circuits. Quantum logic gates include single-qubit gates, such as Hadamard gates (H-gates), Pauli-X gates (X-gates), Pauli-Y gates (Y-gates), Pauli-Z gates (Z-gates), RX gates, RY gates, RZ gates, etc.; and multi-qubit quantum logic gates, such as CNOT gates, CR gates, iSWAP gates, Tofoli gates, etc. Quantum logic gates are generally represented using unitary matrices, which are not only matrix forms but also operations and transformations. The effect of a quantum logic gate on a quantum state is generally calculated by left-multiplying the unitary matrix by the matrix corresponding to the right vector of the quantum state.
[0086] A quantum state, or the logical state of a qubit, is represented in binary in quantum algorithms (or quantum programs). For example, a set of qubits q0, q1, and q2 represents the 0th, 1st, and 2nd qubits, ordered from most significant bit to least significant bit as q2q1q0. This set of qubits corresponds to a total of 2^(1 / 2) qubits, which refers to 8 eigenstates (determined states): |000>, |001>, |010>, |011>, |100>, |101>, |110>, and |111>. Each bit in a quantum state corresponds to a qubit. For example, in the state |000>, 000 corresponds to q2q1q0 from most significant bit to least significant bit. |> is the Dirac notation.
[0087] Taking a single qubit as an example, the logical state ψ of a single qubit may be in a superposition of the states |0>, |1>, and |0> and |1> (an uncertain state), specifically expressed as ψ = a|0> + b|1>, where a and b are complex numbers representing the amplitude (probability amplitude) of the quantum state, and the square of the amplitude represents the probability. 2 b 2 Let a represent the probabilities that the logical state is |0> and |1>, respectively. 2 +b 2 =1. In short, a quantum state is a superposition of eigenstates. When the probability of other states is 0, it is in a uniquely determined eigenstate.
[0088] The following is a further description of a method for measuring the similarity of quantum circuit matrices provided by an embodiment of the present invention.
[0089] See Figure 3 , Figure 3 This is a flowchart illustrating a method for measuring the similarity of quantum circuit corresponding matrices according to an exemplary embodiment of this application, including steps S310 to S340, wherein:
[0090] S310: Obtain simulation data of the quantum circuit simulating Hamiltonian H.
[0091] In quantum mechanics, the energy of a system is described by the Hamiltonian operator H. Simulating the properties of a quantum system is one of the important applications of quantum computers. Currently, the process of simulating the Hamiltonian H using quantum computing can be understood as follows: after obtaining the formulaic expression of a quantum system, the matrix representation of the Hamiltonian H can be obtained by setting the parameters in the formula; then, the Hamiltonian H is simulated over the exponent e to obtain the computational result e. -iHt (Matrix representation); then, based on the calculation result e -iHt The quantum circuit is decomposed into a finite set of quantum gates, and then constructed. Finally, the Hamiltonian H can be simulated using this quantum circuit. If the matrix representation of the Hamiltonian H is a square matrix, the method of this application for measuring the matrix similarity of the corresponding quantum circuits can be performed.
[0092] That is, in step S310, the simulation data includes the circuit matrix U corresponding to the quantum circuit and the calculation result matrix A of the Hamiltonian H on the exponent, A = e -iHt .
[0093] After obtaining the line matrix U and the calculated result matrix A, before executing step S320, the following steps can be performed:
[0094] S350, confirm that both the line matrix U and the calculated result matrix A are square matrices with the same dimensions.
[0095] A square matrix is a matrix where the number of rows and columns are the same; its dimension is either the number of rows or columns. We can determine this by comparing the number of rows and columns of the route matrix U with the number of rows and columns of the calculated matrix A. If both are square matrices, then both U and A are square matrices. Next, we check if the number of rows or columns of route matrix U is the same as that of the calculated matrix A. If they are, then U and A have the same dimension. If they are different, the subsequent steps in the process are skipped.
[0096] Step S350 can be used as a preliminary verification. After confirming that the dimensions of the line matrix U and the calculated result matrix A are both square matrices and have the same dimensions, step S320 can be executed.
[0097] S320: Based on the dimension of the line matrix U or the calculated result matrix A, the line matrix U, and the calculated result matrix A, obtain the process fidelity from the calculated result matrix A to the line matrix U.
[0098] The process fidelity is a fidelity measure of two matrices, used to measure the fidelity relationship between the two matrices.
[0099] Furthermore, the process of obtaining the fidelity from the calculated result matrix A to the line matrix U based on the dimension of the line matrix U or the calculated result matrix A, the line matrix U, and the calculated result matrix A may include the following steps:
[0100] S3201, calculate A1.
[0101] in, dim(A) represents the dimension of the calculated matrix A.
[0102] S3202, calculate the conjugate matrix U1 of the line matrix U.
[0103] Right now
[0104] S3203, obtain the norm value of the dot product of A1 and the conjugate matrix U1, where the norm value is the process fidelity from the calculated result matrix A to the line matrix U.
[0105] The dot product of A1 and its conjugate matrix U1 is res, i.e., res = A1·U1.
[0106] In other words, the vector after expanding res by rows is: res_vec = (res1, res2, ..., res i ,…res n ), where n is the square of the dimension of the calculated matrix A.
[0107] The norm value is obtained through the following formula:
[0108]
[0109] Where, |res|2 is the norm value, which is the process fidelity from the calculated result matrix A to the line matrix U, and n is the square of the dimension of the calculated result matrix A.
[0110] After obtaining the process fidelity from the calculation result matrix A to the line matrix U, proceed to step S330.
[0111] S330. Calculate the similarity between the line matrix U and the calculated result matrix A based on the dimension of the line matrix U or the calculated result matrix A and the fidelity of the process from the calculated result matrix A to the line matrix U.
[0112] The similarity between the line matrix U and the calculated result matrix A is obtained using the following formula:
[0113]
[0114] F state_fid (A,U)=‖res‖2
[0115] Among them, F ave_fid (A,U) represents the similarity between the line matrix U and the calculated result matrix A, F state_fid (A,U) represents the process fidelity from the calculated result matrix A to the line matrix U.
[0116] Further, after obtaining the similarity between the line matrix U and the calculated result matrix A, step S340 can be executed.
[0117] S340, Based on the similarity between the circuit matrix U and the calculated result matrix A, it is confirmed that the Hamiltonian H is effectively simulated by the quantum circuit. This quantum circuit corresponds to the circuit matrix U.
[0118] Specifically, confirming that the Hamiltonian H is effectively simulated by the quantum circuit based on the similarity between the circuit matrix U and the calculated result matrix A includes:
[0119] Determine the similarity F between the line matrix U and the calculated result matrix A. ave_fid Do (A,U) satisfy the following inequality:
[0120] |F ave_fid (A,U)-1|<α
[0121] Here, α is the threshold value, which can be set manually.
[0122] If the above inequality holds, then the similarity F between the line matrix U and the calculated result matrix A can be considered to be... ave_fid If (A,U) is close to 1, then the Hamiltonian H can be effectively simulated by quantum circuits. If the above inequality does not hold, then the Hamiltonian H cannot be effectively simulated by quantum circuits.
[0123] Compared with existing technologies, based on Figure 3 The present application proposes a method to measure matrix similarity, which calculates the process fidelity from the matrix corresponding to the exponential Hamiltonian to the matrix corresponding to the quantum circuit. This allows the similarity between the two matrices to be obtained, and the similarity value can be used to determine whether the exponential Hamiltonian can be simulated using the quantum circuit. Since this method only requires the matrix to be square, without other requirements such as density matrix or Hermitian matrix, it solves the technical problem that matrix similarity measurement methods in related technologies are not suitable for judging the simulation effect of Hamiltonians. Theoretically, it provides a more accurate measurement of the evolution results of parameterized Hamiltonian densities and can effectively measure the simulation effect of Hamiltonians.
[0124] The above combination Figure 3This application provides a detailed description of the method for measuring the similarity of quantum circuit correspondence matrices, as illustrated in its embodiments. The following section combines... Figure 4 This document describes in detail the apparatus for performing the method for measuring the similarity of quantum circuit correspondence matrices provided in the embodiments of this application.
[0125] For example, see Figure 4 , Figure 4 A schematic block diagram of a device for measuring the similarity of quantum circuit correspondence matrices, provided as an exemplary embodiment of this application, and... Figure 3 Corresponding to the process shown, the device 400 for measuring the similarity of the corresponding matrix of the quantum circuit includes:
[0126] The first acquisition module 410 is used to acquire simulation data of the quantum circuit simulating Hamiltonian H; wherein, the simulation data includes the circuit matrix U corresponding to the quantum circuit and the calculation result matrix A of Hamiltonian H on the exponent; both the circuit matrix U and the calculation result matrix A are square matrices;
[0127] The second acquisition module 420 is used to acquire the process fidelity from the calculation result matrix A to the line matrix U based on the dimension of the line matrix U or the calculation result matrix A, the line matrix U and the calculation result matrix A.
[0128] The calculation module 430 is used to calculate the similarity between the line matrix U and the calculation result matrix A based on the dimension of the line matrix U or the calculation result matrix A and the process fidelity from the calculation result matrix A to the line matrix U.
[0129] Optionally, the device 400 for measuring the similarity of corresponding quantum circuit matrices further includes:
[0130] The first confirmation module is used to confirm that the Hamiltonian H is effectively simulated by the quantum circuit based on the similarity between the circuit matrix U and the calculation result matrix A.
[0131] Optionally, the first confirmation module is further configured to:
[0132] Determine the similarity F between the line matrix U and the calculated result matrix A. ave_fid Do (A,U) satisfy the following inequality:
[0133] |F ave_fid (A,U)-1|<α
[0134] Where α is the threshold; A = e -iHt ;
[0135] If yes, it confirms that the Hamiltonian H is effectively simulated by the quantum circuit; otherwise, the Hamiltonian H cannot be effectively simulated by the quantum circuit.
[0136] Optionally, the second acquisition module 420 includes:
[0137] The first calculation unit is used to calculate A1; where, dim(A) represents the dimension of the calculated matrix A;
[0138] The second calculation unit is used to calculate the conjugate matrix U1 of the line matrix U;
[0139] The acquisition unit is used to acquire the norm value of the dot product of A1 and the conjugate matrix U1, wherein the norm value is the process fidelity of the calculation result matrix A to the line matrix U.
[0140] Optionally, the obtaining unit is further configured to obtain the norm value using the following formula:
[0141] res=A1·U1
[0142] res_vec = (res1, res2, ..., res i ,…res n )
[0143]
[0144] Where res is the dot product of A1 and the conjugate matrix U1, res_vec is the vector after res is expanded by rows, n is the square of the dimension of the calculated matrix A, and ‖res‖2 is the norm of the dot product of A1 and the conjugate matrix U1.
[0145] Optionally, the calculation module 430 obtains the similarity between the line matrix U and the calculated result matrix A using the following formula:
[0146]
[0147] F state_fid (A,U)=‖res‖2
[0148] Among them, F ave_fid (A,U) represents the similarity between the line matrix U and the calculated result matrix A, F state_fid (A,u) represents the process fidelity from the calculated result matrix A to the line matrix U.
[0149] Optionally, the device 400 for measuring the similarity of corresponding quantum circuit matrices further includes:
[0150] The second confirmation module is used to confirm that the dimension of the line matrix U is consistent with the dimension of the calculation result matrix A before obtaining the process fidelity from the calculation result matrix A to the line matrix U.
[0151] Compared with existing technologies, based on Figure 4The device shown is for measuring the similarity of the corresponding matrices of a quantum circuit. This application designs a method for measuring matrix similarity. This method calculates the process fidelity from the matrix corresponding to the exponential Hamiltonian to the matrix corresponding to the quantum circuit, thereby obtaining the similarity between the two matrices. The similarity value is then used to determine whether the exponential Hamiltonian can be simulated by the quantum circuit. Since this method only requires the matrix to be a square matrix, without other requirements such as the matrix being a density matrix or a Hermitian matrix, it solves the technical problem that the matrix similarity measurement method in related technologies is not suitable for judging the simulation effect of Hamiltonian. Theoretically, it is more accurate in measuring the evolution result of parameterized Hamiltonian density and can effectively measure the simulation effect of Hamiltonian.
[0152] This application also provides a storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
[0153] Specifically, in this embodiment, the storage medium can be configured to store a computer program for performing the following steps:
[0154] S310, acquire simulation data of the quantum circuit simulating Hamiltonian H; wherein, the simulation data includes the circuit matrix U corresponding to the quantum circuit and the calculation result matrix A of Hamiltonian H on the exponent; both the circuit matrix U and the calculation result matrix A are square matrices.
[0155] S320: Based on the dimension of the line matrix U or the calculated result matrix A, the line matrix U, and the calculated result matrix A, obtain the process fidelity from the calculated result matrix A to the line matrix U.
[0156] S330. Calculate the similarity between the line matrix U and the calculated result matrix A based on the dimension of the line matrix U or the calculated result matrix A and the fidelity of the process from the calculated result matrix A to the line matrix U.
[0157] S340, based on the similarity between the line matrix U and the calculated result matrix A, it is confirmed that the Hamiltonian H is effectively simulated.
[0158] Specifically, in this embodiment, the storage medium may include, but is not limited to, USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks, and other media capable of storing computer programs.
[0159] This application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0160] Specifically, the aforementioned electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the aforementioned processor, and the input / output device is connected to the aforementioned processor.
[0161] Specifically, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0162] S310, acquire simulation data of the quantum circuit simulating Hamiltonian H; wherein, the simulation data includes the circuit matrix U corresponding to the quantum circuit and the calculation result matrix A of Hamiltonian H on the exponent; both the circuit matrix U and the calculation result matrix A are square matrices.
[0163] S320: Based on the dimension of the line matrix U or the calculated result matrix A, the line matrix U, and the calculated result matrix A, obtain the process fidelity from the calculated result matrix A to the line matrix U.
[0164] S330. Calculate the similarity between the line matrix U and the calculated result matrix A based on the dimension of the line matrix U or the calculated result matrix A and the fidelity of the process from the calculated result matrix A to the line matrix U.
[0165] S340, based on the similarity between the line matrix U and the calculated result matrix A, it is confirmed that the Hamiltonian H is effectively simulated.
[0166] Optionally, the electronic device may have one or more processors. The processor can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor that reads software code stored in memory.
[0167] Optionally, the electronic device may contain one or more memories. The memory may be integrated with the processor or disposed separately from it; this application does not limit this. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or disposed separately on different chips. This application does not specifically limit the type of memory or the arrangement of the memory and processor.
[0168] For example, the electronic device may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or other integrated chips.
[0169] It should be understood that the processor in the embodiments of this application can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0170] It should also be understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0171] This application also provides a quantum computer operating system, which implements the measurement of the similarity of quantum circuit corresponding matrices according to any of the above-described method embodiments provided in this application.
[0172] Embodiments of this application also provide a quantum computer, which includes the quantum computer operating system described above.
[0173] The above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.
[0174] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.
[0175] In this application, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0176] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0177] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0178] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0179] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0180] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0181] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0182] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0183] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method of measuring quantum circuit matrix similarity, comprising: The method includes: Obtain simulation data of a quantum circuit simulating Hamiltonian H; wherein, the simulation data includes the circuit matrix U corresponding to the quantum circuit and the calculation result matrix A of Hamiltonian H on the exponent; both the circuit matrix U and the calculation result matrix A are square matrices; Calculate A1; where A1 = dim(A) represents the dimension of the calculated matrix A. Calculate the conjugate matrix U1 of the line matrix U; The norm of the dot product of A1 and the conjugate matrix U1 is obtained by the following formula as the fidelity of the process from the result matrix A to the line matrix U: Where res is the dot product of A1 and the conjugate matrix U1. for The vector obtained by expanding by rows, where n is the square of the dimension of the resulting matrix A. The norm value is the dot product of A1 and the conjugate matrix U1. The similarity between the line matrix U and the calculated matrix A is obtained using the following formula: in, The similarity between the line matrix U and the calculated result matrix A is given. To ensure the fidelity of the process from the result matrix A to the line matrix U.
2. The method according to claim 1, characterized in that, The method further includes: Based on the similarity between the circuit matrix U and the calculated matrix A, it is confirmed that the Hamiltonian H is effectively simulated by the quantum circuit.
3. The method according to claim 2, characterized in that, The step of confirming that the Hamiltonian H is effectively simulated by the quantum circuit based on the similarity between the circuit matrix U and the calculated result matrix A includes: Determine the similarity between the route matrix U and the calculated result matrix A. Does it satisfy the following inequality: in, For the threshold; A= ; If yes, it confirms that the Hamiltonian H is effectively simulated by the quantum circuit; otherwise, the Hamiltonian H cannot be effectively simulated by the quantum circuit.
4. The method according to claim 1, characterized in that, The method further includes: Before obtaining the process fidelity from the calculated result matrix A to the line matrix U, confirm that the dimensions of the line matrix U and the calculated result matrix A are consistent.
5. A device for measuring the similarity of corresponding matrices of quantum circuits, characterized in that, The device includes: The first acquisition module is used to acquire simulation data of the quantum circuit simulating Hamiltonian H; wherein, the simulation data includes the circuit matrix U corresponding to the quantum circuit and the calculation result matrix A of Hamiltonian H on the exponent; both the circuit matrix U and the calculation result matrix A are square matrices; The second acquisition module is used to calculate A1; where A1 = dim(A) represents the dimension of the calculated matrix A. Calculate the conjugate matrix U1 of the line matrix U; The norm of the dot product of A1 and the conjugate matrix U1 is obtained by the following formula as the fidelity of the process from the result matrix A to the line matrix U: Where res is the dot product of A1 and the conjugate matrix U1. for The vector obtained by expanding by rows, where n is the square of the dimension of the resulting matrix A. The norm value is the dot product of A1 and the conjugate matrix U1. The calculation module is used to obtain the similarity between the line matrix U and the calculated result matrix A using the following formula: in, The similarity between the line matrix U and the calculated result matrix A is given. To ensure the fidelity of the process from the result matrix A to the line matrix U.
6. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 4.
7. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the method described in any one of claims 1 to 4 when it is run.
Citation Information
Patent Citations
Method and device for determining fidelity of quantum bit read signal
CN111369003A
Control pulse generation method, device, system and equipment and storage medium
CN112819170A