Patent Description:
Quantum circuit is a representation of a quantum general-purpose computer, which represents hardware implementation of a corresponding quantum algorithm/program under a quantum gate model. For different quantum computing tasks, different quantum circuits need to be constructed to complete the corresponding tasks. An existing solution for constructing a quantum circuit has problems of high complexity, low efficiency, and poor versatility.

<NPL> relates to an arbitrarily accurate variational algorithm that, instead of fixing an ansatz upfront, grows it systematically one operator at a time in a way dictated by the molecule being simulated.

To describe technical solutions in embodiments of this disclosure more clearly, the following briefly introduces the accompanying drawings required for describing the embodiments.

To make objectives, technical solutions, and advantages of this disclosure clearer, the following further describes implementations of this disclosure in detail with reference to the accompanying drawings.

Cloud technology is a hosting technology that unifies a series of resources such as hardware, software, and networks in a wide area network or a local area network to implement computing, storage, processing, and sharing of data.

The cloud technology is a generic term for a network technology, an information technology, an integration technology, a management platform technology, an application technology, and the like based on an application of a cloud computing business mode. A resource pool may be formed, and resources are used based on a requirement, which is flexible and convenient. A cloud computing technology becomes an important support. A backend service of a technical network system requires a large amount of computing and storage resources, such as a video website, an image website, and more portal websites. As the Internet industry is highly developed and applied, each article may have its own identifier in the future, which needs to be transmitted to a backend system for logic processing. Data at different levels is separately processed, and data in various industries requires strong system support, which can be implemented through cloud computing.

The cloud technology involves basic technologies such as cloud computing, cloud storage, databases, and big data. Cloud applications provided based on the cloud technology include medical cloud, cloud Internet of things ( IoT), cloud security, cloud calling, private cloud, public cloud, hybrid cloud, cloud gaming, cloud education, cloud conference, cloud social, artificial intelligence cloud services, and the like. With the development of cloud technologies and the application of cloud technologies in different fields, an increasing number of cloud applications appear.

Generally, a system based on a cloud technology includes a server and a terminal. The server may be an independent physical server, or may be a server cluster or a distributed system including a plurality of physical servers, or may be a cloud server that provides a basic cloud computing service such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a content delivery network (CDN), big data, and an artificial intelligence platform. The terminal may be a smartphone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smartwatch, or the like, but is not limited thereto. The terminal and the server may be directly or indirectly connected in a wired or wireless communication manner. This is not limited in this embodiment of this disclosure.

A quantum computer is a machine that uses the principles of quantum mechanics to perform computations. Based on a superposition principle and quantum entanglement of the quantum mechanics, the quantum computer has a strong parallel processing capability and can resolve some problems that are difficult for a classical computer to compute. Because of a zero-resistance characteristic of a superconducting quantum bit (qubit) and a manufacturing process close to that of an integrated circuit, a quantum computing system constructed using the superconducting qubit is one of the most promising systems for implementing practical quantum computing.

A quantum processor refers to a quantum-level computer processor, that is, a processor of a quantum computer. The quantum processor may include one or more quantum chips.

The quantum chip (or a superconducting quantum chip) is a central processing unit of the quantum computer and is a core part of the quantum computer. The quantum chip integrates quantum circuits on a substrate, to carry a function of quantum information processing. Drawing lessons from the development of a conventional computer, after overcoming the bottleneck technology in quantum computer research, it is necessary to move onto integration to achieve commercialization and industrial upgrading. A superconducting system, a semiconductor quantum dot system, a micro-nano photonics system, and even an atomic and ion system are all expected to move onto chips. From the perspective of development, an superconducting quantum chip system is technically ahead of other physical systems, and the conventional semiconductor quantum dot system is also an objective that people try to explore, because the development of the conventional semiconductor industry is already mature, for example, once a semiconductor quantum chip breaks a threshold of fault-tolerance quantum computing (FTQC) in terms of decoherence time and manipulation accuracy, it is expected to integrate existing achievements of the conventional semiconductor industry to reduce development costs.

In view of advantages of the quantum computer, a system constructed based on a cloud technology in the future can use the quantum computer to perform some processing and computations to provide better services.

Before the technical solutions of this disclosure are described, some key terms involved in this disclosure are explained first.

At present, a relatively conventional solution for constructing a quantum circuit is to use a genetic algorithm. A basic method is to fix a part of a circuit structure of the quantum circuit and then use the genetic algorithm to find an optimal circuit structure for a next part, and repeat the process a plurality of times to construct a complete quantum circuit finally. However, because of large computational workload and low efficiency of the genetic algorithm, construction of the quantum circuit is extremely complex and inefficient. In addition, the solution is poor in versatility. For example, different types of genetic algorithms need to be selected for different quantum computing tasks.

This disclosure provides a technical solution for constructing a quantum circuit. The technical solution may be referred to as a DQAS solution (or a DQAS framework). Under the DQAS framework provided in this disclosure, different types of quantum circuit design problems can be highly abstracted and unified, making the framework universal, which can resolve important problems in a plurality of sub-fields without modification. For example, a quantum circuit constructed using this framework may be used in a plurality of sub-fields of quantum computing and quantum information processing, including but not limited to quantum state preparation, quantum circuit design, quantum compilation, optimal variational structure search, and quantum error suppression. By using this framework, an optimal quantum circuit structure and a circuit parameter can be automatically designed and discovered, thereby achieving fully automatic multi-target and end-to-end quantum circuit design.

The following first provides a general description for the technical solution of this disclosure.

Any quantum circuit can be regarded as being formed by stacking a series of unitary matrices, that is: <MAT> where U represents a quantum circuit, Ui represents an equivalent quantum circuit corresponding to an ith unitary matrix forming the quantum circuit U, θi represents a circuit parameter of the equivalent quantum circuit corresponding to the ith unitary matrix, for example, θi may include zero to a plurality of circuit parameters, i ∈ [<NUM>, p], and i is an integer. The circuit parameter of the quantum circuit is a variational parameter. The variational parameter means that the circuit parameter of the quantum circuit is updatable (that is, adjustable and modifiable), so that the circuit parameter of the quantum circuit may be updated by using an optimizer to optimize an objective function. Any quantum circuit is regarded as being formed by stacking a series of unitary matrices, so that a search solution is not limited to hypothetical circuit search of a quantum classical hybrid computing paradigm, but is applicable to a wider range of problems with or without circuit parameters. That is, this solution may also be used for finding optimal quantum circuit design of a completely discrete quantum gate arrangement. This solution is compatible regardless of a variational parameter of a circuit.

To prepare the quantum circuit U described in the foregoing formula, it is necessary to set a coding solution for a specific problem, that is, what does each placeholder Ui represent, which may be a single-bit gate, or a one-layer quantum gate, or a time-dependent evolution eiHθ of a Hamiltonian. In the embodiments of this disclosure, a circuit unit pool is constructed. The circuit unit pool includes a plurality of selectable circuit units. Each circuit unit may be regarded as a unitary matrix circuit, that is, an equivalent quantum circuit of a unitary matrix. For some basic operations that may be involved in a quantum computing task, a corresponding circuit unit is designed for each basic operation. For example, a circuit unit may be a single-bit quantum gate, a one-layer quantum gate, or a time-dependent evolution of a Hamiltonian, which is not limited in the embodiments of this disclosure. Each placeholder Ui is filled by selecting a circuit unit from the circuit unit pool. The selection is performed in a replacement manner to ensure that each circuit unit may be reused in a final constructed quantum circuit.

For each specific quantum circuit design task, a suitable objective function needs to be specified. For the most common quantum classical hybrid computing, a paradigm of this type of optimization problem is to use an expected sum of a series of observations H as an optimized objective function. The observations (also referred to as observed quantities) refer to some Hermitian matrix operators that can measure classical output. That is, an objective function L is: <MAT> where U is a quantum circuit to be searched and constructed, and U† is a transposed conjugate of a corresponding circuit matrix. For more complex requirements, an optimized objective function may be some function expected by an observation Hi, so that expectation and specific distribution of an output quantum state may be considered in the optimized objective function. In this case, a more general objective function L can be expressed as: <MAT> where fi, gi are arbitrary differentiable functions suitable for a specific task, which means that the final objective function L is a specific transformation of an observation result.

More generally, for other tasks such as quantum machine learning, the objective function L may be defined as the following form similar to conventional supervised learning: <MAT> where fi, gi are arbitrary differentiable functions suitable for a specific task, |ψj〉 is a data set inputted by a corresponding quantum wave function, and yj is a classical label corresponding to a corresponding quantum state of the data set and is usually <NUM> or <NUM>.

For a general unitary matrix learning task, a corresponding objective function L is: <MAT> where φi, ψi respectively an input state and an output state of a circuit. If i has only one value and specially, |ψi〉 = |<NUM>〉, it corresponds to a quantum state preparation task. The objective function in this case represents fidelity of an output quantum state determined after an action of a circuit U is performed on an input simple direct product state |<NUM>〉, and fidelity of a prepared target state |φ〉. A circuit to prepare a corresponding quantum state may be found by optimizing the objective function.

In a word, because an entire computing process supports automatic differentiation, a feature of such automatic differentiation enables the DQAS framework to support an end-to-end optimized objective function in any form well. A gradient required for entire circuit parameter adjustment and optimization may be propagated back from change of a final objective function. This process only requires that a component defined by the objective function supports automatic differentiation, and almost all functions with good properties meet this requirement.

To embed parameters that control a quantum circuit structure into a continuous domain, in this disclosure, a process of selecting circuit units to form a quantum circuit is considered as being controlled by a probability model. The probability model P may be a sufficiently universal energy model or an autoregressive network. In an embodiment, simplest layer-by-layer discrete distribution may be selected to perform a process of selecting circuit units from the circuit unit pool to construct a quantum circuit. The probability model has a continuous parameter α, so that a structural parameter k of discrete integers is sampled from a probability model P(k, α), which determines a structure of a corresponding quantum circuit.

Finally, an end-to-end optimized objective function <IMG> is shown as follows: <MAT> where P(k, α) represents the initial probability model, U(k, θ) represents a candidate quantum circuit constructed and generated based on the structural parameter k, the structural parameter k may include a plurality of discrete values used to represent circuit units determined by sampling this time, and L(U(k, θ)) represents an objective function corresponding to the candidate quantum circuit U(k, θ).

Before a method embodiment of this disclosure is described, a running environment of the method is described first. In an embodiment not falling within the scope of the claims the quantum circuit determining method is implemented by a classical computer (for example, a personal computer (PC)). For example, the classical computer is used to execute a corresponding computer program to implement the method. In embodiments falling within the scope of the claims the method is performed in a hybrid device environment of a classical computer and a quantum computer. The classical computer performs circuit sampling, parameter updating, and circuit selection, and the quantum computer determines a performance evaluation index (for example, an objective function) corresponding to a candidate quantum circuit. This is because a corresponding performance evaluation result of directly deploying a quantum circuit on the quantum computer for execution is theoretically supposed to be better than simulating the quantum circuit on the classical computer.

In the following method embodiment, for ease of description, the description is provided by merely using a computer device as an execution entity of steps.

<FIG> is a flowchart of a quantum circuit determining method according to an embodiment of this disclosure. An execution entity of steps of this method may be a computer device. The method may include the following steps (<NUM> to <NUM>):
Step <NUM>. Sample an initial circuit unit pool according to an initial sampling manner to determine K groups of circuit units, and construct and generate K candidate quantum circuits based on the K groups of circuit units, K being a positive integer.

The circuit unit pool includes a plurality of selectable circuit units. In this embodiment of this disclosure, the circuit unit is a basic unit that forms a quantum circuit, and one quantum circuit may include one or more circuit units. In response to the quantum circuit including a plurality of circuit units, a connection relationship between the circuit units may be pre-defined or designed. In an example, a quantum circuit has a multi-layer structure, each layer includes a circuit unit, and layers are connected in sequence. For example, an output result of a circuit unit of a layer may be used as input data of a circuit unit of a next layer, and the data is further computed or processed through the circuit unit of the next layer. In another example, a quantum circuit has a multi-layer structure, and each layer includes one or more filling positions for filling a circuit unit. In response to a plurality of filling positions in the same layer, the filling positions may be connected in advance in a preset manner.

For some basic operations that may be involved in a quantum computing task, a corresponding circuit unit is designed for each basic operation. For example, a circuit unit may be a single-bit quantum gate, a one-layer quantum gate, or a time-dependent evolution of a Hamiltonian, which is not limited in this embodiment of this disclosure.

The sampling manner refers to a manner of selecting a circuit unit from the circuit unit pool. One or more circuit units are selected from the circuit unit pool during each time of sampling, and the one or more circuit units selected in one time of sampling form one group of circuit units, that is, each group of circuit units includes at least one circuit unit. In this embodiment of this disclosure, each group of circuit units is used for constructing and generating a candidate quantum circuit. In addition, a circuit unit is repeatable in the each group of circuit units. That is, the foregoing sampling process is performed in a replacement manner to ensure that each circuit unit may be reused in a final constructed quantum circuit.

For example, the initial circuit unit pool includes five circuit units respectively numbered <NUM>, <NUM>, <NUM>, <NUM>, and <NUM>. It is assumed that three-time sampling is performed from the initial circuit unit pool according to the initial sampling manner, to determine three groups of circuit units. It is assumed that a group of circuit units determined in first-time sampling includes three circuit units numbered <NUM>, <NUM>, <NUM> respectively, a group of circuit units determined in second-time sampling includes three circuit units numbered <NUM>, <NUM>, <NUM> respectively, and a group of circuit units determined in third-time sampling includes three circuit units numbered <NUM>, <NUM>, <NUM> respectively. Subsequently, according to the sampling results, three candidate quantum circuits are constructed and generated.

Step <NUM>. Determine a performance evaluation index corresponding to the K candidate quantum circuits.

The performance evaluation index is a parameter for quantizing and evaluating performance of a candidate quantum circuit. In this embodiment of this disclosure, the performance evaluation index corresponding to the K candidate quantum circuits is a parameter for evaluating comprehensive performance or average performance of the K candidate quantum circuits, reflecting an overall situation or average situation of respective performance of the K candidate quantum circuits.

In an exemplary embodiment, the performance evaluation index is represented by using an objective function. The objective function is a mathematical function for computing whether a quantum circuit constructed and generated reaches a task optimization objective. For example, as described above, for different quantum circuit design tasks, different objective functions may be set correspondingly.

Step <NUM>. Update the sampling manner and a circuit unit in the initial circuit unit pool based on the performance evaluation index, to determine an updated sampling manner and an updated circuit unit pool.

The performance evaluation index is used for guiding adjustment of the sampling manner and a circuit parameter of a circuit unit, to determine a candidate quantum circuit with better performance by sampling. On the one hand, the sampling manner is updated based on the performance evaluation index to optimize the sampling manner and select better circuit units from the circuit unit pool for combination; on the other hand, a circuit unit in the circuit unit pool is updated based on the performance evaluation index, for example, a circuit parameter of the circuit unit is updated, to optimize performance of a single circuit unit, to help improve overall performance of a constructed quantum circuit.

Step <NUM>. Sample the updated circuit unit pool according to the updated sampling manner to determine updated K groups of circuit units, and construct and generate updated K candidate quantum circuits based on the updated K groups of circuit units.

A sampling process in step <NUM> is the same as or similar to the sampling process described in step <NUM>. A difference is that the sampling manner and the circuit parameter of the circuit unit in the circuit unit pool are updated. In step <NUM>, the updated circuit unit pool is sampled according to the updated sampling manner to determine updated K groups of circuit units.

The number of sampling times in step <NUM> may be the same as or different from the number of sampling times in step <NUM>. For example, in response to the number of sampling times in step <NUM> being the same as the number of sampling times in step <NUM>, for example, if K in step <NUM> is equal to <NUM>, K in step <NUM> is also equal to <NUM>. In another example, in response to the number of sampling times in step <NUM> being different from the number of sampling times in step <NUM>, for example, if K in step <NUM> is equal to <NUM>, K in step <NUM> is equal to <NUM>.

Because a probability model corresponding to the sampling manner tends to converge in this cyclic process, a value of the number K of sampling times in each round is adaptively reduced, which may effectively save computing resources while maintaining performance.

In addition, after step <NUM> is performed, steps <NUM> to <NUM> may be performed cyclically, to continuously update and optimize the sampling manner and the circuit parameter, to construct a better candidate quantum circuit. This cyclic process is stopped until a cycle termination condition is satisfied.

The cycle termination condition refers to a preset condition for triggering the cyclic process to be stopped. For example, the cycle termination condition includes, but is not limited to, at least one of the following: K candidate quantum circuits generated the last time are the same, the number of identical quantum circuits in the K candidate quantum circuits generated the last time is greater than a threshold, a performance evaluation index corresponding to the K candidate quantum circuits generated the last time meets a set index requirement, and the number of execution times in the cyclic process reaches a specified number, and the like, which is not limited in this embodiment of this disclosure.

Step <NUM>. In response to a cycle termination condition being satisfied, determine a target quantum circuit from the updated K candidate quantum circuits.

The target quantum circuit is a quantum circuit determined from the K candidate quantum circuits generated the last time. The target quantum circuit may be a quantum circuit selected from the K candidate quantum circuits generated the last time. In this embodiment of this disclosure, the target quantum circuit is a final constructed and generated quantum circuit for completing a predetermined quantum circuit design task.

In an exemplary embodiment, a candidate quantum circuit with the largest generation probability is determined from the K candidate quantum circuits generated the last time. The candidate quantum circuit with the largest generation probability is determined as a target quantum circuit. A generation probability of a candidate quantum circuit may be a proportion of the candidate quantum circuit in the K candidate quantum circuits. For example, the number of candidate quantum circuits generated the last time is <NUM>, among which nine candidate quantum circuits (denoted by quantum circuit A) are the same, and the other one candidate quantum circuit (denoted by quantum circuit B) is different from the other nine. In this case, a generation probability of the quantum circuit A is <NUM>/<NUM>=<NUM>, a generation probability of the quantum circuit B is <NUM>/<NUM>=<NUM>, and the quantum circuit A may be selected as a final target quantum circuit.

To sum up, for different types of quantum circuit design problems, the technical solutions of this disclosure can be used to construct a target quantum circuit for resolving a corresponding problem, so that different types of quantum circuit design problems are highly abstracted and unified. The solutions have extremely strong universality and versatility.

In addition, compared with a genetic algorithm having disadvantages of large computational consumption and slow convergence, the technical solutions of this disclosure require only to determine a performance evaluation index corresponding to a candidate quantum circuit determined by sampling, and update a sampling manner and a circuit unit in a circuit unit pool based on the performance evaluation index, thereby quickly constructing a candidate quantum circuit with better performance, which not only reduces computational workload, but also improves efficiency of determining a final target quantum circuit.

<FIG> is a flowchart of a quantum circuit determining method according to another embodiment of this disclosure. An execution entity of steps of this method may be a computer device. The method may include the following steps (<NUM> to <NUM>):.

Step <NUM>. Construct an initial probability model, the initial probability model including p×c parameters, p representing a maximum number of circuit units, and c representing a total number of circuit units in the initial circuit unit pool.

In this embodiment of this disclosure, the initial probability model may be used as a sampling manner to sample a plurality of circuit units from the circuit unit pool. The initial probability model is a parameterized probability model, including p×c parameters, p representing a maximum number of circuit units, and c representing a total number of circuit units in the initial circuit unit pool.

The maximum number of circuit units refers to a maximum number of circuit units that may be included in a final constructed and generated target quantum circuit for completing a predetermined quantum circuit design task. For example, if the maximum number of circuit units is <NUM>, an actual number of circuit units included in the final constructed and generated target quantum circuit needs to be less than or equal to <NUM>. In this case, a group of circuit units determined during each time of sampling may include six or less circuit units. In an example, the number of circuit units included in the target quantum circuit is a predetermined number. For example, if the number of circuit units included in the target quantum circuit is pre-defined to be <NUM>, a group of circuit units determined during each time of sampling includes six circuit units. In this case, the maximum number of circuit units is the predetermined number. The predetermined number may be determined according to the number of design layers of the target quantum circuit or the number of filling positions.

The circuit unit pool includes a plurality of circuit units. As described above, any quantum circuit may be regarded as being formed by stacking a series of unitary matrices. Therefore, the circuit unit pool may include equivalent circuits respectively corresponding to a plurality of unitary matrices. The circuit unit pool may also be referred to as an operator pool or another name, which is not limited in this embodiment of this disclosure.

In this embodiment of this disclosure, it is assumed that a model parameter of the initial probability model is α, and α includes p×c parameters. For example, αmay be regarded as a matrix of p rows × c columns. An element in an ith row and a jth column in the matrix represents a probability of filling a jth circuit unit in the circuit unit pool at an ith filling position of the target quantum circuit, i being a positive integer less than or equal to p, and j being a positive integer greater than or equal toc.

Step <NUM>. Sample an initial circuit unit pool K times based on the initial probability model, to determine K groups of circuit units, each time of sampling being performed to determine one group of circuit units.

In each time of sampling process, a structural parameter k is generated based on the model parameter α of the initial probability model P(k, α). The structural parameter k may include a plurality of discrete values to represent the circuit unit determined in this sampling. For example, the circuit unit pool includes five circuit units respectively numbered <NUM>, <NUM>, <NUM>, <NUM>, and <NUM>, the structural parameter k includes (<NUM>, <NUM>, <NUM>), which means that a group of circuit units sampled from the circuit unit pool includes three circuit units numbered <NUM>, <NUM>, and <NUM> respectively. In response to the same model parameter α of the initial probability model P(k, α) being used, structural parameters k generated in any two times of sampling may be the same or different. For example, structural parameters k generated in two consecutive times of sampling are the same, both are (<NUM>, <NUM>, <NUM>). In another example, structural parameters k generated in two consecutive times of sampling are different, which are (<NUM>, <NUM>, <NUM>) and (<NUM>, <NUM>, <NUM>) respectively.

In addition, assuming that the number of circuit parameters of each circuit unit in the circuit unit pool is l, a circuit parameter pool may be maintained. The circuit parameter pool includes a circuit parameter of each circuit unit in the circuit unit pool at each filling position, that is, the circuit parameter pool includes p×c×l parameters.

