CN115358407A - Approximate quantum compiling method and system based on tensor network and electronic equipment - Google Patents
Approximate quantum compiling method and system based on tensor network and electronic equipment Download PDFInfo
- Publication number
- CN115358407A CN115358407A CN202210980282.0A CN202210980282A CN115358407A CN 115358407 A CN115358407 A CN 115358407A CN 202210980282 A CN202210980282 A CN 202210980282A CN 115358407 A CN115358407 A CN 115358407A
- Authority
- CN
- China
- Prior art keywords
- quantum
- sub
- line
- module
- new
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N10/00—Quantum computing, i.e. information processing based on quantum-mechanical phenomena
- G06N10/80—Quantum programming, e.g. interfaces, languages or software-development kits for creating or handling programs capable of running on quantum computers; Platforms for simulating or accessing quantum computers, e.g. cloud-based quantum computing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N10/00—Quantum computing, i.e. information processing based on quantum-mechanical phenomena
- G06N10/40—Physical realisations or architectures of quantum processors or components for manipulating qubits, e.g. qubit coupling or qubit control
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N10/00—Quantum computing, i.e. information processing based on quantum-mechanical phenomena
- G06N10/60—Quantum algorithms, e.g. based on quantum optimisation, quantum Fourier or Hadamard transforms
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- Mathematical Analysis (AREA)
- Evolutionary Computation (AREA)
- Data Mining & Analysis (AREA)
- Condensed Matter Physics & Semiconductors (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Computational Mathematics (AREA)
- Artificial Intelligence (AREA)
- Logic Circuits (AREA)
Abstract
The invention relates to the technical field of quantum compilation, in particular to an approximate quantum compilation method, an approximate quantum compilation system and electronic equipment based on a tensor network, wherein the method comprises the following steps: dividing the quantum circuit to be compiled into a plurality of sub-circuits, wherein the quantum bit of each sub-circuit is not more than the maximum value of the number of preset quantum bits; on the basis of a tensor network theory, compiling each sub-line into a new sub-line only containing basic quantum operation, and enabling any sub-line to be approximately equivalent to the new sub-line corresponding to the sub-line; and combining all the new sub-circuits to obtain a new quantum circuit, and determining the new quantum circuit as a final compiling result. By utilizing the cutting characteristic of tensor, in line division, compared with a scheme expressed by a traditional unitary matrix, fewer sub-lines can be generated, and the number of quantum operations contained in each sub-line is more than that of the scheme expressed by the traditional unitary matrix, so that the coding effect is improved.
Description
Technical Field
The invention relates to the technical field of quantum compiling, in particular to a tensor network-based approximate quantum compiling method, a tensor network-based approximate quantum compiling system and electronic equipment.
Background
A quantum circuit is a common representation of a quantum process, which is composed of quantum bits and a series of quantum operations, and unitary matrices are a basic description of quantum operations in quantum computing, and similarly, a quantum circuit can be described by all unitary matrices that contain the corresponding quantum operations. However, a quantum computer can only perform a specific basic operation, and therefore, before executing a quantum wire in the quantum computer, it is necessary to decompose all general quantum operations in the wire into a series of basic operations, and the quantum wires before and after decomposition are required to be approximately equal in function (i.e. the unitary matrix descriptions of the quantum wires before and after decomposition are approximately equal), which is called approximate quantum coding in this patent.
The performance of a quantum compiler can be measured by the number of basic operations of the quantum wire it outputs, and the smaller the number of basic operations, the better the performance of the quantum compiler. The conventional quantum coding scheme based on unitary matrix description can only process quantum wires containing very small number of quantum bits (usually not more than 4), so when coding a quantum wire containing more quantum bits, the input quantum wire needs to be cut into a plurality of sub-quantum wires containing only very few quantum bits, then each sub-quantum wire needs to be separately coded, and finally, the plurality of coded quantum wires are recombined into a new quantum wire to be output. The above process requires separate compilation of multiple sub-lines, and the performance of the compiler decreases as the number of sub-quantum lines compiled and the number of quantum operations contained in each sub-line increases.
Disclosure of Invention
The invention provides an approximate quantum compiling method, system and electronic equipment based on a tensor network, aiming at the defects of the prior art.
The invention discloses an approximate quantum compiling method based on a tensor network, which has the technical scheme as follows:
dividing the quantum circuit to be compiled into a plurality of sub-circuits, wherein the quantum bit of each sub-circuit is not more than the maximum value of the number of preset quantum bits;
on the basis of a tensor network theory, compiling each sub-line into a new sub-line only containing basic quantum operation, and enabling any sub-line to be approximately equivalent to the new sub-line corresponding to the sub-line;
and combining all the new sub-lines to obtain a new quantum line, and determining the new quantum line as a final compiling result.
The approximate quantum compiling method based on the tensor network has the following beneficial effects:
the quantum operations are expressed by tensor based on a tensor network theory, and by using the cutting characteristic of the tensor, fewer sub-lines can be generated in line division compared with a scheme expressed by a conventional unitary matrix, the number of the quantum operations contained in each sub-line is more than that of the quantum operations expressed by the conventional unitary matrix, and the compiling effect is improved.
The invention discloses an approximate quantum compiling system based on a tensor network, which has the technical scheme as follows:
the device comprises a segmentation module, a compiling module and a combination determining module;
the segmentation module is configured to: dividing the quantum circuit to be compiled into a plurality of sub-circuits, wherein the quantum bit of each sub-circuit is not more than the maximum value of the number of preset quantum bits;
the compiling module is configured to: on the basis of a tensor network theory, compiling each sub-line into a new sub-line only comprising basic quantum operation respectively, and enabling any sub-line to be approximately equivalent to the new sub-line corresponding to the sub-line;
the combination determination module is to: and combining all the new sub-circuits to obtain a new quantum circuit, and determining the new quantum circuit as a final compiling result.
The approximate quantum compiling system based on the tensor network has the following beneficial effects:
based on the tensor network theory, quantum operations are expressed by tensor, and by using the cutting characteristic of the tensor, fewer sub-lines can be generated in line division compared with a scheme expressed by a traditional unitary matrix, the number of quantum operations contained in each sub-line is more than that of the scheme expressed by the traditional unitary matrix, and therefore the coding effect is improved.
A storage medium of the present invention stores instructions, and when the instructions are read by a computer, the instructions cause the computer to execute any one of the tensor network-based approximate quantum compiling methods described above.
An electronic device of the present invention includes a processor and the storage medium, where the processor executes instructions in the storage medium.
Drawings
Fig. 1 is a schematic flowchart of an approximate quantum compiling method based on a tensor network according to an embodiment of the present invention;
FIG. 3 is a schematic representation of CNOT;
FIG. 4 is a diagram of a qubitPerforming quantum operationsFor the qubitA schematic diagram of performing a CNOT quantum operation;
FIG. 5 is a diagram of an application to qubitsSchematic representation of CNOT quantum manipulation on after cleavage;
FIG. 6 is a schematic diagram of the merging of two tensors into a new tensor;
FIG. 8 is one of the schematic diagrams of qubit sets for two quantum manipulation roles;
FIG. 10 is a second schematic diagram of a qubit set for two quantum operations;
FIG. 12 is a schematic diagram of quantum wires and their tensors;
fig. 15 is a schematic structural diagram of an approximate quantum compiler system based on a tensor network according to an embodiment of the present invention.
Detailed Description
As shown in fig. 1, an approximate quantum compiling method based on a tensor network according to an embodiment of the present invention includes the following steps:
s1, dividing a quantum circuit to be compiled into a plurality of sub-circuits, wherein the quantum bit of each sub-circuit is not more than the maximum value of the number of preset quantum bits;
s2, compiling each sub-line into a new sub-line only containing basic quantum operation based on a tensor network theory, and enabling any sub-line to be approximately equivalent to the new sub-line corresponding to the sub-line;
and S3, combining all the new sub-circuits to obtain a new quantum circuit, and determining the new quantum circuit as a final compiling result.
The specific pseudo code is as follows:
inputting: a quantum wire to be compiledMedicine for treating diabetesDegree of rotationMaximum number of qubits in sub-line。
Based on the tensor network theory, quantum operations are expressed by tensor, and by using the cutting characteristic of the tensor, fewer sub-lines can be generated in line division compared with a scheme expressed by a traditional unitary matrix, the number of quantum operations contained in each sub-line is more than that of the scheme expressed by the traditional unitary matrix, and therefore the coding effect is improved.
Wherein, the step of dividing the quantum circuit to be compiled into a plurality of sub-circuits comprises the following steps:
s10, initializing a plurality of sub-lines to be constructed, and constructing a mapping relation from quantum bits in the quantum lines to be compiled to the sub-lines to be constructed, wherein each quantum bit in the quantum lines to be compiled corresponds to one sub-line to be constructed;
s11, sequentially extracting the quantum operations in the quantum circuit to be compiled according to the execution sequence of the quantum operations in the quantum circuit to be compiled;
s12, determining the sub-circuit to be constructed corresponding to the quantum operation extracted in the S11 from all the sub-circuits to be constructed according to the mapping relation;
s13, updating the sub-circuit to be constructed corresponding to the quantum operation extracted in the S11 according to the quantum operation of the sub-circuit to be constructed corresponding to the quantum operation extracted in the S11 and the preset maximum value of the number of quantum bits, wherein the specific updating modes are two, specifically:
1) The first updating mode is as follows: adding quantum operation to the sub-line to be constructed corresponding to the quantum operation extracted in the S11;
2) The second updating method is as follows: and after the first updating mode is executed, cutting the added quantum operation.
S14, judging whether any sub-line to be constructed is constructed or not, if yes, determining the sub-line to be constructed as the sub-line, and generating a new sub-line to be constructed;
and S15, updating the mapping relation, returning to execute the S11 until all quantum operations in the quantum circuit to be compiled are extracted, completing the segmentation of the quantum circuit to be compiled, and obtaining a plurality of sub-circuits. Namely, the mapping relation is updated, and the step returns to execute S11 until all the quantum operations in the quantum line to be compiled are extracted, namely, after all the quantum operations in the quantum line to be compiled are extracted, a plurality of sub-lines are obtained, and the quantum line to be compiled is segmented. The specific pseudo code is as follows:
inputting: quantum wireMaximum number of qubits in sub-line. Presetting maximum value of quantum bit number as;
8. if it is notNumber of qubits contained in all linesAnd wherein the number of CNOT operations that were cutIf yes, entering step 9, otherwise entering step 11;
11. if it is notIs a CNOT operation, andif the CNOT operation in all the lines is not cut, the step 12 is executed, otherwise, the step 13 is executed;
12. the CNOT operation is cut under tensor, and COPY and XOR tensors obtained by cutting are respectively added into the CNOT operationStep 3 is entered;
In the pseudo code, step 1 and step 2 correspond to S10, step 3 corresponds to S11, step 4 and step 5 correspond to S12, step 6 to step 12 correspond to S13, and step 13 to step 17 correspond to S14 and S15.
Wherein the quantum wire to be compiledAs quantum wiresThe pseudo code is executed to divide the quantum circuit to be compiled into a plurality of sub-circuits.
Based on the tensor network theory, compiling each sub-line into a new sub-line only including basic quantum operation respectively, including:
S20-S22 are executed on each sub-line until each sub-line is compiled into a new sub-line only containing basic quantum operation;
s20, initializing any sub-line, and opening the initialized sub-line to obtain a state;
and S21, judging whether the sub-line contained in the state obtained in the S20 meets the output condition, if so, outputting the sub-line corresponding to the state as a new sub-line corresponding to the sub-line, otherwise, executing S22, wherein in the technical field of quantum compilation, the new sub-line after compilation only comprises basic quantum operations.
S22, performing an expansion operation on the state obtained in S20 to obtain a plurality of new states, selecting one state from all the new states, taking the selected state as the state obtained in S20, and repeating S21.
The specific pseudo codes corresponding to S20-S22 are as follows:
And (3) outputting: one comprising only fundamental quantum operations andtensor quantum wireAnd the parameter values thereofSo thatIs composed ofThe decomposition is approximated.
1. The number of qubits in (a) is,in which there are cut qubits present in the qubit,the tensor obtained by the middle cutting;
3. to the direction ofIn (1) addingA U3 quantum operation respectively acting on the qubitsThe above step (1);
wherein, the steps 1 to 5 correspond to S20, the step 6 corresponds to S21, the step 7 corresponds to S22, and each sub-line is taken as a target quantum sub-line to be compiledAnd executing the pseudo code, and compiling each sub-line into a new sub-line only containing basic quantum operations.
Compiling each sub-line into pseudo code of a new sub-line containing only basic quantum operations, wherein the pseudo code of the state Open (Open) is as follows:
The pseudo code for the expansion of state (Expand) is:
5. in the direction ofEnd-of-line effects on qubitsOn CNOT operation, then toEnd-of-line effects on qubitsTwo U3 operations above;
7. in the direction ofThe introduction of the start of the quantum bitCNOT operations on, and then toThe introduction of the start of the quantum bitTwo U3 operations above;
The search space is:
for a quantum wire under a tensor expression, the approximate compiling process can be regarded as a search process of a search space, and one state of the search spaceThe stored information includes: an intermediate quantum wire(Parameter sets for sub-operations with parameters) and specific values of their parametersEvaluation value of the stateParent status of this status. Status of stateCan also be written as. In addition, multiple states may be combinedMake upSet of (A) is denoted as。
Technical terms of the present invention are explained as follows:
1) Quantum bit:
qubits are the fundamental unit of quantum computer storage of data. Quantum operations implement specific functions by corresponding control of qubits. In this patent, symbols are usedRepresenting the collection of all qubits in a quantum computer,representing the second in quantum computersThe number of sub-bits is such that,representing the number of quantum bits in a quantum computer.
2) Unitary matrix representation of quantum manipulation:
quantum manipulation (by symbols)Representation) represents a specific operation that a quantum computer can perform, which contains two pieces of information: qubits of effect and specific functions. Unitary matrix (in symbols)Representation) is one of the most common expressions of quantum manipulation. In general, one acts onQuantum operation on qubitsCan be expressed as a size ofOf a two-dimensional matrixAnd satisfyIn whichRepresenting a unit array.
A control not gate (CNOT gate) is a common two-qubit operation whose unitary matrix is represented as:;
in addition, an arbitrary single qubit quantum operation can be performed with U3 with parameters (note the notation of U with unitary matrix hereIrrelevant) quantum operations. A unitary matrix of U3 quantum operations is represented as:whereinThree undetermined parameters which can be arbitrarily valued are adopted, and one U3 quantum operation can be converted into any single-quantum bit quantum operation through specific values.
3) Quantum operations and their tensor representations:
by default, the specific function of quantum manipulation may be represented by a unitary matrix. The scheme innovatively expresses the specific function of one quantum operation by tensor. Tensor (with sign)Representation) is a high-dimensional matrix for a role inQuantum operation on qubitsIn other words, its tensor (denoted as) The representation can be seen as one dimension (also called degree in tensor) asThe degree of freedom in each dimension of the high-dimensional matrix of (2), therefore,the size of the high-dimensional matrix corresponding to the tensor of the quantum operation of the qubit is. In addition, tensorDegree of (can also be recorded as. The unitary matrix representation and the tensor representation of a quantum operation can be transformed into each other, and the transformation process is the prior art.
In general, one is inQuantum operation on qubitsGraph under tensor, as shown in FIG. 2, where the left side represents the inputIn, the right side represents the output, and the straight line (also called index) of each row corresponds to the qubit it is acting on. It should be noted that the total number of indices possessed by a tensor should equal its degree.
A graph of CNOT (controlled not gate) quantum operation under tensor is shown in fig. 3.
Suppose we first pair qubitsPerforming quantum operationsFor the qubitA CNOT quantum operation is performed, a graph of these two quantum operations under tensor, as shown in fig. 4.
4) Cutting and merging of CNOT quantum operations in tensor representation:
for CNOT quantum manipulation we can perform a special manipulation, called slicing, on it under the tensor. The cut may change the tensor corresponding to one CNOT quantum operation (degree 4) to two tensors of degree 3 (COPY tensor and XOR tensor, respectively). It should be noted that the degree of cutting increases from 4 to 6, and two new indicators are generated. One acting on qubitsGraph of CNOT quantum operations on after cutting, as shown in fig. 5.
The upper half part is a COPY tensor, the lower half part is an XOR tensor, two straight lines cut off in the middle are two newly-added indexes, and the two indexes do not correspond to any quantum bit.
The combination of COPY and XOR is the inverse operation of CNOT quantum operation cutting under tensor, which can restore the COPY and XOR tensors obtained by cutting to the original CNOT quantum operation.
5) Contraction between tensors
Contraction is a fundamental operation in tensor theory that can combine two tensors into a new tensor. In quantum programming, assume we want to pair tensorsA shrink operation is performed, which process can be described asIn whichTo shrink the resulting new tensor (the specific calculation of which is prior art),for quantum operations corresponding to said tensors, the quantum bit acted on by the quantum operation isThe union of the qubit sets is acted upon as shown in fig. 6.
For example, we want to shrink the tensors in the two quantum processes, the output of the process can be written asWhereinAnd carrying out quantum operation corresponding to the newly obtained tensor.The graph of (a) is shown in fig. 7.
The quantum bit set for the two quantum operation functions isTherefore, it isDegree of 4, respectively corresponding to the qubitsAs shown in fig. 8.
For another example, we want to shrink the tensors in the two quantum processes, the output of the process can be recorded asWhereinAnd carrying out quantum operation corresponding to the newly obtained tensor.The graph of (a) is shown in fig. 9.
The qubits for which the two quantum operations described above work are grouped togetherTherefore, it isDegree of 6, corresponding to qubits respectivelyAs shown in fig. 10.
For another example, we want to shrink the tensors in the two quantum processes, the output of the process can be recorded asAnd carrying out quantum operation corresponding to the newly obtained tensor.The graph of (a) is shown in fig. 11.
The quantum bit set for the two quantum operation functions isIn addition, the COPY tensor has an index which is irrelevant to the qubit, soDegree of 5, corresponding to qubits respectivelyAndand a qubit-independent index of the original COPY tensor.
6) Fundamental quantum operations:
in the quantum programming process, it will be assumed that any quantum operation can be performed on a quantum computer. In practical cases, however, a quantum computer can only perform some specific quantum operations, and these operations that can be performed by a specific quantum computer are referred to as basic quantum operations of the quantum computer. The basic quantum operations are assumed in this patent to be single-qubit U3 operations and two-qubit CNOT operations. It should be noted that for most practical quantum computers, the U3 operation and CNOT operation can be easily compiled into their corresponding basic quantum operations. The quantum wires and their tensors are represented as shown in fig. 12.
Quantum wires (using symbols)Representation) is a common description of quantum processes, which generally consist of a quantum bit and a series of quantum operations, if each quantum operation is represented by a tensor, a tensor representation of the quantum line can be obtained. The upper diagram shows a tensor representation of a quantum wire, which contains two qubitsEach line represents a corresponding qubit and also contains three quantum operations, respectivelyAnd CNOT.
7) Classical modeling of quantum wires under tensor representation:
by performing the contraction operation on the tensors in the quantum wire in a certain order (for example, from left to right), only one tensor can be left in the quantum wire, and the process is called a classical simulation of the quantum wire and is marked asWhereinA tensor representation corresponding to the resulting quantum operation.
For example, for the quantum wires shown in the previous figures, in a classical simulation process, the tensors are first alignedAndis contracted and is marked asAt this time, only tensor exists in the lineAs shown in fig. 13.
8) Distance between the two tensors:
distance () For inscribing two tensors acting on the same qubit (not to be noted as) The degree of similarity between them. It can be expressed as:
whereinFor averaging errors, the operation is performed on two tensors with the same degree, the output of the operation is a real number greater than or equal to 0, which can characterize the similarity degree of the two tensors (the lower the value is, the more similar the value is, the 0 is taken to represent complete equivalence), and the specific calculation process of the operation is the prior art.
9) Approximate compilation of quantum wires:
for a quantum wireAnd a sufficiently small positive numberWhen another quantum wire is presentAnd satisfyAt first, callAs quantum wiresIs/are as followsAnd (4) approximate compiling. The performance of a near quantum compiler can be measured by the number of CNOT quantum operations in its output quantum wires, which is the smaller the number of CNOT quantum operations in the output quantum wires, the better the performance of the near quantum compiler.
10 Approximate compilation of quantum wires without XOR and COPY tensors:
for quantum wires under a tensor representationIf the vector does not contain XOR and COPY tensors (the CNOT tensor is not cut), the existing approximate quantum compiler can be called to carry out approximate compilation, and the process is marked asWhereinIn order to be the output line,to a target accuracy
11 ) quantum line optimizer
Some quantum operations in a quantum circuit may have one or more parameters to be determined, such as the aforementioned single-qubit U3 operation, and specific values of these parameters need to be determined during the compilation process, which may be regarded as an optimization problem, and the specific tools for solving this problem are referred to in this patent as quantum operation optimizers (prior art). Specifically, the input to a quantum manipulation optimizer is a quantum wire containing a quantum manipulation of a pending parameterAnd the target sheetQuantity ofOutput is asSpecific value set of middle parametersAnd need to makeIs as small as possible. The calling process of the quantum operation optimizer is noted in the present invention as。
The scheme is divided into three parts of line cutting, sub-line compiling and line combining. The circuit cutting module divides a general quantum circuit with a large number of sub-bits (input circuit of the compiler) into a plurality of sub-circuits with a small number of sub-bits; sub-line compilation is based on a tensor network theory, the sub-lines are compiled into new quantum lines only containing basic quantum operations, and the sub-lines before and after compilation are approximately equivalent; the line combination combines the sub-lines with the new small number of sub-bits obtained by compiling to obtain a line with a new large number of sub-bits as the output result of the compiler, so that the output line and the input line are approximately equivalent, and the high-performance compiling of the quantum line with any number of quantum bits can be realized.
In the above embodiments, although the steps are numbered as S1, S2, etc., but only the specific embodiments are given in the present application, and a person skilled in the art may adjust the execution sequence of S1, S2, etc. according to the actual situation, which is also within the protection scope of the present invention, it is understood that some embodiments may include some or all of the above embodiments.
As shown in fig. 2, an approximate quantum compiling system 200 based on tensor network according to an embodiment of the present invention includes a segmentation module 210, a compiling module 220, and a combination determining module 230;
the segmentation module 210 is configured to: dividing the quantum circuit to be compiled into a plurality of sub-circuits, wherein the quantum bit of each sub-circuit is not more than the maximum value of the number of preset quantum bits;
the compiling module 220 is configured to: on the basis of a tensor network theory, compiling each sub-line into a new sub-line only comprising basic quantum operation respectively, and enabling any sub-line to be approximately equivalent to the new sub-line corresponding to the sub-line;
the combination determination module 230 is configured to: and combining all the new sub-circuits to obtain a new quantum circuit, and determining the new quantum circuit as a final compiling result.
Based on the tensor network theory, quantum operations are expressed by tensor, and by using the cutting characteristic of the tensor, fewer sub-lines can be generated in line division compared with a scheme expressed by a traditional unitary matrix, the number of quantum operations contained in each sub-line is more than that of the scheme expressed by the traditional unitary matrix, and therefore the coding effect is improved.
Optionally, in the foregoing technical solution, the segmentation module 210 includes an initial construction module, a sequence extraction module, a determination module, an update module, a first judgment module, and an update repeat call module;
the initial building block is configured to: initializing a plurality of sub-circuits to be constructed, and constructing a mapping relation from the quantum bits in the quantum circuits to be compiled to the sub-circuits to be constructed, wherein each quantum bit in the quantum circuits to be compiled corresponds to one sub-circuit to be constructed;
the sequence extraction module is to: sequentially extracting the quantum operations in the quantum circuit to be compiled according to the execution sequence of the quantum operations in the quantum circuit to be compiled;
the determination module is to: determining the sub-lines to be constructed corresponding to the quantum operations extracted by the sequence extraction module from all the sub-lines to be constructed according to the mapping relation;
the update module is to: updating the sub-circuit to be constructed corresponding to the quantum operation extracted by the sequential extraction module according to the quantum operation of the sub-circuit to be constructed corresponding to the quantum operation extracted by the sequential extraction module and the preset maximum value of the number of quantum bits;
the first judging module is used for: judging whether any sub-line to be constructed is constructed or not, if so, determining the sub-line to be constructed as the sub-line, and generating a new sub-line to be constructed;
the update repeat call module is to: and updating the mapping relation, and recalling the sequence extraction module, the determination module and the updating module until all quantum operations in the quantum circuit to be compiled are extracted, completing the segmentation of the quantum circuit to be compiled, and obtaining a plurality of sub-circuits.
Optionally, in the foregoing technical solution, the compiling module 220 includes a repeat call module, an initialization opening module, a second judging module, and an expansion repeat call module;
the repeat call module is to: calling an initialization opening module, a second judgment module and a development repeated calling module for each sub-line until each sub-line is compiled into a new sub-line only containing basic quantum operation;
the initialization opening module is used for: initializing any sub-line, and opening the initialized sub-line to obtain a state;
the second judging module is used for: judging whether sub-circuits contained in the state obtained by initializing the opening module meet output conditions or not, if so, outputting the sub-circuit corresponding to the state as a new sub-circuit corresponding to the sub-circuit, and if not, calling a development repeat calling module;
the unwind repeat call module is to: and performing expansion operation on the state obtained by initializing the opening module to obtain a plurality of new states, selecting one state from all the new states, taking the selected state as the state obtained by initializing the opening module, and repeatedly calling the second judgment module.
The above steps for realizing the corresponding functions of each parameter and each unit module in the approximate quantum compiling system based on the tensor network can refer to each parameter and step in the embodiment of the approximate quantum compiling method based on the tensor network, and are not described herein again.
The storage medium of the embodiment of the present invention stores instructions, and when the instructions are read by a computer, the computer is caused to execute any one of the above approximate quantum compiling methods based on the tensor network.
The electronic device of the embodiment of the invention comprises a processor and the storage medium, wherein the processor executes instructions in the storage medium, and the electronic device can be a computer, a mobile phone and the like.
As will be appreciated by one skilled in the art, the present invention may be embodied as a system, method or computer program product.
Accordingly, the present disclosure may be embodied in the form of: the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a "circuit," module "or" system. Furthermore, in some embodiments, the invention may also be embodied in the form of a computer program product in one or more computer-readable media having computer-readable program code embodied in the medium.
Any combination of one or more computer-readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.
Claims (8)
1. An approximate quantum compiling method based on a tensor network, comprising:
s1, dividing a quantum circuit to be compiled into a plurality of sub-circuits, wherein the quantum bit of each sub-circuit is not more than the maximum value of the number of preset quantum bits;
s2, compiling each sub-line into a new sub-line only comprising basic quantum operation based on a tensor network theory, and enabling any sub-line to be approximately equivalent to the new sub-line corresponding to the sub-line;
and S3, combining all the new sub-circuits to obtain a new quantum circuit, and determining the new quantum circuit as a final compiling result.
2. The approximate quantum compiling method based on the tensor network as recited in claim 1, wherein the dividing the quantum wire to be compiled into a plurality of sub-wires comprises:
s10, initializing a plurality of sub-lines to be constructed, and constructing a mapping relation from the quantum bits in the quantum lines to be compiled to the sub-lines to be constructed, wherein each quantum bit in the quantum lines to be compiled corresponds to one sub-line to be constructed;
s11, sequentially extracting the quantum operations in the quantum circuit to be compiled according to the execution sequence of the quantum operations in the quantum circuit to be compiled;
s12, determining the sub-circuit to be constructed corresponding to the quantum operation extracted in the S11 from all the sub-circuits to be constructed according to the mapping relation;
s13, updating the sub-circuit to be constructed corresponding to the quantum operation extracted in the S11 according to the quantum operation of the sub-circuit to be constructed corresponding to the quantum operation extracted in the S11 and the preset maximum value of the number of quantum bits;
s14, judging whether any sub-line to be constructed is constructed or not, if so, determining the sub-line to be constructed as the sub-line, and generating a new sub-line to be constructed;
and S15, updating the mapping relation, returning to execute the S11 until all quantum operations in the quantum line to be compiled are extracted, and completing the segmentation of the quantum line to be compiled to obtain a plurality of sub-lines.
3. The approximate quantum compiling method based on the tensor network as recited in claim 2, wherein the tensor network theory-based compiling each sub-line into a new sub-line containing only fundamental quantum operations respectively comprises:
respectively executing S20-S22 on each sub-line until each sub-line is compiled into a new sub-line only containing basic quantum operation;
s20, initializing any sub-line, and opening the initialized sub-line to obtain a state;
s21, judging whether sub-lines contained in the state obtained in the S20 meet output conditions or not, if so, outputting the sub-line corresponding to the state as a new sub-line corresponding to the sub-line, and if not, executing S22;
s22, performing an expansion operation on the state obtained in S20 to obtain a plurality of new states, selecting one state from all the new states, taking the selected state as the state obtained in S20, and repeating S21.
4. An approximate quantum compiling system based on a tensor network is characterized by comprising a segmentation module, a compiling module and a combination determining module;
the segmentation module is configured to: dividing the quantum circuit to be compiled into a plurality of sub-circuits, wherein the quantum bit of each sub-circuit is not more than the maximum value of the number of preset quantum bits;
the compiling module is configured to: on the basis of a tensor network theory, compiling each sub-line into a new sub-line only containing basic quantum operation, and enabling any sub-line to be approximately equivalent to the new sub-line corresponding to the sub-line;
the combination determination module is to: and combining all the new sub-lines to obtain a new quantum line, and determining the new quantum line as a final compiling result.
5. The tensor network-based approximate quantum compiling system of claim 4, wherein the segmenting module comprises an initial constructing module, a sequential extracting module, a determining module, an updating module, a first judging module and an updating repeat calling module;
the initial building module is to: initializing a plurality of sub-lines to be constructed, and constructing a mapping relation from the quantum bits in the quantum lines to be compiled to the sub-lines to be constructed, wherein each quantum bit in the quantum lines to be compiled corresponds to one sub-line to be constructed;
the sequential extraction module is to: sequentially extracting the quantum operations in the quantum circuit to be compiled according to the execution sequence of the quantum operations in the quantum circuit to be compiled;
the determination module is to: determining sub-lines to be constructed corresponding to the quantum operations extracted by the sequence extraction module from all the sub-lines to be constructed according to the mapping relation;
the update module is to: updating the sub-circuit to be constructed corresponding to the quantum operation extracted by the sequential extraction module according to the quantum operation of the sub-circuit to be constructed corresponding to the quantum operation extracted by the sequential extraction module and a preset maximum value of the number of quantum bits;
the first judging module is used for: judging whether any sub-line to be constructed is constructed or not, if so, determining the sub-line to be constructed as the sub-line, and generating a new sub-line to be constructed;
the update repeat call module is configured to: and updating the mapping relation, and recalling the sequence extraction module, the determination module and the updating module until all quantum operations in the quantum line to be compiled are extracted, completing the segmentation of the quantum line to be compiled, and obtaining a plurality of sub-lines.
6. The tensor network-based approximate quantum compiling system of claim 5, wherein the compiling module comprises a repeat calling module, an initialization opening module, a second judging module and an unfolding repeat calling module;
the repeat call module is configured to: calling the initialization opening module, the second judgment module and the expansion repeated calling module for each sub-line until each sub-line is compiled into a new sub-line only comprising basic quantum operation;
the initialization opening module is used for: initializing any sub-line, and opening the initialized sub-line to obtain a state;
the second judging module is used for: judging whether sub-circuits contained in the state obtained by initializing the opening module meet output conditions or not, if so, outputting the sub-circuit corresponding to the state as a new sub-circuit corresponding to the sub-circuit, and if not, calling the expansion repeated calling module;
the expansion repeat call module is used for: and performing expansion operation on the state obtained by initializing the opening module to obtain a plurality of new states, selecting one state from all the new states, taking the selected state as the state obtained by initializing the opening module, and repeatedly calling the second judgment module.
7. A storage medium having stored therein instructions which, when read by a computer, cause the computer to execute a tensor network-based approximate quantum compilation method as recited in any one of claims 1 to 3.
8. An electronic device comprising the storage medium of claim 7 and a processor, wherein the processor executes instructions in the storage medium.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210980282.0A CN115358407B (en) | 2022-08-16 | 2022-08-16 | Approximate quantum compiling method and system based on tensor network and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210980282.0A CN115358407B (en) | 2022-08-16 | 2022-08-16 | Approximate quantum compiling method and system based on tensor network and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115358407A true CN115358407A (en) | 2022-11-18 |
CN115358407B CN115358407B (en) | 2023-04-11 |
Family
ID=84033528
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210980282.0A Active CN115358407B (en) | 2022-08-16 | 2022-08-16 | Approximate quantum compiling method and system based on tensor network and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115358407B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115860128A (en) * | 2022-12-21 | 2023-03-28 | 北京百度网讯科技有限公司 | Quantum circuit operation method and device and electronic equipment |
CN117408346A (en) * | 2023-10-25 | 2024-01-16 | 北京中科弧光量子软件技术有限公司 | Quantum circuit determining method and device and computing equipment |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108710951A (en) * | 2018-05-17 | 2018-10-26 | 合肥本源量子计算科技有限责任公司 | A kind of method and system of structure quantum wire |
US20190286774A1 (en) * | 2018-03-14 | 2019-09-19 | International Business Machines Corporation | Quantum circuit decomposition by integer programming |
CN112085204A (en) * | 2020-09-18 | 2020-12-15 | 东南大学 | Line transformation method for quantum compiling |
CN114330730A (en) * | 2021-12-25 | 2022-04-12 | 北京量子信息科学研究院 | Quantum line block compiling method, device, equipment, storage medium and product |
CN114399053A (en) * | 2022-02-01 | 2022-04-26 | 上海图灵智算量子科技有限公司 | Quantum discrimination circuit and model for progressive training |
CN114416105A (en) * | 2022-03-30 | 2022-04-29 | 北京中科弧光量子软件技术有限公司 | Quantum operation compiling method and system, storage medium and electronic equipment |
CN114529003A (en) * | 2022-01-29 | 2022-05-24 | 西安电子科技大学 | Dividing method for multi-quantum bit quantum Fourier transform line |
CN114548414A (en) * | 2022-02-22 | 2022-05-27 | 合肥本源量子计算科技有限责任公司 | Method, device, storage medium and compiling system for compiling quantum circuit |
CN114764549A (en) * | 2020-12-31 | 2022-07-19 | 合肥本源量子计算科技有限责任公司 | Quantum line simulation calculation method and device based on matrix product state |
CN114897174A (en) * | 2022-05-19 | 2022-08-12 | 北京大学 | Hybrid calculation method and device based on tensor network and quantum line |
-
2022
- 2022-08-16 CN CN202210980282.0A patent/CN115358407B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190286774A1 (en) * | 2018-03-14 | 2019-09-19 | International Business Machines Corporation | Quantum circuit decomposition by integer programming |
CN108710951A (en) * | 2018-05-17 | 2018-10-26 | 合肥本源量子计算科技有限责任公司 | A kind of method and system of structure quantum wire |
CN112085204A (en) * | 2020-09-18 | 2020-12-15 | 东南大学 | Line transformation method for quantum compiling |
CN114764549A (en) * | 2020-12-31 | 2022-07-19 | 合肥本源量子计算科技有限责任公司 | Quantum line simulation calculation method and device based on matrix product state |
CN114330730A (en) * | 2021-12-25 | 2022-04-12 | 北京量子信息科学研究院 | Quantum line block compiling method, device, equipment, storage medium and product |
CN114529003A (en) * | 2022-01-29 | 2022-05-24 | 西安电子科技大学 | Dividing method for multi-quantum bit quantum Fourier transform line |
CN114399053A (en) * | 2022-02-01 | 2022-04-26 | 上海图灵智算量子科技有限公司 | Quantum discrimination circuit and model for progressive training |
CN114548414A (en) * | 2022-02-22 | 2022-05-27 | 合肥本源量子计算科技有限责任公司 | Method, device, storage medium and compiling system for compiling quantum circuit |
CN114416105A (en) * | 2022-03-30 | 2022-04-29 | 北京中科弧光量子软件技术有限公司 | Quantum operation compiling method and system, storage medium and electronic equipment |
CN114897174A (en) * | 2022-05-19 | 2022-08-12 | 北京大学 | Hybrid calculation method and device based on tensor network and quantum line |
Non-Patent Citations (3)
Title |
---|
MARCO LAZZARIN 等: "Multi-class quantum classifiers with tensor network circuits for quantum phase" * |
喻志超 等: "量子计算模拟及优化方法综述" * |
张静 等: "张量网络与神经网络在物理学中的应用和交融" * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115860128A (en) * | 2022-12-21 | 2023-03-28 | 北京百度网讯科技有限公司 | Quantum circuit operation method and device and electronic equipment |
CN115860128B (en) * | 2022-12-21 | 2023-08-15 | 北京百度网讯科技有限公司 | Quantum circuit operation method and device and electronic equipment |
CN117408346A (en) * | 2023-10-25 | 2024-01-16 | 北京中科弧光量子软件技术有限公司 | Quantum circuit determining method and device and computing equipment |
CN117408346B (en) * | 2023-10-25 | 2024-06-11 | 北京中科弧光量子软件技术有限公司 | Quantum circuit determining method and device and computing equipment |
Also Published As
Publication number | Publication date |
---|---|
CN115358407B (en) | 2023-04-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115358407B (en) | Approximate quantum compiling method and system based on tensor network and electronic equipment | |
JP7186797B2 (en) | Method and system for quantum computing | |
Das et al. | A group incremental feature selection for classification using rough set theory based genetic algorithm | |
JP2018195314A (en) | Domain specific language for generation of recurrent neural network architectures | |
US20190251213A1 (en) | Generating samples of outcomes from a quantum simulator | |
CN111914378B (en) | Single-amplitude quantum computing simulation method and device | |
CN114416105B (en) | Quantum operation compiling method and system, storage medium and electronic equipment | |
CN111915011B (en) | Single-amplitude quantum computing simulation method | |
CN112764738A (en) | Code automatic generation method and system based on multi-view program characteristics | |
Rivero et al. | Dome: a deterministic technique for equation development and symbolic regression | |
Korobkin et al. | Synthesis of the physical principle of operation of engineering systems in the software environment CPN TOOLS | |
CN111931939B (en) | Single-amplitude quantum computing simulation method | |
KR102153161B1 (en) | Method and system for learning structure of probabilistic graphical model for ordinal data | |
CN113128015B (en) | Method and system for predicting resources required by single-amplitude analog quantum computation | |
CN113609806A (en) | Quantum line program universal conversion method combined with subgraph isomorphism | |
Mulderij et al. | A polynomial size model with implicit swap gate counting for exact qubit reordering | |
JP2017111749A (en) | Calculation code generation device, method and program | |
WO2004068342A1 (en) | Software development preprocessing method, software control method, software development method, and software development device | |
Gushanskiy et al. | Development of a scheme of a hardware accelerator of quantum computing for correction quantum types of errors | |
Jin | A note on “An exact algorithm for the blocks relocation problem with new lower bounds” | |
WO2024116608A1 (en) | Computer system and information processing method | |
Kholod et al. | Decomposition of data mining algorithms into unified functional blocks | |
Steinbach et al. | Boolean Differential Equations-a Common Model for Classes, Lattices, and Arbitrary Sets of Boolean Functions | |
CN113284256B (en) | MR (magnetic resonance) mixed reality three-dimensional scene material library generation method and system | |
Duy et al. | VulnSense: Efficient Vulnerability Detection in Ethereum Smart Contracts by Multimodal Learning with Graph Neural Network and Language Model |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |