WO2022077797A1 - 量子线路的确定方法、装置、设备及存储介质 - Google Patents

量子线路的确定方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2022077797A1
WO2022077797A1 PCT/CN2021/073639 CN2021073639W WO2022077797A1 WO 2022077797 A1 WO2022077797 A1 WO 2022077797A1 CN 2021073639 W CN2021073639 W CN 2021073639W WO 2022077797 A1 WO2022077797 A1 WO 2022077797A1
Authority
WO
WIPO (PCT)
Prior art keywords
circuit
quantum
line
units
parameters
Prior art date
Application number
PCT/CN2021/073639
Other languages
English (en)
French (fr)
Inventor
张士欣
谢昌谕
张胜誉
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Priority to EP21772939.1A priority Critical patent/EP4006788A1/en
Priority to JP2021546756A priority patent/JP7451008B2/ja
Priority to KR1020217033817A priority patent/KR20220051132A/ko
Priority to US17/524,194 priority patent/US20220114313A1/en
Publication of WO2022077797A1 publication Critical patent/WO2022077797A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • G06N10/20Models of quantum computing, e.g. quantum circuits or universal quantum computers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/01Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N7/00Computing arrangements based on specific mathematical models
    • G06N7/01Probabilistic graphical models, e.g. probabilistic networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • G06N10/60Quantum algorithms, e.g. based on quantum optimisation, quantum Fourier or Hadamard transforms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • G06N10/70Quantum error correction, detection or prevention, e.g. surface codes or magic state distillation

Definitions

  • the embodiments of the present application relate to the field of quantum technology, and in particular, to a method, apparatus, device, and storage medium for determining a quantum circuit.
  • a quantum circuit is a representation of a quantum general-purpose computer, representing the hardware implementation of the corresponding quantum algorithm/program under the quantum gate model.
  • Embodiments of the present application provide a method, apparatus, device, and storage medium for determining a quantum circuit.
  • the technical solution is as follows:
  • a method for determining a quantum circuit comprising:
  • K groups of circuit units are sampled from the initial circuit unit pool to construct and generate K candidate quantum circuits; wherein, each group of circuit units includes at least one circuit unit for constructing and generating one candidate quantum circuit; K is a positive integer;
  • the sampling mode and the line units in the line unit pool are updated to obtain the updated sampling mode and the updated line unit pool;
  • the target quantum circuit is determined from the K candidate quantum circuits generated last time.
  • a method for determining a quantum circuit comprising:
  • the line unit pool includes a plurality of line units, each line unit is an equivalent quantum circuit corresponding to a unitary matrix, and the N is an integer greater than 1;
  • a quantum circuit is constructed and generated based on the N circuit units and circuit parameters corresponding to the N circuit units respectively.
  • a device for determining a quantum circuit comprising:
  • the circuit sampling module is used for sampling K groups of circuit units from the initial circuit unit pool according to the initial sampling method, and constructing and generating K candidate quantum circuits; wherein, each group of circuit units includes at least one circuit unit, which is used for constructing and generating A candidate quantum circuit; K is a positive integer;
  • a circuit evaluation module used for determining the performance evaluation index corresponding to the K candidate quantum circuits
  • a parameter update module used for updating the sampling mode and the line units in the line unit pool based on the performance evaluation index, to obtain the updated sampling mode and the updated line unit pool;
  • the circuit sampling module is also used to sample K groups of circuit units from the updated circuit unit pool according to the updated sampling mode, and construct and generate K candidate quantum circuits;
  • the circuit determination module is configured to determine the target quantum circuit from the K candidate quantum circuits generated last time under the condition that the cycle termination condition is satisfied.
  • a device for determining a quantum circuit comprising:
  • the line unit selection module is used to select N line units from a line unit pool, the line unit pool includes a plurality of line units, each line unit is an equivalent quantum circuit corresponding to a unitary matrix, and the N is greater than an integer of 1;
  • a line parameter determination module configured to determine line parameters corresponding to the N line units respectively, where the line parameters are used to define operations performed by the line units, and the line parameters are updatable;
  • a quantum circuit construction module configured to construct and generate a quantum circuit based on the N circuit units and circuit parameters corresponding to the N circuit units respectively.
  • a computer device includes a processor and a memory, and the memory stores at least one instruction, at least one program, a code set or an instruction set, the at least one The instructions, the at least one piece of program, the code set or the instruction set are loaded and executed by the processor to implement the above-mentioned method for determining a quantum circuit.
  • a computer-readable storage medium stores at least one instruction, at least a piece of program, code set or instruction set, the at least one instruction One instruction, the at least one piece of program, the code set or the instruction set are loaded and executed by the processor to implement the above determination method of the quantum circuit.
  • a computer program product or computer program where the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
  • the processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above method for determining a quantum circuit.
  • the technical solution of the present application can be used to construct a target quantum circuit for solving the corresponding problem, so that different types of quantum circuit design problems can be highly abstracted and unified. universality and versatility.
  • the technical solution of the present application only needs to determine the performance evaluation index corresponding to the candidate quantum circuit obtained by sampling, and then based on the performance evaluation index, the sampling method and circuit are determined.
  • the circuit units in the unit pool are updated synchronously, so that a candidate quantum circuit with better performance can be quickly constructed, which not only reduces the amount of calculation, but also improves the efficiency of finalizing the target quantum circuit.
  • FIG. 1 is a flowchart of a method for determining a quantum circuit provided by an embodiment of the present application
  • FIG. 2 is a flowchart of a method for determining a quantum circuit provided by another embodiment of the present application.
  • FIG. 3 is a schematic diagram of a differentiable quantum structure search framework provided by an embodiment of the present application.
  • FIG. 4 is a flowchart of a method for determining a quantum circuit provided by another embodiment of the present application.
  • FIG. 5 is a flowchart of a method for determining a quantum circuit provided by another embodiment of the present application.
  • 6 to 12 exemplarily show the schematic diagrams of several quantum circuits constructed using the differentiable quantum structure search framework provided by the present application;
  • FIG. 13 is a block diagram of an apparatus for determining a quantum circuit structure provided by an embodiment of the present application.
  • FIG. 14 is a block diagram of an apparatus for determining a quantum circuit structure provided by another embodiment of the present application.
  • 15 is a block diagram of an apparatus for determining a quantum circuit structure provided by another embodiment of the present application.
  • 16 is a block diagram of an apparatus for determining a quantum circuit structure provided by another embodiment of the present application.
  • FIG. 17 is a block diagram of a computer device provided by an embodiment of the present application.
  • Cloud technology refers to a kind of hosting technology that unifies a series of resources such as hardware, software, and network in a wide area network or a local area network to realize the calculation, storage, processing and sharing of data.
  • Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, and application technology based on cloud computing business models. Cloud computing technology will become an important support. Background services of technical network systems require a lot of computing and storage resources, such as video websites, picture websites and more portal websites. With the high development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the back-end system for logical processing. Data of different levels will be processed separately, and all kinds of industry data need to be strong. The system backing support can be realized through cloud computing.
  • Cloud technology involves basic technologies such as cloud computing, cloud storage, database and big data.
  • Cloud applications based on cloud technology include medical cloud, cloud IoT, cloud security, cloud calling, private cloud, public cloud, hybrid cloud, cloud gaming, Cloud education, cloud conference, cloud social networking, artificial intelligence cloud services, etc.
  • a system built on cloud technology includes servers and terminals.
  • the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud service, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, intermediate Cloud servers for basic cloud computing services such as software services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
  • the terminal may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto.
  • the terminal and the server may be directly or indirectly connected through wired or wireless communication, which is not limited in this application.
  • a quantum computer is a machine that uses the principles of quantum mechanics to perform calculations. Based on the superposition principle and quantum entanglement of quantum mechanics, quantum computers have strong parallel processing capabilities and can solve some problems that are difficult to calculate by classical computers.
  • the zero resistance characteristics of superconducting qubits and the manufacturing process close to that of integrated circuits make the quantum computing system constructed with superconducting qubits one of the most promising systems for practical quantum computing.
  • Quantum processor refers to a quantum-level computer processor, that is, the processor of a quantum computer.
  • a quantum processor may include one or more quantum chips.
  • a quantum chip (or superconducting quantum chip) is the central processing unit of a quantum computer and the core component of a quantum computer.
  • a quantum chip integrates quantum circuits on a substrate to carry the function of quantum information processing. Drawing on the development history of traditional computers, after overcoming the bottleneck technology, quantum computer research needs to take the road of integration in order to achieve commercialization and industrial upgrading.
  • Superconducting systems, semiconductor quantum dot systems, micro-nano photonics systems, and even atomic and ion systems all want to take the road of chipization.
  • the superconducting quantum chip system is technically ahead of other physical systems; the traditional semiconductor quantum dot system is also the target of people's efforts to explore, because after all, the development of the traditional semiconductor industry is very mature, such as semiconductor quantum chips in the Once the decoherence time and control accuracy break through the threshold of fault-tolerant quantum computing, it is expected to integrate the existing achievements of the traditional semiconductor industry and save development costs.
  • quantum computers can be used in future cloud-based systems to perform some processing and calculations to provide better services.
  • Quantum computing A computing method based on quantum logic, and the basic unit for storing data is a quantum bit (qubit).
  • Qubit The basic unit of quantum computing. Traditional computers use 0 and 1 as the basic units of binary. The difference is that quantum computing can process 0 and 1 at the same time, and the system can be in a linear superposition state of 0 and 1:
  • ⁇ >
  • 2 represent the probability of being at 0 and 1, respectively.
  • Quantum circuit a representation of a quantum universal computer, representing the hardware implementation of the corresponding quantum algorithm/program under the quantum gate model.
  • Hamiltonian A Hermitian-conjugate matrix that describes the total energy of a quantum system.
  • the Hamiltonian is a physical word, an operator that describes the total energy of a system, usually denoted by H.
  • NAS Neural Architecture Search
  • AutoML automated machine learning
  • reinforcement learning various underlying technologies
  • microstructure search The solution is to realize the purpose of computer automatic search and construction of neural network topology and structure with excellent performance.
  • Quantum Architecture Search A general term for a series of works and schemes that attempt to automate and programmatically search the structure, pattern and arrangement of quantum circuits.
  • the work of quantum structure search usually adopts greedy algorithm, reinforcement learning or genetic algorithm as its core technology.
  • Quantum-classical hybrid computing a computing paradigm in which the inner layer uses quantum circuits for calculation, and the outer layer uses traditional classical optimizers to adjust the parameters of variable quantum circuits, which can maximize the advantages of quantum computing and is believed to have potential One of the important directions for proving quantum superiority.
  • Quantum Approximate Optimization Algorithm A specific quantum circuit structure assumption, the quantum state generated by such a quantum circuit can be used to approximate NP (Non-deterministic Polynomial, non-deterministic polynomial)
  • NP Non-deterministic Polynomial, non-deterministic polynomial
  • H c , H b are mixer and phase Hamiltonians, respectively, and ⁇ and ⁇ are variational parameters.
  • H c is the same as the objective function we want to optimize.
  • ⁇ 0 > is an easy-to-prepare initial wave function, usually a direct product
  • ⁇ > is the target state wave function.
  • P represents the number of layers assumed to be arranged in QAOA. The larger P is, the closer it is to the adiabatic approximation, and the closer the target wave function is to the theoretical result, the better the approximation effect.
  • the max cut problem a typical graph theory combinatorial optimization problem with NP-complete complexity, and it is also the earliest problem that the QAOA algorithm is used to solve.
  • MAX CUT refers to finding a bipartite scheme of nodes for a given graph with node and edge connections such that the sum of the number of edges (or edge weights) across the two nodes is the largest.
  • NISQ Noisy Intermediate-Scale Quantum
  • Quantum Error Mitigation Corresponding to Quantum Error Correction, it is a series of quantum error mitigation and noise suppression schemes with lower resource cost under NISQ era hardware. Compared to full quantum error correction, the resources required are significantly reduced, and may only be suitable for specific tasks, rather than general solutions.
  • VQE Variational-Quantum-Eigensolver
  • a relatively conventional solution for constructing quantum circuits is to use genetic algorithms.
  • the basic method is to use genetic algorithm to find the optimal circuit structure of the next part after fixing a part of the circuit structure of the quantum circuit, and finally construct a complete quantum circuit by repeating the above process many times.
  • the construction of quantum circuits is very complex and inefficient.
  • the generality of the scheme is poor, for example, different variants of genetic algorithms need to be selected for different quantum computing tasks.
  • the present application provides a technical solution for constructing a quantum circuit, which can be called a Differentiable Quantum Architecture Search (DQAS for short) solution (or a Differentiable Quantum Architecture Search Framework).
  • DQAS Differentiable Quantum Architecture Search
  • a Differentiable Quantum Architecture Search Framework a technical solution for constructing a quantum circuit
  • DQAS Differentiable Quantum Architecture Search
  • Differentiable Quantum Architecture Search Framework a technical solution for constructing a quantum circuit, which can be called a Differentiable Quantum Architecture Search (DQAS for short) solution (or a Differentiable Quantum Architecture Search Framework).
  • DQAS Differentiable Quantum Architecture Search
  • Any quantum circuit can be regarded as a stack of a series of unitary matrices, namely:
  • U represents the quantum circuit
  • U i represents the equivalent quantum circuit corresponding to the ith unitary matrix composing the quantum circuit
  • ⁇ i represents the circuit parameters of the equivalent quantum circuit corresponding to the ith unitary matrix, such as ⁇ i Can contain zero to several line parameters, i ⁇ [0,p] and i is an integer.
  • the circuit parameters of the quantum circuit are variational parameters.
  • the so-called variational parameters mean that the circuit parameters of the quantum circuit are updatable (that is, can be adjusted and modified), so that the circuit parameters of the quantum circuit can be updated by the optimizer to achieve the optimization goal. purpose of the function.
  • our search scheme is not limited to the hypothetical circuit search in the quantum-classical hybrid computing paradigm, but is applicable to a wider range of problems with or without circuit parameters. That is to say, we can also use this scheme to find the optimal quantum circuit design of a completely discrete quantum gate arrangement, and the scheme is compatible with the existence of the variational parameters of the circuit itself.
  • a circuit unit pool is constructed, and the circuit unit pool includes a plurality of optional circuit units, and each circuit unit can be regarded as a unitary matrix circuit, that is, an equivalent quantum circuit of a unitary matrix .
  • a corresponding circuit unit is designed for each basic operation.
  • a circuit unit may be a single-bit quantum gate, a one-layer quantum gate, or a time-dependent evolution of a Hamiltonian, etc., which are not limited in the embodiments of the present application.
  • a circuit unit is selected from the circuit unit pool to be filled, and this selection is replaced to ensure that each circuit unit can be reused in the final constructed quantum circuit.
  • the optimization objective function can be some function expected of the observed quantity H i , so that the optimization objective can take into account both the expectation and the specific distribution of the output quantum state.
  • the more general objective function L can be expressed as:
  • f i , gi are arbitrary differentiable functions suitable for specific tasks, indicating that the final objective function L is a certain transformation of the observation result.
  • the objective function L can be defined as the following form similar to traditional supervised learning:
  • f i , gi are arbitrary differentiable functions suitable for a specific task
  • ⁇ j > is the dataset of the corresponding quantum wave function input
  • y j is the classical label corresponding to the corresponding quantum state of the dataset, usually 0 or 1.
  • ⁇ i , ⁇ i correspond to the input state and output state of the line, respectively. If i has only one item and
  • ⁇ i >
  • the objective function at this time represents the fidelity of the input simple direct product state
  • this feature of automatic differentiation makes the differentiable quantum structure search framework well support for any form of end-to-end optimization objective function.
  • the gradient required for the adjustment and optimization of the entire line parameters can be back-propagated from the change of the final objective function.
  • This process only requires that the components defined by the objective function are automatically differentiable, and almost any function with good properties can be used. meet this requirement.
  • the present application regards the process of selecting circuit units constituting the quantum circuit as being controlled by a probability model.
  • This probability model P can be a sufficiently general energy model or an autoregressive network.
  • the simplest layer-by-layer discrete distribution can be selected to describe the process of selecting circuit units from the circuit unit pool to construct quantum circuits.
  • This probability model has a continuous parameter ⁇ , whereby from the probability model P(k, ⁇ ) a discrete integer structure parameter k can be sampled, which determines the structure of the corresponding quantum circuit.
  • P(k, ⁇ ) represents the probability model
  • U(k, ⁇ ) represents the candidate quantum circuit constructed and generated based on the structural parameter k
  • the structural parameter k can include several discrete values, which are used to represent the circuit units obtained by this sampling.
  • L(U(k, ⁇ )) represents the objective function corresponding to the candidate quantum circuit U(k, ⁇ ).
  • the method for determining a quantum circuit structure provided by the embodiments of the present application can be implemented by a classical computer (such as a PC (Personal Computer)), for example, by executing a corresponding computer program on a classical computer to implement the method; it can also be implemented in a classical computer.
  • a classical computer such as a PC (Personal Computer)
  • PC Personal Computer
  • the classical computer performs the steps of circuit sampling, parameter update and circuit selection, while the quantum computer performs the steps of determining the performance evaluation index (such as the objective function) corresponding to the candidate quantum circuit, because Deploying the quantum circuit directly on a quantum computer for execution, the corresponding performance evaluation results should theoretically be better than simulating the above quantum circuit on a classical computer.
  • the performance evaluation index such as the objective function
  • the computer device may be a classical computer, or may include a mixed execution environment of a classical computer and a quantum computer, which is not limited in the embodiments of the present application.
  • FIG. 1 shows a flowchart of a method for determining a quantum circuit provided by an embodiment of the present application.
  • the execution body of each step of the method may be a computer device.
  • the method may include the following steps (101-105):
  • Step 101 according to the initial sampling method, sample K groups of line units from the initial line unit pool, and construct and generate K candidate quantum circuits, where K is a positive integer.
  • the line unit pool includes a number of line units to choose from.
  • a circuit unit is a basic unit constituting a quantum circuit, and a quantum circuit may include one or more circuit units.
  • the connection relationship between each circuit unit can be pre-defined or designed.
  • a quantum circuit is a multi-layer structure, each layer contains a circuit unit, and the layers are connected in sequence, for example, the output result of a circuit unit of a certain layer can be used as the input of the circuit unit of the next layer. data, and go through the next layer of line unit for further calculation or processing.
  • a quantum circuit is a multilayer structure, and each layer includes one or more locations to be filled for filling circuit units. In the case that the same layer includes multiple positions to be filled, the positions to be filled may be connected in a predetermined manner in advance.
  • a corresponding circuit unit is designed for each basic operation.
  • a circuit unit may be a single-bit quantum gate, a one-layer quantum gate, or a time-dependent evolution of a Hamiltonian, etc., which are not limited in the embodiments of the present application.
  • the sampling method refers to the method of selecting line units from the line unit pool.
  • Each sampling selects one or more line units from the line unit pool, and the one or more line units selected for one sampling constitute a group of line units, that is, each group of line units includes at least one line unit.
  • each group of circuit units is used to construct and generate a candidate quantum circuit.
  • the line units included in each set of line units are repeatable. That is, the above-mentioned sampling process has replacement, so as to ensure that each circuit unit can be reused in the final constructed quantum circuit.
  • the initial line unit pool includes 5 line units numbered 0, 1, 2, 3, and 4, respectively. It is assumed that, according to the initial sampling method, three samplings are performed from the initial line unit pool to obtain three groups of line units. Assume that a group of line units obtained by the first sampling includes 3 line units numbered 2, 1, and 3 in sequence, and a group of line units obtained by the second sampling includes 3 line units numbered 2, 1, and 1 in sequence , a group of line units obtained by the third sampling includes 3 line units numbered 2, 1, and 4 in sequence. Then, according to the above sampling results, three candidate quantum circuits are constructed and generated.
  • Step 102 Determine the performance evaluation indexes corresponding to the K candidate quantum circuits.
  • the performance evaluation index is a parameter used to quantitatively evaluate the performance of the candidate quantum circuit.
  • the performance evaluation index corresponding to the K candidate quantum circuits is a parameter used to evaluate the comprehensive performance or average performance of the K candidate quantum circuits, and reflects the overall performance of the K candidate quantum circuits. or the mean case.
  • an objective function is used to characterize the above performance evaluation index.
  • the objective function is the mathematical function used to calculate whether the quantum circuit generated by the construct achieves the task optimization objective. For example, as described above, for different quantum circuit design tasks, different objective functions can be set accordingly.
  • Step 103 Update the sampling mode and the line units in the line unit pool based on the performance evaluation index, to obtain the updated sampling mode and the updated line unit pool.
  • the performance evaluation index is used to guide the adjustment of the sampling method and the circuit parameters of the circuit unit, so that a candidate quantum circuit with better performance is sampled.
  • the sampling method is updated based on the performance evaluation index to optimize the sampling method, and a better combination scheme of line units is selected from the line unit pool; Update, such as updating the circuit parameters of the circuit unit, to optimize the performance of a single circuit unit, thereby helping to improve the overall performance of the constructed quantum circuit.
  • Step 104 According to the updated sampling method, K groups of line units are sampled from the updated line unit pool to construct and generate K candidate quantum circuits.
  • step 104 The sampling process in step 104 is the same as or similar to the sampling process introduced in step 101, the difference is that the sampling method and the line parameters of the line units in the line unit pool have been updated.
  • step 104 according to the updated sampling method, from K groups of line units are sampled in the updated line unit pool.
  • sampling times in step 104 and the sampling times in step 101 may be the same or different.
  • K in step 101 is equal to 10
  • K in step 104 is also equal to 10.
  • K in step 101 is equal to 10
  • K in step 104 is equal to 8. Since the probability model corresponding to the sampling method tends to converge during this cycle, adaptively reducing the value of the number of samples K in each round can effectively save computing resources while maintaining performance.
  • the above steps 102 to 104 can be executed cyclically to continuously update the optimal sampling method and the optimal circuit parameters, so as to construct a better candidate quantum circuit, until the cycle termination condition is met, stop the cycle process.
  • the loop termination condition refers to a preset condition for triggering the termination of the above loop process.
  • the loop termination condition includes, but is not limited to, at least one of the following: the K candidate quantum circuits generated in the last time are the same, the K candidate quantum circuits generated in the last time have the same quantum circuits that are greater than a threshold number, the last generation of the same quantum circuits
  • the performance evaluation indexes corresponding to the K candidate quantum circuits meet the set index requirements, the execution times of the cyclic process reach the set times, etc., which are not limited in this embodiment of the present application.
  • Step 105 determining the target quantum circuit from the K candidate quantum circuits generated last time when the loop termination condition is satisfied.
  • the target quantum circuit is a quantum circuit determined from the K candidate quantum circuits generated last time, and the target quantum circuit can be a certain quantum circuit selected from the K candidate quantum circuits generated last time.
  • the target quantum circuit is the quantum circuit generated by the final structure and used to achieve a certain predetermined quantum circuit design task.
  • a candidate quantum circuit with the highest generation probability is determined; the candidate quantum circuit with the highest generation probability is determined as a target quantum circuit.
  • the generation probability of a certain candidate quantum circuit may be the proportion of the candidate quantum circuit in the above-mentioned K candidate quantum circuits.
  • the number of candidate quantum circuits generated last time is 10, of which 9 candidate quantum circuits are the same (denoted as quantum circuit A), and the other 1 candidate quantum circuit is different from the other 9 (denoted as quantum circuit B).
  • the technical solutions of the present application can be used to construct a target quantum circuit for solving the corresponding problems, so that different types of quantum circuit design problems can be highly abstracted and unified.
  • the scheme has strong universality and versatility.
  • the technical solution of the present application only needs to determine the performance evaluation index corresponding to the candidate quantum circuit obtained by sampling, and then based on the performance evaluation index, the sampling method and circuit are determined.
  • the circuit units in the unit pool are updated synchronously, so that a candidate quantum circuit with better performance can be quickly constructed, which not only reduces the amount of calculation, but also improves the efficiency of finalizing the target quantum circuit.
  • FIG. 2 shows a flowchart of a method for determining a quantum circuit provided by another embodiment of the present application.
  • the execution body of each step of the method may be a computer device.
  • the method may include the following steps (201-211):
  • Step 201 constructing an initial probability model, which includes p ⁇ c parameters; where p represents the maximum number of line units, and c represents the total number of line units in the line unit pool.
  • a probability model may be used as a sampling method, and several groups of line units are obtained by sampling from the line unit pool.
  • the probability model is a parametric probability model, which includes p ⁇ c parameters; where p represents the maximum number of line units, and c represents the total number of line units in the line unit pool.
  • the maximum number of circuit units refers to the maximum number of circuit units that may be included in the target quantum circuit generated by the final construction to achieve a given quantum circuit design task. For example, if the maximum number of circuit units is 6, then the actual number of circuit units contained in the target quantum circuit generated by the final construction should be less than or equal to 6. In this case, a set of circuit units obtained by each sampling can include 6 circuit units The line unit may include 6 or less line units. In an example, the number of circuit units included in the target quantum circuit is a predetermined number. If the number of circuit units included in the target quantum circuit is pre-specified as 6, then a group of circuit units obtained by each sampling includes 6 circuits unit. At this time, the maximum number of circuit units is the predetermined number, and the predetermined number may be determined according to the design layer number of the target quantum circuit or the number of positions to be filled.
  • a line unit pool contains multiple line units. As described above, any quantum circuit can be regarded as a stack of a series of unitary matrices, so the circuit unit pool can include equivalent circuits corresponding to multiple unitary matrices respectively.
  • the line unit pool may also be called an operator pool or other names, which are not limited in this embodiment of the present application.
  • the model parameter of the probability model is ⁇
  • includes p ⁇ c parameters.
  • can be regarded as a matrix with p rows ⁇ c columns, and the element in the i-th row and the j-th column in the matrix indicates that the j-th circuit unit in the circuit unit pool is filled at the i-th position to be filled in the target quantum circuit
  • the probability of , i is a positive integer less than or equal to p
  • j is a positive integer less than or equal to c.
  • Step 202 based on the initial probability model, perform K sampling on the initial line unit pool, obtain a group of line units for each sampling, and obtain K groups of line units.
  • the structural parameter k is generated based on the model parameter ⁇ of the probability model P(k, ⁇ ).
  • the structural parameter k may include several discrete values to represent the line units obtained by this sampling.
  • the line unit pool includes 5 line units numbered 0, 1, 2, 3, and 4 respectively, and the structural parameter k includes (2, 1, 3), which represents a group of line units sampled from the line unit pool Including 3 line units numbered 2, 1, and 3 in sequence.
  • the model parameter ⁇ of the probability model P(k, ⁇ ) is the same, the structural parameter k generated by any two samplings may be the same or may be different.
  • the structural parameters k generated by the two samplings before and after are the same, which are (2, 1, 3); for another example, the structural parameters k generated by the two samplings before and after are different, the former is (2, 1, 3), and the latter is (2, 1, 3). is (2, 1, 4).
  • the line parameter pool includes the lines of each line unit in the line unit pool at each position to be filled parameter, that is, the line parameter pool includes p ⁇ c ⁇ l parameters.
  • Step 203 construct and generate K candidate quantum circuits based on the K groups of circuit units.
  • connection relationship between each line unit may be predefined or designed, which is not limited in this embodiment of the present application.
  • Step 204 Determine the performance evaluation index corresponding to the K candidate quantum circuits, where the performance evaluation index is the operation result of the objective function.
  • the objective function is the mathematical function used to calculate whether the quantum circuit generated by the construct achieves the task optimization objective. For example, as described above, for different quantum circuit design tasks, different objective functions can be set accordingly.
  • the candidate quantum circuit constructed and generated based on the structural parameter k is U(k, ⁇ )
  • the objective function corresponding to the candidate quantum circuit U(k, ⁇ ) is denoted as L(U(k, ⁇ ) )
  • the objective function corresponding to the generated K candidate quantum circuits is constructed after K sampling It can be expressed as follows:
  • the operation results corresponding to the objective function of the K candidate quantum circuits are calculated first, and K operation results are obtained, and then based on the K operation results, the performance evaluation index (that is, the objective function) is obtained. the result of the operation).
  • the objective function The result of operation reflects the overall situation or the average situation of the respective performances of the K candidate quantum circuits.
  • Step 205 Calculate the first gradient information and the second gradient information based on the performance evaluation index; wherein the first gradient information is the gradient information of the model parameters of the probability model, and the second gradient information is the line parameters of the line units in the line unit pool gradient information.
  • the gradient information of the objective function relative to the model parameters of the probability model is calculated to obtain the first gradient information, and the first gradient information is used to guide the updating of the model parameters of the probability model;
  • the objective function is relative to the gradient information of the line parameters of the line units in the line unit pool to obtain second gradient information, where the second gradient information is used to guide the updating of the line parameters of the line units.
  • the derivative of the objective function with respect to the model parameters of the probability model is calculated to obtain the first gradient information.
  • the derivative formula used to calculate the first gradient information is:
  • the second gradient information is obtained by computing derivatives of the objective function with respect to line parameters of line units in the line unit pool.
  • the derivative formula used to calculate the second gradient information is:
  • a related technique of Monte Carlo expectation automatic differentiation may be used, including but not limited to a score function (score function) or a reparameterization (reparameterization) method.
  • a scheme using a score function can be applied to a general model involving unnormalized probability distributions.
  • Step 206 Update the model parameters of the probability model based on the first gradient information to obtain an updated probability model.
  • a gradient descent algorithm is used to update the model parameter ⁇ of the probability model to continuously optimize the model parameter ⁇ of the probability model, thereby sampling a better combination scheme of line units.
  • Step 207 Update line parameters of line units in the line unit pool based on the second gradient information to obtain an updated line unit pool.
  • the gradient descent algorithm is used to update the line parameter ⁇ of each line unit in the line unit pool to continuously optimize the line parameter ⁇ of each line unit, thereby optimizing the performance of a single line unit, which in turn helps to improve the constructed The overall performance of the quantum circuit.
  • Step 208 According to the updated probability model, K groups of line units are sampled from the updated line unit pool to construct and generate K candidate quantum circuits.
  • Step 209 under the condition that the loop termination condition is satisfied, determine the target quantum circuit from the K candidate quantum circuits generated last time.
  • Steps 208 to 209 are the same as or similar to steps 104 to 105 in the embodiment of FIG. 1 .
  • steps 208 to 209 are the same as or similar to steps 104 to 105 in the embodiment of FIG. 1 .
  • steps 208 to 209 are the same as or similar to steps 104 to 105 in the embodiment of FIG. 1 .
  • steps 208 to 209 are the same as or similar to steps 104 to 105 in the embodiment of FIG. 1 .
  • the method provided by the embodiment of the present application further includes the following steps 210 to 211, so as to further optimize the circuit parameters of the target quantum circuit.
  • step 210 the structure of the target quantum circuit is fixed, and the circuit parameters of each circuit unit included in the target quantum circuit are adjusted.
  • the target quantum circuit After the target quantum circuit is determined, its circuit structure (that is, the circuit units contained in the circuit and the connection relationship between each circuit unit) is fixed, and if necessary, the target quantum circuit can be further defined.
  • the circuit parameters of each circuit unit included are further tuned to further improve the performance of the target quantum circuit.
  • the gradient descent algorithm is also used to update the circuit parameters of the target quantum circuit, so as to continuously optimize the circuit parameters of the target quantum circuit to improve the performance of the target quantum circuit performance.
  • Step 211 under the condition that the adjustment termination condition is satisfied, the target quantum circuit after parameter adjustment is obtained.
  • the adjustment termination condition refers to a preset condition for triggering to stop adjusting the circuit parameters of the target quantum circuit.
  • the adjustment termination condition includes but is not limited to at least one of the following: the performance evaluation index of the target quantum circuit reaches a preset index, the adjustment times of the circuit parameters of the target quantum circuit reaches a set number of times, etc. This is not limited.
  • the target quantum circuit after parameter tuning is the quantum circuit generated by the final construction and used to achieve a predetermined quantum circuit design task.
  • the following step is further included: for the jth circuit unit in the ith candidate quantum circuit, according to the jth circuit unit in the circuit unit pool of the jth circuit unit The position and the position in the i-th candidate quantum circuit, obtain the circuit parameters of the j-th circuit unit from the circuit parameter pool; wherein, the circuit parameter pool includes each circuit unit in the circuit unit pool at each to-be-filled position Line parameters on ; i is a positive integer less than or equal to K, and j is a positive integer.
  • the line parameter pool may include p ⁇ c groups of line parameters, and the (i,j)th group of line parameters is the line parameter when the jth line unit in the line unit pool is filled to the ith to-be-filled position, and i is less than A positive integer equal to p, j is a positive integer less than or equal to c.
  • the parameter binding mechanism is used to bind the line parameters of the line unit to the position to be filled, so that after constructing and generating a new candidate quantum circuit, the line parameters of each line unit can be simply and efficiently obtained from the line parameter pool .
  • the line parameters stored in the line parameter pool need to be updated synchronously, so as to ensure that the line parameters obtained from the line parameter pool are consistent with each other. accuracy.
  • training techniques emerging from research in NAS and the wider machine learning field may be introduced and developed, including but not limited to early stop, multi-start, line Variational parameter warm-up training, training and validation data sets are separately optimized for two groups of parameters, post-processing and grid search for optimal training results, progressive layer-by-layer training, and the sliding average of the objective function is added as the baseline during the Monka gradient estimation (baseline) to reduce the estimated variance, add random noise to the line parameters to smooth the energy loss, add a regular term and a penalty term to support multiple objectives in the objective function, small-scale surrogate tasks and transfer learning, etc.
  • the model parameters of the probability model determine the sampling times and probability of each line unit
  • the corresponding regular terms based on model parameters can be defined to encourage certain types of line units (such as single line units).
  • Bit quantum gate that is, increasing the sampling times and probability of this type of circuit unit; or, suppressing some types of circuit units (such as two-bit quantum gates), that is, reducing the sampling times and probability of this type of circuit unit.
  • adding the following regular term to the objective function L adding the regular term can be expressed as ⁇ L:
  • c represents the number of line units in the line unit pool
  • p is the number of positions to be filled
  • is the regular term
  • the weight of , q represents the number of two-bit quantum gates in the circuit unit.
  • the above-mentioned method of introducing a custom regular term improves the flexibility and controllability of circuit unit sampling, thereby helping to improve the performance of the quantum circuit generated by the final construction and reduce its quantum noise level.
  • the technical solutions provided by the embodiments of the present application relax the search domain of quantum circuits to a continuous space, thereby making automatic differentiation and stochastic gradient descent possible, which greatly reduces the consumption of computing resources, and also improves the convergence performance. better guarantee.
  • the model parameters and the line parameters can be optimized simultaneously based on the above two kinds of gradient information, and a multi-objective parameter optimization scheme is realized. Helps to improve the efficiency of quantum circuit construction.
  • the line unit pool 31 includes a plurality of optional line units, such as line units 1, 2, 3, etc. shown in the figure.
  • K groups of line units are obtained by sampling from the line unit pool 31 in batches, and K candidate quantum circuits are constructed and generated.
  • the parameter pool 32 is used to store circuit parameters of the quantum circuit. The circuit parameters of each circuit unit in each candidate quantum circuit generated by the construction can be obtained from the parameter pool 32 .
  • the performance of the candidate quantum circuits is evaluated through the objective function L, and the overall performance of the K candidate quantum circuits can adopt the objective function to evaluate.
  • the model parameter ⁇ and the line parameter ⁇ are updated respectively.
  • K groups of circuit units are sampled from the updated circuit unit pool to construct and generate K candidate quantum circuits.
  • the above process is executed in a loop, and when the loop termination condition is satisfied, from the K candidate quantum circuits generated last time, the candidate quantum circuit with the highest generation probability is selected as the final target quantum circuit.
  • FIG. 4 shows a flowchart of a method for determining a quantum circuit provided by another embodiment of the present application.
  • the execution body of each step of the method may be a computer device.
  • the method may include the following steps (401-403):
  • Step 401 Select N line units from a line unit pool, the line unit pool includes a plurality of line units, each line unit is an equivalent quantum circuit corresponding to a unitary matrix, and N is an integer greater than 1.
  • the line unit pool includes a number of line units to choose from.
  • a circuit unit is a basic unit constituting a quantum circuit, and a quantum circuit may include one or more circuit units.
  • the connection relationship between each circuit unit can be predefined or designed.
  • a quantum circuit is a multi-layer structure, each layer contains a circuit unit, and the layers are connected in sequence, for example, the output result of a circuit unit of a certain layer can be used as the input of the circuit unit of the next layer. data, and go through the next layer of line unit for further calculation or processing.
  • a quantum circuit is a multilayer structure, and each layer includes one or more locations to be filled for filling circuit units. In the case that the same layer includes multiple positions to be filled, the positions to be filled may be connected in a predetermined manner in advance.
  • a corresponding circuit unit is designed for each basic operation.
  • a circuit unit may be a single-bit quantum gate, a one-layer quantum gate, or a time-dependent evolution of a Hamiltonian, etc., which are not limited in the embodiments of the present application.
  • the quantum circuit is divided by the granularity of the circuit unit, and a quantum circuit may be formed by connecting a plurality of circuit units according to a certain connection method. Therefore, in order to construct a quantum circuit for completing a certain quantum computing task, several circuit units can be selected from the circuit unit pool.
  • N line units are selected from the line unit pool according to a certain sampling method.
  • the sampling method refers to the method of selecting line units from the line unit pool.
  • Each sampling selects N line units from the line unit pool, and the N line units selected for one sampling constitute a group of line units, that is, each group of line units includes N line units.
  • the line units included in the N line units are repeatable. That is, the above-mentioned sampling process has replacement, so as to ensure that each circuit unit can be reused in the final constructed quantum circuit.
  • the above sampling method may be a probability model.
  • the method of obtaining line units by sampling the probability model reference may be made to the description in the above embodiment, and details are not repeated here.
  • Step 402 Determine line parameters corresponding to the N line units respectively, the line parameters are used to define the operations performed by the line units, and the line parameters can be updated.
  • the line unit has a corresponding line parameter, and the line parameter is used to define the operation performed by the line unit. That is, the operation performed by a line unit is not only related to the structure of the line unit, but also related to the line parameters of the line unit.
  • the line parameters of the line unit are variational parameters, that is, the line parameters of the line unit are updatable (that is, can be adjusted and modified), so that if necessary, the line parameters of the line unit can be updated. Line parameters to improve the performance of the line unit.
  • a line parameter pool may be maintained, and the line parameter pool includes line parameters for each line unit in the line unit pool at each position to be filled.
  • the line parameters of the i-th line unit are acquired from the line parameter pool according to the to-be-filled position of the i-th line unit.
  • the parameter binding mechanism is used to bind the line parameters of the line unit to the position to be filled, so that the line parameters of each line unit can be simply and efficiently obtained from the line parameter pool when the quantum circuit is constructed and generated.
  • Step 403 construct and generate a quantum circuit based on the N circuit units and circuit parameters corresponding to the N circuit units respectively.
  • the quantum circuit includes the above-mentioned N line units, and the line parameters of the quantum circuit include the above-mentioned N line units corresponding to the respective line parameters.
  • the connection relationship between each line unit may be predefined or designed, which is not limited in this embodiment of the present application.
  • step 403 further includes the following steps:
  • Step 404 Determine the performance evaluation index corresponding to the quantum circuit.
  • the performance evaluation index is a parameter used to quantitatively evaluate the performance of the quantum circuit.
  • an objective function is used to characterize the above performance evaluation index.
  • the objective function is the mathematical function used to calculate whether the quantum circuit generated by the construct achieves the task optimization objective. For example, as described above, for different quantum circuit design tasks, different objective functions can be set accordingly.
  • Step 405 Calculate target gradient information based on the performance evaluation index, where the target gradient information is gradient information of circuit parameters of the quantum circuit.
  • the target gradient information is obtained by calculating the gradient information of the target function relative to the circuit parameters of the quantum circuit, and the target gradient information is used to guide the updating of the circuit parameters of the quantum circuit.
  • the derivative of the objective function with respect to the circuit parameters of the quantum circuit is calculated to obtain objective gradient information.
  • the derivative formula used to calculate the target gradient information is:
  • Step 406 based on the target gradient information, update the circuit parameters of the quantum circuit to obtain the updated quantum circuit.
  • the gradient descent algorithm is used to update the circuit parameters of the quantum circuit to continuously optimize the circuit parameters of each circuit unit, thereby improving the overall performance of the quantum circuit.
  • the corresponding gradient information can be calculated by means of derivation, so that the gradient descent algorithm can be used to update and optimize the circuit parameters, so as to continuously improve the performance of the quantum circuit. performance.
  • the technical solutions provided in the embodiments of the present application consider the quantum circuit as a stack of equivalent quantum circuits corresponding to a series of unitary matrices, so as to divide the quantum circuit into circuit units, and construct circuits by constructing circuits.
  • the unit pool provides optional circuit units, and circuit units are selected from the circuit unit pool to construct quantum circuits, which realizes the search of differentiable quantum structures and provides a universal and universal quantum circuit construction scheme.
  • the performance of the quantum circuit can be improved by updating (ie, adjusting) the circuit parameters.
  • the objective function corresponding to the quantum circuit is a differentiable function, the corresponding gradient information can be calculated by means of derivation, so that the gradient descent algorithm can be used to update and optimize the circuit parameters, so as to continuously improve the performance of the quantum circuit. performance.
  • the resulting complete quantum circuit has a problem of non-global optimality.
  • the circuit parameters are updated, and the circuit parameters that make the entire quantum circuit optimal as a whole can be finally found, so the performance is better.
  • the operator pool and coding scheme we adopt are single-bit and two-bit quantum gates.
  • the type of quantum gate and the number of qubit rows in which it is located determine the composition of the operator pool.
  • the GHZ quantum state is defined as Such states, also known as Schrödinger's cat states, have many applications in both theory and quantum information practice.
  • the differentiable quantum structure search framework provided in this application can automatically design a corresponding quantum state preparation circuit. Its objective function is the inner product of the output state of the quantum circuit and the theoretical GHZ state. By gradually reducing the number of training gates p and ensuring the performance of the search, it is guaranteed to find the qualified preparation circuit with the least required quantum gates.
  • the specific circuit is shown in Figure 6.
  • the parameter ⁇ /2 is completely learned by the framework itself.
  • Bell states refer to four orthogonal entangled states composed of two bits, which play an important role in quantum teleportation and compression coding.
  • the corresponding quantum circuits should map the four different measured ground states to the corresponding encoded Bell state entangled states, respectively. So the problem is a complete circuit learning problem, not just a single quantum state preparation.
  • the inner product of the target state or the expectation of the observed quantities XX, ZZ can be used as the objective function, and four different input state evaluations are required as the overall objective function.
  • the specific lines obtained by automatic search are shown in Figure 7.
  • the framework utilizes only discrete parameterless operator pools, ie no variable line parameters.
  • the quantum error suppression strategy adopted here is: the gaps in the quantum circuit are filled with single-bit quantum gates, and the set of these quantum gates gives the identity matrix. In this way, on the premise of not changing the corresponding matrix of the quantum circuit, the attenuation noise of the waiting bit can be effectively reduced, and the more difficult to suppress coherent noise can be converted into a simple Pauli noise.
  • a comparative baseline for this error correction effect is to manage to fill a quantum gate equivalent to 1 in the corresponding continuous gap, and we find that our framework can search for lines with higher fidelity than this knowledge-based commonsense scheme. In fact, differentiable quantum structure search can effectively sense certain long-range correlations in quantum circuits, so that individual voids can also be filled non-identically to achieve further improvements in fidelity.
  • the corresponding fidelities of the original circuit, the expert circuit and the circuit automatically designed by the framework are 0.33, 0.55 and 0.6, respectively.
  • the corresponding fidelities of the original circuit, the expert circuit and the circuit automatically designed by the framework are 0.13, 0.41 and 0.45, respectively.
  • the error correction circuit designed automatically by this framework can suppress quantum noise better than the circuit design by human experts.
  • this automatic circuit design does not depend on any prior knowledge at all, and is generated from scratch.
  • the corresponding quantum error correction design and the specific fidelity value depend on the assumed quantum noise model.
  • the original lines of 3 bits and 4 bits, and the error correction lines discovered by this framework are shown in Figures 8 to 11, respectively.
  • the gray quantum gate in the error correction circuit is the result of intelligent filling after the training of the differentiable quantum structure search framework.
  • QAOA is a very important quantum-classical hybrid computing paradigm, and has strong physical significance and connection with quantum annealing. Therefore, in the case of the same depth and the same amount of circuit parameters, finding a quantum circuit arrangement with stronger approximation ability has important application value (used to demonstrate quantum advantage) and theoretical significance (used to intersect with important concepts in quantum annealing). compare and understand).
  • the end-to-end environment adopts the typical MAX CUT combinatorial optimization problem, while the operator pool adopts the strategy of combining the Hamiltonian time-dependent evolution layer and the ordinary single-bit quantum gate layer.
  • H-layer, rx-layer, ry-layer, rz-layer, zz-layer we call these basic components H-layer, rx-layer, ry-layer, rz-layer, zz-layer respectively.
  • xx-layer and yy-layer can be generated with the above basic component construction, so they are redundant items.
  • the end-to-end objective function setting is the same as the traditional QAOA, which is the expectation of the MAX CUT corresponding Hamiltonian in the output state of the quantum circuit.
  • the differentiable quantum structure search framework provided by the present application can be widely used in various quantum computing and quantum information problems, especially the automatic design of quantum circuits in various situations.
  • This end-to-end differentiable design which does not rely on any assumptions about the circuit structure, opens up many possibilities for quantum circuit design.
  • this approach combines novel programming paradigms such as quantum programming, differential programming, and probabilistic programming, and can be used to explore potentially efficient quantum structures beyond the accumulation of existing knowledge.
  • this framework has shown good performance and excellent results in quantum state preparation, quantum circuit decomposition and compilation, quantum error correction, and variational quantum structure search.
  • the differentiable methodology and the high versatility of the framework itself ensure that the scheme is simple and efficient, while taking into account the native quantum gates, connection topology and noise characteristics of real quantum hardware.
  • This scheme is the first automatic design scheme of differentiable quantum circuits, which allows this scheme to consume less computing resources, such as time, hardware, etc., to obtain similar or significantly better results than other schemes.
  • Multi-objective This scheme can optimize multiple objectives at the same time, making hardware friendly, quantum error correction and other considerations better embedded in the overall framework.
  • the technical solution of the present application helps to speed up the design of quantum circuits with stronger adaptability at the present stage.
  • the typical shortcomings of quantum hardware in the NISQ era are short coherence time and large quantum noise.
  • the differentiable quantum structure search framework provided in this application can well solve this multi-objective circuit design problem, thereby gaining advantages in the commercial application of quantum computing.
  • differentiable quantum structure search can also effectively exert the design potential in quantum coding technology stack and quantum error suppression, making the corresponding circuit more stable against quantum noise.
  • FIG. 13 shows a block diagram of an apparatus for determining a quantum circuit provided by an embodiment of the present application.
  • the device has the function of implementing the above method example, and the function can be implemented by hardware, or can be implemented by hardware executing corresponding software.
  • the apparatus may be the computer equipment described above, or may be provided in the computer equipment.
  • the apparatus 1300 may include: a line sampling module 1310 , a line evaluation module 1320 , a parameter update module 1330 and a line determination module 1340 .
  • the circuit sampling module 1310 is used to sample K groups of circuit units from the initial circuit unit pool according to the initial sampling method, and construct and generate K candidate quantum circuits; wherein, each group of circuit units includes at least one circuit unit for constructing Generate a candidate quantum circuit; K is a positive integer.
  • the circuit evaluation module 1320 is configured to determine the performance evaluation index corresponding to the K candidate quantum circuits.
  • the parameter updating module 1330 is configured to update the sampling mode and the line units in the line unit pool based on the performance evaluation index to obtain the updated sampling mode and the updated line unit pool.
  • the line sampling module 1310 is further configured to sample K groups of line units from the updated line unit pool according to the updated sampling manner, to construct and generate K candidate quantum circuits.
  • the circuit determination module 1340 is configured to determine the target quantum circuit from the K candidate quantum circuits generated last time under the condition that the cycle termination condition is satisfied.
  • the line sampling module 1310 includes: a model construction unit 1311 , a line sampling unit 1312 and a line construction unit 1313 .
  • the model building unit 1311 is configured to build an initial probability model, where the probability model includes p ⁇ c parameters; where p represents the maximum number of line units, and c represents the total number of line units in the line unit pool.
  • the line sampling unit 1312 is configured to perform K samples on the initial line unit pool based on the initial probability model, and obtain a group of line units for each sampling to obtain the K groups of line units.
  • the circuit construction unit 1313 is configured to construct and generate the K candidate quantum circuits based on the K groups of circuit units.
  • the parameter update module 1330 includes: a gradient calculation unit 1331 , a model parameter update unit 1332 and a line parameter update unit 1333 .
  • the gradient calculation unit 1331 is configured to calculate the first gradient information and the second gradient information based on the performance evaluation index; wherein the first gradient information is the gradient information of the model parameters of the probability model, and the second gradient information
  • the information is gradient information of line parameters of line units in the line unit pool.
  • the model parameter updating unit 1332 is configured to update the model parameters of the probability model based on the first gradient information to obtain an updated probability model.
  • the line parameter updating unit 1333 is configured to update the line parameters of the line units in the line unit pool based on the second gradient information to obtain an updated line unit pool.
  • the performance evaluation index is an operation result of an objective function.
  • the gradient calculation unit 1331 is configured to calculate the derivative of the objective function relative to the model parameters of the probability model to obtain the first gradient information; calculate the objective function relative to the line units in the line unit pool The derivative of the line parameter is obtained to obtain the second gradient information.
  • the performance evaluation index is an operation result of an objective function.
  • the circuit evaluation module 1320 is configured to calculate the operation results corresponding to the objective function of the K candidate quantum circuits respectively, and obtain K operation results; and obtain the performance evaluation index based on the K operation results.
  • the circuit determination module 1340 is configured to determine the candidate quantum circuit with the highest generation probability from the K candidate quantum circuits generated last time; determine the candidate quantum circuit with the highest generation probability as the candidate quantum circuit. for the target quantum circuit.
  • the apparatus 1300 further includes: a parameter acquisition module 1350 for, for the jth line unit in the ith candidate quantum circuit, according to the jth line unit At the position in the line unit pool and the position in the i-th candidate quantum circuit, the line parameters of the j-th line unit are obtained from the line parameter pool.
  • the line parameter pool includes line parameters of each line unit in the line unit pool at each position to be filled; i is a positive integer less than or equal to K, and j is a positive integer.
  • the apparatus 1300 further includes: a parameter tuning module 1360 for fixing the structure of the target quantum circuit and adjusting each circuit unit included in the target quantum circuit The circuit parameters of ; when the adjustment termination condition is satisfied, the target quantum circuit after parameter optimization is obtained.
  • the line units included in each set of line units are repeatable.
  • the technical solutions of the present application can be used to construct a target quantum circuit for solving the corresponding problems, so that different types of quantum circuit design problems can be highly abstracted and unified.
  • the scheme has strong universality and versatility.
  • the technical solution of the present application only needs to determine the performance evaluation index corresponding to the candidate quantum circuit obtained by sampling, and then based on the performance evaluation index, the sampling method and circuit are determined.
  • the circuit units in the unit pool are updated synchronously, so that a candidate quantum circuit with better performance can be quickly constructed, which not only reduces the amount of calculation, but also improves the efficiency of finalizing the target quantum circuit.
  • FIG. 15 shows a block diagram of an apparatus for determining a quantum circuit provided by another embodiment of the present application.
  • the apparatus has the function of implementing the above method example, and the function may be implemented by hardware or by executing corresponding software by hardware.
  • the apparatus may be the computer equipment described above, or may be provided in the computer equipment.
  • the apparatus 1500 may include: a circuit unit selection module 1510 , a circuit parameter determination module 1520 and a quantum circuit construction module 1530 .
  • the line unit selection module 1510 is used to select N line units from the line unit pool, the line unit pool includes a plurality of line units, each line unit is an equivalent quantum circuit corresponding to a unitary matrix, and the N is Integer greater than 1.
  • the line parameter determination module 1520 is configured to determine line parameters corresponding to the N line units respectively, where the line parameters are used to define operations performed by the line units, and the line parameters are updatable.
  • the quantum circuit construction module 1530 is configured to construct and generate a quantum circuit based on the N circuit units and circuit parameters corresponding to the N circuit units respectively.
  • the line parameter determination module 1520 is configured to, for the ith line unit in the N line units, select from the line parameter pool according to the to-be-filled position of the ith line unit obtain the line parameters of the i-th line unit;
  • the line parameter pool includes line parameters of each line unit in the line unit pool at each position to be filled; i is a positive integer less than or equal to N.
  • the apparatus 1500 further includes: an evaluation index determination module 1540 , a gradient information calculation module 1550 and a line parameter update module 1560 .
  • the evaluation index determination module 1540 is configured to determine the performance evaluation index corresponding to the quantum circuit.
  • the gradient information calculation module 1550 is configured to calculate target gradient information based on the performance evaluation index, where the target gradient information is gradient information of circuit parameters of the quantum circuit.
  • the circuit parameter updating module 1560 is configured to update the circuit parameters of the quantum circuit based on the target gradient information to obtain an updated quantum circuit.
  • the performance evaluation index is an operation result of an objective function.
  • the gradient information calculation module 1550 is configured to calculate the derivative of the objective function with respect to the circuit parameters of the quantum circuit to obtain the objective gradient information.
  • the line units included in the N line units are repeatable.
  • the technical solutions provided in the embodiments of the present application consider the quantum circuit as a stack of equivalent quantum circuits corresponding to a series of unitary matrices, so as to divide the quantum circuit into circuit units, and construct circuits by constructing circuits.
  • the unit pool provides optional circuit units, and circuit units are selected from the circuit unit pool to construct quantum circuits, which realizes the search of differentiable quantum structures and provides a universal and universal quantum circuit construction scheme.
  • FIG. 17 shows a structural block diagram of a computer device provided by an embodiment of the present application.
  • the computer device can be used to implement the quantum circuit determination method provided in the above-mentioned embodiments.
  • the computer device 1700 includes a processing unit (such as a CPU (Central Processing Unit, central processing unit), a GPU (Graphics Processing Unit, graphics processor) and an FPGA (Field Programmable Gate Array, field programmable gate array, etc.) 1701, including A RAM (Random-Access Memory) 1702 and a system memory 1704 of a ROM (Read-Only Memory) 1703, and a system bus 1705 connecting the system memory 1704 and the central processing unit 1701.
  • a processing unit such as a CPU (Central Processing Unit, central processing unit), a GPU (Graphics Processing Unit, graphics processor) and an FPGA (Field Programmable Gate Array, field programmable gate array, etc.) 1701, including A RAM (Random-Access Memory) 1702 and a system memory 1704 of a ROM (Read-Only Memory) 1703, and a system bus 1705 connecting the system memory 1704 and the central processing unit 1701.
  • a processing unit such as a CPU (Central Processing Unit, central processing unit),
  • the computer device 1700 also includes a basic input/output system (I/O system) 1706 that facilitates the transfer of information between various devices within the server, and a basic input/output system (I/O system) 1706 for storing an operating system 1713, application programs 1714, and other program modules 1715
  • the basic input/output system 1706 includes a display 1708 for displaying information and input devices 1709 such as a mouse, keyboard, etc., for user input of information.
  • the display 1708 and the input device 1709 are both connected to the central processing unit 1701 through the input and output controller 1710 connected to the system bus 1705 .
  • the basic input/output system 1706 may also include an input output controller 1710 for receiving and processing input from a number of other devices such as a keyboard, mouse, or electronic stylus.
  • input output controller 1710 also provides output to a display screen, printer, or other type of output device.
  • the mass storage device 1707 is connected to the central processing unit 1701 through a mass storage controller (not shown) connected to the system bus 1705 .
  • the mass storage device 1707 and its associated computer-readable media provide non-volatile storage for the computer device 1700 . That is, the mass storage device 1707 may include a computer-readable medium (not shown) such as a hard disk or a CD-ROM (Compact Disc Read-Only Memory) drive.
  • Computer-readable media can include computer storage media and communication media.
  • Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data.
  • Computer storage media include RAM, ROM, EPROM (Erasable Programmable Read-Only Memory, Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory, Electrically Erasable Programmable Read-Only Memory), flash memory or Other solid-state storage technologies, CD-ROM, DVD (Digital Video Disc, high-density digital video disc) or other optical storage, cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices.
  • the system memory 1704 and the mass storage device 1707 described above may be collectively referred to as memory.
  • the computer device 1700 may also be connected to a remote computer on the network through a network such as the Internet to run. That is, the computer device 1700 can be connected to the network 1712 through the network interface unit 1711 connected to the system bus 1705, or can also use the network interface unit 1711 to connect to other types of networks or remote computer systems (not shown) .
  • the memory also includes at least one instruction, at least one piece of program, set of code or set of instructions stored in the memory and configured to be executed by one or more processors , in order to realize the determination method of the above quantum circuit.
  • a computer-readable storage medium stores at least one instruction, at least one segment of a program, a code set or an instruction set, the at least one instruction, the at least one segment
  • the program, the code set or the instruction set when executed by the processor, implements the above determination method of the quantum circuit.
  • the computer-readable storage medium may include: ROM (Read-Only Memory, read-only memory), RAM (Random-Access Memory, random access memory), SSD (Solid State Drives, solid-state hard disk), or an optical disk.
  • the random access memory may include ReRAM (Resistance Random Access Memory, resistive random access memory) and DRAM (Dynamic Random Access Memory, dynamic random access memory).
  • a computer program product or computer program comprising computer instructions stored in a computer readable storage medium.
  • the processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above method for determining a quantum circuit.
  • references herein to "a plurality” means two or more.
  • "And/or" which describes the association relationship of the associated objects, means that there can be three kinds of relationships, for example, A and/or B, which can mean that A exists alone, A and B exist at the same time, and B exists alone.
  • the character "/" generally indicates that the associated objects are an "or” relationship.
  • the numbering of the steps described in this document only exemplarily shows a possible execution sequence between the steps. In some other embodiments, the above steps may also be executed in different order, such as two different numbers. The steps are performed at the same time, or two steps with different numbers are performed in a reverse order to that shown in the figure, which is not limited in this embodiment of the present application.

Abstract

本申请公开了一种量子线路的确定方法、装置、设备及存储介质,属于量子技术领域。所述方法包括:按照初始的取样方式,从初始的线路单元池中取样K组线路单元,构造生成K个候选量子线路;确定K个候选量子线路对应的性能评价指标;基于性能评价指标对取样方式以及线路单元池中的线路单元进行更新;按照更新后的取样方式,从更新后的线路单元池中取样K组线路单元,构造生成K个候选量子线路;在满足循环中止条件的情况下,从最后一次生成的K个候选量子线路中确定目标量子线路。本申请方案具有极强的普适性和通用性,且能够高效地构造出用于完成目标任务的量子线路,且计算消耗小。

Description

量子线路的确定方法、装置、设备及存储介质
本申请要求于2020年10月14日提交的申请号为202011096965.7、发明名称为“量子线路的确定方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及量子技术领域,特别涉及一种量子线路的确定方法、装置、设备及存储介质。
背景技术
量子线路是量子通用计算机的一种表示,代表了相应量子算法/程序在量子门模型下的硬件实现。
针对不同的量子计算任务,需要构建不同的量子线路来完成相应的任务。目前已有的构建量子线路的方案,存在复杂低效且通用性差的问题。
发明内容
本申请实施例提供了一种量子线路的确定方法、装置、设备及存储介质。所述技术方案如下:
根据本申请实施例的一个方面,提供了一种量子线路的确定方法,所述方法包括:
按照初始的取样方式,从初始的线路单元池中取样K组线路单元,构造生成K个候选量子线路;其中,每一组线路单元包括至少一个线路单元,用于构造生成一个候选量子线路;K为正整数;
确定所述K个候选量子线路对应的性能评价指标;
基于所述性能评价指标对所述取样方式以及所述线路单元池中的线路单元进行更新,得到更新后的取样方式和更新后的线路单元池;
按照所述更新后的取样方式,从所述更新后的线路单元池中取样K组线路单元,构造生成K个候选量子线路;
在满足循环中止条件的情况下,从最后一次生成的所述K个候选量子线路中确定目标量子线路。
根据本申请实施例的一个方面,提供了一种量子线路的确定方法,所述方法包括:
从线路单元池中选取N个线路单元,所述线路单元池中包括多个线路单元,每个线路单元是一个酉矩阵对应的等效量子线路,所述N为大于1的整数;
确定所述N个线路单元分别对应的线路参数,所述线路参数用于定义所述线路单元所执行的操作,且所述线路参数是可更新的;
基于所述N个线路单元以及所述N个线路单元分别对应的线路参数,构造生成量子线路。
根据本申请实施例的一个方面,提供了一种量子线路的确定装置,所述装置包括:
线路取样模块,用于按照初始的取样方式,从初始的线路单元池中取样K组线路单元,构造生成K个候选量子线路;其中,每一组线路单元包括至少一个线路单元,用于构造生成一个候选量子线路;K为正整数;
线路评价模块,用于确定所述K个候选量子线路对应的性能评价指标;
参数更新模块,用于基于所述性能评价指标对所述取样方式以及所述线路单元池中的线路单元进行更新,得到更新后的取样方式和更新后的线路单元池;
所述线路取样模块,还用于按照所述更新后的取样方式,从所述更新后的线路单元池中取样K组线路单元,构造生成K个候选量子线路;
线路确定模块,用于在满足循环中止条件的情况下,从最后一次生成的所述K个候选量子线路中确定目标量子线路。
根据本申请实施例的一个方面,提供了一种量子线路的确定装置,所述装置包括:
线路单元选取模块,用于从线路单元池中选取N个线路单元,所述线路单元池中包括多个线路单元,每个线路单元是一个酉矩阵对应的等效量子线路,所述N为大于1的整数;
线路参数确定模块,用于确定所述N个线路单元分别对应的线路参数,所述线路参数用于定义所述线路单元所执行的操作,且所述线路参数是可更新的;
量子线路构造模块,用于基于所述N个线路单元以及所述N个线路单元分别对应的线路参数,构造生成量子线路。
根据本申请实施例的一个方面,提供了一种计算机设备,所述计算机设备包括处理器和存储器,所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现上述量子线路的确定方法。
根据本申请实施例的一个方面,提供了一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由处理器加载并执行以实现上述量子线路的确定方法。
根据本申请实施例的一个方面,提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述量子线路的确定方法。
本申请实施例提供的技术方案可以包括如下有益效果:
针对不同类型的量子线路设计问题,都可以采用本申请技术方案构建出一个用于解决相应问题的目标量子线路,使得不同类型的量子线路设计问题得到了高度的抽象和统一,该方案具有极强的普适性和通用性。
另外,相比于基因算法本身所存在的计算消耗大、收敛慢的缺陷,本申请技术方案仅需确定取样得到的候选量子线路对应的性能评价指标,然后基于该性能评价指标对取样方式以及线路单元池中的线路单元进行同步更新,从而能够快速构造出性能较优的候选量子线路,这不但减少了计算量,而且还提升了最终确定出目标量子线路的效率。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一个实施例提供的量子线路的确定方法的流程图;
图2是本申请另一个实施例提供的量子线路的确定方法的流程图;
图3是本申请一个实施例提供的可微量子结构搜索框架的示意图;
图4是本申请另一个实施例提供的量子线路的确定方法的流程图;
图5是本申请另一个实施例提供的量子线路的确定方法的流程图;
图6至图12示例性示出了几种采用本申请提供的可微量子结构搜索框架构建的量子线路的示意图;
图13是本申请一个实施例提供的量子线路结构的确定装置的框图;
图14是本申请另一个实施例提供的量子线路结构的确定装置的框图;
图15是本申请另一个实施例提供的量子线路结构的确定装置的框图;
图16是本申请另一个实施例提供的量子线路结构的确定装置的框图;
图17是本申请一个实施例提供的计算机设备的框图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
云技术(cloud technology)是指在广域网或局域网内将硬件、软件、网络等系列资源统一起来,实现数据的计算、储存、处理和共享的一种托管技术。
云技术是基于云计算商业模式应用的网络技术、信息技术、整合技术、管理平台技术、应用技术等的总称,可以组成资源池,按需所用,灵活便利。云计算技术将变成重要支撑。技术网络系统的后台服务需要大量的计算、存储资源,如视频网站、图片类网站和更多的门户网站。伴随着互联网行业的高度发展和应用,将来每个物品都有可能存在自己的识别标志,都需要传输到后台系统进行逻辑处理,不同程度级别的数据将会分开处理,各类行业数据皆需要强大的系统后盾支撑,能通过云计算来实现。
云技术涉及云计算、云存储、数据库和大数据等基础技术,基于云技术提供的云应用包括医疗云、云物联、云安全、云呼叫、私有云、公有云、混合云、云游戏、云教育、云会议、云社交、人工智能云服务等。随着云技术的发展以及云技术在不同领域的应用,将会出现越来越多的云应用。
通常来讲,基于云技术构建的系统包括服务器和终端。服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN(Content Delivery Network,内容分发网络)、以及大数据和人工智能平台等基础云计算服务的云服务器。终端可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能音箱、智能手表等,但并不局限于此。终端和服务器之间可以通过有线或无线通信方式进行直接或间接地连接,本申请在此不作限制。
量子计算机(quantum computer)是利用量子力学原理来进行计算的一种机器。基于量子力学的叠加原理和量子纠缠,量子计算机具有较强的并行处理能力,可以解决一些经典计算机难以计算的问题。超导量子比特的零电阻特性及与集成电路接近的制造工艺,使得利用超导量子比特构建的量子计算体系是目前最有希望实现实用量子计算的体系之一。
量子处理器是指量子级计算机处理器,也就是量子计算机的处理器。量子处理器可以包括一个或者多个量子芯片。
量子芯片(或称为超导量子芯片)是量子计算机的中央处理器,是量子计算机的核心部件。量子芯片是将量子线路集成在基片上,进而承载量子信息处理的功能。借鉴于传统计算机的发展历程,量子计算机的研究在克服瓶颈技术之后,要想实现商品化和产业升级,需要走集成化的道路。超导系统、半导体量子点系统、微纳光子学系统、甚至是原子和离子系统,都想走芯片化的道路。从发展看,超导量子芯片系统从技术上走在了其它物理系统的前面;传统的半导体量子点系统也是人们努力探索的目标,因为毕竟传统的半导体工业发展已经很成熟,如半导体量子芯片在退相干时间和操控精度上一旦突破容错量子计算的阈值,有望集成传统半导体工业的现有成果,节省开发成本。
鉴于量子计算机的优势,未来基于云技术构建的系统中可以使用量子计算机来进行一些处理和计算,以提供更好的服务。
在对本申请技术方案进行介绍之前,先对本申请中涉及的一些关键术语进行解释说明。
1、量子计算:基于量子逻辑的计算方式,存储数据的基本单元是量子比特(qubit)。
2、量子比特:量子计算的基本单元。传统计算机使用0和1作为二进制的基本单元。不同的是量子计算可以同时处理0和1,系统可以处于0和1的线性叠加态:|ψ>=α|0>+β|1>,这边α,β代表系统在0和1上的复数概率幅。它们的模平方|α| 2,|β| 2分别代表处于0和1的概率。
3、量子线路:量子通用计算机的一种表示,代表了相应量子算法/程序在量子门模型下 的硬件实现。
4、哈密顿量:描述量子系统总能量的一个厄密共轭的矩阵。哈密顿量是一个物理词汇,是一个描述系统总能量的算符,通常以H表示。
5、本征态:对于一个哈密顿量矩阵H,满足方程:H|ψ>=E|ψ>的解称之为H的本征态|ψ>,具有本征能量E。基态则对应了量子系统能量最低的本征态。
6、神经网络结构搜索(Neural Architecture Search,简称NAS):自动化机器学习(Auto Machine Learning,简称AutoML)中的关键领域,其利用强化学习,基因算法以及可微结构搜索等多种不同的底层技术方案,以实现计算机自动化搜寻构建性能优异的神经网络拓扑和结构的目的。
7、量子结构搜索(Quantum Architecture Search,简称QAS):尝试对量子线路的结构、模式和排布进行自动化和程序化搜索的一系列工作和方案的总称。传统上量子结构搜索的工作通常会采用贪心算法、强化学习或基因算法作为其核心技术。
8、量子经典混合计算:一种内层利用量子线路进行计算,外层用传统的经典优化器调节变分量子线路参数的计算范式,可以最大限度地发挥量子计算的优势,被相信是有潜力证明量子优势的重要方向之一。
9、量子近似优化算法(Quantum Approximate Optimization Algorithm,简称QAOA):一种特定的量子线路结构假设,通过这样的量子线路产生的量子态可以用来近似NP(Non-deterministic Polynomial,非确定性多项式)完全的组合数学优化问题的结果,属于典型的量子经典混合计算范式。这种特定的量子线路的定义如下:
Figure PCTCN2021073639-appb-000001
其中H c,H b分别为mixer和phase哈密顿量,γ,β为变分参数。一般地,H c与我们想要优化的目标函数相同。|ψ 0>是容易制备的初始波函数,通常为直积态
Figure PCTCN2021073639-appb-000002
而|ψ>则是目标态波函数。P代表了QAOA假设排布的层数,P越大,越接近绝热近似,目标波函数越接近理论结果,近似效果越好。
10、最大切割(max cut)问题:一个典型的复杂度为NP完全的图论组合优化问题,也是QAOA算法最早用来解决的问题。MAX CUT指的是对于给定了节点和边连接的图,找到一种节点的二分方案,使得跨两种节点的边数(或边权重)的和最大。
11、NISQ(Noisy Intermediate-Scale Quantum):近期中等规模有噪声的量子硬件,是量子计算发展现在所处的阶段和研究的重点方向。这一阶段量子计算暂时由于规模和噪声的限制,无法作为通用计算的引擎应用,但在部分问题上,已经可以实现超越最强经典计算机的结果,这通常被称作量子霸权或量子优势。
12、量子误差消除(Quantum Error Mitigation):与量子纠错(Quantum Error Correction)相对应,是一系列NISQ时代硬件下的更小资源代价的量子错误缓解和噪声抑制方案。相比完整的量子纠错所需的资源明显减少,同时可能只适用于特定任务,而非通用方案。
13、变分-量子-本征解算器(Variational-Quantum-Eigensolver,简称VQE):通过变分线路实现特定量子系统基态能量的估计,也是一种典型的量子经典混合计算范式,在量子化学领域有广泛的应用。
目前比较常规的一种构建量子线路的方案是采用基因算法。其基本做法是通过在固定量子线路的一部分线路结构之后,采用基因算法寻找下一部分最优的线路结构,通过多次重复上述过程,最终构造出一个完整的量子线路。但是,由于基因算法本身存在计算量大、效率低的问题,导致量子线路的构建十分的复杂低效。而且,方案通用性较差,比如针对不同的量子计算任务需要选择不同变种的基因算法。
本申请提供了一种用于构建量子线路的技术方案,该技术方案可以称为可微量子结构搜 索(Differentiable Quantum Architecture Search,简称DQAS)方案(或可微量子结构搜索框架)。在本申请提出的可微量子结构搜索框架下,不同类型的量子线路设计问题得到了高度的抽象和统一,使得该框架具有极强的普适性,不需要进行修改就可以解决多个子领域的重要问题。例如,采用该框架构建的量子线路,可用于量子计算和量子信息处理的多个子领域,包括但不限于量子态的制备、量子线路的设计、量子编译、最优变分结构搜索,以及量子误差抑制等。采用该框架能够自动设计和发现最优的量子线路结构及线路参数,从而实现多目标、全自动、端到端的量子线路自动设计。
下面,首先对本申请技术方案进行概述性说明。
任意量子线路都可视为由一系列的酉矩阵堆叠而成,也即:
Figure PCTCN2021073639-appb-000003
其中,U表示量子线路,U i表示组成该量子线路U的第i个酉矩阵对应的等效量子线路,θ i表示该第i个酉矩阵对应的等效量子线路的线路参数,如θ i可以包含零到若干个线路参数,i∈[0,p]且i为整数。量子线路的线路参数是变分参数,所谓变分参数是指量子线路的线路参数是可更新的(即可调整和修改的),从而可以通过优化器更新量子线路的线路参数,以达到优化目标函数的目的。通过将任意量子线路视为由一系列的酉矩阵堆叠而成,使得我们的搜索方案不限于量子经典混合计算范式的假设线路搜索,而适用于更广泛的包含线路参数或不包含参数的问题。也就是说,我们可以同样用这一方案来寻找完全离散的量子门排布的最优量子线路设计,线路本身的变分参数存在与否该方案都可以兼容。
为了制备按上述公式描述的量子线路U,需要对于具体问题设定一种编码方案,也即每个占位符U i究竟代表什么,其可以是一个单比特门,也可以是一层的量子门,或者是一个哈密顿量的含时演化e iHθ。在本申请实施例中,构建一个线路单元池,该线路单元池中包括多个可供选择的线路单元,每个线路单元可看作是一个酉矩阵线路,即一个酉矩阵的等效量子线路。可选地,对于量子计算任务中可能涉及的一些基础操作,针对每一种基础操作设计相对应的一个线路单元。例如,一个线路单元可以是一个单比特量子门,也可以是一层的量子门,或者是一个哈密顿量的含时演化等等,本申请实施例对此不作限定。对于每一个占位符U i,从线路单元池中挑选一个线路单元来填充,这一挑选是有放回的,以保证每个线路单元是可以在最终构建的量子线路中重复利用的。
对于每一个具体的量子线路设计任务,需要指定相适应的目标函数。最常见的量子经典混合计算,这类优化问题的范式,是采用一系列观察量H的期望和作为优化目标。所谓观察量(也称为观测量),指的是一些可以测量得到经典输出的厄米矩阵算符。也即目标函数L为:
Figure PCTCN2021073639-appb-000004
其中,U就是我们要搜索构建的量子线路,而
Figure PCTCN2021073639-appb-000005
是对应线路矩阵的转置共轭。对于更复杂的需求,优化目标函数可以是观察量H i期望的某些函数,这样优化目标可以同时考虑到输出量子态的期望和具体分布情况。此时更通用的目标函数L可以表示为:
Figure PCTCN2021073639-appb-000006
其中,f i,g i是适用于特定任务的任意可微函数,表示了最终的目标函数L是观察量结果的某种变换。
更一般地,对于其他如量子机器学习等任务,目标函数L可以定义为以下类似传统监督学习的形式:
Figure PCTCN2021073639-appb-000007
其中,f i,g i是适用于特定任务的任意可微函数,|ψ j>是对应的量子波函数输入的数据集,y j是数据集相应量子态对应的经典标签,通常为0或1。
而对于通用酉矩阵学习任务,相应的目标函数L为:
Figure PCTCN2021073639-appb-000008
其中,φ i,ψ i分别对应了线路的输入态和输出态。若i只有一项且|ψ i>=|0>的特例,则对应了量子态制备任务。此时的目标函数表征的是输入简单直积态|0>经过线路U作用后的输出量子态与制备目标态|φ>的保真度。优化该目标函数可以使我们找到制备相应量子态的线路。
总之,由于整个计算过程都支持自动微分,这一自动微分的特性使得可微量子结构搜索框架对任意形式的端到端优化目标函数都有很好的支持。整个线路参数的调整优化所需要的梯度,都可以由最后目标函数的变化反向传播回来,这一过程只需要目标函数定义的组件是可自动微分的即可,而性质良好的任意函数几乎都满足该要求。
为了将控制量子线路结构的参数嵌入到连续域,本申请将组成量子线路的线路单元选取的过程视为是被一个概率模型所控制。这一概率模型P可以是足够普适的能量模型或者自回归(autoregressive)网络。在实例中,可以选取最简单的逐层离散分布,来刻画从线路单元池中挑选线路单元进行量子线路构造的过程。这一概率模型具有连续参数α,由此从该概率模型P(k,α)中可取样离散整数的结构参数k,其决定了对应量子线路的结构。
最后,端到端的优化目标函数
Figure PCTCN2021073639-appb-000009
则如下所示:
Figure PCTCN2021073639-appb-000010
其中,P(k,α)表示概率模型,U(k,θ)表示基于结构参数k构造生成的候选量子线路,结构参数k可以包括若干个离散数值,用于表示本次取样获取的线路单元,L(U(k,θ))表示候选量子线路U(k,θ)对应的目标函数。
在对本申请方法实施例进行介绍说明之前,先对该方法的运行环境进行介绍说明。本申请实施例提供的量子线路结构的确定方法,其可以由经典计算机(如PC(Personal Computer,个人计算机))执行实现,例如通过经典计算机执行相应的计算机程序以实现该方法;也可以在经典计算机和量子计算机的混合设备环境下执行,例如由经典计算机执行线路取样、参数更新以及线路选择等步骤,而由量子计算机执行确定候选量子线路对应的性能评价指标(如目标函数)等步骤,因为将量子线路直接部署在量子计算机上执行,相比于在经典计算机上模拟上述量子线路,相应的性能评估结果理论上应当更佳。
在下述方法实施例中,为了便于说明,仅以各步骤的执行主体为计算机设备进行介绍说明。应当理解的是,该计算机设备可以是经典计算机,也可以包括经典计算机和量子计算机的混合执行环境,本申请实施例对此不作限定。
请参考图1,其示出了本申请一个实施例提供的量子线路的确定方法的流程图。该方法各步骤的执行主体可以是计算机设备。该方法可以包括如下几个步骤(101~105):
步骤101,按照初始的取样方式,从初始的线路单元池中取样K组线路单元,构造生成K个候选量子线路,K为正整数。
线路单元池中包括多个可供选择的线路单元。在本申请实施例中,线路单元是组成量子线路的基本单元,一个量子线路可以包括一个或者多个线路单元。在量子线路包括多个线路 单元的情况下,各个线路单元之间的连接关系可以预先定义或设计。在一个示例中,一个量子线路为多层结构,每一层中包含一个线路单元,各层之间顺次连接,如某一层线路单元的输出结果,可以作为其下一层线路单元的输入数据,并经过该下一层线路单元做进一步的计算或处理。在另一个示例中,一个量子线路为多层结构,每一层中包含一个或多个用于填充线路单元的待填充位置。在同一层中包含多个待填充位置的情况下,各个待填充位置之间可以预先按照设定方式进行连接。
可选地,对于量子计算任务中可能涉及的一些基础操作,针对每一种基础操作设计相对应的一个线路单元。例如,一个线路单元可以是一个单比特量子门,也可以是一层的量子门,或者是一个哈密顿量的含时演化等等,本申请实施例对此不作限定。
取样方式是指从线路单元池中选取线路单元的方式。每一次取样从线路单元池中选取一个或多个线路单元,一次取样选取的该一个或多个线路单元构成一组线路单元,即每一组线路单元包括至少一个线路单元。在本申请实施例中,每一组线路单元用于构造生成一个候选量子线路。另外,每一组线路单元中包括的线路单元是可重复的。也即,上述取样过程是有放回的,以保证每个线路单元是可以在最终构建的量子线路中重复利用的。
例如,初始的线路单元池中包括编号分别为0、1、2、3、4的5个线路单元。假设按照初始的取样方式,从该初始的线路单元池中进行3次取样,获取3组线路单元。假设第1次取样获取的一组线路单元包括编号依次为2、1、3的3个线路单元,第2次取样获取的一组线路单元包括编号依次为2、1、1的3个线路单元,第3次取样获取的一组线路单元包括编号依次为2、1、4的3个线路单元。之后,按照上述取样结果,构造生成3个候选量子线路。
步骤102,确定K个候选量子线路对应的性能评价指标。
性能评价指标是用于量化评价候选量子线路的性能的参数。在本申请实施例中,K个候选量子线路对应的性能评价指标,是用于评价该K个候选量子线路的综合性能或平均性能的参数,反映了该K个候选量子线路各自性能的整体情况或均值情况。
在示例性实施例中,采用目标函数来表征上述性能评价指标。目标函数是用于计算构造生成的量子线路是否达到任务优化目标的数学函数。例如,如上文介绍,针对不同的量子线路设计任务,可以对应设置不同的目标函数。
步骤103,基于性能评价指标对取样方式以及线路单元池中的线路单元进行更新,得到更新后的取样方式和更新后的线路单元池。
性能评价指标用于指导对取样方式和线路单元的线路参数的调整,以使得取样出性能更优的候选量子线路。一方面,基于性能评价指标对取样方式进行更新,以优化取样方式,从线路单元池中选取更优的线路单元的组合方案;另一方面,基于性能评价指标对线路单元池中的线路单元进行更新,如对线路单元的线路参数进行更新,以优化单个线路单元的表现性能,进而有助于提升构造出的量子线路整体的表现性能。
步骤104,按照更新后的取样方式,从更新后的线路单元池中取样K组线路单元,构造生成K个候选量子线路。
步骤104中的取样过程与步骤101中介绍的取样过程相同或类似,不同之处在于取样方式和线路单元池中线路单元的线路参数发生了更新,在步骤104中按照更新后的取样方式,从更新后的线路单元池中取样K组线路单元。
需要说明的一点是,步骤104中的取样次数和步骤101中的取样次数可以相同,也可以不同。例如,在步骤104中的取样次数和步骤101中的取样次数相同的情况下,如步骤101中的K等于10,步骤104中的K也等于10。又例如,在步骤104中的取样次数和步骤101中的取样次数不相同的情况下,如步骤101中的K等于10,步骤104中的K等于8。由于取样方式对应的概率模型在这一循环过程中趋向于收敛,因此自适应的减小每一轮的取样个数K的值,可以保持性能的同时有效节约计算资源。
另外,在上述步骤104之后,可以循环执行上述步骤102~104,以不断地更新优化取样方式以及不断地更新优化线路参数,从而构造出更优的候选量子线路,直至满足循环中止条 件时,停止该循环过程。
循环中止条件是指预先设定的用于触发停止上述循环过程的条件。示例性地,该循环中止条件包括但不限于以下至少一种:最后一次生成的K个候选量子线路相同、最后一次生成的K个候选量子线路中存在大于阈值数量的相同量子线路、最后一次生成的K个候选量子线路对应的性能评价指标符合设定指标要求、循环过程的执行次数达到设定次数等等,本申请实施例对此不作限定。
步骤105,在满足循环中止条件的情况下,从最后一次生成的K个候选量子线路中确定目标量子线路。
目标量子线路是从最后一次生成的K个候选量子线路中确定出的一个量子线路,该目标量子线路可以是从最后一次生成的K个候选量子线路中选取的某一个量子线路。在本申请实施例中,目标量子线路即为最终构造生成的,用于达成某一既定的量子线路设计任务的量子线路。
在示例性实施例中,从最后一次生成的K个候选量子线路中,确定生成概率最大的候选量子线路;将该生成概率最大的候选量子线路,确定为目标量子线路。某一候选量子线路的生成概率,可以是该候选量子线路在上述K个候选量子线路中的数量占比。例如,最后一次生成的候选量子线路的数量为10,其中9个候选量子线路相同(记为量子线路A),另外1个候选量子线路与其他9个不同(记为量子线路B)。那么,量子线路A的生成概率即为9/10=0.9,量子线路B的生成概率即为1/10=0.1,可以选择量子线路A作为最终的目标量子线路。
综上所述,针对不同类型的量子线路设计问题,都可以采用本申请技术方案构建出一个用于解决相应问题的目标量子线路,使得不同类型的量子线路设计问题得到了高度的抽象和统一,该方案具有极强的普适性和通用性。
另外,相比于基因算法本身所存在的计算消耗大、收敛慢的缺陷,本申请技术方案仅需确定取样得到的候选量子线路对应的性能评价指标,然后基于该性能评价指标对取样方式以及线路单元池中的线路单元进行同步更新,从而能够快速构造出性能较优的候选量子线路,这不但减少了计算量,而且还提升了最终确定出目标量子线路的效率。
请参考图2,其示出了本申请另一个实施例提供的量子线路的确定方法的流程图。该方法各步骤的执行主体可以是计算机设备。该方法可以包括如下几个步骤(201~211):
步骤201,构建初始的概率模型,该概率模型包括p×c个参数;其中,p表示最大线路单元数量,c表示线路单元池中的线路单元的总数。
在本申请实施例中,可以采用概率模型作为取样方式,从线路单元池中取样获取若干组线路单元。该概率模型是一个含参概率模型,其包括p×c个参数;其中,p表示最大线路单元数量,c表示线路单元池中的线路单元的总数。
最大线路单元数量是指最终构造生成的用于达成某一既定的量子线路设计任务的目标量子线路中,可能包含的线路单元的最大数量。例如,最大线路单元数量为6,那么最终构造生成的目标量子线路中包含的线路单元的实际数量应当小于等于6,在这种情况下,每次取样获取的一组线路单元中可以包括6个线路单元,也可以包括6个以下的线路单元。在一个示例中,目标量子线路中包含的线路单元为既定数量,如预先规定好目标量子线路中包含的线路单元的数量为6,那么每次取样获取的一组线路单元中均包括6个线路单元。此时,最大线路单元数量即为该既定数量,该既定数量可以根据目标量子线路的设计层数或者待填充位置数决定。
线路单元池中包含多个线路单元。在上文已经介绍,任意量子线路都可视为由一系列的酉矩阵堆叠而成,因此线路单元池中可以包括多个酉矩阵分别对应的等效线路。线路单元池也可以称为算符池或者其他名称,本申请实施例对此不作限定。
在本申请实施例中,假设概率模型的模型参数为α,α包括p×c个参数。例如,α可看作 是一个p行×c列的矩阵,矩阵中第i行第j列的元素,表示在目标量子线路的第i个待填充位置填充线路单元池中的第j个线路单元的概率,i为小于等于p的正整数,j为小于等于c的正整数。
步骤202,基于初始的概率模型,对初始的线路单元池进行K次取样,每次取样获取一组线路单元,得到K组线路单元。
在每一次取样过程中,基于概率模型P(k,α)的模型参数α生成结构参数k,该结构参数k可以包括若干个离散数值,用于表示本次取样获取的线路单元。例如,线路单元池中包括编号分别为0、1、2、3、4的5个线路单元,结构参数k包括(2,1,3),表示从线路单元池中取样获取的一组线路单元包括编号依次为2、1、3的3个线路单元。需要说明的是,在概率模型P(k,α)的模型参数α相同的情况下,任意两次取样生成的结构参数k可能相同,也可能不同。例如,前后两次取样生成的结构参数k相同,均为(2,1,3);又例如,前后两次取样生成的结构参数k不同,前一次为(2,1,3),后一次为(2,1,4)。
另外,假设线路单元池中每个线路单元的线路参数数目为l,那么可以维护一个线路参数池,该线路参数池中包括线路单元池中的每一个线路单元在每一个待填充位置上的线路参数,即该线路参数池中包括p×c×l个参数。
步骤203,基于K组线路单元,构造生成K个候选量子线路。
对于取样获取的每一组线路单元,相应地构造生成出一个候选量子线路。各个线路单元之间的连接关系可以预先定义或设计,本申请实施例对此不作限定。
步骤204,确定K个候选量子线路对应的性能评价指标,该性能评价指标为目标函数的运算结果。
目标函数是用于计算构造生成的量子线路是否达到任务优化目标的数学函数。例如,如上文介绍,针对不同的量子线路设计任务,可以对应设置不同的目标函数。
在本申请实施例中,假设基于结构参数k构造生成的候选量子线路为U(k,θ),该候选量子线路U(k,θ)对应的目标函数记为L(U(k,θ)),那么经K次取样后构造生成的K个候选量子线路对应的目标函数
Figure PCTCN2021073639-appb-000011
可如下式表示:
Figure PCTCN2021073639-appb-000012
由上式可以看出,先计算K个候选量子线路针对目标函数分别对应的运算结果,得到K个运算结果,然后基于该K个运算结果,得到性能评价指标(即目标函数
Figure PCTCN2021073639-appb-000013
的运算结果)。该目标函数
Figure PCTCN2021073639-appb-000014
的运算结果反映了该K个候选量子线路各自性能的整体情况或均值情况。
步骤205,基于性能评价指标,计算第一梯度信息和第二梯度信息;其中,第一梯度信息是概率模型的模型参数的梯度信息,第二梯度信息是线路单元池中的线路单元的线路参数的梯度信息。
在本申请实施例中,一方面,计算目标函数相对于概率模型的模型参数的梯度信息,得到第一梯度信息,该第一梯度信息用于指导更新概率模型的模型参数;另一方面,计算目标函数相对于线路单元池中的线路单元的线路参数的梯度信息,得到第二梯度信息,该第二梯度信息用于指导更新线路单元的线路参数。
在一个示例中,计算目标函数相对于概率模型的模型参数的导数,得到第一梯度信息。示例性地,计算该第一梯度信息所采用的导数公式为:
Figure PCTCN2021073639-appb-000015
其中,
Figure PCTCN2021073639-appb-000016
代表目标函数
Figure PCTCN2021073639-appb-000017
相对于模型参数α的导数,公式中的其他参数可参见上文介绍说明,此处不再赘述。
在另一个示例中,计算目标函数相对于线路单元池中的线路单元的线路参数的导数,得 到第二梯度信息。示例性地,计算该第二梯度信息所采用的导数公式为:
Figure PCTCN2021073639-appb-000018
其中,
Figure PCTCN2021073639-appb-000019
代表目标函数
Figure PCTCN2021073639-appb-000020
相对于线路参数θ的导数,公式中的其他参数可参见上文介绍说明,此处不再赘述。
另外,在通过求导方式计算第一梯度信息时,可以利用蒙特卡洛期望自动微分的相关技术,包括但不限于得分函数(score function)或者重参数化(reparameterization)的方式。例如,采用得分函数的方案,可适用于普遍的包括未归一的概率分布模型。在通过求导方式计算第二梯度信息时,数值上可以利用自动微分求导,而实验上可以通过参数平移(parameter shift)或直接测量梯度量子线路的方法计算量子线路的导数。
步骤206,基于第一梯度信息对概率模型的模型参数进行更新,得到更新后的概率模型。
例如,采用梯度下降算法对概率模型的模型参数α进行更新,以不断优化该概率模型的模型参数α,从而取样出更优的线路单元的组合方案。
步骤207,基于第二梯度信息对线路单元池中的线路单元的线路参数进行更新,得到更新后的线路单元池。
例如,采用梯度下降算法对线路单元池中的各个线路单元的线路参数θ进行更新,以不断优化各个线路单元的线路参数θ,从而优化单个线路单元的表现性能,进而有助于提升构造出的量子线路整体的表现性能。
步骤208,按照更新后的概率模型,从更新后的线路单元池中取样K组线路单元,构造生成K个候选量子线路。
步骤209,在满足循环中止条件的情况下,从最后一次生成的K个候选量子线路中确定目标量子线路。
步骤208~209与图1实施例中的步骤104~105相同或类似,具体可参见上文实施例中的介绍说明,此处不再赘述。
可选地,本申请实施例提供的方法还包括如下步骤210~211,以实现对目标量子线路的线路参数进行进一步的调优。
步骤210,固定目标量子线路的结构,并调整目标量子线路中包含的各个线路单元的线路参数。
在确定出目标量子线路之后,其线路结构(也即线路中包含的线路单元以及各个线路单元之间的连接关系)就固定下来了,在有必要的情况下,可以进一步对该目标量子线路中包含的各个线路单元的线路参数进行进一步的调优,从而进一步提升目标量子线路的表现性能。
例如,通过计算目标函数相对于目标量子线路的线路参数的梯度信息,同样采用梯度下降算法对目标量子线路的线路参数进行更新,以不断优化目标量子线路的线路参数,以提升目标量子线路的表现性能。
步骤211,在满足调整中止条件的情况下,得到参数调优后的目标量子线路。
调整中止条件是指预先设定的用于触发停止对目标量子线路的线路参数进行调整的条件。示例性地,该调整中止条件包括但不限于以下至少一种:目标量子线路的性能评价指标达到预设指标、目标量子线路的线路参数的调整次数达到设定次数等等,本申请实施例对此不作限定。
在本申请实施例中,参数调优后的目标量子线路即为最终构造生成的,用于达成某一既定的量子线路设计任务的量子线路。
在示例性实施例中,在构造生成K个候选量子线路之后,还包括如下步骤:对于第i个候选量子线路中的第j个线路单元,根据该第j个线路单元在线路单元池中的位置以及在第i个候选量子线路中的位置,从线路参数池中获取第j个线路单元的线路参数;其中,线路参数池中包括线路单元池中的每一个线路单元在每一个待填充位置上的线路参数;i为小于等于 K的正整数,j为正整数。线路参数池中可以包括p×c组线路参数,第(i,j)组线路参数是线路单元池中的第j个线路单元填充至第i个待填充位置上时的线路参数,i为小于等于p的正整数,j为小于等于c的正整数。
通过上述方式,采用参数绑定机制将线路单元的线路参数与其待填充位置相绑定,这样在构造生成新的候选量子线路之后,能够简单高效地从线路参数池中获取各个线路单元的线路参数。另外,在基于第二梯度信息对线路单元池中各个线路单元的线路参数进行更新时,需要对线路参数池中保存的线路参数进行同步更新,从而保证从线路参数池中获取到的线路参数的准确性。
在示例性实施例中,为了更稳定的训练过程,可以引入和发展在NAS和更广泛的机器学习领域研究中出现的训练技巧,包括但不限于early stop(早停法),多起点,线路变分参数预热训练,训练验证数据集分开分别优化两组参数,较优训练结果的后处理和网格搜索,渐进式逐层训练,蒙卡梯度估计时添加目标函数的滑动平均值作为基线(baseline)以减小估计方差,线路参数添加随机噪声来平滑能量损失,在目标函数添加支持多目标的正则项和惩罚项,较小规模的代理任务和迁移学习等。
其中较为重要的是正则项的添加,由于概率模型的模型参数决定了每个线路单元的取样次数和概率,因此可以定义相应基于模型参数的正则项,从而鼓励某些类型的线路单元(如单比特量子门),即提升该类型的线路单元的取样次数和概率;或者,抑制某些类型的线路单元(如两比特量子门),即降低该类型的线路单元的取样次数和概率。例如,添加以下正则项到目标函数L之中,添加正则项后的目标函数L可表示为ΔL:
Figure PCTCN2021073639-appb-000021
其中,c代表线路单元池中线路单元的数量,p是待填充位置的数量,p(k i=k)是在第i个候选填充位置填充第k个线路单元的概率,λ是该正则项的权重,q代表线路单元中两比特量子门的数目。
上述引入自定义正则项方式,提升了线路单元取样的灵活性和可控性,从而有助于提升最终构造生成的量子线路的表现性能,并减少其量子噪声水平。
综上所述,本申请实施例提供的技术方案,将量子线路的搜索域放宽到连续空间,从而使自动微分和随机梯度下降成为可能,这极大地降低了计算资源的消耗,同时收敛性也能得到更好的保证。
另外,在参数优化的过程中,本申请通过计算第一梯度信息和第二梯度信息,基于上述两种梯度信息能够同时对模型参数和线路参数进行优化,实现了多目标的参数优化方案,有助于提升量子线路构建的效率。
下面,结合图3,对本申请实施例提供的可微量子结构搜索框架的完整架构进行介绍说明。假设通过该可微量子结构搜索框架,搜索构建出一个用于达成某一既定的量子线路设计任务的目标量子线路。其中,线路单元池31中包括多个可供选择的线路单元,如图中所示的线路单元1、2、3等。基于概率模型P(k,α)从线路单元池31中分批次取样获取K组线路单元,构造生成K个候选量子线路。参数池32用于存储量子线路的线路参数。对于构造生成的每一个候选量子线路中各个线路单元的线路参数,可以从参数池32中获取。另外,通过目标函数L对候选量子线路的性能进行评估,K个候选量子线路的整体性能可以采用目标函数
Figure PCTCN2021073639-appb-000022
进行评估。计算目标函数
Figure PCTCN2021073639-appb-000023
相对于概率模型的模型参数α的梯度信息
Figure PCTCN2021073639-appb-000024
以及目标函数
Figure PCTCN2021073639-appb-000025
相对于线路单元池31中线路单元的线路参数θ的梯度信息
Figure PCTCN2021073639-appb-000026
基于上述两个梯度信息,分别对模型参数α和线路参数θ进行更新。之后,按照更新后的概率模型,从更新后的线路单元池中取样K组线路单元,构造生成K个候选量子线路。循环执行上述过程,在满足循环中止条 件的情况下,从最后一次生成的K个候选量子线路中,选择生成概率最大的候选量子线路,作为最终的目标量子线路。
请参考图4,其示出了本申请另一个实施例提供的量子线路的确定方法的流程图。该方法各步骤的执行主体可以是计算机设备。该方法可以包括如下几个步骤(401~403):
步骤401,从线路单元池中选取N个线路单元,线路单元池中包括多个线路单元,每个线路单元是一个酉矩阵对应的等效量子线路,N为大于1的整数。
线路单元池中包括多个可供选择的线路单元。在本申请实施例中,线路单元是组成量子线路的基本单元,一个量子线路可以包括一个或者多个线路单元。在量子线路包括多个线路单元的情况下,各个线路单元之间的连接关系可以预先定义或设计。在一个示例中,一个量子线路为多层结构,每一层中包含一个线路单元,各层之间顺次连接,如某一层线路单元的输出结果,可以作为其下一层线路单元的输入数据,并经过该下一层线路单元做进一步的计算或处理。在另一个示例中,一个量子线路为多层结构,每一层中包含一个或多个用于填充线路单元的待填充位置。在同一层中包含多个待填充位置的情况下,各个待填充位置之间可以预先按照设定方式进行连接。
可选地,对于量子计算任务中可能涉及的一些基础操作,针对每一种基础操作设计相对应的一个线路单元。例如,一个线路单元可以是一个单比特量子门,也可以是一层的量子门,或者是一个哈密顿量的含时演化等等,本申请实施例对此不作限定。
在本申请实施例中,将量子线路以线路单元为粒度进行划分,一个量子线路可以由多个线路单元按照某种连接方式进行连接而成。因此,为了构建出一个用于完成某种量子计算任务的量子线路,可以从线路单元池中选取若干个线路单元。
在可能的实施方式中,按照某种取样方式,从线路单元池中选取N个线路单元。取样方式是指从线路单元池中选取线路单元的方式。每一次取样从线路单元池中选取N个线路单元,一次取样选取的该N个线路单元构成一组线路单元,即每一组线路单元包括N个线路单元。另外,N个线路单元中包括的线路单元是可重复的。也即,上述取样过程是有放回的,以保证每个线路单元是可以在最终构建的量子线路中重复利用的。
在示例性实施例中,上述取样方式可以是概率模型,有关通过概率模型取样获取线路单元的方式,可参见上文实施例中的介绍说明,此处不再赘述。
步骤402,确定N个线路单元分别对应的线路参数,线路参数用于定义线路单元所执行的操作,且线路参数是可更新的。
对于一个线路单元来说,该线路单元具有对应的线路参数,该线路参数用于定义该线路单元所执行的操作。也即,一个线路单元所执行的操作,除了与该线路单元的结构有关之外,还与该线路单元的线路参数有关。在步骤401中从线路单元池中选出N个线路单元之后,每个线路单元的结构是既定的,然后通过步骤402获取每个线路单元的线路参数。
在本申请实施例中,线路单元的线路参数是变分参数,即线路单元的线路参数是可更新的(即可调整和修改的),从而在有必要的情况下,可以更新该线路单元的线路参数,以提升该线路单元的表现性能。
在示例性实施例中,可以维护一个线路参数池,该线路参数池中包括线路单元池中的每一个线路单元在每一个待填充位置上的线路参数。对于上述N个线路单元中的第i个线路单元,根据该第i个线路单元的待填充位置,从线路参数池中获取该第i个线路单元的线路参数。通过上述方式,采用参数绑定机制将线路单元的线路参数与其待填充位置相绑定,这样在构造生成量子线路时,能够简单高效地从线路参数池中获取各个线路单元的线路参数。
步骤403,基于N个线路单元以及该N个线路单元分别对应的线路参数,构造生成量子线路。
在得到N个线路单元以及该N个线路单元分别对应的线路参数之后,构造生成量子线路,该量子线路中包括上述N个线路单元,且该量子线路的线路参数包括上述N个线路单元分别 对应的线路参数。另外,各个线路单元之间的连接关系可以预先定义或设计,本申请实施例对此不作限定。
在示例性实施例中,如图5所示,上述步骤403之后还包括如下步骤:
步骤404,确定量子线路对应的性能评价指标。
性能评价指标是用于量化评价量子线路的性能的参数。在示例性实施例中,采用目标函数来表征上述性能评价指标。目标函数是用于计算构造生成的量子线路是否达到任务优化目标的数学函数。例如,如上文介绍,针对不同的量子线路设计任务,可以对应设置不同的目标函数。
步骤405,基于性能评价指标,计算目标梯度信息,该目标梯度信息是量子线路的线路参数的梯度信息。
在本申请实施例中,通过计算目标函数相对于量子线路的线路参数的梯度信息,得到目标梯度信息,该目标梯度信息用于指导更新量子线路的线路参数。
在一个示例中,计算目标函数相对于量子线路的线路参数的导数,得到目标梯度信息。示例性地,计算该目标梯度信息所采用的导数公式为:
Figure PCTCN2021073639-appb-000027
其中,
Figure PCTCN2021073639-appb-000028
代表目标函数L相对于量子线路U(k,θ)的线路参数θ的导数。
步骤406,基于目标梯度信息,对量子线路的线路参数进行更新,得到更新后的量子线路。
例如,采用梯度下降算法对量子线路的线路参数进行更新,以不断优化各个线路单元的线路参数,从而提升量子线路整体的表现性能。
在本申请实施例中,由于目标函数是可微函数,因此可以通过求导的方式来计算相应的梯度信息,从而使得能够采用梯度下降算法对线路参数进行更新和优化,以不断提升量子线路的性能。
综上所述,本申请实施例提供的技术方案,通过将量子线路视为由一系列酉矩阵对应的等效量子线路堆叠而成的,从而将量子线路划分为一个个线路单元,通过构建线路单元池提供可供选择的线路单元,从该线路单元池中选取线路单元来构建量子线路,实现了可微量子结构搜索,提供了一种普适性强且通用的量子线路构建方案。
另外,由于量子线路中包含的各个线路单元的线路参数是可更新的,因此可以通过更新(即调整)线路参数来提升量子线路的表现性能。进一步的,由于量子线路对应的目标函数是可微函数,因此可以通过求导的方式来计算相应的梯度信息,从而使得能够采用梯度下降算法对线路参数进行更新和优化,以不断提升量子线路的性能。
另外,相比于采用基因算法构建量子线路,由于基因算法是逐段搜寻局部最优的部分线路结构,导致最终构建出的完整量子线路存在非整体最优的问题,本申请通过在构造出完整量子线路结构之后,对线路参数进行更新,能够最终找到使得该完整量子线路整体最优的线路参数,因此性能更佳。
需要说明的是,对于本实施例中未详细说明的细节,可参照上文其他实施例中的介绍说明。
下面,对本申请提供的可微量子结构搜索框架应用到具体量子线路设计问题中的实验案例进行介绍说明。这里分别考虑三类问题,来展示可微量子结构搜索框架的应用和前景。
案例一,GHZ(GreenbergerHorne-Zeiling)量子态制备和Bell态线路设计。
在以下的例子中,我们所采取的算符池和编码方案为单比特和两比特量子门,量子门的种类和所在的量子比特行数决定了算符池的组成。
GHZ量子态定义为
Figure PCTCN2021073639-appb-000029
这样的态也即著名的薛定谔猫态,在理论和量子信息实践上都有很多应用。本申请提供的可微量子结构搜索框架,可以自动设计 出对应的量子态制备线路。其目标函数为量子线路输出态与理论GHZ态的内积。通过逐渐调小训练的门数p并确保性能的方式进行搜索,可以保证找到所需量子门最少的符合条件的制备线路,具体线路如图6。其中的参数π/2完全是框架自己习得的。
Bell态是指两比特构成的四个正交的纠缠态,在量子隐形传态和压缩编码中都有重要作用。相应的量子线路应该分别将4个不同的测量基直基态映射到对应编码的Bell态纠缠态。因此该问题是一个完整的线路学习问题,而不只是单个量子态制备。目标态的内积或者观测量XX,ZZ的期望都可以作为目标函数,同时需要4个不同的输入态评估作为总的目标函数。自动搜索得到的具体线路如图7。在这一例子中,该框架只利用了离散的无参数算符池,也即无可变线路参数。
案例二,量子错误抑制(quantum error mitigation)。
这里利用量子计算中经常出现的量子傅立叶变换的线路组件和假设的量子噪声模型,来展示可微量子结构搜索方案在量子纠错领域的潜在应用。我们通过在3比特和4比特系统上,对量子傅立叶变换线路进行填充,从而实现输出态的保真度提升。
这里采用的量子错误抑制策略为:量子线路中的空隙填充单比特量子门,而使得这些量子门的集合给出单位矩阵。这样在不改变量子线路对应矩阵的前提下,可以有效的减少等待位的衰减噪声,并且可以将更难抑制的相干噪声转化为简单的泡利噪声。与该策略相适应地,我们采取的线路设计编码方案即为不同类型单比特门构成的算符池V和搜索深度p等于原始线路空隙位置数目的占位符U。如对于3比特量子傅立叶变换线路p=6,而对于4比特线路,p=12。
这一纠错效果的比较基线是在相应连续的空隙中设法填充等效为1的量子门,我们发现,本框架可以搜索到保真度较这一基于知识的常识方案更高的线路。事实上,可微量子结构搜索可以有效地感知到量子线路中的某种长程关联,从而对单个空隙也可进行非恒等的填充,以实现保真度的进一步提升。
具体地,对于3比特量子傅立叶变换线路,原始线路、专家线路和框架自动设计的线路对应的保真度分别0.33、0.55和0.6。而对于4比特量子傅立叶变换线路,原始线路、专家线路和框架自动设计的线路对应的保真度分别为0.13、0.41和0.45。可以看到本框架自动完成设计的纠错线路对于量子噪声的抑制要好于人类专家的线路设计。而这种自动化线路设计完全不依赖于任何先验知识,是从无到有的生成的。(对应的量子纠错设计和具体的保真度数值取决于假设的量子噪声模型,本例所采取的量子噪声模型为:对于每列量子门的空隙,存在p=0.02的比特反转噪声,而对于每个量子线路空位,存在p=0.2的比特反转噪声。)
3比特和4比特的原始线路,本框架发现的纠错线路分别如图8至11所示。其中纠错线路中的灰色量子门,为可微量子结构搜索框架训练后,智能填充的结果。
案例三,QAOA类型的线路构型搜索。
QAOA是非常重要的量子经典混合计算范式,且有较强的物理意义及和量子退火的联系。因此在同等深度,同样线路参数量的情形下,找到近似能力更强的量子线路排布就具有重要的应用价值(用来展现量子优势)和理论意义(用来和量子退火中的重要概念交叉对比和理解)。在这样的问题中,端对端的环境采用的是典型的MAX CUT组合优化问题,而算符池则采取了哈密顿量含时演化层和普通的单比特量子门层相结合的策略。最简单的情形下,考虑的算符包括Hadamard门层,单比特x,y,z旋转层(其等价于e iHθ,其中H=Σ iX i,X也可替换为Y,Z算符)以及
Figure PCTCN2021073639-appb-000030
层,其中ij代表了问题中图的边。这些基础组件我们分别称为H-layer,rx-layer,ry-layer,rz-layer,zz-layer。需要注意的是xx-layer和yy-layer可以用上述的基础组件构造生成,因此是冗余项。而端对端的目标函数设置则和传统的QAOA相同,是MAX CUT对应哈密顿量在量子线路输出态上的期望。
通过该框架,我们可以找到一种构型和对应参数,使得相应的量子线路构造可以同时适用于一批产生于某个分布的图实例,例如regular graph。这样找到的量子线路构造,是尽可能 的用同样的方案逼近不同图的最优解。我们可以自动搜索得到QAOA相同的布局,也即H-layer,zz-layer,rx-layer,zz-layer,rx-layer,如图12所示。也就是说,在图的范围比较广泛,且层数较浅的情况下,该框架显示出QAOA的交替排布确实是近似效果最好的选择,这也显示出该框架在强大的可应用性之外,还兼具一定的理论探索的功能。
如上述所示,本申请提供的可微量子结构搜索框架可以广泛应用在多样的量子计算和量子信息问题之中,尤其是各种情形下的量子线路的自动化设计。这种端到端的可微设计,不依赖于任何对线路结构的假设,这给量子线路设计带来了很多可能性。理论上这一方法结合了量子编程、微分编程和概率编程等全新的编程范式,且可以用来探索找到现有知识积累之外的潜在高效的量子结构。实践上,这一框架无论在量子态制备、量子线路分解与编译、量子纠错、变分量子结构搜索中都表现出了良好的性能和出色的结果。可微的方法论和框架本身的高度通用性,保证了该方案简洁高效的同时,又可以同时考虑进真实量子硬件的原生量子门,连接拓扑和噪声特点等。
具体地说,我们已经有实证的例子可以表明,本申请提供的可微量子结构搜索框架可以实现以下内容和效果:
1、自动设计多比特的GHZ量子态制备线路。
2、自动实现给定量子线路的离散门分解,完成Bell态映射线路的设计。
3、在量子傅立叶变换的线路上实现了一定的量子错误抑制,找到了超越现有专家经验的纠错策略。
4、只通过MAX CUT组合优化问题的环境,自发找到了QAOA的排布结构作为量子线路解的假设,并在具体的问题里,可以搜索到性能更好的哈密顿子块排布方式。
总体来讲,本申请提供的技术方案相比其他方案具有以下优势:
1、通用性:我们第一次完整的概括和抽象出了量子结构搜索这一重要问题,并首次提出了完全通用的端到端解决方案。
2、计算效率:该方案是首个可微分的量子线路自动设计方案,这使得该方案可以消耗更少的计算资源,比如时间、硬件等,就可以得到其他方案相似或明显更优的结果。
3、多目标:该方案可以同时优化多个目标,使得硬件友好,量子纠错等考虑更好的嵌入总的框架。
4、超越现有知识经验的结果:将该框架应用到具体的量子计算问题,我们不依赖任何领域专有知识的假设,单纯依靠机器学习取得了一系列达到或超越现有知识积累的结果,显示了该方案的巨大潜力。
本申请技术方案,有助于加快现阶段适应性更强的量子线路设计。NISQ时代量子硬件的典型缺点就是相干时间短且量子噪声大,相应的我们需要充分考虑量子硬件本身具体特征的情况下,尽量减小量子线路的深度,和两比特量子门的数目。由于两比特量子门往往较单比特量子门具有更大的噪声,在保证性能的同时减少两比特量子门的数目,可以有效的缓解量子噪声的影响。本申请提供的可微量子结构搜索框架,可以很好地解决这一多目标的线路设计问题,从而在量子计算商业应用上获得优势。
另外,在中短期内可能应用到量子硬件评估,实际生产中的应用包括可微量子结构搜索辅助的VQE或QAOA假设优化,可以使得我们利用更少的量子资源获得更好的结果,其对应产品可以用来解决组合优化问题或量子化学的基态能量模拟。同时可微量子结构搜索也可以有效的在量子编译技术栈和量子错误抑制上发挥设计潜力,使得相应的线路对于量子噪声更稳定。
下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。
请参考图13,其示出了本申请一个实施例提供的量子线路的确定装置的框图。该装置具 有实现上述方法示例的功能,所述功能可以由硬件实现,也可以由硬件执行相应的软件实现。该装置可以是上文介绍的计算机设备,也可以设置在计算机设备中。如图13所示,该装置1300可以包括:线路取样模块1310、线路评价模块1320、参数更新模块1330和线路确定模块1340。
线路取样模块1310,用于按照初始的取样方式,从初始的线路单元池中取样K组线路单元,构造生成K个候选量子线路;其中,每一组线路单元包括至少一个线路单元,用于构造生成一个候选量子线路;K为正整数。
线路评价模块1320,用于确定所述K个候选量子线路对应的性能评价指标。
参数更新模块1330,用于基于所述性能评价指标对所述取样方式以及所述线路单元池中的线路单元进行更新,得到更新后的取样方式和更新后的线路单元池。
所述线路取样模块1310,还用于按照所述更新后的取样方式,从所述更新后的线路单元池中取样K组线路单元,构造生成K个候选量子线路。
线路确定模块1340,用于在满足循环中止条件的情况下,从最后一次生成的所述K个候选量子线路中确定目标量子线路。
在示例性实施例中,如图14所示,所述线路取样模块1310,包括:模型构建单元1311、线路取样单元1312和线路构造单元1313。
模型构建单元1311,用于构建初始的概率模型,所述概率模型包括p×c个参数;其中,p表示最大线路单元数量,c表示所述线路单元池中的线路单元的总数。
线路取样单元1312,用于基于所述初始的概率模型,对所述初始的线路单元池进行K次取样,每次取样获取一组线路单元,得到所述K组线路单元。
线路构造单元1313,用于基于所述K组线路单元,构造生成所述K个候选量子线路。
在示例性实施例中,如图14所示,所述参数更新模块1330,包括:梯度计算单元1331、模型参数更新单元1332和线路参数更新单元1333。
梯度计算单元1331,用于基于所述性能评价指标,计算第一梯度信息和第二梯度信息;其中,所述第一梯度信息是所述概率模型的模型参数的梯度信息,所述第二梯度信息是所述线路单元池中的线路单元的线路参数的梯度信息。
模型参数更新单元1332,用于基于所述第一梯度信息对所述概率模型的模型参数进行更新,得到更新后的概率模型。
线路参数更新单元1333,用于基于所述第二梯度信息对所述线路单元池中的线路单元的线路参数进行更新,得到更新后的线路单元池。
在示例性实施例中,所述性能评价指标为目标函数的运算结果。所述梯度计算单元1331,用于计算所述目标函数相对于所述概率模型的模型参数的导数,得到所述第一梯度信息;计算所述目标函数相对于所述线路单元池中的线路单元的线路参数的导数,得到所述第二梯度信息。
在示例性实施例中,所述性能评价指标为目标函数的运算结果。所述线路评价模块1320,用于计算所述K个候选量子线路针对所述目标函数分别对应的运算结果,得到K个运算结果;基于所述K个运算结果,得到所述性能评价指标。
在示例性实施例中,所述线路确定模块1340用于从最后一次生成的所述K个候选量子线路中,确定生成概率最大的候选量子线路;将所述生成概率最大的候选量子线路,确定为所述目标量子线路。
在示例性实施例中,如图14所示,所述装置1300还包括:参数获取模块1350,用于对于第i个候选量子线路中的第j个线路单元,根据所述第j个线路单元在所述线路单元池中的位置以及在所述第i个候选量子线路中的位置,从线路参数池中获取所述第j个线路单元的线路参数。其中,所述线路参数池中包括所述线路单元池中的每一个线路单元在每一个待填充位置上的线路参数;i为小于等于K的正整数,j为正整数。
在示例性实施例中,如图14所示,所述装置1300还包括:参数调优模块1360,用于固 定所述目标量子线路的结构,并调整所述目标量子线路中包含的各个线路单元的线路参数;在满足调整中止条件的情况下,得到参数调优后的所述目标量子线路。
在示例性实施例中,每一组线路单元中包括的线路单元是可重复的。
综上所述,针对不同类型的量子线路设计问题,都可以采用本申请技术方案构建出一个用于解决相应问题的目标量子线路,使得不同类型的量子线路设计问题得到了高度的抽象和统一,该方案具有极强的普适性和通用性。
另外,相比于基因算法本身所存在的计算消耗大、收敛慢的缺陷,本申请技术方案仅需确定取样得到的候选量子线路对应的性能评价指标,然后基于该性能评价指标对取样方式以及线路单元池中的线路单元进行同步更新,从而能够快速构造出性能较优的候选量子线路,这不但减少了计算量,而且还提升了最终确定出目标量子线路的效率。
请参考图15,其示出了本申请另一个实施例提供的量子线路的确定装置的框图。该装置具有实现上述方法示例的功能,所述功能可以由硬件实现,也可以由硬件执行相应的软件实现。该装置可以是上文介绍的计算机设备,也可以设置在计算机设备中。如图15所示,该装置1500可以包括:线路单元选取模块1510、线路参数确定模块1520和量子线路构造模块1530。
线路单元选取模块1510,用于从线路单元池中选取N个线路单元,所述线路单元池中包括多个线路单元,每个线路单元是一个酉矩阵对应的等效量子线路,所述N为大于1的整数。
线路参数确定模块1520,用于确定所述N个线路单元分别对应的线路参数,所述线路参数用于定义所述线路单元所执行的操作,且所述线路参数是可更新的。
量子线路构造模块1530,用于基于所述N个线路单元以及所述N个线路单元分别对应的线路参数,构造生成量子线路。
在示例性实施例中,所述线路参数确定模块1520,用于对于所述N个线路单元中的第i个线路单元,根据所述第i个线路单元的待填充位置,从线路参数池中获取所述第i个线路单元的线路参数;
其中,所述线路参数池中包括所述线路单元池中的每一个线路单元在每一个待填充位置上的线路参数;i为小于等于N的正整数。
在示例性实施例中,如图16所示,所述装置1500还包括:评价指标确定模块1540、梯度信息计算模块1550和线路参数更新模块1560。
评价指标确定模块1540,用于确定所述量子线路对应的性能评价指标。
梯度信息计算模块1550,用于基于所述性能评价指标,计算目标梯度信息,所述目标梯度信息是所述量子线路的线路参数的梯度信息。
线路参数更新模块1560,用于基于所述目标梯度信息,对所述量子线路的线路参数进行更新,得到更新后的量子线路。
在示例性实施例中,所述性能评价指标为目标函数的运算结果。所述梯度信息计算模块1550,用于计算所述目标函数相对于所述量子线路的线路参数的导数,得到所述目标梯度信息。
在示例性实施例中,所述N个线路单元中包括的线路单元是可重复的。
综上所述,本申请实施例提供的技术方案,通过将量子线路视为由一系列酉矩阵对应的等效量子线路堆叠而成的,从而将量子线路划分为一个个线路单元,通过构建线路单元池提供可供选择的线路单元,从该线路单元池中选取线路单元来构建量子线路,实现了可微量子结构搜索,提供了一种普适性强且通用的量子线路构建方案。
需要说明的是,上述实施例提供的装置,在实现其功能时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述 实施例提供的装置与方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
请参考图17,其示出了本申请一个实施例提供的计算机设备的结构框图。该计算机设备可以用于实施上述实施例中提供的量子线路的确定方法。以该计算机设备为经典计算机为例:
该计算机设备1700包括处理单元(如CPU(Central Processing Unit,中央处理器)、GPU(Graphics Processing Unit,图形处理器)和FPGA(Field Programmable Gate Array,现场可编程逻辑门阵列)等)1701、包括RAM(Random-Access Memory,随机存储器)1702和ROM(Read-Only Memory,只读存储器)1703的系统存储器1704,以及连接系统存储器1704和中央处理单元1701的系统总线1705。该计算机设备1700还包括帮助服务器内的各个器件之间传输信息的基本输入/输出系统(Input Output System,I/O系统)1706,和用于存储操作系统1713、应用程序1714和其他程序模块1715的大容量存储设备1707。
该基本输入/输出系统1706包括有用于显示信息的显示器1708和用于用户输入信息的诸如鼠标、键盘之类的输入设备1709。其中,该显示器1708和输入设备1709都通过连接到系统总线1705的输入输出控制器1710连接到中央处理单元1701。该基本输入/输出系统1706还可以包括输入输出控制器1710以用于接收和处理来自键盘、鼠标、或电子触控笔等多个其他设备的输入。类似地,输入输出控制器1710还提供输出到显示屏、打印机或其他类型的输出设备。
该大容量存储设备1707通过连接到系统总线1705的大容量存储控制器(未示出)连接到中央处理单元1701。该大容量存储设备1707及其相关联的计算机可读介质为计算机设备1700提供非易失性存储。也就是说,该大容量存储设备1707可以包括诸如硬盘或者CD-ROM(Compact Disc Read-Only Memory,只读光盘)驱动器之类的计算机可读介质(未示出)。
不失一般性,该计算机可读介质可以包括计算机存储介质和通信介质。计算机存储介质包括以用于存储诸如计算机可读指令、数据结构、程序模块或其他数据等信息的任何方法或技术实现的易失性和非易失性、可移动和不可移动介质。计算机存储介质包括RAM、ROM、EPROM(Erasable Programmable Read-Only Memory,可擦写可编程只读存储器)、EEPROM(Electrically Erasable Programmable Read-Only Memory,电可擦写可编程只读存储器)、闪存或其他固态存储其技术,CD-ROM、DVD(Digital Video Disc,高密度数字视频光盘)或其他光学存储、磁带盒、磁带、磁盘存储或其他磁性存储设备。当然,本领域技术人员可知该计算机存储介质不局限于上述几种。上述的系统存储器1704和大容量存储设备1707可以统称为存储器。
根据本申请实施例,该计算机设备1700还可以通过诸如因特网等网络连接到网络上的远程计算机运行。也即计算机设备1700可以通过连接在该系统总线1705上的网络接口单元1711连接到网络1712,或者说,也可以使用网络接口单元1711来连接到其他类型的网络或远程计算机系统(未示出)。
所述存储器还包括至少一条指令、至少一段程序、代码集或指令集,该至少一条指令、至少一段程序、代码集或指令集存储于存储器中,且经配置以由一个或者一个以上处理器执行,以实现上述量子线路的确定方法。
在一个示例性实施例中,还提供了一种计算机可读存储介质,所述存储介质中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集在被处理器执行时以实现上述量子线路的确定方法。
可选地,该计算机可读存储介质可以包括:ROM(Read-Only Memory,只读存储器)、RAM(Random-Access Memory,随机存储器)、SSD(Solid State Drives,固态硬盘)或光盘等。其中,随机存取记忆体可以包括ReRAM(Resistance Random Access Memory,电阻式随机存取记忆体)和DRAM(Dynamic Random Access Memory,动态随机存取存储器)。
在一个示例性实施例中,还提供了一种计算机程序产品或计算机程序,所述计算机程序产品或计算机程序包括计算机指令,所述计算机指令存储在计算机可读存储介质中。计算机设备的处理器从所述计算机可读存储介质中读取所述计算机指令,所述处理器执行所述计算机指令,使得所述计算机设备执行上述量子线路的确定方法。
应当理解的是,在本文中提及的“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。另外,本文中描述的步骤编号,仅示例性示出了步骤间的一种可能的执行先后顺序,在一些其它实施例中,上述步骤也可以不按照编号顺序来执行,如两个不同编号的步骤同时执行,或者两个不同编号的步骤按照与图示相反的顺序执行,本申请实施例对此不作限定。
以上所述仅为本申请的示例性实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种量子线路的确定方法,所述方法包括:
    按照初始的取样方式,从初始的线路单元池中取样K组线路单元,构造生成K个候选量子线路;其中,每一组线路单元包括至少一个线路单元,用于构造生成一个候选量子线路;K为正整数;
    确定所述K个候选量子线路对应的性能评价指标;
    基于所述性能评价指标对所述取样方式以及所述线路单元池中的线路单元进行更新,得到更新后的取样方式和更新后的线路单元池;
    按照所述更新后的取样方式,从所述更新后的线路单元池中取样K组线路单元,构造生成K个候选量子线路;
    在满足循环中止条件的情况下,从最后一次生成的所述K个候选量子线路中确定目标量子线路。
  2. 根据权利要求1所述的方法,其中,所述按照初始的取样方式,从初始的线路单元池中取样K组线路单元,构造生成K个候选量子线路,包括:
    构建初始的概率模型,所述概率模型包括p×c个参数;其中,p表示最大线路单元数量,c表示所述线路单元池中的线路单元的总数;
    基于所述初始的概率模型,对所述初始的线路单元池进行K次取样,每次取样获取一组线路单元,得到所述K组线路单元;
    基于所述K组线路单元,构造生成所述K个候选量子线路。
  3. 根据权利要求2所述的方法,其中,所述基于所述性能评价指标对所述取样方式以及所述线路单元池中的线路单元进行更新,得到更新后的取样方式和更新后的线路单元池,包括:
    基于所述性能评价指标,计算第一梯度信息和第二梯度信息;其中,所述第一梯度信息是所述概率模型的模型参数的梯度信息,所述第二梯度信息是所述线路单元池中的线路单元的线路参数的梯度信息;
    基于所述第一梯度信息对所述概率模型的模型参数进行更新,得到更新后的概率模型;
    基于所述第二梯度信息对所述线路单元池中的线路单元的线路参数进行更新,得到更新后的线路单元池。
  4. 根据权利要求3所述的方法,其中,所述性能评价指标为目标函数的运算结果;
    所述基于所述性能评价指标,计算第一梯度信息和第二梯度信息,包括:
    计算所述目标函数相对于所述概率模型的模型参数的导数,得到所述第一梯度信息;
    计算所述目标函数相对于所述线路单元池中的线路单元的线路参数的导数,得到所述第二梯度信息。
  5. 根据权利要求1所述的方法,其中,所述性能评价指标为目标函数的运算结果;
    所述确定所述K个候选量子线路对应的性能评价指标,包括:
    计算所述K个候选量子线路针对所述目标函数分别对应的运算结果,得到K个运算结果;
    基于所述K个运算结果,得到所述性能评价指标。
  6. 根据权利要求1所述的方法,其中,所述从最后一次生成的所述K个候选量子线路中确定目标量子线路,包括:
    从最后一次生成的所述K个候选量子线路中,确定生成概率最大的候选量子线路;
    将所述生成概率最大的候选量子线路,确定为所述目标量子线路。
  7. 根据权利要求1所述的方法,其中,所述构造生成K个候选量子线路之后,还包括:
    对于第i个候选量子线路中的第j个线路单元,根据所述第j个线路单元在所述线路单元池中的位置以及在所述第i个候选量子线路中的位置,从线路参数池中获取所述第j个线路单元的线路参数;
    其中,所述线路参数池中包括所述线路单元池中的每一个线路单元在每一个待填充位置上的线路参数;i为小于等于K的正整数,j为正整数。
  8. 根据权利要求1至7任一项所述的方法,其中,所述从最后一次生成的所述K个候选量子线路中确定目标量子线路之后,还包括:
    固定所述目标量子线路的结构,并调整所述目标量子线路中包含的各个线路单元的线路参数;
    在满足调整中止条件的情况下,得到参数调优后的所述目标量子线路。
  9. 根据权利要求1至7任一项所述的方法,其中,每一组线路单元中包括的线路单元是可重复的。
  10. 一种量子线路的确定方法,所述方法包括:
    从线路单元池中选取N个线路单元,所述线路单元池中包括多个线路单元,每个线路单元是一个酉矩阵对应的等效量子线路,所述N为大于1的整数;
    确定所述N个线路单元分别对应的线路参数,所述线路参数用于定义所述线路单元所执行的操作,且所述线路参数是可更新的;
    基于所述N个线路单元以及所述N个线路单元分别对应的线路参数,构造生成量子线路。
  11. 根据权利要求10所述的方法,其中,所述确定所述N个线路单元分别对应的线路参数,包括:
    对于所述N个线路单元中的第i个线路单元,根据所述第i个线路单元的待填充位置,从线路参数池中获取所述第i个线路单元的线路参数;
    其中,所述线路参数池中包括所述线路单元池中的每一个线路单元在每一个待填充位置上的线路参数;i为小于等于N的正整数。
  12. 根据权利要求10所述的方法,其中,所述基于所述N个线路单元以及所述N个线路单元分别对应的线路参数,构造生成量子线路之后,还包括:
    确定所述量子线路对应的性能评价指标;
    基于所述性能评价指标,计算目标梯度信息,所述目标梯度信息是所述量子线路的线路参数的梯度信息;
    基于所述目标梯度信息,对所述量子线路的线路参数进行更新,得到更新后的量子线路。
  13. 根据权利要求12所述的方法,其中,所述性能评价指标为目标函数的运算结果;
    所述基于所述性能评价指标,计算目标梯度信息,包括:
    计算所述目标函数相对于所述量子线路的线路参数的导数,得到所述目标梯度信息。
  14. 根据权利要求10至13任一项所述的方法,其中,所述N个线路单元中包括的线路单元是可重复的。
  15. 一种量子线路的确定方法,应用于计算机设备,所述方法包括:
    按照初始的取样方式,从初始的线路单元池中取样K组线路单元,构造生成K个候选量子线路;其中,每一组线路单元包括至少一个线路单元,用于构造生成一个候选量子线路;K为正整数;
    确定所述K个候选量子线路对应的性能评价指标;
    基于所述性能评价指标对所述取样方式以及所述线路单元池中的线路单元进行更新,得到更新后的取样方式和更新后的线路单元池;
    按照所述更新后的取样方式,从所述更新后的线路单元池中取样K组线路单元,构造生成K个候选量子线路;
    在满足循环中止条件的情况下,从最后一次生成的所述K个候选量子线路中确定目标量子线路。
  16. 一种量子线路的确定方法,应用于计算机设备,所述方法包括:
    从线路单元池中选取N个线路单元,所述线路单元池中包括多个线路单元,每个线路单元是一个酉矩阵对应的等效量子线路,所述N为大于1的整数;
    确定所述N个线路单元分别对应的线路参数,所述线路参数用于定义所述线路单元所执行的操作,且所述线路参数是可更新的;
    基于所述N个线路单元以及所述N个线路单元分别对应的线路参数,构造生成量子线路。
  17. 一种量子线路的确定装置,所述装置包括:
    线路取样模块,用于按照初始的取样方式,从初始的线路单元池中取样K组线路单元,构造生成K个候选量子线路;其中,每一组线路单元包括至少一个线路单元,用于构造生成一个候选量子线路;K为正整数;
    线路评价模块,用于确定所述K个候选量子线路对应的性能评价指标;
    参数更新模块,用于基于所述性能评价指标对所述取样方式以及所述线路单元池中的线路单元进行更新,得到更新后的取样方式和更新后的线路单元池;
    所述线路取样模块,还用于按照所述更新后的取样方式,从所述更新后的线路单元池中取样K组线路单元,构造生成K个候选量子线路;
    线路确定模块,用于在满足循环中止条件的情况下,从最后一次生成的所述K个候选量子线路中确定目标量子线路。
  18. 一种量子线路的确定装置,所述装置包括:
    线路单元选取模块,用于从线路单元池中选取N个线路单元,所述线路单元池中包括多个线路单元,每个线路单元是一个酉矩阵对应的等效量子线路,所述N为大于1的整数;
    线路参数确定模块,用于确定所述N个线路单元分别对应的线路参数,所述线路参数用于定义所述线路单元所执行的操作,且所述线路参数是可更新的;
    量子线路构造模块,用于基于所述N个线路单元以及所述N个线路单元分别对应的线路参数,构造生成量子线路。
  19. 一种计算机设备,所述计算机设备包括处理器和存储器,所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如权利要求1至14任一项所述的量子线路的确定方法。
  20. 一种计算机可读存储介质,所述存储介质中存储有至少一条指令、至少一段程序、 代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由处理器加载并执行以实现如权利要求1至14任一项所述的量子线路的确定方法。
PCT/CN2021/073639 2020-10-14 2021-01-25 量子线路的确定方法、装置、设备及存储介质 WO2022077797A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
EP21772939.1A EP4006788A1 (en) 2020-10-14 2021-01-25 Quantum circuit determining method and apparatus, device, and storage medium
JP2021546756A JP7451008B2 (ja) 2020-10-14 2021-01-25 量子回路の決定方法、装置、機器及びコンピュータプログラム
KR1020217033817A KR20220051132A (ko) 2020-10-14 2021-01-25 양자 회로 결정 방법 및 장치, 디바이스, 및 저장 매체
US17/524,194 US20220114313A1 (en) 2020-10-14 2021-11-11 Method and apparatus for determining quantum circuit, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011096965.7 2020-10-14
CN202011096965.7A CN112651509B (zh) 2020-10-14 2020-10-14 量子线路的确定方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/524,194 Continuation US20220114313A1 (en) 2020-10-14 2021-11-11 Method and apparatus for determining quantum circuit, and storage medium

Publications (1)

Publication Number Publication Date
WO2022077797A1 true WO2022077797A1 (zh) 2022-04-21

Family

ID=75346754

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/073639 WO2022077797A1 (zh) 2020-10-14 2021-01-25 量子线路的确定方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN112651509B (zh)
WO (1) WO2022077797A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114897173A (zh) * 2022-05-18 2022-08-12 北京大学 基于变分量子线路确定PageRank的方法及装置
CN115392469A (zh) * 2022-08-16 2022-11-25 北京中科弧光量子软件技术有限公司 基于动态深度搜索的量子线路映射方法、系统和电子设备
CN116384498A (zh) * 2023-06-07 2023-07-04 上海微观纪元数字科技有限公司 变分量子算法线路的并行训练方法及存储介质

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022247887A1 (zh) * 2021-05-28 2022-12-01 合肥本源量子计算科技有限责任公司 一种线性函数对应的量子线路的构建方法及装置
CN114037082A (zh) * 2021-11-09 2022-02-11 腾讯科技(深圳)有限公司 量子计算任务处理方法、系统及计算机设备
CN114511094B (zh) * 2022-01-27 2023-08-04 本源量子计算科技(合肥)股份有限公司 一种量子算法的优化方法、装置、存储介质与电子装置
CN114548414B (zh) * 2022-02-22 2023-10-10 合肥本源量子计算科技有限责任公司 一种编译量子线路的方法、装置、存储介质及编译系统
CN114358319B (zh) * 2022-03-22 2022-06-21 合肥本源量子计算科技有限责任公司 基于机器学习框架的分类方法及相关装置
CN114372583B (zh) * 2022-03-22 2022-07-15 合肥本源量子计算科技有限责任公司 基于机器学习框架的量子程序优化方法及相关设备
CN117744819A (zh) * 2022-09-14 2024-03-22 本源量子计算科技(合肥)股份有限公司 评测量子设备性能的方法、装置、存储介质及电子装置
CN116402154B (zh) * 2023-04-03 2024-02-02 正则量子(北京)技术有限公司 一种基于神经网络的本征值求解方法及设备
CN116341667B (zh) * 2023-04-03 2024-03-12 正则量子(北京)技术有限公司 一种量子线路搭建方法及设备
CN117234524B (zh) * 2023-11-15 2024-01-26 北京量子信息科学研究院 量子云计算的编译方法和装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108710951A (zh) * 2018-05-17 2018-10-26 合肥本源量子计算科技有限责任公司 一种构建量子线路的方法及系统
CN110674921A (zh) * 2019-07-11 2020-01-10 中国科学技术大学 构建基于经典训练的量子前馈神经网络的方法
CN111242306A (zh) * 2020-01-22 2020-06-05 北京百度网讯科技有限公司 量子主成分分析的方法、装置、电子设备以及计算机可读存储介质
US10797869B1 (en) * 2018-03-09 2020-10-06 Wells Fargo Bank, N.A. Systems and methods for quantum session authentication

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11755682B2 (en) * 2018-05-25 2023-09-12 Microsoft Technology Licensing, Llc Evaluating quantum computing circuits in view of the resource costs of a quantum algorithm
EP3841532B1 (en) * 2018-09-25 2023-08-02 Google LLC Error corrected variational algorithms
CN109800883B (zh) * 2019-01-25 2020-12-04 合肥本源量子计算科技有限责任公司 量子机器学习框架构建方法、装置及量子计算机
CN110490327B (zh) * 2019-07-23 2023-07-18 湖北工业大学 量子计算机量子处理单元、量子电路以及量子电路量子算法
CN111461334B (zh) * 2020-03-30 2021-10-15 北京百度网讯科技有限公司 量子电路的处理方法、装置及设备
CN111598247B (zh) * 2020-04-22 2022-02-01 北京百度网讯科技有限公司 量子吉布斯态生成方法、装置及电子设备
CN111241356B (zh) * 2020-04-26 2020-08-11 腾讯科技(深圳)有限公司 基于模拟量子算法的数据搜索方法、装置及设备
CN111563599B (zh) * 2020-04-30 2023-12-12 本源量子计算科技(合肥)股份有限公司 一种量子线路的分解方法、装置、存储介质及电子装置
CN111598249B (zh) * 2020-05-19 2021-09-07 北京百度网讯科技有限公司 确定近似量子门的方法、装置、经典计算机和存储介质
CN111738448B (zh) * 2020-06-23 2021-09-28 北京百度网讯科技有限公司 量子线路模拟方法、装置、设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10797869B1 (en) * 2018-03-09 2020-10-06 Wells Fargo Bank, N.A. Systems and methods for quantum session authentication
CN108710951A (zh) * 2018-05-17 2018-10-26 合肥本源量子计算科技有限责任公司 一种构建量子线路的方法及系统
CN110674921A (zh) * 2019-07-11 2020-01-10 中国科学技术大学 构建基于经典训练的量子前馈神经网络的方法
CN111242306A (zh) * 2020-01-22 2020-06-05 北京百度网讯科技有限公司 量子主成分分析的方法、装置、电子设备以及计算机可读存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4006788A4 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114897173A (zh) * 2022-05-18 2022-08-12 北京大学 基于变分量子线路确定PageRank的方法及装置
CN114897173B (zh) * 2022-05-18 2023-05-30 北京大学 基于变分量子线路确定PageRank的方法及装置
CN115392469A (zh) * 2022-08-16 2022-11-25 北京中科弧光量子软件技术有限公司 基于动态深度搜索的量子线路映射方法、系统和电子设备
CN116384498A (zh) * 2023-06-07 2023-07-04 上海微观纪元数字科技有限公司 变分量子算法线路的并行训练方法及存储介质
CN116384498B (zh) * 2023-06-07 2023-08-18 上海微观纪元数字科技有限公司 变分量子算法线路的并行训练方法及存储介质

Also Published As

Publication number Publication date
CN112651509A (zh) 2021-04-13
CN112651509B (zh) 2022-04-22

Similar Documents

Publication Publication Date Title
WO2022077797A1 (zh) 量子线路的确定方法、装置、设备及存储介质
JP7451008B2 (ja) 量子回路の決定方法、装置、機器及びコンピュータプログラム
WO2020151129A1 (zh) 量子机器学习框架构建方法、装置、量子计算机及计算机存储介质
Xu et al. Chemical reaction optimization for task scheduling in grid computing
Ramzanpoor et al. Multi-objective fault-tolerant optimization algorithm for deployment of IoT applications on fog computing infrastructure
Han et al. An improved approximation approach incorporating particle swarm optimization and a priori information into neural networks
CN106547854B (zh) 基于贪心萤火虫算法的分布式文件系统存储优化节能方法
CN113641447A (zh) 边缘计算中基于容器层依赖关系的在线学习型调度方法
CN113821983A (zh) 基于代理模型的工程设计优化方法、装置及电子设备
CN113935235A (zh) 基于遗传算法和代理模型的工程设计优化方法及装置
Jin et al. QPlayer: Lightweight, scalable, and fast quantum simulator
AlSuwaidan et al. Swarm intelligence algorithms for optimal scheduling for cloud-based fuzzy systems
Zhang et al. A Survey on Graph Neural Network Acceleration: Algorithms, Systems, and Customized Hardware
Zong et al. Fedcs: Efficient communication scheduling in decentralized federated learning
CN113240100A (zh) 基于离散Hopfield神经网络的并行计算方法及系统
CN110175172B (zh) 基于稀疏二分图的极大二分团并行枚举方法
Luan et al. LRP‐based network pruning and policy distillation of robust and non‐robust DRL agents for embedded systems
Ren et al. Smig-rl: An evolutionary migration framework for cloud services based on deep reinforcement learning
Guo et al. Hierarchical design space exploration for distributed CNN inference at the edge
Khomami et al. Cellular goore game with application to finding maximum clique in social networks
Suresh et al. Divisible load scheduling in distributed system with buffer constraints: Genetic algorithm and linear programming approach
Tang et al. To cloud or not to cloud: an on-line scheduler for dynamic privacy-protection of deep learning workload on edge devices
Yao A Multi-Objective Cloud Workflow Scheduling Optimization Based on Evolutionary Multi-objective Algorithm with Decomposition
CN111027709A (zh) 信息推荐方法、装置、服务器及存储介质
Czajkowski et al. Hybrid parallelization of evolutionary model tree induction

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2021546756

Country of ref document: JP

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2021772939

Country of ref document: EP

Effective date: 20210928

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21772939

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE