CN116796668A - Method, device and storage medium for measuring similarity of quantum circuit corresponding matrix - Google Patents

Method, device and storage medium for measuring similarity of quantum circuit corresponding matrix Download PDF

Info

Publication number
CN116796668A
CN116796668A CN202210241553.0A CN202210241553A CN116796668A CN 116796668 A CN116796668 A CN 116796668A CN 202210241553 A CN202210241553 A CN 202210241553A CN 116796668 A CN116796668 A CN 116796668A
Authority
CN
China
Prior art keywords
matrix
calculation result
line
quantum
similarity
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210241553.0A
Other languages
Chinese (zh)
Inventor
方圆
陈博颖
王晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Benyuan Quantum Computing Technology Hefei Co ltd
Original Assignee
Benyuan Quantum Computing Technology Hefei Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Benyuan Quantum Computing Technology Hefei Co ltd filed Critical Benyuan Quantum Computing Technology Hefei Co ltd
Priority to CN202210241553.0A priority Critical patent/CN116796668A/en
Priority to PCT/CN2023/079746 priority patent/WO2023169345A1/en
Publication of CN116796668A publication Critical patent/CN116796668A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/30Circuit design
    • G06F30/32Circuit design at the digital level
    • G06F30/33Design verification, e.g. functional simulation or model checking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Geometry (AREA)
  • Computational Mathematics (AREA)
  • Condensed Matter Physics & Semiconductors (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Complex Calculations (AREA)

Abstract

The application provides a method, a device and a storage medium for measuring the similarity of a matrix corresponding to a quantum circuit, which solve the technical problem that the method for measuring the similarity of the matrix in the related technology is not suitable for measuring the judgment of the Hamiltonian analog effect, and can effectively measure the effectiveness of Hamiltonian analog. The method for measuring the similarity of the quantum circuit corresponding matrix comprises the following steps: obtaining analog data of a quantum circuit simulating the Hamiltonian quantity H; the simulation data comprises a circuit matrix U corresponding to the quantum circuit to calculate a result matrix A; the line matrix U and the calculation result matrix A are square matrixes; acquiring the process fidelity from the calculation result matrix A to the line matrix U according to the dimension of the line matrix U or the calculation result matrix A, the line matrix U and the calculation result matrix A; and calculating the similarity of the circuit matrix U and the calculation result matrix A according to the dimension of the circuit matrix U or the calculation result matrix A and the process fidelity from the calculation result matrix A to the circuit matrix U.

Description

Method, device and storage medium for measuring similarity of quantum circuit corresponding matrix
Technical Field
The present application relates to the field of quantum computing technologies, and in particular, to a method, an apparatus, and a storage medium for measuring similarity of a corresponding matrix of a quantum circuit.
Background
The quantum computer is a kind of physical device which performs high-speed mathematical and logical operation, stores and processes quantum information according to the law of quantum mechanics. When a device processes and calculates quantum information and operates on a quantum algorithm, the device is a quantum computer. Quantum computers thus have the ability to handle mathematical problems more efficiently than ordinary computers.
Currently, algorithms for quantum computing are typically represented by quantum circuits, which include quantum logic gate operations. For any t>0,ε>0, compriseThe quantum circuit U of the quantum logic gate meets the requirements of U-e -iHt ||<Epsilon is a small positive number, the hamiltonian H acting on n bits can be effectively modeled. Since epsilon cannot be exhausted, a method is defined to measure the similarity of the matrix, so as to judge the simulation effect.
In the related art, since the matrix is required to be a density matrix during calculation, the method for measuring the similarity of the matrix is not suitable for judging the Hamiltonian analog effect. Further, how to define a method of matrix similarity that can effectively scale the effectiveness of simulations has been a hotspot in research in the art and needs to be addressed.
Disclosure of Invention
The embodiment of the application provides a method, a device and a storage medium for measuring the similarity of a matrix corresponding to a quantum circuit, which are used for solving the technical problem that the method for measuring the similarity of the matrix in the related technology is not suitable for judging the Hamiltonian simulation effect, and can effectively measure the Hamiltonian simulation effect.
In order to achieve the above purpose, the application adopts the following technical scheme:
in a first aspect, a method for measuring similarity of a corresponding matrix of a quantum wire is provided, where the method includes:
obtaining analog data of a quantum circuit simulating the Hamiltonian quantity H; the simulation data comprises a line matrix U corresponding to the quantum line and a calculation result matrix A of Hamiltonian quantity H on an index; the line matrix U and the calculation result matrix A are square matrixes;
acquiring the process fidelity from the calculation result matrix A to the line matrix U according to the dimension of the line matrix U or the calculation result matrix A, the line matrix U and the calculation result matrix A;
and calculating the similarity of the circuit matrix U and the calculation result matrix A according to the dimension of the circuit matrix U or the calculation result matrix A and the process fidelity from the calculation result matrix A to the circuit matrix U.
Optionally, the method further comprises:
and according to the similarity between the line matrix U and the calculation result matrix A, confirming that the Hamiltonian quantity H is effectively simulated by the quantum line.
Optionally, the determining that the hamiltonian H is effectively simulated by the quantum circuit according to the similarity between the circuit matrix U and the calculation result matrix a includes:
judging the similarity F of the circuit matrix U and the calculation result matrix A ave_fid (A, U) whether the following inequality is satisfied:
|F ave_fid (A,U)-1|<α
wherein α is a threshold; a=e -iHt
If yes, confirming that the Hamiltonian quantity H is effectively simulated by the quantum circuit; otherwise, hamiltonian H cannot be effectively modeled by the quantum wires.
Optionally, the obtaining the process fidelity from the calculation result matrix a to the line matrix U according to the dimension of the line matrix U or the calculation result matrix a, the line matrix U, and the calculation result matrix a includes:
calculating A1; wherein,dim (A) is the dimension of the calculation result matrix A;
calculating a conjugate matrix U1 of the line matrix U;
and obtaining a norm value obtained after the point multiplication of the A1 and the conjugate matrix U1, wherein the norm value is the process fidelity from the calculation result matrix A to the line matrix U.
Optionally, the obtaining the norm value obtained by multiplying the point of the A1 and the conjugate matrix U1 includes:
the norm value is obtained by the following equation:
res=A1·U1
res_vec=(res 1 ,res 2 ,…,res i ,…res n )
where res is the dot product of A1 and the conjugate matrix U1, res_vec is the vector of res after row expansion, n is the square of the dimension of the computation result matrix A, |res|| 2 Is the norm value of the multiplication of the point A1 and the conjugate matrix U1.
Optionally, the calculating the similarity between the line matrix U and the calculation result matrix a according to 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 includes:
the similarity between the line matrix U and the calculation result matrix a is obtained by the following expression:
F state_fid (A,U)=‖res‖ 2
wherein ,Fave_fid (A) is the similarity between the line matrix U and the calculated result matrix A, F state_fid (A, U) is the process fidelity of computing the result matrix A to the line matrix U.
Optionally, the method further comprises:
before the process fidelity from the calculation result matrix A to the line matrix U is obtained, the dimension of the line matrix U is confirmed to be consistent with the dimension of the calculation result matrix A.
In a second aspect, there is provided an apparatus for measuring similarity of a quantum wire correspondence matrix, the apparatus comprising:
the first acquisition module is used for acquiring the analog data of the quantum circuit simulating the Hamiltonian quantity H; the simulation data comprises a line matrix U corresponding to the quantum line and a calculation result matrix A of Hamiltonian quantity H on an index; the line matrix U and the calculation result matrix A are square matrixes;
the second acquisition module is used for acquiring the process fidelity from the calculation result matrix A to the line matrix U according to the dimension of the line matrix U or the calculation result matrix A, the line matrix U and the calculation result matrix A;
the calculation module is used for calculating the similarity of the circuit matrix U and the calculation result matrix A according to the dimension of the circuit matrix U or the calculation result matrix A and the process fidelity from the calculation result matrix A to the circuit matrix U.
Optionally, the apparatus further comprises:
and the first confirmation module is used for confirming that the Hamiltonian quantity H is effectively simulated by the quantum circuit according to the similarity between the circuit matrix U and the calculation result matrix A.
Optionally, the first confirmation module is further configured to:
judging the similarity F of the circuit matrix U and the calculation result matrix A ave_fid (A, U) whether the following inequality is satisfied:
|F ave_fid (A,U)-1|<α
wherein α is a threshold; a=e -iHt
If yes, confirming that the Hamiltonian quantity H is effectively simulated by the quantum circuit; otherwise, hamiltonian H cannot be effectively modeled by the quantum wires.
Optionally, the second acquisition module includes:
a first calculation unit for calculating A1; wherein,dim (A) is the dimension of the calculation result matrix A;
a second calculation unit for calculating a conjugate matrix U1 of the line matrix U;
the acquisition unit is used for acquiring a norm value obtained by multiplying the point of the A1 and the conjugate matrix U1, wherein the norm value is the process fidelity from the calculation result matrix A to the line matrix U.
Optionally, the obtaining unit is further configured to obtain the norm value by:
res=A1·U1
res_vec=(res 1 ,res 2 ,…,res i ,…res n )
where res is the dot product of A1 and the conjugate matrix U1, res_vec is the vector of res after row expansion, n is the square of the dimension of the computation result matrix A, |res|| 2 Is the norm value of the multiplication of the point A1 and the conjugate matrix U1.
Optionally, the calculation module obtains the similarity between the line matrix U and the calculation result matrix a by the following formula:
F state_fid (A,U)=‖res‖ 2
wherein ,Fave_fid (A, U) is the similarity between the line matrix U and the calculated result matrix A, F state_fid (A, U) is the process fidelity of computing the result matrix A to the line matrix U.
Optionally, the apparatus further comprises:
and the second confirming module is used for confirming that the dimension of the line matrix U is consistent with the dimension of the calculation result matrix A before the process fidelity from the calculation result matrix A to the line matrix U is obtained.
In a third aspect, there is provided an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the method of any of the first aspects above.
In a fourth aspect, there is provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the method of any of the first aspects above when run.
In a fifth aspect, a quantum computer operating system is provided, where the quantum computer operating system implements measuring the similarity of the quantum wire corresponding matrix according to the method of any one of the first aspects.
In a sixth aspect, there is provided a quantum computer comprising the quantum computer operating system of the fifth aspect described above.
Based on the method, the device and the storage medium for measuring the similarity of the quantum circuit matrix, the application designs a method for measuring the similarity of the matrix, the method is used for calculating the process fidelity from the matrix corresponding to the Hamiltonian quantity on the index to the matrix corresponding to the quantum circuit, and then the similarity of the two matrices can be obtained, so that whether the Hamiltonian quantity on the index can be simulated by the quantum circuit can be judged through the value of the similarity.
Drawings
Fig. 1 is a block diagram of a hardware structure of a computer terminal according to a method for measuring similarity of corresponding matrixes of quantum circuits according to an exemplary embodiment of the present application;
fig. 2 is a schematic diagram of a quantum circuit according to an exemplary embodiment of the present application;
fig. 3 is a flowchart of a method for measuring similarity of corresponding matrixes of quantum circuits according to an exemplary embodiment of the present application;
fig. 4 is a schematic block diagram of an apparatus for measuring similarity of a corresponding matrix of a quantum circuit according to an exemplary embodiment of the present application.
Detailed Description
The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the application.
The embodiment of the application firstly provides a method for measuring the similarity of the corresponding matrixes of the quantum circuits, which can be applied to electronic equipment such as computer terminals, in particular to common computers, quantum computers and the like.
The following describes the operation of the computer terminal in detail by taking it as an example. Fig. 1 is a hardware block diagram of a computer terminal according to a method for measuring similarity of a corresponding matrix of a quantum circuit according to an embodiment of the present application. As shown in fig. 1, the computer terminal 10 may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, and optionally, a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the configuration shown in fig. 1 is merely illustrative and is not intended to limit the configuration of the computer terminal described above. For example, the computer terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store software programs and modules of application software, such as program instructions/modules corresponding to the method for measuring the similarity of the quantum wire corresponding matrix in the embodiment of the present application, and the processor 102 executes the software programs and modules stored in the memory 104 to perform various functional applications and data processing, i.e., implement the method described above. 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 examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission means 106 is arranged to receive or transmit data via a network. The specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module for communicating with the internet wirelessly.
It should be noted that a real quantum computer is a hybrid structure, which includes two major parts: part of the computers are classical computers and are responsible for performing classical computation and control; the other part is quantum equipment, which is responsible for running quantum programs so as to realize quantum computation. The quantum program is a series of instruction sequences written by a quantum language such as the qlunes language and capable of running on a quantum computer, so that the support of quantum logic gate operation is realized, and finally, quantum computing is realized. Specifically, the quantum program is a series of instruction sequences for operating the quantum logic gate according to a certain time sequence.
In practical applications, quantum computing simulations are often required to verify quantum algorithms, quantum applications, etc., due to the development of quantum device hardware. Quantum computing simulation is a process of realizing simulated operation of a quantum program corresponding to a specific problem by means of a virtual architecture (namely a quantum virtual machine) built by resources of a common computer. In general, it is necessary to construct a quantum program corresponding to a specific problem. The quantum program, namely the program for representing the quantum bit and the evolution thereof written in the classical language, wherein the quantum bit, the quantum logic gate and the like related to quantum computation are all represented by corresponding classical codes.
Quantum circuits, which are one embodiment of quantum programs, also weigh sub-logic circuits, are the most commonly used general quantum computing models, representing circuits that operate on qubits under an abstract concept, the composition of which includes qubits, circuits (timelines), and various quantum logic gates, and finally the results often need to be read out by quantum measurement operations.
The display mode of the quantum circuit can be a quantum logic gate sequence arranged according to a certain time sequence, specifically, for example:
q 0 :RX(q 0 )、H(q 0 )、CNOT(q 0 ,q 2 )、X(q 0 )
q 1 :X(q 1 )、RY(q 1 )、H(q 1 )、CNOT(q 2 ,q 1 )
q 2 :H(q 2 )、X(q 2 )、CNOT(q 0 ,q 2 )、CNOT(q 2 ,q 1 )、RZ(q 2 )
a more visual representation of a quantum circuit corresponding to the above-described quantum logic gate sequence is shown with reference to fig. 2.
Unlike conventional circuits that are connected by metal lines to pass voltage or current signals, in quantum circuits, the circuits can be seen as being connected by time, i.e., the state of the qubit naturally evolves over time, as indicated by the hamiltonian operator, during which the circuit is operated until the quantum logic gate is encountered.
One quantum program is corresponding to one total quantum circuit, and the quantum program refers to the total quantum circuit, wherein the total number of quantum bits in the total quantum circuit is the same as the total number of quantum bits of the quantum program. It can be understood that: one quantum program may consist of a quantum circuit, a measurement operation for the quantum bits in the quantum circuit, a register to hold the measurement results, and a control flow node (jump instruction), and one quantum circuit may contain several tens to hundreds or even thousands of quantum logic gate operations. The execution process of the quantum program is a process of executing all quantum logic gates according to a certain time sequence. Note that the timing is the time sequence in which a single quantum logic gate is executed.
It should be noted that in classical computation, the most basic unit is a bit, and the most basic control mode is a logic gate, and the purpose of the control circuit can be achieved by a combination of logic gates. Similarly, the way in which the qubits are handled is a quantum logic gate. Quantum logic gates are used, which are the basis for forming quantum circuits, and include single-bit quantum logic gates, such as Hadamard gates (H gates, ada Ma Men), bery-X gates (X gates), bery-Y gates (Y gates), bery-Z gates (Z gates), RX gates, RY gates, RZ gates, and the like; multi-bit quantum logic gates such as CNOT gates, CR gates, iSWAP gates, toffoli gates, and the like. Quantum logic gates are typically represented using unitary matrices, which are not only in matrix form, but also an operation and transformation. The effect of a general quantum logic gate on a quantum state is calculated by multiplying the unitary matrix by the matrix corresponding to the right vector of the quantum state.
The quantum states, i.e. the logic states of the qubits, are represented in the quantum algorithm (or weighing subprogram) in binary, for example, a group of qubits q0, q1, q2, representing the 0 th, 1 st, 2 nd qubits, ordered from high to low as q2q1q0, the quantum states corresponding to the group of qubits having a total number of 2 qubits to the power of the total number of qubits, referring to 8 eigenstates (determined states): the bits of each quantum state correspond to the quantum bits in correspondence, such as |000> states, with 000 corresponding to q2q1q0 from high to low, and |101>, |110>, |111 >.
Described in terms of a single qubit, the logic state ψ of a single qubit may be at |0>State, |1>State, |0>State sum |1>The superimposed state (uncertainty state) of the states can be expressed in particular as ψ=a|0>+b|1>Wherein a and b are complex numbers representing the amplitude (probability amplitude) of the quantum state, the square of the amplitude representing the probability, a 2 、b 2 Respectively indicate that the logic state is |0>State, |1>Probability of state, a 2 +b 2 =1. In short, a quantum state is an superposition of eigenstates, when the probability of the other states is 0, i.e. in a uniquely defined eigenstate.
The method for measuring the similarity of the quantum circuit matrix provided by the embodiment of the application is further described below.
Referring to fig. 3, fig. 3 is a flowchart of a method for measuring similarity of corresponding matrixes of quantum circuits according to an exemplary embodiment of the present application, including steps S310 to S340, where:
s310, obtaining analog data of a quantum circuit simulating the Hamiltonian quantity H.
The energy of the system in quantum mechanics is calculated by HamiltonianH describes the properties of a quantum system, which is one of the important applications of quantum computers. At present, the process of solving the Hamiltonian H simulation by utilizing quantum computation can be understood as follows: after the expression of one quantum system is obtained, the matrix expression form of the Hamiltonian quantity H can be obtained by setting parameters in the expression; then, the Hamiltonian quantity H is put on an e index for simulation to obtain a calculation result e -iHt (matrix representation form); then, according to the calculation result e -iHt Decomposing into a set of limited quantum gates, and further constructing a quantum circuit; finally, the hamiltonian H can be simulated by the quantum wire. If the matrix representation of the hamiltonian H is a square matrix, the method of measuring the similarity of the corresponding matrices of the quantum wires of the present application may be performed.
That is, in step S310, the analog data includes a line matrix U corresponding to the quantum line and an exponentially calculated result matrix a of the hamiltonian H, a=e -iHt
After obtaining the line matrix U and calculating the result matrix a, the following steps may be performed before performing step S320:
s350, confirming that the line matrix U and the calculation result matrix A are square matrixes and have the same dimension.
The square matrix is the same as the matrix in terms of the number of rows and columns, and the dimension of the square matrix is the number of rows or columns. The line matrix U and the calculation result matrix a are square matrices if the line matrix U has the same number of lines and columns and the calculation result matrix a has the same number of lines and columns. Then, judging whether the line number or the column number of the line matrix U is the same as the line number or the column number of the calculation result matrix A. If the number of rows or columns of the line matrix U is the same as the number of rows or columns of the calculation result matrix A, the dimensions of the line matrix U and the calculation result matrix A are consistent. If not, the subsequent method flow is not continued.
Step S350 may be used as a pre-verification, and step S320 is executed on the premise that the dimensions of the line matrix U and the calculation result matrix a are both square matrices and the dimensions are consistent.
S320, obtaining the process fidelity from the calculation result matrix A to the line matrix U according to the dimension of the line matrix U or the calculation result matrix A, the line matrix U and the calculation result matrix A.
The process fidelity is a fidelity measurement value of two matrixes and is used for measuring the fidelity relation between the two matrixes.
Further, the obtaining the process fidelity from the calculation result matrix a to the line matrix U according to the dimension of the line matrix U or the calculation result matrix a, the line matrix U and the calculation result matrix a may include the following steps:
s3201, calculating A1.
wherein ,dim (a) is the dimension of the calculation result matrix a.
S3202, a conjugate matrix U1 of the line matrix U is calculated.
I.e.
S3203, obtaining a norm value obtained after the point multiplication of the A1 and the conjugate matrix U1, wherein the norm value is the process fidelity from the calculation result matrix A to the line matrix U.
The result of the point multiplication of A1 and the conjugate matrix U1 is res, that is, res=a1·u1.
That is, the vector after res is spread by row is: res_vec= (res) 1 ,res 2 ,…,res i ,…res n ). Where n is the square of the dimension of the computation result matrix A.
The norm value is obtained by the following equation:
wherein II res II 2 Is a norm value, i.e. the fidelity of the process of calculating the result matrix a to the line matrix U, n is the square of the dimension of the result matrix a.
After obtaining the process fidelity of calculating the result matrix a to the line matrix U, step S330 is performed.
S330, calculating the similarity of the circuit matrix U and the calculation result matrix A according to the dimension of the circuit matrix U or the calculation result matrix A and the process fidelity from the calculation result matrix A to the circuit matrix U.
The similarity between the line matrix U and the calculation result matrix a is obtained by the following formula:
F state_fid (A,U)=‖res‖ 2
wherein ,Fave_fid (A, U) is the similarity between the line matrix U and the calculated result matrix A, F state_fid (A, U) is the process fidelity of computing the result matrix A to the line matrix U.
Further, after the similarity between the line matrix U and the calculation result matrix a is obtained, step S340 may be performed.
S340, according to the similarity between the line matrix U and the calculation result matrix A, the Hamiltonian quantity H is confirmed to be effectively simulated by the quantum line. The quantum wires correspond to the wire matrix U.
Specifically, according to the similarity between the line matrix U and the calculation result matrix a, the verification that the hamiltonian H is effectively simulated by the quantum line includes:
judging the similarity F of the circuit matrix U and the calculation result matrix A ave_fid (A, U) whether the following inequality is satisfied:
|F ave_fid (A,U)-1|<α
wherein, alpha is a threshold value, and a numerical value can be set manually.
If the inequality is satisfied, the similarity F between the line matrix U and the calculation result matrix A can be considered ave_fid If (a, U) is close to 1, it is confirmed that hamiltonian H can be effectively simulated by the quantum wire. If the inequality is not satisfied, the Hamiltonian amount H cannot be effectively simulated by the quantum circuit。
Compared with the prior art, the method for measuring the similarity of the matrix corresponding to the quantum line is designed based on the method for measuring the similarity of the matrix shown in fig. 3, the method is used for calculating the process fidelity from the matrix corresponding to the Hamiltonian amount on an index to the matrix corresponding to the quantum line, and then the similarity of the two matrices can be obtained, so that whether the Hamiltonian amount on the index can be simulated through the quantum line can be judged through the value of the similarity.
The method for measuring the similarity of the corresponding matrixes of the quantum circuits provided by the embodiment of the application is described in detail above with reference to fig. 3. The following describes in detail an apparatus for executing the method for measuring the similarity of the quantum circuit corresponding matrix according to the embodiment of the present application with reference to fig. 4.
Referring to fig. 4, fig. 4 is a schematic block diagram of an apparatus for measuring similarity of a quantum circuit corresponding matrix according to an exemplary embodiment of the present application, corresponding to the flow shown in fig. 3, an apparatus 400 for measuring similarity of a quantum circuit corresponding matrix includes:
a first obtaining module 410, configured to obtain analog data of a quantum circuit that simulates hamiltonian H; the simulation data comprises a line matrix U corresponding to the quantum line and a calculation result matrix A of Hamiltonian quantity H on an index; the line matrix U and the calculation result matrix A are square matrixes;
the second obtaining module 420 is configured to obtain the process fidelity from the calculation result matrix a to the line matrix U according to the dimension of the line matrix U or the calculation result matrix a, the line matrix U, and the calculation result matrix a;
the calculating module 430 is configured to calculate the similarity between the line matrix U and the calculation result matrix a according to 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.
Optionally, the apparatus 400 for measuring similarity of the quantum wire corresponding matrix further includes:
and the first confirmation module is used for confirming that the Hamiltonian quantity H is effectively simulated by the quantum circuit according to the similarity between the circuit matrix U and the calculation result matrix A.
Optionally, the first confirmation module is further configured to:
judging the similarity F of the circuit matrix U and the calculation result matrix A ave_fid (A, U) whether the following inequality is satisfied:
|F ave_fid (A,U)-1|<α
wherein α is a threshold; a=e -iHt
If yes, confirming that the Hamiltonian quantity H is effectively simulated by the quantum circuit; otherwise, hamiltonian H cannot be effectively modeled by the quantum wires.
Optionally, the second acquisition module 420 includes:
a first calculation unit for calculating A1; wherein,dim (A) is the dimension of the calculation result matrix A;
a second calculation unit for calculating a conjugate matrix U1 of the line matrix U;
the acquisition unit is used for acquiring a norm value obtained by multiplying the point of the A1 and the conjugate matrix U1, wherein the norm value is the process fidelity from the calculation result matrix A to the line matrix U.
Optionally, the obtaining unit is further configured to obtain the norm value by:
res=A1·U1
res_vec=(res 1 ,res 2 ,…,res i ,…res n )
wherein res is the point multiplication junction of A1 and the conjugate matrix U1If res_vec is a vector of res expanded by rows, n is the square of the dimension of the calculation result matrix A, |res|| 2 Is the norm value of the multiplication of the point A1 and the conjugate matrix U1.
Alternatively, the calculation module 430 obtains the similarity of the line matrix U and the calculation result matrix a by the following formula:
F state_fid (A,U)=‖res‖ 2
wherein ,Fave_fid (A, U) is the similarity between the line matrix U and the calculated result matrix A, F state_fid (A, U) is the process fidelity of computing the result matrix A to the line matrix U.
Optionally, the apparatus 400 for measuring similarity of the quantum wire corresponding matrix further includes:
and the second confirming module is used for confirming that the dimension of the line matrix U is consistent with the dimension of the calculation result matrix A before the process fidelity from the calculation result matrix A to the line matrix U is obtained.
Compared with the prior art, the method for measuring the similarity of the matrix is designed based on the device for measuring the similarity of the matrix corresponding to the quantum line shown in fig. 4, the method is used for calculating the process fidelity from the matrix corresponding to the Hamiltonian amount on the index to the matrix corresponding to the quantum line, and then the similarity of the two matrices can be obtained, so that whether the Hamiltonian amount on the index can be simulated through the quantum line can be judged through the value of the similarity.
The embodiment of the application also provides a storage medium, in which a computer program is stored, wherein the computer program is configured to perform the steps of any of the method embodiments described above when run.
Specifically, in the present embodiment, the above-described storage medium may be configured to store a computer program for executing the steps of:
s310, obtaining analog data of a quantum circuit for simulating Hamiltonian quantity H; the simulation data comprises a line matrix U corresponding to the quantum line and a calculation result matrix A of Hamiltonian quantity H on an index; the line matrix U and the calculation result matrix A are square matrices.
S320, obtaining the process fidelity from the calculation result matrix A to the line matrix U according to the dimension of the line matrix U or the calculation result matrix A, the line matrix U and the calculation result matrix A.
S330, calculating the similarity of the circuit matrix U and the calculation result matrix A according to the dimension of the circuit matrix U or the calculation result matrix A and the process fidelity from the calculation result matrix A to the circuit matrix U.
S340, according to the similarity between the line matrix U and the calculation result matrix A, the Hamiltonian quantity H is confirmed to be effectively simulated.
Specifically, in the present embodiment, the storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
The present application also provides an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Specifically, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Specifically, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s310, obtaining analog data of a quantum circuit for simulating Hamiltonian quantity H; the simulation data comprises a line matrix U corresponding to the quantum line and a calculation result matrix A of Hamiltonian quantity H on an index; the line matrix U and the calculation result matrix A are square matrices.
S320, obtaining the process fidelity from the calculation result matrix A to the line matrix U according to the dimension of the line matrix U or the calculation result matrix A, the line matrix U and the calculation result matrix A.
S330, calculating the similarity of the circuit matrix U and the calculation result matrix A according to the dimension of the circuit matrix U or the calculation result matrix A and the process fidelity from the calculation result matrix A to the circuit matrix U.
S340, according to the similarity between the line matrix U and the calculation result matrix A, the Hamiltonian quantity H is confirmed to be effectively simulated.
Alternatively, the processor in the electronic device may be one or more. The processor may be implemented in hardware or in software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, or the like. When implemented in software, the processor may be a general purpose processor, implemented by reading software code stored in a memory.
Alternatively, the memory in the electronic device may be one or more. The memory may be integral with the processor or separate from the processor, and the application is not limited. The memory may be a non-transitory processor, such as a ROM, which may be integrated on the same chip as the processor, or may be separately provided on different chips, and the type of memory and the manner of providing the memory and the processor are not particularly limited in the present application.
The electronic device may be, for example, a field programmable gate array (field programmable gate array, FPGA), an application specific integrated chip (application specific integrated circuit, ASIC), a system on chip (SoC), a central processing unit (central processor unit, CPU), a network processor (network processor, NP), a digital signal processing circuit (digital signal processor, DSP), a microcontroller (micro controller unit, MCU), a programmable controller (programmable logic device, PLD) or other integrated chip.
It should be appreciated that the processor in embodiments of the application may be a central processing unit (central processing unit, CPU), which may also be other general purpose processors, digital signal processors (digital signal processor, DSP), application specific integrated circuits (application specific integrated circuit, ASIC), off-the-shelf programmable gate arrays (field programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It should also be appreciated that the memory in embodiments of the present application may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. The volatile memory may be random access memory (random access memory, RAM) which acts as an external cache. By way of example but not limitation, many forms of random access memory (random access memory, RAM) are available, such as Static RAM (SRAM), dynamic Random Access Memory (DRAM), synchronous Dynamic Random Access Memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced Synchronous Dynamic Random Access Memory (ESDRAM), synchronous Link DRAM (SLDRAM), and direct memory bus RAM (DR RAM).
The embodiment of the application also provides a quantum computer operating system which can measure the similarity of the corresponding matrixes of the quantum circuits according to any one of the method embodiments provided by the embodiment of the application.
The embodiment of the application also provides a quantum computer, which comprises the quantum computer operating system.
The above embodiments may be implemented in whole or in part by software, hardware (e.g., circuitry), firmware, or any other combination. When implemented in software, the above-described embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product comprises one or more computer instructions or computer programs. When the computer instructions or computer program are loaded or executed on a computer, the processes or functions described in accordance with embodiments of the present application are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website site, computer, server, or data center to another website site, computer, server, or data center by wired (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more sets of available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. The semiconductor medium may be a solid state disk.
It should be understood that the term "and/or" is merely an association relationship describing the associated object, and means that three relationships may exist, for example, a and/or B may mean: there are three cases, a alone, a and B together, and B alone, wherein a, B may be singular or plural. In addition, the character "/" herein generally indicates that the associated object is an "or" relationship, but may also indicate an "and/or" relationship, and may be understood by referring to the context.
In the present application, "at least one" means one or more, and "a plurality" means two or more. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b, or c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or plural.
It should be understood that, in various embodiments of the present application, the sequence numbers of the foregoing processes do not mean the order of execution, and the order of execution of the processes should be determined by the functions and internal logic thereof, and should not constitute any limitation on the implementation process of the embodiments of the present application.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method for measuring similarity of a corresponding matrix of a quantum circuit, the method comprising:
obtaining analog data of a quantum circuit simulating the Hamiltonian quantity H; the simulation data comprises a line matrix U corresponding to the quantum line and a calculation result matrix A of Hamiltonian quantity H on an index; the line matrix U and the calculation result matrix A are square matrixes;
acquiring the process fidelity from the calculation result matrix A to the line matrix U according to the dimension of the line matrix U or the calculation result matrix A, the line matrix U and the calculation result matrix A;
and calculating the similarity of the circuit matrix U and the calculation result matrix A according to the dimension of the circuit matrix U or the calculation result matrix A and the process fidelity from the calculation result matrix A to the circuit matrix U.
2. The method according to claim 1, wherein the method further comprises:
and according to the similarity between the line matrix U and the calculation result matrix A, confirming that the Hamiltonian quantity H is effectively simulated by the quantum line.
3. The method according to claim 2, wherein said validating the hamiltonian H as effectively modeled by the quantum wire based on the similarity of the wire matrix U and the computation result matrix a comprises:
judging the similarity F of the circuit matrix U and the calculation result matrix A ave_fid (A, U) whether the following inequality is satisfied:
|F ave_fid (A,U)-1|<α
wherein α is a threshold; a=e -iHt
If yes, confirming that the Hamiltonian quantity H is effectively simulated by the quantum circuit; otherwise, hamiltonian H cannot be effectively modeled by the quantum wires.
4. A method according to claim 3, wherein the obtaining the process fidelity from the calculation result matrix a to the line matrix U according to the dimension of the line matrix U or the calculation result matrix a, the line matrix U, and the calculation result matrix a comprises:
calculating A1; wherein,dim (A) is the dimension of the calculation result matrix A;
calculating a conjugate matrix U1 of the line matrix U;
and obtaining the norm value obtained after the point multiplication of the A1 and the conjugate matrix U1 as the process fidelity from the calculation result matrix A to the line matrix U.
5. The method of claim 4, wherein the obtaining the norm value of the multiplication of the A1 and the conjugate matrix U1 point comprises:
the norm value is obtained by the following equation:
res=A1·U1
res_vec=(res 1 ,res 2 ,…,res i ,…res n )
where res is the dot product of A1 and the conjugate matrix U1, res_vec is the vector of res after row expansion, n is the square of the dimension of the computation result matrix A, |res|| 2 Is the norm value of the multiplication of the point A1 and the conjugate matrix U1.
6. The method according to claim 5, wherein calculating the similarity of the line matrix U and the calculation result matrix a according to the dimension of the line matrix U or the calculation result matrix a and the process fidelity of the calculation result matrix a to the line matrix U comprises:
the similarity between the line matrix U and the calculation result matrix a is obtained by the following expression:
F state_fid (A,U)=‖res‖ 2
wherein ,Fave_fid (A, U) is the similarity of the line matrix U and the calculation result matrix A, F state_fid (A, U) is the process fidelity of computing the result matrix A to the line matrix U.
7. The method according to claim 1, wherein the method further comprises:
before the process fidelity from the calculation result matrix A to the line matrix U is obtained, the dimension of the line matrix U is confirmed to be consistent with the dimension of the calculation result matrix A.
8. A device for measuring similarity of a corresponding matrix of a quantum wire, the device comprising:
the first acquisition module is used for acquiring the analog data of the quantum circuit simulating the Hamiltonian quantity H; the simulation data comprises a line matrix U corresponding to the quantum line and a calculation result matrix A of Hamiltonian quantity H on an index; the line matrix U and the calculation result matrix A are square matrixes;
the second acquisition module is used for acquiring the process fidelity from the calculation result matrix A to the line matrix U according to the dimension of the line matrix U or the calculation result matrix A, the line matrix U and the calculation result matrix A;
the calculation module is used for calculating the similarity of the circuit matrix U and the calculation result matrix A according to the dimension of the circuit matrix U or the calculation result matrix A and the process fidelity from the calculation result matrix A to the circuit matrix U.
9. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the method of any of the claims 1 to 7.
10. A storage medium having a computer program stored therein, wherein the computer program is arranged to perform the method of any of claims 1 to 7 when run.
CN202210241553.0A 2022-03-11 2022-03-11 Method, device and storage medium for measuring similarity of quantum circuit corresponding matrix Pending CN116796668A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210241553.0A CN116796668A (en) 2022-03-11 2022-03-11 Method, device and storage medium for measuring similarity of quantum circuit corresponding matrix
PCT/CN2023/079746 WO2023169345A1 (en) 2022-03-11 2023-03-06 Method and apparatus for processing data simulation task, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210241553.0A CN116796668A (en) 2022-03-11 2022-03-11 Method, device and storage medium for measuring similarity of quantum circuit corresponding matrix

Publications (1)

Publication Number Publication Date
CN116796668A true CN116796668A (en) 2023-09-22

Family

ID=88037309

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210241553.0A Pending CN116796668A (en) 2022-03-11 2022-03-11 Method, device and storage medium for measuring similarity of quantum circuit corresponding matrix

Country Status (1)

Country Link
CN (1) CN116796668A (en)

Similar Documents

Publication Publication Date Title
CN111563599B (en) Quantum circuit decomposition method and device, storage medium and electronic device
CN111582491B (en) Quantum circuit construction method and device
CN112114776B (en) Quantum multiplication method, device, electronic device and storage medium
CN112068798B (en) Method and device for realizing importance ordering of network nodes
CN113850389B (en) Quantum circuit construction method and device
CN113222150B (en) Quantum state transformation method and device
CN113222153B (en) Quantum state simulation method and device, storage medium and electronic device
CN114764619B (en) Convolution operation method and device based on quantum circuit
CN113222151B (en) Quantum state transformation method and device
CN114819168A (en) Quantum comparison method and device for matrix eigenvalues
CN114519429B (en) Method, device and medium for obtaining observability quantity of target system
CN114819163B (en) Training method and device for quantum generation countermeasure network, medium and electronic device
CN114372539B (en) Machine learning framework-based classification method and related equipment
CN116011681A (en) Meteorological data prediction method and device, storage medium and electronic device
CN116796668A (en) Method, device and storage medium for measuring similarity of quantum circuit corresponding matrix
CN115713122B (en) Method and device for determining size relation between quantum data and classical data
CN116776995A (en) Quantum circuit construction method, quantum circuit construction device and storage medium
CN115907016B (en) Quantum-based method for calculating search target range value and related device
CN115879559B (en) Method and device for judging equivalence relation among multiple quantum states and quantum computer
CN117852665A (en) Quantum circuit-based physical system state prediction method and related device
CN116048458B (en) Quantum computation-based numerical dividing method, device, equipment and storage medium
CN114819167B (en) Sparse approximate inverse quantum preprocessing method and device for sparse linear system
CN116796846A (en) Hamiltonian amount simulation method, device and storage medium
CN115511094B (en) Quantum circuit execution result determining method and device and quantum computer operating system
CN115730670B (en) Method and device for generating mode file, medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination