Quantum computing gate circuit expression and compression method and medium

Through the three-part expression of operation code, bit code and parameter code, the quantum gate circuit is converted into binary or hexadecimal, which solves the problem of low efficiency in transmitting quantum computing language between different terminals and achieves the unification of data compression and readability.

CN120781995APending Publication Date: 2025-10-14HEFEI NATIONAL LABORATORY +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510943371.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2025-10-14

AI Technical Summary

Technical Problem

When existing quantum computing languages ​​are transmitted between different terminals, the code files are large in size, affecting the transmission efficiency. In addition, the expression forms of different underlying quantum languages ​​vary greatly, making code conversion difficult.

Method used

Using a three-part expression of operation code, bit code and parameter code, the quantum gate circuit is converted into binary or hexadecimal form, the quantum language is unified, and the interaction between the quantum computing cloud platform and the terminal quantum computer is realized.

Benefits of technology

It significantly reduces the storage space requirements of quantum circuits while maintaining readability, solves the problem of low code transmission efficiency, and unifies the expression forms of different quantum languages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120781995A_ABST
    Figure CN120781995A_ABST
Patent Text Reader

Abstract

The invention discloses a quantum computing gate circuit expression and compression method and a medium, and relates to the technical field of quantum computing, and the method comprises the steps: setting a conversion expression character between a user side and a quantum computing cloud platform, or setting the conversion expression character between the quantum computing cloud platform and a terminal quantum computer for unifying quantum languages; the conversion expression character is divided into three segments which are an operation code, a bit code and a parameter code in sequence, the operation code refers to quantum gate operation, the bit code refers to a quantum bit number, and the parameter code refers to a floating-point number related to the operation code; the core of the method is that the file volume is compressed and the quantum language is unified, so that the problem of transmission efficiency of existing codes among different terminals is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of quantum computing, and in particular to a quantum computing gate circuit expression and compression method and medium. BACKGROUND

[0002] The current classification of quantum computing languages mainly has two categories: one is a high-level quantum programming language, which is designed to be consistent with classical programming languages, making it easy for high-level users to directly operate without needing to understand the implementation details of quantum computing; the other is a low-level quantum programming language, which usually directly describes quantum gate circuits and has high readability, but requires users to understand the meaning of each quantum gate operation and the effect of its combination.

[0003] At the present stage, a high-level quantum programming language converts user-level program expressions into a low-level quantum programming language through its compiler. Subsequently, the low-level quantum programming language is sent to a quantum computer and further interpreted into waveforms and acquisition information required by specific quantum computing control devices to achieve specific control and execution.

[0004] Therefore, the main interaction between the user end and the quantum computer end is the code of this low-level quantum programming language, which includes the interaction between the user and the quantum computing cloud platform, and the interaction between the quantum computing cloud platform and the terminal quantum computer.

[0005] However, these programs are all transmitted in the form of clear ASCII characters, and when a quantum circuit uses a large number of bits or has a complex or deep circuit, the code file is large in size, which seriously affects the transmission efficiency of the code between different terminals.

[0006] At the same time, different low-level quantum languages, although semantically the same, have great differences in expression form / definition, and if they can be unified, it will also be beneficial to the universality of the circuit. SUMMARY

[0007] Based on the technical problems existing in the background art, the present application proposes a quantum computing gate circuit expression and compression method and medium.

[0008] The quantum computing gate circuit expression and compression method proposed by the present application sets a conversion expression character between the user end and the quantum computing cloud platform, which is used to unify the quantum language; The conversion expression character is divided into three segments, namely operation code, bit code and parameter code in sequence, the operation code refers to quantum gate operation, the bit code refers to quantum bit number, and the parameter code refers to a floating-point number associated with the operation code.

[0009] Further, the operation code, bit code and parameter code are binary or hexadecimal respectively.

[0010] Further, the definition form of the operation code is as follows: All 0s are reset gates, and all 1s are measurement gates. 00XX_XXXX is a single-bit gate without parameters, and X is 0 or 1. 01XX_XXXX and 10XX_XXXX are single-bit gates with parameters, and X is 0 or 1. 11XX_XXXX is a double-bit gate, and 11XX_XXXX is a gate other than all 1s.

[0011] Further, the bit code has the ability to describe at least two bits, and the numbering range of each bit supports more than ten thousand; The single-bit gate uses 2 bytes to represent the bit code, and the double-bit gate uses 4 bytes to represent the bit code.

[0012] Further, when the single-bit gate has no parameters, the storage space of the second bit code is reused with the operation code thereafter, or for a given length of expression, 0 is used to occupy the space.

[0013] Further, the entire encoding of the parameter code is a variable-length instruction or a fixed-length instruction.

[0014] Further, when the entire encoding of the parameter code is a fixed-length instruction, the conversion expression character is 72 bits, that is, the operation code is 8 bits, the bit code is 32 bits, and the parameter code is 32 bits.

[0015] Further, when the entire encoding of the parameter code is a variable-length instruction, the conversion expression character is at least 24 bits, that is, the operation code is 8 bits, and the bit code is 16 bits.

[0016] A quantum computing gate circuit expression and compression method, comprising: A conversion expression character is arranged between a quantum computing cloud platform and a terminal quantum computer, for unifying quantum languages; The conversion expression character is divided into three segments, in order, an operation code, a bit code, and a parameter code, the operation code refers to a quantum gate operation, the bit code refers to a quantum bit number, and the parameter code refers to a floating-point number associated with the operation code.

[0017] A computer readable storage medium, the computer readable storage medium has a plurality of classification programs stored thereon, the plurality of classification programs are used to be called by a processor and execute the quantum computing gate circuit expression and compression method as described above, Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware, the foregoing program can be stored in a computer readable storage medium, and the program performs the steps of the above-mentioned method embodiments when executed; and the foregoing storage medium includes ROM, RAM, a magnetic disc or an optical disc and various storage medium capable of storing program codes.

[0018] The quantum computing gate circuit expression and compression method and medium provided by the application have the advantages that a novel quantum circuit expression mode is provided, the total amount of data of the circuit expression can be compressed, and the circuit expression still has readability. The quantum circuit can be freed from the problem of non-uniform language expression styles and code conversion and rewriting when the quantum circuit is expressed in a character form. The ASCII character expression of the underlying quantum gate circuit is converted into a binary or hexadecimal expression form, the demand for quantum circuit storage space can be greatly reduced, and the meaning of the gate circuit can still be quickly determined according to the definition of the data structure when the binary expression quantum circuit is read / analyzed. That is, the data volume can be greatly reduced / compressed, and the readability is maintained. BRIEF DESCRIPTION OF DRAWINGS

[0019] Figure 1 Flowchart for interaction between a user terminal and a quantum computing cloud platform; Figure 2 Flowchart for interaction between a quantum computing cloud platform and a terminal quantum computer. DETAILED DESCRIPTION

[0020] Hereinafter, the technical solutions of the application will be described in detail through specific embodiments. In the following description, many specific details are set forth in order to provide a thorough understanding of the application. However, the application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without departing from the scope of the application. Therefore, the application is not limited to the specific implementations disclosed below.

[0021] At present, the quantum gate circuit of the quantum computing programming language is expressed by using the underlying gate operation, and is generally as follows (the contents of the following two codes are the same, and only different quantum language definitions provided by different providers are used): Bell state preparation represented by a domestic QCIS language: H Q0; H Q6; CZ Q0 Q6; H Q6; Z Q0; M Q0; M Q6; The above circuit is expressed by using an OpenQasm language abroad: h q[0]; h q[6]; cz q[0],q[6]; h q[6]; z q[0]; measure q[0] ->c[0]; measure q[6] ->c[1]; From the above examples, it can be seen that the quantum circuit is generally divided into two types of operation circuit (H Q0, H Q6, CZ Q0 Q6, H Q6, Z Q0, h q[0], h q[6], cz q[0], q[6], h q[6], z q[0]) and measurement circuit (M Q0, M Q6, measure q[0]->c[0], measure q[6]->c[1]).

[0022] In summary, each action circuit is represented as: Operation code+bit code+parameter code; Among them, the operation code mainly refers to the gate operation, such as X, Y, Z, RX, RXY, M and a series of operations, and the keywords of different quantum languages are different, forming a multi-language inconsistency.

[0023] The bit code is the quantum bit number, and the expression forms of different quantum languages are different, such as Q0 representing the 0th bit in the qcis language, but OpenQasm uses the form q[0] to express the same meaning. At present, the bit scale of quantum computing is about 100, but considering scalability and future error correction, the maximum bit scale needs to support to ten thousand bits.

[0024] The parameter code generally has certain relevance with the operation code, such as only single-bit gates have the need to pass parameters, and double-bit gate operations have no parameter passing needs. This part of the parameter is a floating point number in the present expression.

[0025] Therefore, the embodiment sets a conversion expression character between the user end and the quantum computing cloud platform and between the quantum computing cloud platform and the terminal quantum computer, which is used to unify the quantum language, so as to realize quantum interaction between the user end and the quantum computing cloud platform and between the quantum computing cloud platform and the terminal quantum computer.

[0026] Therefore, as shown in Figure 1 The quantum computing gate circuit expression and compression method provided by the present application comprises: A conversion expression character is set between the user end and the quantum computing cloud platform, which is used to unify the quantum language; The conversion expression character is divided into three segments in sequence, namely, an operation code, a bit code and a parameter code, the operation code refers to gate operations of different quantum languages, the bit code refers to quantum bit numbers, and the parameter code refers to floating-point numbers associated with the operation code.

[0027] Meanwhile, as shown in Figure 2 a quantum computing gate circuit expression and compression method is also proposed, comprising: A conversion expression character is arranged between the quantum computing cloud platform and the terminal quantum computer, for unifying quantum languages; The conversion expression character is divided into three segments in sequence, namely, an operation code, a bit code and a parameter code, the operation code refers to gate operations of different quantum languages, the bit code refers to quantum bit numbers, and the parameter code refers to floating-point numbers associated with the operation code.

[0028] The embodiment aims to construct an expression form of a quantum circuit, converts ASCII character representation of a bottom quantum gate circuit into a binary or hexadecimal expression form, can greatly reduce the storage space requirement of the quantum circuit, and when reading / analyzing the binary expression quantum circuit, the meaning of the gate circuit can still be quickly identified according to the definition of the data structure. That is, the data volume can be greatly reduced / compressed, and the readability is maintained.

[0029] The core of the embodiment is that the file volume is compressed and the quantum languages are unified, thereby solving the transmission efficiency problem of the existing code between different terminals; the operation code, the bit code and the parameter code adopt binary / hexadecimal as an intermediate expression (conversion tool). The embodiment does not actually limit several binary, as long as the above-mentioned quantum computing gate circuit expression and compression method can be implemented.

[0030] In one of the embodiments, the following operation codes are described in binary, and hexadecimal mechanism or other binary can be directly converted with binary, and the operation code is specifically as follows: The operation code is 1 byte, binary, 8 bits. If no special distinction is made, 256 operation codes can be expressed, which is enough for the requirement. However, actually, so many operation codes are not needed, and the embodiment can be segmented according to the situation, and the definition form of the operation code is as follows: All 0 (0000_0000) is a reset gate, and all 1 (1111_1111) is a measurement gate; 00XX_XXXX (64) is a single-bit gate without parameters, and the value of X is 0 or 1; 01XX_XXXX and 10XX_XXXX are single-bit gates with parameters, and the value of X is 0 or 1; 11XX_XXXX is a double-bit gate, wherein 11XX_XXXX is a gate other than all 1, and the value of X is 0 or 1.

[0031] The embodiment is based on practice, and currently sets the opcode form of single-bit gate and double-bit gate, because more bit gates are generally converted into single-bit gate and double-bit gate combination when expressed in bottom language. If there is a higher bit gate, the total length of the bit code is not easy to control, but the embodiment does not exclude the application of 3-bit gate or even more bit gate. The 3-bit gate or even more bit gate can be specifically defined by referring to the opcode form defined by the single-bit gate and double-bit gate. The extended form is that the opcode specifies a segment, and then the bit code is 3, such as ccx q1 q2 q3. The embodiment will not be repeated here.

[0032] In one embodiment, the following bit code is described in binary, and hexadecimal or other binary can be directly converted into binary. The bit code is as follows: The bit code needs to have the ability to describe at least two bits, and the numbering range of each bit should support more than ten thousand, so 2 bytes, i.e. 16 bits in binary, are used to describe a bit code. 2^16=65535 bits. Single-bit gate uses 2 bytes to represent bit code, double-bit gate uses 4 bytes to represent bit code, which is used to cover the above-mentioned demand of ten thousand, i.e. two bits use 4 bytes to describe bit code, but actually, whether the second bit code is needed depends on whether it is a double-bit gate, and when the single-bit gate has no parameters, the storage space of the second bit code can be multiplexed with the opcode behind it, or for fixed-length expression, 0 is used to occupy the space. When multiplexing, whether it is a bit code can be directly and quickly judged by whether the definition of the opcode is reasonable (whether it is a double-bit gate).

[0033] In one embodiment, the following parameter code is described in binary, and hexadecimal or other binary can be directly converted into binary. The parameter code is as follows: According to the parameter characteristics of quantum computing, the parameter is generally an angle / radian. The embodiment uses a floating-point number to represent it. Within the range of accuracy requirements, float type can be used, which requires 4 bytes. Double type requires 8 bytes.

[0034] The entire encoding of the parameter code in the embodiment is variable-length instruction or fixed-length instruction. Using variable-length instruction can save more data space and be more flexible, but the instruction parsing is slightly more complex. For example, the data compression rate from ASCII string to binary expression can be accepted, or fixed-length instruction can be directly used. Although the flexibility of the instruction and the maximum compression ratio are sacrificed, the reading and parsing process is much more convenient.

[0035] For example, when fixed-length instruction is taken, the conversion expression character is 72 bits, i.e. 8 bits of opcode, 32 bits of bit code, and 32 bits of parameter, a total of 9 bytes.

[0036] When describing the use of variable-length instructions, the shortest conversion expression character is 24 bits, i.e. 8 bits of operation code, 16 bits of bit code, a total of 3 bytes.

[0037] And the corresponding ASCII character, the following qcis as an example: Parameter code instruction: 1-4 characters, i.e. 1-4 bytes; Bit code bit: 1 bit, generally Q0-Q65534, then 2-6 bytes.

[0038] Parameter: generally between ±π, so there is a sign 1 byte, integer 1 byte, decimal point 1 byte, and the decimal part considers the effective bits, generally 4-8 bytes; Space between instructions: 1 byte; Then according to the ASCII character, the shortest is 1 byte of instruction, 1 byte of space, 2 bytes of bit, i.e. 4 bytes. The longest is 4 bytes of instruction, 1 byte of space, 6 bytes of bit, 1 byte of space, 1+1+1+8 of parameter, i.e. 23 bytes. All take the average state, 2 bytes of instruction, 1 byte of space, 4 bytes of bit, 1 byte of space, 1+1+1+8 of parameter, i.e. 19 bytes. The compression ratio can reach 2.55 times at most.

[0039] Thus, the embodiment provides a new quantum circuit expression method, which can realize data total amount compression of circuit expression and still has readability. The quantum circuit can be made to get rid of the problem of different language expression styles not being unified and code conversion rewriting when expressed in character form.

[0040] The above describes only the preferred specific embodiments of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can make equivalent replacement or change according to the technical solution and inventive concept of the present application within the technical range disclosed by the present application, which should be covered within the protection scope of the present application.

Claims

1. A quantum computing gate circuit expression and compression method, characterized in that: include: Set up conversion expression characters between the user end and the quantum computing cloud platform to unify the quantum language; The conversion expression characters are divided into three sections, namely operation code, bit code and parameter code. The operation code refers to the quantum gate operation, the bit code refers to the quantum bit number, and the parameter code refers to the floating point number associated with the operation code.

2. The quantum computing gate circuit expression and compression method according to claim 1, characterized in that: The operation code, bit code and parameter code are respectively in binary or hexadecimal.

3. The quantum computing gate circuit expression and compression method according to claim 1, characterized in that: The definition of the operation code is as follows: All 0s are reset gates, and all 1s are measurement gates; 00XX_XXXX is a single-bit gate with no parameters, where the value of X is 0 or 1; 01XX_XXXX and 10XX_XXXX are parameterized single-bit gates, where the value of X is 0 or 1; 11XX_XXXX is a two-bit gate, where 11XX_XXXX is a gate that is not all 1s.

4. The quantum computing gate circuit expression and compression method according to claim 1, characterized in that: The bit code has the ability to describe at least two bits, and the number range of each bit supports more than ten thousand; A single-bit gate uses 2 bytes to represent the bit code, and a double-bit gate uses 4 bytes to represent the bit code.

5. The quantum computing gate circuit expression and compression method according to claim 4, characterized in that: When the single-bit gate has no parameters, the storage space of the second bit code is reused with the subsequent operation code, or for an expression of a given length, 0 is used to occupy the space.

6. The quantum computing gate circuit expression and compression method according to claim 1, characterized in that: The entire encoding of the parameter code is a variable-length instruction or a fixed-length instruction.

7. The quantum computing gate circuit expression and compression method according to claim 6, characterized in that: When the entire encoding of the parameter code is a fixed-length instruction, the conversion expression character is 72 bits, that is, the operation code is 8 bits, the bit code is 32 bits, and the parameter code is 32 bits.

8. The method for expressing and compressing quantum computing gate circuits according to claim 6, wherein: When the entire encoding of the parameter code is a variable-length instruction, the shortest conversion expression character is 24 bits, that is, the operation code is 8 bits and the bit code is 16 bits.

9. A quantum computing gate circuit expression and compression method, characterized in that: include: Set up conversion expression characters between the quantum computing cloud platform and the terminal quantum computer to unify the quantum language; The conversion expression characters are divided into three sections, namely operation code, bit code and parameter code. The operation code refers to the quantum gate operation, the bit code refers to the quantum bit number, and the parameter code refers to the floating point number associated with the operation code.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a plurality of classification programs, which are used to be called by a processor and execute the quantum computing gate circuit expression and compression method according to any one of claims 1 or 9.

Citation Information

Cited By

  • Distribution network area optical storage and charging control method and system based on routing optimization

    CN122136935A