Step <NUM>. Construct and generate K candidate quantum circuits based on the K groups of circuit units.

For each group of circuit units determined by sampling, a candidate quantum circuit is constructed and generated correspondingly. A connection relationship between the circuit units may be pre-defined or designed, which is not limited in this embodiment of this disclosure.

Step <NUM>. Determine a performance evaluation index corresponding to the K candidate quantum circuits, the performance evaluation index being an operation result of an objective function.

The objective function is a mathematical function for computing whether a quantum circuit constructed and generated reaches a task optimization objective. For example, as described above, for different quantum circuit design tasks, different objective functions may be set correspondingly.

In this embodiment of this disclosure, it is assumed that a candidate quantum circuit constructed and generated based on a structural parameter k is U(k, θ), and an objective function corresponding to the candidate quantum circuit U(k, θ) is denoted by LeU(k, θ)), an objective function <IMG> corresponding to K candidate quantum circuits generated after K times of sampling may be expressed as follows: <MAT>.

It can be seen from the above formula that operation results respectively corresponding to the K candidate quantum circuits with respect to the objective function are first computed, to determine K operation results, and the performance evaluation index (that is, an operation result of the objective function <IMG>) is then determined based on the K operation results. The operation result of the objective function <IMG> reflects an overall situation or average situation of respective performance of the K candidate quantum circuits.

Step <NUM>. Compute first gradient information and second gradient information based on the performance evaluation index, the first gradient information being gradient information of the model parameter of the initial probability model, and the second gradient information being gradient information of a circuit parameter of a circuit unit in the initial circuit unit pool.

In this embodiment of this disclosure, on the one hand, gradient information of the objective function relative to the model parameter of the initial probability model is computed, to determine first gradient information, the first gradient information being used for guiding update of the model parameter of the initial probability model; on the other hand, gradient information of the objective function relative to a circuit parameter of a circuit unit in the circuit unit pool is computed, to determine second gradient information, the second gradient information being used for guiding update of the circuit parameter of the circuit unit.

In an example, a derivative of the objective function relative to the model parameter of the initial probability model is computed, to determine the first gradient information. For example, a derivative formula for computing the first gradient information is: <MAT>
where <IMG> represents a derivative of the objective function <IMG> relative to the model parameter α. For other parameters in the formula, reference may be made to the description above.

In another example, a derivative of the objective function relative to the circuit parameter of the circuit unit in the circuit unit pool is computed, to determine the second gradient information. For example, a derivative formula for computing the second gradient information is: <MAT> where ∇θ<IMG> represents a derivative of the objective function <IMG> relative to the circuit parameter θ. For other parameters in the formula, reference may be made to the description above.

In addition, in response to the first gradient information being computed through derivation, related techniques of Monte Carlo expected automatic differentiation may be used, including but not limited to a score function or a reparameterization method. For example, a solution using the score function is applicable to universal probability distribution models including an unnormalized one. In response to the second gradient information being computed through derivation, automatic differentiation may be used to determine the derivative numerically. Experimentally, a derivative of a quantum circuit may be computed through parameter shift or direct measurement of the gradient quantum circuit.

Step <NUM>. Update the model parameter of the initial probability model based on the first gradient information, to determine an updated probability model.

For example, the model parameter αof the initial probability model is updated by using a gradient descent algorithm, to continuously optimize the model parameter α of the initial probability model, so as to determine better circuit units by sampling for combination.

Step <NUM>. Update the circuit parameter of the circuit unit in the circuit unit pool based on the second gradient information, to determine the updated circuit unit pool.

For example, a circuit parameter θof each circuit unit in the circuit unit pool is updated by using the gradient descent algorithm, to continuously optimize the circuit parameter θ of the each circuit unit, so as to optimize performance of a single circuit unit, to help improve overall performance of a constructed quantum circuit.

Step <NUM>. Sample the updated circuit unit pool according to the updated probability model to determine updated K groups of circuit units, and construct and generate updated K candidate quantum circuits based on the updated K groups of circuit units.

Step <NUM> and step <NUM> are the same as or similar to step <NUM> and step <NUM> in the embodiment of <FIG>. For details, reference may be made to the descriptions in the foregoing embodiment.

The method provided in this embodiment of this disclosure further includes step <NUM> and step <NUM>, to implement further tuning of a circuit parameter of a target quantum circuit.

Step <NUM>. Fix a structure of the target quantum circuit, and adjust a circuit parameter of each circuit unit included in the target quantum circuit.

After the target quantum circuit is determined, a circuit structure (that is, circuit units included in the circuit and a connection relationship between the circuit units) of the target quantum circuit is fixed. If necessary, a circuit parameter of each circuit unit included in the target quantum circuit may be further tuned, to further improve performance of the target quantum circuit.

For example, gradient information of the objective function relative to the circuit parameter of the target quantum circuit is computed, and the gradient descent algorithm is also used to update the circuit parameter of the target quantum circuit, to continuously optimize the circuit parameter of the target quantum circuit to improve performance of the target quantum circuit.

Step <NUM>. In response to an adjustment termination condition being satisfied, determine the target quantum circuit post parameter tuning.

The adjustment termination condition refers to a preset condition for triggering adjustment of the circuit parameter of the target quantum circuit to be stopped. For example, the adjustment termination condition includes, but is not limited to, at least one of the following: a performance evaluation index of the target quantum circuit reaches a preset index, the number of adjustment times of the circuit parameter of the target quantum circuit reaches a specified number, and the like, which is not limited in this embodiment of this disclosure.

In this embodiment of this disclosure, the target quantum circuit post parameter tuning is a final constructed and generated quantum circuit for completing a predetermined quantum circuit design task.

In an exemplary embodiment, after the constructing and generating K candidate quantum circuits, the method further includes the following step: determining, for a jth circuit unit in an ith candidate quantum circuit, a circuit parameter of the jth circuit unit from a circuit parameter pool according to a position of the jth circuit unit in the circuit unit pool and a position of the jth circuit unit in the ith candidate quantum circuit, the circuit parameter pool including a circuit parameter of each circuit unit in the circuit unit pool at each filling position, i being a positive integer less than or equal to K, and j being a positive integer. The circuit parameter pool may include p×c groups of circuit parameters, an (i, j)th group of circuit parameters are circuit parameters in response to a jth circuit unit in the circuit unit pool being filled at an ith filling position, i being a positive integer less than or equal to p, and j being a positive integer greater than or equal to c.

In the foregoing manner, a parameter binding mechanism is used to bind a circuit parameter of a circuit unit to a filling position of the circuit unit, so that after a new candidate quantum circuit is constructed and generated, a circuit parameter of each circuit unit may be simply and efficiently determined from the circuit parameter pool. In addition, in response to the circuit parameter of the each circuit unit in the circuit unit pool being updated based on the second gradient information, the circuit parameter stored in the circuit parameter pool needs to be synchronously updated, to ensure accuracy of the circuit parameter determined from the circuit parameter pool.

In an exemplary embodiment, for a more stable training process, training techniques that have emerged in research of NAS and the broader field of machine learning may be introduced and developed, including but not limited to early stop, multi-start, circuit variational parameter warm-up training, separating a training verification data set to optimize two groups of parameters, post-processing of better training results and grid search, progressive layer-by-layer training, adding a moving average of an objective function as a baseline during Monte Carlo gradient estimation to reduce an estimation variance, adding random noise to circuit parameters to smooth energy loss, adding a regular term and a penalty term that support a plurality of objectives to the objective function, a smaller-scale agent task, transfer learning, and the like.

The more important one is the addition of the regular item. Because the model parameter of the initial probability model determines the sampling times and probability of each circuit unit, a corresponding regular item based on the model parameter may be defined, to encourage some types of circuit units (for example, a single-bit quantum gate), that is, to increase the sampling times and probabilities of the types of circuit units, or suppress some types of circuit units (for example, a two-bit quantum gate), that is, to reduce the sampling times and probabilities of the types of circuit units. For example, the following regular item is added to an objective function L, and the objective function L added with the regular item is expressed as ΔL: <MAT>.

where c represents the number of circuit units in the circuit unit pool, p is the number of filling positions, p(ki = k) is a probability of filling a kth circuit unit at an ith candidate filling position, λ is a weight of the regular item, and q represents the number of two-bit quantum gates in the circuit units.

Such a manner of introducing a custom regular term improves flexibility and controllability of circuit unit sampling, thereby helping improve performance of the final constructed and generated quantum circuit and reduce a quantum noise level of the quantum circuit.

To sum up, in the technical solutions provided in the embodiments of this disclosure, a search domain of a quantum circuit is expanded to a continuous space, thereby making automatic differentiation and stochastic gradient descent possible, which greatly reduces consumption of computing resources, while ensuring better convergence.

In addition, in a process of parameter optimization, in this disclosure, the first gradient information and the second gradient information are computed, and the model parameter and the circuit parameter can be optimized based on the two types of gradient information, so that a multi-objective parameter optimization solution is realized, thereby helping improve efficiency of quantum circuit construction.

The following describes, with reference to <FIG>, a complete architecture of a DQAS framework according to an embodiment of this disclosure. It is assumed that a target quantum circuit for completing a predetermined quantum circuit design task is searched and constructed through the DQAS framework. A circuit unit pool <NUM> includes a plurality of selectable circuit units, such as circuit units <NUM>, <NUM>, and <NUM> shown in the figure. The circuit unit pool <NUM> is sampled based on a probability model P(k, α) in batches to determine K groups of circuit units, and K candidate quantum circuits are constructed and generated. A parameter pool <NUM> is configured to store a circuit parameter of a quantum circuit. A circuit parameter of each circuit unit in each candidate quantum circuit constructed and generated may be determined from the parameter pool <NUM>. In addition, performance of the candidate quantum circuits is evaluated by using an objective function L, and overall performance of the K candidate quantum circuits may be evaluated by using the objective function <IMG>. Gradient information ∇α<IMG> of the objective function <IMG> relative to a model parameter α of the initial probability model and gradient information ∇θ<IMG> of the objective function <IMG> relative to a circuit parameter θ of a circuit unit in the circuit unit pool <NUM> are computed, and the model parameter α and the circuit parameter θ are updated based on the two pieces of gradient information. Subsequently, the updated circuit unit pool is sampled according to the updated probability model to determine updated K groups of circuit units, and K candidate quantum circuits are constructed and generated. The foregoing process is cyclically performed. In response to a cycle termination condition being satisfied, a candidate quantum circuit with the largest generation probability is selected, from K candidate quantum circuits generated the last time, as a final target quantum circuit.

<FIG> is a flowchart of a quantum circuit determining method according to another embodiment of this disclosure. An execution entity of steps of this method may be a computer device. The method may include the following steps (<NUM> to <NUM>):
Step <NUM>. Select N circuit units from a circuit unit pool, the circuit unit pool including a plurality of circuit units, each circuit unit being an equivalent quantum circuit corresponding to a unitary matrix, and N being an integer greater than <NUM>.

In this embodiment of this disclosure, the quantum circuit is divided with a circuit unit as granularity, and one quantum circuit may be formed by a plurality of circuit units connected in a specific connection manner. Therefore, to construct a quantum circuit for completing a specific quantum computing task, a plurality of circuit units may be selected from the circuit unit pool.

In an implementation, according to a specific sampling manner, N circuit units are selected from the circuit unit pool. The sampling manner refers to a manner of selecting a circuit unit from the circuit unit pool. N circuit units are selected from the circuit unit pool during each time of sampling, and the N circuit units selected in one time of sampling form a group of circuit units, that is, each group of circuit units includes N circuit units. In addition, a circuit unit is repeatable in the N circuit units. That is, the foregoing sampling process is performed in a replacement manner to ensure that each circuit unit may be reused in a final constructed quantum circuit.

In an exemplary embodiment, the sampling manner may be a probability model. For a manner of determining the circuit unit through sampling by using the probability model, reference may be made to the descriptions in the foregoing embodiment.

Step <NUM>. Determine circuit parameters respectively corresponding to the N circuit units, the circuit parameter being used for defining an operation performed by the circuit unit, and the circuit parameter being updatable.

A circuit unit has a corresponding circuit parameter, and the circuit parameter is used for defining an operation performed by the circuit unit. That is, an operation performed by a circuit unit is not only related to a structure of the circuit unit, but also related to a circuit parameter of the circuit unit. After the N circuit units are selected from the circuit unit pool in step <NUM>, a structure of each circuit unit is predetermined, and a circuit parameter of the each circuit unit is determined by performing step <NUM>.

In this embodiment of this disclosure, the circuit parameter of the circuit unit is a variational parameter, that is, the circuit parameter of the circuit unit is updatable (that is, adjustable and modifiable), so that if necessary, the circuit parameter of the circuit unit may be updated to improve performance of the circuit unit.

In an exemplary embodiment, a circuit parameter pool may be maintained. The circuit parameter pool includes a circuit parameter of each circuit unit in the circuit unit pool at each filling position. For an ith circuit unit in the N circuit units, a circuit parameter of the ith circuit unit is determined from the circuit parameter pool according to a filling position of the ith circuit unit. In the foregoing manner, a parameter binding mechanism is used to bind a circuit parameter of a circuit unit to a filling position of the circuit unit, so that in response to a quantum circuit being constructed and generated, a circuit parameter of each circuit unit may be simply and efficiently determined from the circuit parameter pool.

Step <NUM>. Construct and generate a quantum circuit based on the N circuit units and the circuit parameters respectively corresponding to the N circuit units.

After the N circuit units and the circuit parameters respectively corresponding to the N circuit units are determined, the quantum circuit is constructed and generated. The quantum circuit includes the N circuit units, and a circuit parameter of the quantum circuit includes the circuit parameters respectively corresponding to the N circuit units. In addition, a connection relationship between the circuit units may be pre-defined or designed, which is not limited in this embodiment of this disclosure.

In an exemplary embodiment, as shown in <FIG>, the method further includes the following steps after step <NUM>:
Step <NUM>. Determine a performance evaluation index corresponding to the quantum circuit.

The performance evaluation index is a parameter for quantizing and evaluating performance of a quantum circuit. In an exemplary embodiment, the performance evaluation index is represented by using an objective function. The objective function is a mathematical function for computing whether a quantum circuit constructed and generated reaches a task optimization objective. For example, as described above, for different quantum circuit design tasks, different objective functions may be set correspondingly.

Step <NUM>. Compute target gradient information based on the performance evaluation index, the target gradient information being gradient information of the circuit parameter of the quantum circuit.

In this embodiment of this disclosure, the target gradient information is determined by computing gradient information of the objective function relative to the circuit parameter of the quantum circuit. The target gradient information is used for guiding update of the circuit parameter of the quantum circuit.

In an example, a derivative of the objective function relative to the circuit parameter of the quantum circuit is computed, to determine the target gradient information. For example, a derivative formula for computing the target gradient information is: <MAT>
where ∇θL represents a derivative of an objective function L relative to a circuit parameter θ of a quantum circuit U(k, θ).

Step <NUM>. Update the circuit parameter of the quantum circuit based on the target gradient information, to determine an updated quantum circuit.

For example, the circuit parameter of the quantum circuit is updated by using a gradient descent algorithm, to continuously optimize the circuit parameters of the circuit units, so as to improve overall performance of the quantum circuit.

In this embodiment of this disclosure, because the objective function is a differentiable function, corresponding gradient information may be computed through derivation, so that the circuit parameter can be updated and optimized by using the gradient descent algorithm, to continuously improve the performance of the quantum circuit.

To sum up, in the technical solutions provided in the embodiments of this disclosure, a quantum circuit is regarded as being formed by stacking equivalent quantum circuits corresponding to a series of unitary matrices, so that the quantum circuit is divided into circuit units. A circuit unit pool is constructed to provide selectable circuit units, and circuit units are selected from the circuit unit pool to construct a quantum circuit, thereby implementing DQAS, and providing a universal quantum circuit construction solution.

In addition, because a circuit parameter of each circuit unit included in the quantum circuit is updatable, performance of the quantum circuit can be improved by updating (that is, adjusting) the circuit parameter. Further, because an objective function corresponding to the quantum circuit is a differentiable function, corresponding gradient information may be computed through derivation, so that the circuit parameter can be updated and optimized by using the gradient descent algorithm, to continuously improve the performance of the quantum circuit.

In addition, compared with constructing a quantum circuit by using a genetic algorithm, which searches piecewise for a partial circuit structure locally optimal, thus leading to a problem that a final constructed complete quantum circuit is not globally optimal, this disclosure has better performance since a circuit parameter is updated after a complete quantum circuit structure is constructed, and a circuit parameter that achieves a complete quantum circuit globally optimal can be finally found.

For details not described in this embodiment, reference may be made to the descriptions in other embodiments above.

The following describes experiment cases in which a DQAS framework provided in this disclosure is applied to a specific quantum circuit design matter. Three types of matters are considered herein to show applications and prospects of the DQAS framework.

Case <NUM>: Greenberger-Horne-Zeilinger (GHZ) quantum state preparation and Bell state circuit design.

In the following example, single-bit and two-bit quantum gates are adopted in an operator pool and a coding solution. Types of quantum gates and the number of qubit rows at which the quantum gates are located determine a constituent of the operator pool.

GHZ quantum state is defined as <MAT>. Such a state is known as the Schrödinger's cat state, which is widely used in theory and quantum information practice. The DQAS framework provided in this disclosure can automatically design a corresponding quantum state preparation circuit. An objective function of the quantum state preparation circuit is an inner product of an output state of the quantum circuit and a theoretical GHZ state. Searching is performed by gradually reducing the number p of gates while ensuring performance, and it can be ensured that a preparation circuit that satisfies a condition and requires the least quantum gates is found. A specific circuit is shown in <FIG>. A parameter π/<NUM> is completely learned by the framework itself.

Bell state refers to four orthogonal entangled states formed by two bits, which play important roles in quantum teleportation and compression coding. A corresponding quantum circuit needs to respectively map four different measurement ground states to corresponding coded Bell state entangled states. Therefore, this matter is a complete circuit learning matter, rather than single quantum state preparation. An inner product of a target state and expectations of observations XX and ZZ may all be used as objective functions, and four different input state evaluations are required as a total objective function. A specific circuit determined by automatic search is shown in <FIG>. In this example, the framework uses only a discrete parameter-less operator pool, that is, a non-variable circuit parameter.

A circuit component of quantum Fourier transform and a hypothetical quantum noise model that often appear in quantum computing are used, to show a potential application of the DQAS solution in the field of quantum error correction. A quantum Fourier transform circuit is filled on <NUM>-bit and <NUM>-bit systems to improve fidelity of an output state.

A quantum error mitigation policy adopted herein is that a gap in a quantum circuit is filled with single-bit quantum gates, so that a set of the quantum gates provides an identity matrix. In this way, without changing a corresponding matrix of the quantum circuit, attenuation noise of a waiting bit may be effectively reduced, and coherent noise, which is more difficult to suppress, can be transformed into simple Pauli noise. In accordance with this policy, a circuit design coding solution adopted is an operator pool V formed by different types of single-bit gates and a placeholder U whose search depth p is equal to the number of gap positions in an original circuit. For example, for a <NUM>-bit quantum Fourier transform circuit, p = <NUM>, and for a <NUM>-bit circuit, p = <NUM>.

A comparison baseline of such an error correction effect is to try to fill quantum gates equivalent to <NUM> in corresponding consecutive gaps. It is found that this framework can find a circuit with higher fidelity than this knowledge-based common-sense solution. Actually, the DQAS can effectively perceive a specific long-range correlation in the quantum circuit, so that a single gap can also be filled non-identically to achieve a further improvement in fidelity.

Specifically, for the <NUM>-bit quantum Fourier transform circuit, fidelity corresponding to the original circuit, an expert circuit, and a circuit automatically designed by the framework is <NUM>, <NUM>, and <NUM>, respectively. For the <NUM>-bit quantum Fourier transform circuit, fidelity corresponding to the original circuit, the expert circuit, and the circuit automatically designed by the framework is <NUM>, <NUM>, and <NUM>, respectively. It may be seen that the error correction circuit designed automatically by this framework can suppress quantum noise better than a circuit designed by human experts. Such automatic circuit design does not depend on any prior knowledge at all, but is generated from scratch. (A corresponding quantum error correction design and a specific fidelity value depend on the hypothetical quantum noise model. The quantum noise model adopted in this example is: For a gap of each column of quantum gates, there is bit-flip noise of p=<NUM>, and for each quantum circuit vacancy, there is bit-flip noise ofp=<NUM>).

For <NUM>-bit and <NUM>-bit original circuits, error correction circuits found in this framework are respectively shown in <FIG>. A gray quantum gate in the error correction circuit is a result of intelligent filling after the DQAS framework is trained.

Case <NUM>: QAOA-type circuit configuration search.

The QAOA is a very important quantum classical hybrid computing paradigm, and has a strong physical meaning and a strong connection with quantum annealing. Therefore, with the same depth and the same number of circuit parameters, finding a quantum circuit arrangement with stronger approximation capabilities has important application value (for showing quantum advantages) and theoretical significance (for cross-comparing and understanding with important concepts in quantum annealing). In such a matter, an end-to-end environment adopts a typical Max-Cut combinatorial optimization problem, and the operator pool adopts a policy of combining a Hamiltonian time-dependent evolution layer and an ordinary single-bit quantum gate layer. In the simplest case, an operator considered includes a Hadamard gate layer, single-bit x, y, z rotation layers (equivalent to eiHθ, where H = ∑i Xi, and X may be replaced by a Y or Z operator), and ei Σij ZiZjθ layer, ij representing an edge of a graph in the problem. The basic components are respectively referred to as an H-layer, an rx-layer, an ry-layer, an rz-layer, and a zz-layer. The xx-layer and the yy-layer may be constructed and generated by using the basic components, and therefore are redundant items. The setting of an end-to-end objective function is the same as that of a conventional QAOA, which is, an expectation, on an output state of a quantum circuit, of Max-Cut corresponding to a Hamiltonian.

Through this framework, a configuration and corresponding parameters may be found, so that a corresponding quantum circuit structure may be simultaneously applied to a batch of graph instances generated from a specific distribution, for example, a regular graph. The quantum circuit structure found in this way is an optimal possible solution of approximating different graphs with the same solution. The same layout as the QAOA can be automatically found by search, that is, as shown in <FIG>, an H-layer, a zz-layer, an rx-layer, a zz-layer, and an rx-layer. That is, in response to a relatively wide scope of the graph and a relatively small number of layers, the framework shows that an alternate arrangement of the QAOA is indeed the best choice for approximation, which also shows that the framework has a specific theoretical exploration function in addition to strong applicability.

As shown above, the DQAS framework provided in this disclosure can be widely used in various quantum computing and quantum information problems, especially automated design of quantum circuits in various situations. Such end-to-end differentiable design does not depend on any hypothesis about a circuit structure, which brings many possibilities for quantum circuit design. In theory, this method combines new programming paradigms such as quantum programming, differential programming, and probabilistic programming, and can be used to explore and find a potentially efficient quantum structure beyond accumulation of existing knowledge. In practice, this framework has good performance and excellent results in quantum state preparation, quantum circuit decomposition and compilation, quantum error correction, and variable quantum structure search. The differentiable methodology and high versatility of the framework ensure that the solution is simple and efficient, while allowing for account native quantum gates of real quantum hardware, connection topologies, noise features, and the like.

Specifically, empirical examples can indicate that the DQAS framework provided in this disclosure can achieve the following contents and effects:.

Generally, the technical solutions provided in this disclosure has the following advantages over other solutions:.

The technical solutions of this disclosure are helpful to speed up design of a more adaptable quantum circuit at present. Typical shortcomings of quantum hardware in the NISQ era are short coherence time and large quantum noise. Correspondingly, in addition to fully considering a specific feature of the quantum hardware, a depth of the quantum circuit and the number of two-bit quantum gates need to be reduced to the greatest extent. Because the two-bit quantum gate usually has greater noise than a single-bit quantum gate, reducing the number of two-bit quantum gates while ensuring performance can effectively alleviate impact of quantum noise. The DQAS framework provided in this disclosure can well resolve this multi-objective circuit design problem, thereby determining advantages in commercial application of quantum computing.

In addition, quantum hardware evaluation may be applied in a short to medium time. Applications in actual production include a VQE or QAOA hypothesis optimization assisted by DQAS, which helps to use fewer quantum resources to determine better results, and corresponding products can be used to resolve a combinatorial optimization problem or a ground state energy simulation in quantum chemistry. In addition, the DQAS can also effectively exert design potential in a quantum compilation technology stack and quantum error mitigation, making a corresponding circuit more stable to quantum noise.

The following describes apparatus embodiments of this disclosure, which can be used to execute the method embodiments of this disclosure. For details not disclosed in the apparatus embodiments of this disclosure, refer to the method embodiments of this disclosure.

<FIG> is a block diagram of a quantum circuit determining apparatus according to an embodiment of this disclosure. The apparatus has functions of implementing the foregoing method embodiments. The functions may be implemented by hardware, or may be implemented by hardware executing corresponding software. The apparatus may be the computer device described above, or may be disposed in the computer device. As shown in <FIG>, the apparatus <NUM> may include: a circuit sampling module <NUM>, a circuit evaluation module <NUM>, a parameter updating module <NUM>, and a circuit determining module <NUM>.

The circuit sampling module <NUM> is configured to sample an initial circuit unit pool according to an initial sampling manner to determine K groups of circuit units, and construct and generate K candidate quantum circuits based on the K groups of circuit units, each group of circuit units including at least one circuit unit for constructing and generating a candidate quantum circuit, and K being a positive integer.

The circuit evaluation module <NUM> is configured to determine a performance evaluation index corresponding to the K candidate quantum circuits.

The parameter updating module <NUM> is configured to update the sampling manner and a circuit unit in the initial circuit unit pool based on the performance evaluation index, to determine an updated sampling manner and an updated circuit unit pool.

The circuit sampling module <NUM> is further configured to sample the updated circuit unit pool according to the updated sampling manner to determine updated K groups of circuit units, and construct and generate updated K candidate quantum circuits based on the updated K groups of circuit units.

The circuit determining module <NUM> is configured to in response to a cycle termination condition being satisfied, determine a target quantum circuit from the updated K candidate quantum circuits.

In an exemplary embodiment, as shown in <FIG>, the circuit sampling module <NUM> includes: a model construction unit <NUM>, a circuit sampling unit <NUM>, and a circuit construction unit <NUM>.

The model construction unit <NUM> is configured to construct an initial probability model, the initial probability model including p×c parameters, p representing a maximum number of circuit units, and c representing a total number of circuit units in the initial circuit unit pool.

The circuit sampling unit <NUM> is configured to sample the initial circuit unit pool K times based on the initial probability model, to determine the K groups of circuit units, each time of sampling being performed to determine one group of circuit units.

The circuit construction unit <NUM> is configured to construct and generate the K candidate quantum circuits based on the K groups of circuit units.

In an exemplary embodiment, as shown in <FIG>, the parameter updating module <NUM> includes: a gradient computing unit <NUM>, a model parameter updating unit <NUM>, and a circuit parameter updating unit <NUM>.

The gradient computing unit <NUM> is configured to compute first gradient information and second gradient information based on the performance evaluation index, the first gradient information being gradient information of a model parameter of the initial probability model, and the second gradient information being gradient information of a circuit parameter of the circuit unit in the circuit unit pool.

The model parameter updating unit <NUM> is configured to update the model parameter of the initial probability model based on the first gradient information, to determine an updated probability model.

The circuit parameter updating unit <NUM> is configured to update the circuit parameter of the circuit unit in the circuit unit pool based on the second gradient information, to determine the updated circuit unit pool.

In an exemplary embodiment, the performance evaluation index is an operation result of an objective function. The gradient computing unit <NUM> is configured to compute a derivative of the objective function relative to the model parameter of the initial probability model, to determine the first gradient information; and compute a derivative of the objective function relative to the circuit parameter of the circuit unit in the circuit unit pool, to determine the second gradient information.

In an exemplary embodiment, the performance evaluation index is an operation result of an objective function. The circuit evaluation module <NUM> is configured to compute K operation results of the objective function respectively corresponding to the K candidate quantum circuits; and determine the performance evaluation index based on the K operation results.

In an exemplary embodiment, the circuit determining module <NUM> is configured to determine a candidate quantum circuit with a largest generation probability from the K candidate quantum circuits generated the last time; and determine the candidate quantum circuit with the largest generation probability as the target quantum circuit.

In an exemplary embodiment, as shown in <FIG>, the apparatus <NUM> further includes: a parameter determining module <NUM>, configured to determine, for a jth circuit unit in an ith candidate quantum circuit, a circuit parameter of the jth circuit unit from a circuit parameter pool according to a position of the jth circuit unit in the circuit unit pool and a position of the jth circuit unit in the ith candidate quantum circuit. The circuit parameter pool includes a circuit parameter of each circuit unit in the circuit unit pool at each filling position, i is a positive integer less than or equal to K, and j is a positive integer.

In an exemplary embodiment, as shown in <FIG>, the apparatus <NUM> further includes: a parameter tuning module <NUM>, configured to fix a structure of the target quantum circuit, and adjust a circuit parameter of each circuit unit included in the target quantum circuit; and in response to an adjustment termination condition being satisfied, determine the target quantum circuit post parameter tuning.

In an exemplary embodiment, a circuit unit is repeatable in each group of circuit units.

<FIG> is a block diagram of a quantum circuit determining apparatus according to another embodiment of this disclosure. The apparatus has functions of implementing the foregoing method embodiments. The functions may be implemented by hardware, or may be implemented by hardware executing corresponding software. The apparatus may be the computer device described above, or may be disposed in the computer device. As shown in <FIG>, the apparatus <NUM> may include: a circuit unit selection module <NUM>, a circuit parameter determining module <NUM>, and a quantum circuit construction module <NUM>.

