Method for bit number compression in variational quantum circuits and related apparatus

By mapping possible results to binary representations in quantum computing, the number of qubits in variable quantum circuits is compressed, solving the problem of the limitation on the number of qubits, simplifying the construction of quantum circuits, and reducing hardware requirements and noise impact.

CN123140286APending Publication Date: 2026-11-20ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511208836.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-27
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

In quantum computing, the limitation on the number of qubits is a bottleneck for the performance and application scope of algorithms in noisy intermediate-scale quantum devices. Traditional constrained quantum circuit design leads to a significant increase in circuit complexity and hardware resource requirements. Therefore, reducing quantum computing resources has become crucial.

Method used

By mapping possible outcomes to binary representations, the number of qubits and the number of penalty terms or constraints embedded in the associated quantum gates in the variable quantum circuit are reduced. When constructing the variable quantum circuit, only a first number of qubits are used, satisfying that the first power of 2 is greater than the total number of possible outcomes.

Benefits of technology

It reduces the complexity of variable quantum circuits, simplifies the construction of quantum circuits, reduces hardware requirements, and improves computational efficiency on noisy intermediate-scale quantum devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123140286A_ABST
    Figure CN123140286A_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a bit number compression method in a variational quantum circuit and a related device, relates to the technical field of quantum circuit optimization, and determines the total number of possible results meeting a constraint condition according to the constraint condition, and determines a first number according to the total number, where the first power of 2 is not less than the total number, and a binary of the first number of bits is used to one-to-one represent each possible result. In this way, the variational quantum circuit can be constructed by using the first number of quantum bits. It can be seen that this method only needs the first number of quantum bits to construct the quantum circuit, and does not need to construct the quantum circuit by using the number of quantum bits corresponding to the total number of features as in the related art. In other words, this method compresses the number of quantum bits, thereby facilitating the construction of a simpler constraint quantum circuit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of quantum circuit optimization technology, and in particular to a method and apparatus for qubit compression in variable quantum circuits. Background Technology

[0002] Quantum computing is a computational paradigm that utilizes the principles of quantum mechanics for information processing. Unlike traditional binary computing, quantum computing uses qubits as the basic computational unit. A qubit can simultaneously represent both 0 and 1 states, thus enabling parallel computing and exponential information processing capabilities. Quantum computing has demonstrated the potential to surpass classical computing in solving specific problems, such as large integer factorization, search algorithms, and simulating quantum systems.

[0003] In the field of quantum computing, especially in recent Noisy Intermediate Scale Quantum (NISQ) devices, the limitation on the number of qubits is a key bottleneck restricting algorithm performance and application scope. This is because qubits possess coherence, and traditional constrained quantum circuit design leads to a significant increase in circuit complexity and hardware resource requirements. Therefore, constrained quantum circuits typically require more quantum computing resources and higher fidelity gate sequences; thus, reducing the quantum computing resources required for constrained quantum circuits is of great significance. Summary of the Invention

[0004] This application provides a method and related apparatus for compressing the number of qubits in a variable quantum circuit. By mapping possible results to binary representations, it not only reduces the number of qubits required to construct a circuit for handling combinatorial optimization problems, but also reduces the number of quantum gates related to penalty terms or constraint embeddings in the variable quantum circuit. This helps to reduce the complexity of the variable quantum circuit, enabling the constructed variable quantum circuit to be better implemented at the chip level.

[0005] The first aspect of this application provides a bit number compression method in a variable quantum line, comprising: determining the total number of possible results that satisfy the above constraints according to the constraints;

[0006] Based on the total number mentioned above, a first number is determined, wherein 2 raised to the first number is not less than the total number mentioned above, and the binary representation of the first number is used to represent each possible result one by one.

[0007] A variable quantum circuit is constructed based on the aforementioned first number of qubits; wherein the optimization result of the aforementioned variable quantum circuit is used to indicate the target result selected from the possible results.

[0008] Optionally, determining the first number based on the total number mentioned above includes:

[0009] In the case where the total number is M, the first number is determined to be...

[0010] Optionally, the above-mentioned construction of a variable quantum circuit based on the first number of qubits includes:

[0011] An initial quantum circuit is constructed based on the aforementioned first number of qubits, wherein the initial quantum circuit includes parameterized quantum gates.

[0012] The parameters of the above parameterized quantum gate are updated using the gradient descent method to obtain the above variable quantum circuit;

[0013] In this context, the generator state of the aforementioned variable quantum circuit covers the binary representation of the first number of bits corresponding to each possible result.

[0014] Optionally, the above parameterized quantum gates include a parameterized single quantum gate acting on each quantum bit and a two-qubit gate acting on two quantum bits;

[0015] The timing of the above-mentioned parameterized single quantum gate precedes that of the above-mentioned two-qubit gate.

[0016] Optionally, the above method further includes:

[0017] Based on the mapping relationship information and the optimization results obtained after the above variable quantum circuit operates on the first number of qubits, the target result is selected from the possible results;

[0018] The aforementioned mapping information is used to indicate the mapping relationship between the binary representation of the first number of bits and the possible results.

[0019] Optionally, the above mapping information can be generated in the following way:

[0020] Determine the original string corresponding to the possible results, wherein the original string consists of characters of 0 and 1, one character corresponds to one element, and the character 1 indicates that an element is selected;

[0021] Determine the integer rank corresponding to each original string, and represent each integer rank using the first number of binary bits;

[0022] Based on the aforementioned integer rank, the binary representation of each first number of digits is mapped to the original string, and the mapping relationship information is obtained based on the mapping results of each first number of digits to the original string.

[0023] Optionally, when the bit number compression method in the above-mentioned variable quantum circuit is applied to an image recognition scenario, the above-mentioned elements include image feature data;

[0024] When the bit number compression method in the above-mentioned variable quantum circuit is applied to an object selection scenario, the above elements include any of the following:

[0025] Path feature information, device feature information.

[0026] A second aspect of this application provides a bit number compression device in a variable quantum line, comprising: a first determining unit, configured to determine the total number of possible results satisfying the constraints based on constraints.

[0027] The second determining unit is used to determine the first number based on the total number mentioned above, wherein the first number of 2 raised to the power of the first number is not less than the total number mentioned above, and the binary representation of the first number is used to represent each possible result one by one.

[0028] A construction unit is used to construct a variable quantum circuit based on the first number of qubits mentioned above; wherein the optimization result of the variable quantum circuit is used to indicate the target result selected from the possible results.

[0029] A third aspect of this application provides an electronic device, including: a processor and a memory;

[0030] The processor is connected to a memory, wherein the memory is used to store computer programs and the processor is used to invoke the computer programs to execute the methods as described in the first aspect of the embodiments of this application.

[0031] A fourth aspect of this application provides a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, perform the method as described in the first aspect of this application.

[0032] This application provides a method and related apparatus for compressing the number of qubits in a variable quantum circuit. Based on constraints, the total number of possible outcomes satisfying the constraints is determined, and a first number is determined based on this total number. The first power of 2 is not less than the total number. The binary representation of this first number of qubits is used to represent each possible outcome. Thus, a variable quantum circuit can be constructed using this first number of qubits. It is evident that this method only requires the first number of qubits to construct the quantum circuit, unlike related technologies which require a number of qubits corresponding to the total number of features. This effectively compresses the number of qubits, thereby simplifying the construction of the constrained quantum circuit.

[0033] Furthermore, since the binary representation formed by the first number of qubits corresponds one-to-one with each possible outcome, most of the binary representations formed by the first number of qubits can be mapped one-to-one with the possible outcomes. This significantly reduces the number of penalty terms or constraint embeddings required for the circuit, thereby simplifying the constructed variable quantum circuit. Through this one-to-one mapping, the target outcome can be determined from the possible outcomes based on the optimization results of the constructed variable quantum circuit, thus solving the combinatorial optimization problem. Attached Figure Description

[0034] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0035] Figure 1 An example system block diagram of a bit number compression method in a variable quantum line according to an embodiment of this application is shown;

[0036] Figure 2 A schematic flowchart of a bit number compression method in a variable quantum line provided in one embodiment of this application is shown;

[0037] Figure 3 This illustration shows a schematic diagram of the bit number compression method in a variable quantum line according to an embodiment of this application.

[0038] Figure 4 This invention provides a schematic diagram of the structure of a bit number compression device in a variable quantum line according to an embodiment of the present application.

[0039] Figure 5 A schematic diagram of the structure of a computer device provided in one embodiment of this application is shown. Detailed Implementation

[0040] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0041] Classical computers use transistors to encode information in binary data, such as bits, where each bit can represent a value of 1 or 0. These 1s and 0s act as switches to drive the functions of a classical computer. If there are n bits of data, then there are 2... n Possible classical states, and represent one state at a time.

[0042] Quantum computers use quantum processors that operate on data represented by qubits, also known as quantum bits. A single qubit can represent the classical binary states "0" or "1", or a superposition of "0" and "1". Because it can represent a superposition of "0" and "1", a qubit can represent both "0" and "1" states simultaneously. For example, if there are n bits of data, then 2^n qubits can represent n bits of data. n A quantum state can be represented simultaneously. Furthermore, qubits in a superposition can be correlated with each other, a phenomenon known as entanglement, where the state of one qubit (whether 1, 0, or both) depends on the state of another qubit, and more information can be encoded within two entangled qubits. Based on the principles of superposition and entanglement, qubits enable quantum computers to perform functions that might be relatively complex and time-consuming for classical computers.

[0043] Please refer to Figure 1 This illustrates an example system block diagram of a bit-count compression method in variable quantum circuits provided in one embodiment of this application. System 100 may be a hybrid computing system comprising a combination of one or more quantum computers, quantum hardware systems, and / or classical computers. Figure 1 In the example shown, system 100 may include a quantum hardware system 110 and a classical computer 120. In one implementation, the quantum hardware system 110 and the classical computer 120 may be configured to communicate via one or more wired and / or wireless connections (e.g., wireless networks). The quantum hardware system 110 may include a quantum chipset consisting of one or more quantum chips, comprising various hardware components for processing data encoded in qubits. The quantum chipset may be a quantum computing core surrounded by infrastructure to protect the quantum chips from electromagnetic noise sources, mechanical vibration sources, heat sources, and other noise sources that can degrade the performance of the quantum chips. The classical computer 120 may be electronically integrated with the quantum hardware system 110 via any suitable wired and / or wireless electronic connection.

[0044] exist Figure 1 In the example shown, the quantum hardware system 110 can be any suitable set of components capable of performing quantum operations on a physical system. Quantum operations, such as quantum gate operations, manipulate the quantum states of qubits to evolve and / or become entangled. Figure 1In the illustrated example embodiment, the quantum hardware system 110 may include a measurement and control unit 111, an interface 112, and a quantum chip 113. In some embodiments, all or part of each of the measurement and control unit 111, interface 112, and quantum chip 113 may be located in a cryogenic environment to facilitate the performance of quantum operations. The quantum chip 113 may be any hardware capable of processing information using quantum states. This hardware may include multiple qubits and means for coupling or entanglement of the qubits to process information using quantum states. Qubits may include, but are not limited to, charge qubits, flux qubits, phase qubits, spin qubits, and ion qubits. The quantum chip may include a set of quantum logic gates configured to perform quantum logic operations on the qubits stored in a quantum register. The quantum gates may include one or more single-qubit gates, two-qubit gates, and / or other multi-qubit gates.

[0045] The measurement and control unit 111 can be any combination of digital computing devices capable of performing quantum computing (e.g., executing quantum circuits) in conjunction with interface 112. This digital computing device may include a digital processor and memory for storing and executing quantum instructions using interface 112. The digital computing device may also include a communication protocol device for receiving instructions and sending the results of the performed quantum computing to a classical computer. Additionally, the digital computing device may include a communication interface having interface 112. In one embodiment, the measurement and control unit 111 may be configured to receive classical instructions (e.g., from classical computer 120) and convert these classical instructions into measurement and control instructions for interface 112. The measurement and control instructions provided by the measurement and control unit 111 to interface 112 may be, for example, digital signals indicating which quantum gates in a quantum gate array need to be applied to the qubits to perform a specific function. Interface 112 may be configured to convert these digital signals into analog signals (e.g., analog pulses of microwave pulses), which can be used to apply quantum gates to the qubits to manipulate the interactions between the qubits.

[0046] Interface 112 may be a classical-quantum interface, comprising a combination of devices capable of receiving instructions from the integrated measurement and control unit 111 and converting those instructions into a means for implementing quantum operations. In one embodiment, interface 112 may convert instructions from the integrated measurement and control unit 111 into drive signals capable of driving or manipulating qubits, and / or applying quantum gates to qubits. Additionally, interface 112 may be configured to convert signals received from the quantum chip 113 into digital signals capable of being processed and transmitted by the integrated measurement and control unit 111. Devices included in interface 112 may include, but are not limited to, digital-to-analog converters, analog-to-digital converters, waveform generators, attenuators, amplifiers, optical fibers, lasers, and filters. Interface 112 may further include circuitry configured to measure multiple qubits after a quantum gate is applied, wherein the measurement may produce results represented in classical bits. Each measurement performed by interface 112 may be read out to a device connected to the quantum hardware system 110, such as a classical computer 120. The multiple measurement results provided by interface 112 may represent probabilistic results.

[0047] The classical computer 120 can include hardware components such as a processor and storage devices (e.g., including memory devices and classical registers) for processing data encoded in classical bits. In one embodiment, the classical computer 120 can be configured to provide the quantum hardware system 110 with various control signals, instructions, and data encoded in classical bits. Further, quantum states measured by the quantum hardware system 110 can be read out by the classical computer 120, and the classical computer 120 can store the measured quantum states as classical bits in classical registers. In one embodiment, the classical computer 120 can be any suitable combination of computer-executable hardware and / or computer-executable software capable of executing the preparation module 121 to perform quantum computation using data stored in the data storage module 122 as part of the construction and computation. The data storage module 122 can be a repository for data to be analyzed using quantum computing algorithms and the results of that analysis. The preparation module 121 can be a program or module capable of preparing classical data from the data storage module 122 as part of a quantum circuit implementation. Preparation module 121 can be instantiated as part of a larger algorithm, such as an application programming interface (API) function call, or by resolving hybrid classical-quantum computing into aspects of quantum and classical computing. For example, preparation module 121 can generate instructions for creating quantum circuits using quantum gates. In an embodiment, such instructions can be stored by the measurement and control unit 111 and can be instantiated by components of interface 112 to execute, enabling quantum operations of quantum gates to be performed on quantum chip 113.

[0048] The classic computer 120 may be a laptop computer, desktop computer, vehicle-integrated computer, smart mobile device, tablet device, and / or any other suitable classic computing device. Additionally or alternatively, the classic computer 120 may also operate as part of a cloud computing service model, such as Software as a Service (SaaS), Platform as a Service (PaaS), or Infrastructure as a Service (IaaS). The classic computer 120 may also reside in a cloud computing deployment model, such as a private cloud, community cloud, public cloud, or hybrid cloud.

[0049] To better understand the ideas behind this disclosure, the scenario of this disclosure can be described again in conjunction with the background technology described above.

[0050] This disclosure primarily addresses constrained problems, such as optimizing delivery routes in the logistics and supply chain field, for example, selecting p regional distribution centers from m warehouses (m > p) to cover all demand points and minimize transportation costs. In equipment scheduling scenarios, it addresses selecting Q units from L units for a particular batch of production (L > Q) to ensure maximum production efficiency while meeting process requirements. In energy resource scheduling scenarios, it addresses selecting K power plants (N > K) from N renewable energy power plants (photovoltaic, wind power, etc.) to connect to the grid, maximizing power supply stability while controlling line losses. In other words, resource scheduling scenarios may involve numerous constraints.

[0051] Furthermore, in some image recognition or person profiling scenarios, constraint problems may also be involved. For example, selecting a subset of features from high-dimensional images to represent the characteristics of the image, such as selecting some labels from multiple feature labels of a user to determine a user profile.

[0052] It is evident that when faced with a scenario where it is necessary to select a portion of the original data for object representation, constraints may arise.

[0053] Constraint problems (or combinatorial optimization problems, or selecting specific combinations to achieve the optimal effect) are often difficult to handle with classical computers. For example, selecting 5 feature labels from 20 feature labels to approximate a user's profile results in 15,504 possible combinations. As the number of features increases, the number of possible combinations becomes even greater. While classical computers can typically use heuristic algorithms to search the solution space, they struggle to find the global optimum efficiently in extremely large solution spaces and are prone to getting stuck in local optima or consuming excessive computation time.

[0054] In quantum computing, a qubit can simultaneously represent multiple solutions through a superposition state (e.g., a superposition state of n qubits can represent 2^n qubits). nUnlike classical states, quantum circuits can perform "parallel operations" on all possible solutions through unitary transformations. For example, a superposition of 5 qubits can simultaneously cover 32 states, and any one of these states can be obtained with a certain probability after measurement. This parallelism allows quantum computing to explore the characteristics of the entire solution space in a single circuit run, rather than enumerating solutions one by one, significantly improving search efficiency.

[0055] Meanwhile, quantum entanglement in quantum computing links the states of multiple qubits together, forming quantum states that transcend classical probability distributions. This helps quantum algorithms escape the trap of local optima. For example, the Variational Quantum Equation (VQE) generates quantum states covering the space of valid solutions by parameterizing quantum circuits. Combined with classical optimizers to adjust parameters, it can efficiently converge to the global optimum, making it particularly suitable for scenarios where "valid solutions are scattered" in constrained problems.

[0056] In related technologies, the same number of qubits as the dimension of the combinatorial optimization problem is typically used to represent all variables. For example, in a combinatorial optimization problem with 8 variables, traditional methods use 8 qubits, with each bit representing whether an option is selected (1 for selection, 0 for non-selection). To satisfy the constraint of "only two ones", additional quantum gate operations (such as penalty terms or constraint embeddings) need to be introduced into the quantum circuit to restrict illegal states (e.g., to avoid cases with 3 or 4 ones in the result, that is, to restrict cases with more than 2 ones such as "10101010" or "11100000", and to ensure that all states have only 2 ones, such as "00100010" or "01000010").

[0057] However, this approach may require a large number of qubits, leading to increased circuit depth, significantly increasing computational complexity and hardware requirements. Furthermore, the direct implementation of constraints increases the number of quantum gates, further exacerbating the noise effect, especially in noisy intermediate-scale quantum (NISQ) devices.

[0058] Based on this, this disclosure provides a method for compressing the number of qubits in variable quantum circuits. By mapping possible results to binary representations, only a first number of qubits are needed to construct the variable quantum circuit, and this first number only needs to satisfy 2 raised to the power of a first number being greater than the total number of possible results. This method not only reduces the number of qubits required to construct circuits for handling combinatorial optimization problems, but also reduces the number of quantum gates related to penalty terms or constraint embeddings in the variable quantum circuit. This helps to reduce the complexity of the variable quantum circuit, allowing the constructed variable quantum circuit to be better implemented at the chip level.

[0059] Please refer to Figure 2This illustration shows a flowchart of a bit number compression method in a variable quantum circuit according to an embodiment of this application. The method can be applied to computer devices, which refer to electronic devices with data computing and processing capabilities. The method may include the following steps:

[0060] Step 201: Determine the total number of possible outcomes that satisfy the constraints.

[0061] As an example, constraints can include number constraints, specific type constraints, etc. The total number of possible outcomes that satisfy the constraints can be understood as the possible outcomes that require each condition in the constraints to be satisfied.

[0062] For example, a constraint might include selecting 2 devices from 8 devices (this can be understood as a number constraint), in which case there are 28 possible selections. The total number can be understood as 28. If a specific type preset is added, and the number of devices selected from type A is not less than 0, the number of type A devices is 3; then there are only 18 possible results, and the total number of possible results can be 18.

[0063] Step 202: Determine the first number based on the total number.

[0064] Here, the first power of 2 is not less than the total number, and the binary representation of the first number is used to represent each possible result. For example, if the total number is M, the first number is N, and the first power of 2 is not less than the total number, it can be represented as 2. N >M.

[0065] As an example, determining the first number based on the total number yields better results when there are more possible totals. For instance, if there are 1000 possible totals (selecting a few from 30 elements based on constraints could result in 1000 different choices), then the first number only needs to be greater than 10, because 2... 10 =1024, which is already greater than the total number. The related technology that maps bits to elements one-to-one requires 30 qubits.

[0066] In other words, the first power of 2 only needs to be greater than the total number for the first number of bits to represent each possible result in binary.

[0067] In some implementations, when there are M possible outcomes, the first number can be... In this way, the first number of binary bits can not only represent each possible result in a one-to-one correspondence, but also make the first number small enough, which is more conducive to making the subsequently obtained constrained quantum circuits simpler.

[0068] For example, if two devices are selected from eight devices to operate, there are 28 possible outcomes, and the first number can be five. Since five qubits have 32 possible binary representations, each of the 28 possible outcomes can be uniquely represented in the binary representation of the five qubits.

[0069] In other words, each first number of binary bits can correspond to a unique possible result, and the first number is determined by the total number (the total number of possible results). This helps to reduce the number of qubits required, avoids too many unnecessary quantum states, and can encode too many penalty terms or constraint embeddings into the related quantum gates in the constructed variable quantum circuit.

[0070] Step 203: Construct a variable quantum circuit based on the first number of qubits.

[0071] Here, the optimization results of the variable quantum circuit can be used to indicate the target result selected from all possible results.

[0072] As an example, the optimization result of a variable quantum circuit can be understood as performing multiple measurements on the variable quantum circuit, while the quantum state with the highest occurrence number (or frequency of occurrence) can be understood as the optimization result.

[0073] As an example, since the optimization result can be represented by a first number of binary bits, and the first number of binary bits corresponds one-to-one with the possible results, the target result can be selected from the possible results based on the optimization result. The target result can also be understood as the solution to the combinatorial optimization problem, or as the optimal combination in the combinatorial optimization problem.

[0074] As an example, by determining the possible outcomes and their corresponding binary representations before constructing the variable quantum circuit, it is not necessary to embed constraint detection gates in the quantum circuit. This results in a variable quantum circuit with fewer logic gates and fewer bits, making it easier to implement on a quantum chip.

[0075] In related technologies, n qubits are used to directly represent n variables (e.g., 8 bits represent 8 elements), and their state space contains all 2^n qubits. n There are 256 possible states, but only a few are valid (e.g., 28 combinations for selecting 2 elements). Quantum circuits explore all states (including invalid ones), requiring additional mechanisms (e.g., constraint gates) for filtering. The method disclosed here, when selecting 2 elements from 8 elements, has 28 combinations, requiring 5 bits... 5=32, which can cover 28 possible outcomes, leaving only 4 meaningless states. In this case, we can ignore or fill them to prevent them from interfering with the valid solutions.

[0076] As can be seen, in this disclosure, based on the constraints, the total number of possible outcomes satisfying the constraints is determined, and a first number is determined based on this total number. The first power of 2 is not less than the total number. The binary representation of this first number of bits is used to represent each possible outcome individually. Thus, a variable quantum circuit can be constructed using this first number of qubits. It is evident that this method only requires the first number of qubits to construct the quantum circuit, unlike related technologies which require a number of qubits corresponding to the total number of features. This effectively compresses the number of qubits, thereby simplifying the construction of the constrained quantum circuit.

[0077] Furthermore, since the binary representation formed by the first number of qubits corresponds one-to-one with each possible outcome, most of the binary representation formed by the first number of qubits can be one-to-one with the possible outcomes. This is equivalent to greatly reducing the penalty terms or constraint embedding required for the circuit, which can further simplify the constructed variable quantum circuit.

[0078] In some embodiments, step 202, determining the first number based on the total number, may specifically include:

[0079] Given a total number of M, determine the first number as...

[0080] As an example, this approach allows for a smaller initial number, which in turn makes the final variable quantum circuit simpler and easier to implement on a quantum chip.

[0081] In some embodiments, step 203, "constructing a variable quantum circuit based on a first number of qubits," may specifically include:

[0082] An initial quantum circuit is constructed based on a first number of qubits, wherein the initial quantum circuit includes a parameterized quantum gate. The parameters of the parameterized quantum gate are updated using the gradient descent method to obtain a variable quantum circuit.

[0083] In this context, the generator state of the variable quantum circuit covers the binary representation of the first number of bits corresponding to each possible result.

[0084] As an example, a parameterized quantum gate can consist of a single quantum gate with adjustable parameters (such as RY(θ), where θ can be understood as a parameter) and an entangled gate (such as CNOT), with an initial quantum circuit U(θ) (where θ is a parameter vector). The parameters can be updated more effectively using the gradient descent rule to obtain a variable quantum circuit, and the output state of the variable quantum circuit can cover the first number of bits of binary representation corresponding to each possible outcome.

[0085] In some implementations, parameterized quantum gates include parameterized single-qubit gates acting on each qubit and two-qubit gates acting on two qubits;

[0086] The timing of the parameterized single-qubit gate precedes that of the two-qubit gate.

[0087] As examples, parametric single-qubit gates can include, but are not limited to, parametric RY gates and parametric RX gates. Two-qubit gates include, but are not currently defined as, CNOT gates, CZ gates, iSWAP gates, etc.

[0088] As an example, parameterized quantum gates can include parametric RY gates that operate on each qubit and CNOT gates that operate on two qubits;

[0089] The parameterized RY gate operates before the CNOT gate.

[0090] As an example, a CNOT gate acting on two qubits can act on adjacent qubits and on qubits spaced apart. For instance, with four qubits, q1, q2, q3, and q4, there can be combinations of q1 and q2, q3 and q4, q1 and q3, and q2 and q4, each corresponding to a CNOT gate. This approach better achieves entanglement between quantum states, helping to better determine the final target outcome (which is one or more possible outcomes).

[0091] As an example, the parametric RY gate operates before the CNOT gate. This allows the RY gate to operate on each qubit beforehand, placing them in specific superposition states. These states can then serve as inputs to the CNOT gate, facilitating the generation of entangled states that meet the requirements. For instance, in solving combinatorial optimization problems, qubits need to be in specific combinations of superposition states to explore different solution spaces. The pre-control of individual qubits by the RY gate enables the CNOT gate to more effectively generate problem-related entangled states, improving the subsequent computation's ability to explore the solution space.

[0092] Meanwhile, in practical quantum computing, qubits are easily affected by environmental noise and decoherent. As a two-qubit gate, the CNOT gate is more susceptible to noise interference than the single-qubit RY gate. Executing the RY gate first allows for the preparation of a single-qubit state with relatively low noise, followed by the execution of the CNOT gate for entanglement. This sequence reduces the noise introduced by multi-qubit operations during single-qubit state preparation, thereby reducing overall circuit noise accumulation and improving quantum state fidelity.

[0093] In some embodiments, the above method may further include:

[0094] Based on the mapping relationship information and the optimization results obtained after the first number of qubits are processed by the variable quantum circuit, the target result is determined from the possible results.

[0095] Here, the mapping information is used to indicate the mapping relationship between the binary representation of the first number of bits and the possible results.

[0096] It should be understood that the optimization result here refers to the result determined by the observations obtained after a certain number of observations. For example, the result with the highest frequency of occurrence is determined as the optimization result. For instance, running a variable quantum circuit 1000 times and observing each time yields observation results, which can then be used to determine the optimization result. The observation results can indicate the probability of each state occurring, and the one with the highest probability or several states with relatively high probabilities can be taken as the optimization result.

[0097] It should be understood that since the mapping information can be used to indicate the mapping relationship between the binary representation of the first number of bits and the possible results, it is possible to determine the target result (the optimal combination) from the possible results based on the target binary representation corresponding to the optimization result and then using the mapping relationship.

[0098] In some embodiments, the above mapping relationship information can be generated in the following manner:

[0099] Determine the original string corresponding to the possible results. The original string consists of characters of 0 and 1, with one character corresponding to one element. The character 1 indicates that an element is selected.

[0100] Determine the integer rank corresponding to each original string, and represent each integer rank using the first number of binary bits;

[0101] Based on the integer rank, the binary representation of each first number of digits is mapped to the original string, and the mapping relationship information is obtained based on the mapping results of each first number of digits to the original string.

[0102] In some implementations, bit number compression methods in variable quantum circuits are applied to image recognition scenarios, where the elements include image feature data;

[0103] In variable quantum circuits, the bit number compression method is applied to an object selection scenario where the element includes any of the following:

[0104] Path feature information, device feature information.

[0105] As an example, image feature data can include data corresponding to different aspects of an image's features, such as grayscale data, color data, and texture data. By analyzing this data, it is determined which data combinations to use for image recognition or classification.

[0106] As an example, path feature information can include specific path time, number of traffic lights along the path, path length, and other information. By analyzing path feature information, it is possible to determine which paths to use as target paths.

[0107] As an example, equipment characteristic information can include equipment production quantity information, power information, cost qualification rate information, etc. By analyzing the equipment characteristic information, it can be determined which equipment combinations to use for this production plan.

[0108] In other words, an element can correspond to a character, and the selection of an element can be represented by the character 0 or 1, which helps to better achieve the mapping.

[0109] To facilitate understanding, the following example illustrates this: For instance, a constraint indicates selecting 2 elements from 5 elements. There are 10 possible results, so the first number can be 4. If the 5 elements are A, B, C, D, and E, and the possible results are represented by a string, for example, the string "11000" corresponds to elements A and B. The rank of the string "11000" can be 0, so the binary representation of the first number can be "0000". The specific mapping information can be as follows:

[0110]

[0111] As can be seen, by using the mapping relationship information, after determining the target result, it is possible to determine which specific elements were selected. For example, if the binary representation of the target result is "1000", it can be indicated that the target result indicates that elements C and E were selected.

[0112] To better understand the ideas behind this disclosure, the concept of this disclosure will be explained again below:

[0113] It is important to understand that in traditional quantum computing methods, the same number of qubits as the problem dimension is usually used to represent all variables. For example, in a problem with 8 variables, the traditional method uses 8 qubits, each representing whether an option is selected (1 for selection, 0 for non-selection). To satisfy the constraint of "only two ones", additional quantum gate operations (such as penalty terms or constraint embeddings) need to be introduced into the quantum circuit to restrict illegal states. This method has the following drawbacks: (1) The large number of qubits leads to an increase in circuit depth, significantly increasing computational complexity and hardware requirements; (2) The direct implementation of the constraint increases the number of quantum gates, further aggravating the noise effect, especially on noisy intermediate-scale quantum (NISQ) devices; (3) The number of variational parameters increases linearly with the number of qubits, resulting in slow convergence of the optimization process and making it difficult to scale to larger problems.

[0114] The concept behind this disclosed solution is to achieve bit compression through classical mapping and encoding methods, specifically including:

[0115] Classic mapping and encoding:

[0116] In classical computing techniques, a lexicographical mapping method is used to map all combinations of states that satisfy the constraints to a unique Rank value, which is then converted into a new binary number. For example, for 28 combinations, all possible cases are mapped to binary codes from 0 to 27 (using 5 bits, sufficient to cover 28 states). For example, state "11000000" can be mapped to binary "00000", state "10100000" can be mapped to "00001", and so on. This mapping table ensures that each valid 8-bit state (containing two 1s) corresponds one-to-one with a unique 5-bit code, and the mapping process is reversible.

[0117] The core concept can be understood as follows: A bit sequence of length n containing k "1"s is losslessly mapped to a unique, space-optimal integer rank, and the result can be recovered from this rank. These C(n,k) unique combinations are sorted lexicographically, and each combination is assigned a unique integer from 0 to C(n,k)-1; this integer is the rank of that combination. The encoding process calculates the rank of a given combination, and the decoding process constructs the corresponding combination from the given rank.

[0118] Encoding Algorithm (Sequence → Rank)

[0119] By iteratively processing the position of each "1", the algorithm accumulates the number of combinations that precede the current sequence lexicographically. Specifically, for each position of a "1", the algorithm calculates how many possible sub-combinations would result if this "1" were placed in any earlier (but unoccupied) position. The final rank is obtained by summing the counts of all these sub-combinations.

[0120] Decoding algorithm (rank → sequence)

[0121] Decoding algorithms are the inverse process of encoding; specifically, they can be understood as constructing a unique bit sequence from scratch based on a given rank. The principle is as follows: employing a greedy strategy of "rank consumption," the algorithm determines the position of each "1" one by one. Starting with the first "1," the algorithm tentatively checks each available position. At each position, it calculates how many rank points would be consumed to "skip" that position (i.e., how many lexicographically smaller combinations would be skipped if the "1" were not placed there). By comparing this value with the currently held rank, it decides whether to place the "1" at the currently probed position. This process continues until the positions of all k "1s" have been determined.

[0122] Of course, this is just one possible encoding and decoding algorithm. In practical applications, other methods can also be used for mapping. For example, the binary representation of the first number can be directly mapped one-to-one with the possible results by sorting and generating a mapping table.

[0123] Furthermore, a fixed-length binary conversion is required to facilitate the implementation of quantum variational networks. Specifically, this involves converting the calculated integer rank to and from a fixed-length binary string. The process can be as follows:

[0124] Encoding to binary: Convert the integer rank to a binary string of the first number length, padding with "0"s on the left if the length is insufficient.

[0125] Decoding from binary: Convert the binary string of the first number of lengths back to the integer rank it represents, and then call the decoding algorithm to recover it.

[0126] In the variational quantum circuit design phase, a quantum variational circuit can be designed based on the first number of compressed qubits. The circuit contains parameterized quantum gates (such as RY gates and CNOT gates), and quantum states are generated by adjusting the variational parameters. The compressed state space is explored (taking two elements out of eight as an example, i.e., the encoding space from 0 to 27), and these quantum states can be mapped to possible results in the classical mapping table.

[0127] In variational optimization, the quantum state generated by the quantum circuit is measured to obtain a bit string of the first number of bits (e.g., the first number of bits is 5, and the measured bit string is "00101"). Using a predefined classical mapping table, this 5-bit bit string is decoded back to the corresponding 8-bit state (e.g., "00101" might be mapped to "10100000", indicating that the first and third bits are 1). Subsequently, this 8-bit state is used as input to calculate a problem-specific loss function. For example, in the exponential pursuit scenario, the 8-bit state can represent the selection of a specific element, and the loss function can be defined according to the specific situation. For instance, in the path scenario, the loss function can be defined as a weighted sum of time and distance; in the image recognition scenario, the loss function can be defined as a weighted sum of accuracy and efficiency. In constrained combinatorial optimization scenarios, the loss function may involve a penalty term for violating constraints to ensure that the solution meets the problem requirements.

[0128] To better understand the ideas in this disclosure, one can combine them with... Figure 3 To explain, Figure 3 This can be understood as a schematic diagram illustrating the specific process of the bit number compression method in a variable quantum circuit provided in this disclosure, by... Figure 3 As can be seen, compared with the traditional variational quantum circuit construction method, the scheme disclosed herein adds a decoding layer (and of course, a corresponding encoding layer, which can also be understood as adding a bit compression concept). This decoding layer ensures a significant reduction in the number of bits of variational parameters and a large reduction in the number of parameters. Furthermore, since the constraints on real chips are difficult to take effect, the scheme disclosed herein can effectively avoid the limitations of the number of bits, constraints ansatz, penalty terms, etc. on real chips, thus making it easier to implement the scheme disclosed herein at the chip level.

[0129] It should also be noted that the design of the loss function and the method of changing the sub-network parameters according to the loss function are relatively conventional quantum model optimization methods. The specific settings can be reasonably set according to the actual situation, and this disclosure does not limit the details of this part.

[0130] Figure 4 A schematic diagram of a bit number compression device 400 in a variable quantum line according to an embodiment of this application is shown. The device 400 may include:

[0131] The first determining unit 401 is used to determine the total number of possible results that satisfy the above constraints based on the constraints.

[0132] The second determining unit 402 is used to determine a first number based on the total number mentioned above, wherein the first number of 2 raised to the power of the first number is not less than the total number mentioned above, and the binary representation of the first number is used to represent each possible result one by one.

[0133] The construction unit 403 is used to construct a variable quantum circuit based on the first number of qubits mentioned above; wherein the optimization result of the variable quantum circuit is used to indicate the target result selected from the possible results.

[0134] In some embodiments, determining the first number based on the total number includes:

[0135] In the case where the total number is M, the first number is determined to be...

[0136] In some embodiments, the construction unit 403 is further configured to: construct an initial quantum circuit based on the first number of qubits, wherein the initial quantum circuit includes parameterized quantum gates.

[0137] The parameters of the above parameterized quantum gate are updated using the gradient descent method to obtain the above variable quantum circuit;

[0138] In this context, the generator state of the aforementioned variable quantum circuit covers the binary representation of the first number of bits corresponding to each possible result.

[0139] In some embodiments, the parameterized quantum gates described above include a parameterized single quantum gate acting on each quantum bit and a two-qubit gate acting on two quantum bits;

[0140] The timing of the above-mentioned parameterized single quantum gate precedes that of the above-mentioned two-qubit gate.

[0141] In some embodiments, the device 400 may also be used to: select a target result from possible results based on the mapping relationship information and the optimization result obtained after the above-mentioned variable quantum circuit acts on a first number of qubits;

[0142] The aforementioned mapping information is used to indicate the mapping relationship between the binary representation of the first number of bits and the possible results.

[0143] In some embodiments, the device 400 can also be used to generate the above-mentioned mapping relationship information in the following manner:

[0144] Determine the original string corresponding to the possible results, wherein the original string consists of characters of 0 and 1, one character corresponds to one element, and the character 1 indicates that an element is selected;

[0145] Determine the integer rank corresponding to each original string, and represent each integer rank using the first number of binary bits;

[0146] Based on the aforementioned integer rank, the binary representation of each first number of digits is mapped to the original string, and the mapping relationship information is obtained based on the mapping results of each first number of digits to the original string.

[0147] In some embodiments, when the bit number compression method in the above-described variable quantum circuit is applied to an image recognition scenario, the above-described elements include image feature data;

[0148] When the bit number compression method in the above-mentioned variable quantum circuit is applied to an object selection scenario, the above elements include any of the following:

[0149] Path feature information, device feature information.

[0150] Figure 5 A schematic diagram of the structure of a computer device provided in one embodiment of this application is shown, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the function of the computer system of the bit number compression method in the variable quantum circuit in any of the above embodiments.

[0151] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer, causes the computer to perform the functions of a computer system for the bit number compression method in the variable quantum circuit of any of the above embodiments.

[0152] This application also provides a computer program product containing instructions that, when executed by a computer, cause the computer system to perform the bit number compression method in the variable quantum line of any of the above embodiments.

[0153] It is understood that the specific examples in this application are only intended to help those skilled in the art better understand the implementation methods of this application, and are not intended to limit the scope of the invention.

[0154] It is understood that in the various embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not limit the implementation process of the embodiments of this application in any way.

[0155] It is understood that the various implementation methods described in this application can be implemented individually or in combination, and the implementation methods in this application are not limited in this respect.

[0156] Unless otherwise stated, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The term "and / or" as used in this application includes any and all combinations of one or more of the associated listed items. The singular forms "a," "the," and "the" as used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0157] It is understood that the processor in the embodiments of this application can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiments can be completed by the integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0158] It is understood that the memory in the embodiments of this application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Specifically, non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM). It should be noted that the memory in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0159] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0160] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the aforementioned method implementations, and will not be repeated here.

[0161] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0162] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0163] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0164] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0165] The above are merely specific embodiments of this application, but the scope of protection of this invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this invention should be determined by the scope of the claims.

Claims

1. A method for compressing the number of bits in a variable quantum circuit, characterized in that, include: Based on the constraints, determine the total number of possible outcomes that satisfy the constraints; Based on the total number, a first number is determined, wherein 2 raised to the first number is not less than the total number, and the binary representation of the first number is used to represent each possible result one by one. A variable quantum circuit is constructed based on the first number of qubits; wherein the optimization result of the variable quantum circuit is used to indicate the target result selected from the possible results.

2. The method according to claim 1, characterized in that, Determining the first number based on the total number includes: When the total number is M, the first number is determined to be...

3. The method according to claim 1, characterized in that, The construction of a variable quantum circuit based on the first number of qubits includes: An initial quantum circuit is constructed based on the first number of qubits, wherein the initial quantum circuit includes parameterized quantum gates. The parameters of the parameterized quantum gate are updated using the gradient descent method to obtain the variable quantum circuit; The generator state of the variable quantum circuit covers the binary representation of the first number of bits corresponding to each possible result.

4. The method according to claim 3, characterized in that, The parameterized quantum gates include a parameterized single quantum gate acting on each quantum bit and a two-qubit gate acting on two quantum bits; The timing of the parameterized single quantum gate precedes that of the two-qubit gate.

5. The method according to claim 1 or 3, characterized in that, The method further includes: Based on the mapping relationship information and the optimization results obtained after the variable quantum circuit operates on the first number of qubits, the target result is selected from the possible results; The mapping information is used to indicate the mapping relationship between the binary representation of a first number of bits and the possible results.

6. The method according to claim 5, characterized in that, The mapping information is generated in the following manner: Determine the original string corresponding to the possible results, wherein the original string consists of characters of 0 and 1, one character corresponds to one element, and the character 1 indicates that an element is selected; Determine the integer rank corresponding to each original string, and represent each integer rank using the first number of binary bits; Based on the integer rank, the binary representation of each first number of digits is mapped to the original string, and the mapping relationship information is obtained based on the mapping results of each first number of digits to the original string.

7. The method according to claim 6, characterized in that, When the bit number compression method in the variable quantum circuit is applied to an image recognition scenario, the element includes image feature data; In the context of applying the bit number compression method in the variable quantum circuit to an object selection scenario, the element includes any one of the following: Path feature information, device feature information.

8. A bit number compression device in a variable quantum circuit, characterized in that, include: The first determining unit is used to determine the total number of possible results that satisfy the constraints, based on the constraints. The second determining unit is used to determine a first number based on the total number, wherein 2 raised to the power of the first number is not less than the total number, and the binary representation of the first number is used to represent each possible result one by one. A construction unit is used to construct a variable quantum circuit based on the first number of qubits; wherein the optimization result of the variable quantum circuit is used to indicate the target result selected from the possible results.

9. An electronic device, characterized in that, include: Processor and memory; The processor is connected to a memory, wherein the memory is used to store a computer program, and the processor is used to invoke the computer program to perform the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, perform the method as described in any one of claims 1-7.