The circuit unit selection module <NUM> is configured to select N circuit units from a circuit unit pool, the circuit unit pool including a plurality of circuit units, each circuit unit being an equivalent quantum circuit corresponding to a unitary matrix, and N being an integer greater than <NUM>.

The circuit parameter determining module <NUM> is configured to determine circuit parameters respectively corresponding to the N circuit units, the circuit parameter being used for defining an operation performed by the circuit unit, and the circuit parameter being updatable.

The quantum circuit construction module <NUM> is configured to construct and generate a quantum circuit based on the N circuit units and the circuit parameters respectively corresponding to the N circuit units.

In an exemplary embodiment, the circuit parameter determining module <NUM> is configured to determine, for an ith circuit unit in the N circuit units, a circuit parameter of the ith circuit unit from a circuit parameter pool according to a filling position of the ith circuit unit,.

the circuit parameter pool including a circuit parameter of each circuit unit in the circuit unit pool at each filling position, i being a positive integer less than or equal to N.

In an exemplary embodiment, as shown in <FIG>, the apparatus <NUM> further includes an evaluation index determining module <NUM>, a gradient information computing module <NUM>, and a circuit parameter updating module <NUM>.

The evaluation index determining module <NUM> is configured to determine a performance evaluation index corresponding to the quantum circuit.

The gradient information computing module <NUM> is configured to compute target gradient information based on the performance evaluation index, the target gradient information being gradient information of a circuit parameter of the quantum circuit.

The circuit parameter updating module <NUM> is configured to update the circuit parameter of the quantum circuit based on the target gradient information, to determine an updated quantum circuit.

In an exemplary embodiment, the performance evaluation index is an operation result of an objective function. The gradient information computing module <NUM> is configured to compute a derivative of the objective function relative to the circuit parameter of the quantum circuit, to determine the target gradient information.

In an exemplary embodiment, a circuit unit is repeatable in the N circuit units.

When the apparatus provided in the foregoing embodiments implements its functions, a description is given only by using the foregoing division of functional modules as an example. In actual applications, the functions may be allocated to and implemented by different functional modules according to the requirements, that is, the internal structure of the device may be divided into different functional modules, to implement all or some of the functions described above. In addition, the apparatus provided in the foregoing embodiment belongs to the same conception as the embodiment of the method. For a specific implementation process thereof, reference may be made to the method embodiment.

<FIG> is a structural block diagram of a computer device according to an embodiment of this disclosure. The computer device may be configured to implement the quantum circuit determining method provided in the foregoing embodiments. For example, the computer device is a classical computer.

The computer device <NUM> includes a processing unit (for example, a central processing unit (CPU), a graphics processing unit (GPU), and a field-programmable gate array (FPGA) <NUM>, a system memory <NUM> including a random access memory (RAM) <NUM> and a read-only memory (ROM) <NUM>, and a system bus <NUM> connecting the system memory <NUM> and the CPU <NUM>. The computer device <NUM> further includes a basic input/output system (I/O system) <NUM> for information transmission between components in the computer device, and a large-capacity storage device <NUM> for storing an operating system <NUM>, an application program <NUM>, and another program module <NUM>.

The basic I/O system <NUM> includes a display <NUM> configured to display information and an input device <NUM>, such as a mouse or a keyboard, for a user to input information. The display <NUM> and the input device <NUM> are both connected to the CPU <NUM> by using an input/output controller <NUM> connected to the system bus <NUM>. The basic I/O system <NUM> may further include the I/O controller <NUM> configured to receive and process inputs from a plurality of other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input/output controller <NUM> further provides an output to a display screen, a printer, or other type of output device.

The large-capacity storage device <NUM> is connected to the CPU <NUM> by using a mass storage controller (not shown) connected to the system bus <NUM>. The large-capacity storage device <NUM> and an associated computer-readable medium thereof provide non-volatile storage for the computer device <NUM>. That is, the large-capacity storage device <NUM> may include a computer-readable medium (not shown) such as a hard disk or a compact disc ROM (CD-ROM) drive.

Without loss of generality, the computer-readable medium may include a computer storage medium and a communication medium. The computer storage medium includes volatile and non-volatile, removable and non-removable media implemented by using any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. The computer storage medium includes a RAM, a ROM, an erasable programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), a flash memory or another solid-state memory technology, a CD-ROM, a digital versatile disc (DVD) or another optical memory, a tape cartridge, a magnetic cassette, a magnetic disk memory, or another magnetic storage device. Certainly, a person skilled in the art can know that the computer storage medium is not limited to the foregoing types. The system memory <NUM> and the large-capacity storage device <NUM> may be generally referred to as a memory.

According to the embodiments of this disclosure, the computer device <NUM> may be further connected, through a network such as the Internet, to a remote computer on the network and run. That is, the computer device <NUM> may be connected to a network <NUM> by using a network interface unit <NUM> connected to the system bus <NUM>, or may be connected to another type of network or a remote computer system (not shown) by using a network interface unit <NUM>.

The memory further includes at least one instruction, at least one program, a code set, or an instruction set, the at least one instruction, the at least one program, the code set, or the instruction set being stored in the memory and configured to be executed by one or more processors to implement the foregoing quantum circuit determining method.

In an exemplary embodiment, a computer-readable storage medium is further provided, the storage medium storing at least one instruction, at least one program, a code set, or an instruction set, the at least one instruction, the at least one program, the code set, or the instruction set, when executed by the processor, implementing the foregoing quantum circuit determining method.

The computer-readable storage medium may be a ROM, a RAM, a compact disc ROM (CD-ROM), a magnetic tape, a solid state drive (SSD), an optical disc, or the like. The RAM may include a resistance random access memory (ReRAM) and a dynamic random access memory (DRAM).

In an exemplary embodiment, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions to cause the computer device to perform the foregoing quantum circuit determining method.

Claim 1:
A quantum circuit determining method for determining a quantum circuit according to a quantum circuit design task, performed by a computer device forming a hybrid device environment including a classical computer and a quantum computer, the method comprising:
sampling (<NUM>), by the classical computer, an initial circuit unit pool according to an initial sampling manner to determine K groups of circuit units, K being a positive integer,
and constructing and generating K candidate quantum circuits based on the K groups of circuit units, wherein each group of circuit units comprises a plurality of circuit units for constructing and generating a candidate quantum circuit, a candidate quantum circuit has a multi-layer structure, each layer includes a plurality of filling positions for filling a circuit unit, the plurality of filling positions in a same layer are connected to one another in a preset manner, and a gap in a candidate quantum circuit is filled with circuit units being single-bit quantum gates so that a set of the single-bit quantum gates filling the gap proves an identity matrix,
determining (<NUM>), by the quantum computer, a performance evaluation index corresponding to the K candidate quantum circuits, wherein the performance evaluation index is an operation result of an objective function (<NUM>), wherein the objective function is specified according to the quantum circuit design task;
updating (<NUM>), by the classical computer, the sampling manner and a circuit unit in the initial circuit unit pool based on the performance evaluation index, to determine an updated sampling manner and an updated circuit unit pool;
sampling (<NUM>, <NUM>), by the classical computer, the updated circuit unit pool according to the updated sampling manner to determine updated K groups of circuit units, and constructing and generating updated K candidate quantum circuits based on the updated K groups of circuit units; and
in response to a cycle termination condition being satisfied, determining (<NUM>), by the classical computer, a target quantum circuit from the updated K candidate quantum circuits.