Quantum circuit fidelity prediction model construction method and system, and prediction method
Through a fully connected neural network combined with the specific encoding of the quantum circuit feature vector, a quantum circuit fidelity prediction model is constructed, which solves the problem of difficulty in balancing accuracy and cost in the existing technology, and achieves high accuracy and low cost quantum circuit protection Truth prediction.
Patent Information
- Application Number
- CN202411164568.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-08-23
AI Technical Summary
Existing quantum circuit fidelity prediction methods are difficult to balance between accuracy and computational cost. Simple formula methods predict results are insufficient, while complex machine learning models have high computational efficiency and resource consumption, which cannot meet the prediction of complex quantum circuits. need.
The fidelity of quantum circuits on specified quantum computing devices is predicted using fully connected neural networks, through the application relationship between quantum gates and qubits, the fidelity of quantum gates, the fidelity of qubits, and the decoherence time splicing. The feature vector of quantum circuit is constructed, the initial quantum circuit fidelity prediction model is constructed for multiple iterative training to obtain the quantum circuit fidelity prediction model.
It realizes high accuracy prediction fidelity in complex quantum circuits while reducing computing costs, improving the accuracy and efficiency of quantum circuit prediction.
Smart Images

Figure CN119067228A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of quantum computing technology, and more specifically, to a prediction model construction method and system for quantum circuit fidelity, and a prediction method. Background Art
[0002] Quantum computing is becoming an important branch of modern science with its potential to surpass classical computing. Quantum circuits, as the core of quantum computing, are the basic structure for implementing quantum algorithms through quantum bits (qubits). These quantum circuits are designed to use the principles of quantum mechanics, such as superposition and entanglement, to perform specific computing tasks, thereby showing potential huge advantages in fields such as password cracking and drug discovery. However, existing quantum computing devices are still in the NI SQ (medium-scale noisy quantum computing) era. Quantum circuits are inevitably disturbed by the external environment, such as temperature fluctuations, electromagnetic noise, etc., which are collectively referred to as quantum noise. In addition, internal defects in quantum systems, such as inaccurate preparation of quantum bits and imperfect implementation of quantum gate operations, will also introduce errors. These noises and errors are collectively referred to as quantum errors, which will accumulate and propagate, thereby seriously disrupting the execution process of quantum circuits and affecting the final calculation results. Fidelity is a key indicator to measure the accuracy of quantum circuit execution. It quantifies the closeness between the actual output quantum state and the theoretically expected quantum state. A high-fidelity quantum circuit means that its output is highly consistent with theoretical predictions, while low fidelity implies the existence of significant errors. Therefore, fidelity is not only an important parameter for evaluating the performance of quantum computing devices, but also a prerequisite for the successful implementation of quantum algorithms.
[0003] Existing quantum circuit fidelity prediction methods are mainly divided into two types: (1) Formula calculation method: By simply multiplying the fidelity of each quantum logic gate and measurement gate in the quantum circuit, the fidelity of the entire quantum circuit is estimated. This method is easy to implement and has low computational cost. However, it ignores the complex interactions and cumulative errors that may exist between quantum gates, resulting in a large deviation between the predicted results and the actual fidelity. This deviation is particularly obvious when the scale of quantum circuits increases, limiting the application of formula methods in the prediction of the fidelity of complex quantum circuits. (2) Machine learning model prediction methods, such as using graph neural networks to predict the fidelity of circuits. Although these methods are accurate, they usually require a large amount of training data and computing resources. In addition, the model training and inference process is time-consuming and has high hardware requirements, which limits their application in real-time or resource-constrained environments.
[0004] In summary, existing quantum circuit fidelity prediction methods often face a trade-off between accuracy and computational cost. Although simple formula methods have low computational costs, the accuracy of the prediction results is insufficient and cannot meet the prediction needs of complex quantum circuits. Complex machine learning models can provide higher accuracy, but at the expense of computational efficiency and increased resource consumption. Therefore, there is an urgent need for a quantum circuit fidelity prediction method with high prediction accuracy and low computational cost.
[0005] It should be noted that this background technology is only used to introduce the relevant information of the present invention to help understand the technical solution of the present invention, but it does not mean that the relevant information is necessarily the prior art. If there is no evidence that the relevant information has been disclosed before the application date of the present invention, the relevant information shall not be regarded as the prior art. Summary of the invention
[0006] Therefore, the purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a prediction model construction method and system and prediction method for quantum circuit fidelity.
[0007] The objective of the present invention is achieved through the following technical solutions:
[0008] According to a first aspect of the present invention, the present invention proposes a method for constructing a prediction model for quantum circuit fidelity, wherein the quantum circuit fidelity prediction model is used to predict the fidelity of a quantum circuit on a specified quantum computing device, and the method comprises: step S1, obtaining configuration information of a specified quantum computing device, randomly generating multiple quantum circuits based on the configuration information of the specified quantum computing device and executing them on the specified quantum computing device, so as to obtain a parameter list and actual fidelity of each randomly generated quantum circuit on the specified quantum computing device, wherein each quantum circuit comprises multiple quantum bits and / or multiple quantum bit pairs; step S2, counting the number of single-bit gates applied to each quantum bit of each randomly generated quantum circuit and the number of two-bit gates applied to each quantum bit pair and using this as the encoding quantity The initial feature vector of the subcircuit is obtained, and the initial feature vector of each quantum circuit is concatenated with its parameter list on the specified quantum computing device to encode the final feature vector of the quantum circuit, and a label is configured for the final feature vector of each quantum circuit based on the actual fidelity of each quantum circuit running on the specified device, and the final feature vectors of all quantum circuits with labels constitute a training set; step S3, constructing an initial quantum circuit fidelity prediction model, using the constructed training set to take the final feature vector of the quantum circuit as input and the fidelity of the quantum circuit on the specified device as output to perform multiple iterative training on the initial quantum circuit fidelity prediction model to obtain the quantum circuit fidelity prediction model, wherein the initial quantum circuit fidelity prediction model is configured as a fully connected neural network with adjustable network layers and nodes.
[0009] Preferably, the configuration information includes all categories of single-bit quantum gates, two-bit quantum gates, quantum bits, and quantum bit pairs consisting of two topologically connected quantum bits supported by the specified quantum computing device.
[0010] Preferably, the parameter list includes the fidelity of each single-bit quantum gate applied to each quantum bit of the quantum circuit on a specified quantum computing device, the fidelity of each two-bit quantum gate applied to each quantum bit pair, the read fidelity of each quantum bit, and the longitudinal relaxation time and transverse relaxation time of each quantum bit.
[0011] Preferably, the reading fidelity of each quantum bit is the average of the fidelity of reading 0 and the fidelity of reading 1 of the quantum circuit to which the quantum bit belongs on the designated quantum computing device.
[0012] Preferably, the loss function of the fully connected neural network is configured as:
[0013]
[0014] Among them, MSE represents the mean square loss value, n represents the number of samples in the training set, and x i represents the prediction fidelity of the ith quantum circuit on the specified quantum computing device, y i represents the actual fidelity of the ith quantum circuit on a specified quantum computing device.
[0015] According to a second aspect of the present invention, the present invention proposes a prediction model construction system for implementing any of the methods described in the first aspect of the present invention, which is used to construct a quantum circuit fidelity prediction model. The system includes: a parameter list construction module, which is used to randomly generate multiple quantum circuits based on the configuration parameters of a specified quantum computing device and run them on the specified quantum circuit to obtain a parameter list and actual fidelity of each quantum circuit on the specified quantum computing device; a feature vector encoding module, which is used to obtain the initial feature vector of each randomly generated quantum circuit and splice it with the parameters of the quantum circuit on the specified quantum computing device to encode the final feature vector, and configure a label for the final feature vector of each quantum circuit based on the actual fidelity of each quantum circuit running on the specified device, and form a training set with the final feature vectors of all quantum circuits configured with labels; a fidelity prediction model construction module, which is used to perform multiple iterative training on the initial quantum circuit fidelity prediction model based on the constructed training set with the final feature vector of the quantum circuit as input and the fidelity of the quantum circuit on the specified device as output to obtain the quantum circuit fidelity prediction model.
[0016] According to a third aspect of the present invention, the present invention proposes a quantum circuit fidelity prediction method for predicting the fidelity of a target quantum circuit in a specified quantum computing device, the method comprising: step T1, obtaining configuration information of the specified quantum computing device; step T2, obtaining a parameter list of the target quantum circuit executed in the specified quantum computing device based on the configuration information; step T3, obtaining an initial feature vector of the target quantum circuit and concatenating it with the parameter list of the target quantum circuit executed in the specified quantum computing device to construct a final feature vector of the target quantum circuit; step T4, using a quantum circuit fidelity prediction model constructed by any method as described in the first aspect of the present invention to process the final feature vector of the target quantum circuit constructed in step T3 to obtain the predicted fidelity of the target quantum circuit.
[0017] Preferably, in step T2, it is determined whether the constructed quantum circuit fidelity prediction model can predict the target quantum circuit, and a parameter list of the target quantum circuit that can be predicted is obtained, wherein the determination is made in the following manner: determining whether the specified quantum computing device configuration information contains all types of single-bit quantum gates, two-bit quantum gates, and quantum bit pairs in the target quantum circuit; if so, the quantum circuit fidelity prediction model can predict the fidelity of the target quantum circuit executed on the specified quantum computing device; otherwise, the fidelity of the target quantum circuit executed on the specified quantum computing device cannot be predicted.
[0018] According to a fourth aspect of the present invention, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program can be executed by a processor to implement the steps of the method described in any one of the first aspect or the third aspect of the present invention.
[0019] According to the fifth aspect of the present invention, the present invention proposes an electronic device, comprising: one or more processors; and a memory, wherein the memory is used to store executable instructions; the one or more processors are configured to implement the steps of the method described in any one of the first aspect or the third aspect of the present invention by executing the executable instructions.
[0020] Compared with the prior art, the advantages of the present invention are:
[0021] The present invention adopts a fully connected neural network to predict the fidelity of a quantum circuit on a specified quantum computing device. Compared with the neural network adopted in the existing quantum circuit prediction model, the neural network has the characteristics of simple calculation and low cost. Secondly, the present invention constructs the feature vector of the quantum circuit based on the application relationship between the quantum gate and the quantum bit in the quantum circuit, the fidelity of the quantum gate, the reading fidelity of the quantum bit and the decoherence time splicing. The feature encoding method takes into account the information of the quantum circuit and the specific parameters of the quantum computing device at the same time, and can obtain better prediction effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The embodiments of the present invention are further described below with reference to the accompanying drawings, in which:
[0023] Figure 1 A flowchart of a method for constructing a prediction model for quantum circuit fidelity according to an embodiment of the present invention;
[0024] Figure 2 A flow chart for constructing a feature vector according to an embodiment of the present invention;
[0025] Figure 3 A structural diagram of an initial quantum circuit fidelity prediction model according to an embodiment of the present invention;
[0026] Figure 4 A diagram of a device structure for constructing a quantum circuit fidelity prediction model according to an embodiment of the present invention;
[0027] Figure 5 is a flow chart of a quantum circuit fidelity prediction method according to an embodiment of the present invention;
[0028] Figure 6 is the relationship between the predicted fidelity and the true fidelity of different data sets according to an embodiment of the present invention;
[0029] Figure 7 ] are mean square errors and determination coefficients of different data sets according to embodiments of the present invention. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail by specific embodiments below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0031] As mentioned in the background technology section, existing quantum circuit fidelity prediction methods often face a trade-off between accuracy and computational cost. Although the simple formula method has a low computational cost, the accuracy of the prediction results is insufficient and cannot meet the prediction requirements of complex quantum circuits. Although complex machine learning models can provide higher accuracy, they sacrifice computational efficiency and increase resource consumption. Therefore, there is an urgent need for a quantum circuit fidelity prediction method with high prediction accuracy and low computational cost.
[0032] In order to solve the above problems, the present invention proposes a new quantum circuit fidelity prediction model construction scheme. The scheme adopts a fully connected neural network to predict the fidelity of the quantum circuit on a specified quantum computing device. Compared with the neural network adopted in the existing quantum circuit prediction model, the neural network has the characteristics of simple calculation and low cost. Secondly, the present invention constructs a feature vector of the quantum circuit based on the application relationship between the quantum gate and the quantum bit in the quantum circuit, the fidelity of the quantum gate, the reading fidelity of the quantum bit and the decoherence time splicing. The feature encoding method takes into account the information of the quantum circuit and the specific parameters of the quantum computing device at the same time, which can effectively improve the accuracy of the fidelity prediction.
[0033] The present invention is described in detail below with reference to the accompanying drawings and embodiments.
[0034] In summary, the present invention proposes a method for constructing a prediction model of quantum circuit fidelity, which is used to predict the fidelity of a quantum circuit on a specified quantum computing device, such as Figure 1 As shown, the method comprises step S1, obtaining configuration information of a specified quantum computing device, randomly generating multiple quantum circuits based on the configuration information of the specified quantum computing device and executing them on the specified quantum computing device, so as to obtain a parameter list and actual fidelity of each randomly generated quantum circuit on the specified quantum computing device, wherein each quantum circuit comprises multiple quantum bits and / or multiple quantum bit pairs; step S2, counting the number of single-bit gates applied to each quantum bit of each randomly generated quantum circuit and the number of two-bit gates applied to each quantum bit pair and encoding the initial feature vector of the quantum circuit by counting the number of single-bit gates applied to each quantum bit of each randomly generated quantum circuit and encoding the initial feature vector of the quantum circuit by counting the number of two-bit gates applied to each quantum bit pair ... The parameter lists on the computing devices are spliced to encode the final feature vector of the quantum circuit, and labels are configured for the final feature vectors of each quantum circuit based on the actual fidelity of each quantum circuit running on the designated device, and the final feature vectors of all labeled quantum circuits constitute a training set; step S3, constructing an initial quantum circuit fidelity prediction model, using the constructed training set to take the final feature vector of the quantum circuit as input and the fidelity of the quantum circuit on the designated device as output to perform multiple iterative training on the initial quantum circuit fidelity prediction model to obtain the quantum circuit fidelity prediction model, wherein the initial quantum circuit fidelity prediction model is configured as a fully connected neural network with adjustable network layers and nodes.
[0035] In order to better understand the present invention, each step is described in detail below in conjunction with specific embodiments.
[0036] According to one embodiment of the present invention, in step S1, based on the configuration information of a specified quantum computing device M, a plurality of quantum circuits executable on the quantum computing device are randomly generated, wherein the configuration information of the quantum computing device includes all categories of single-bit quantum gates, two-bit quantum gates, quantum bits, and quantum bit pairs consisting of two topologically connected quantum bits supported by the quantum computing device, and the randomly generated quantum circuits are quantum algorithms represented by single-bit quantum gates, two-bit quantum gates, quantum bits, and quantum bit pairs in the quantum computing device.
[0037] According to one embodiment of the present invention, in step S1, the randomly generated quantum circuit is executed on a designated quantum computing device M, and the parameters of each quantum circuit executed on the quantum computing device are obtained and the sample data of the quantum circuit is constructed based on the parameters, wherein the sample data of the i-th randomly generated quantum circuit is expressed as (C i ,L i ,f i ), C i represents the ith quantum circuit, L i represents the parameter list of the i-th quantum circuit executed on the quantum computing device M, f i represents the actual fidelity of the execution of i quantum circuits on the quantum computing device M, where the parameter list L i It includes the fidelity of each single-bit quantum gate on each quantum bit, the fidelity of each two-bit quantum gate on each quantum bit pair, and the read fidelity of each bit, the longitudinal relaxation time T1, and the transverse relaxation time T2. The read fidelity of each quantum bit is the average of the fidelity of reading 0 and the fidelity of reading 1.
[0038] According to one embodiment of the present invention, in step S2, the process of obtaining the characteristics of each quantum circuit and concatenating it with its parameter list on a specified quantum computing device to encode the final characteristic vector of the quantum circuit is as follows: Figure 2 As shown, the sample data obtained are traversed one by one, and a feature vector of a quantum circuit is constructed in each round of traversal. The operations performed in each round of traversal include: obtaining all quantum bits q in the quantum device M in the quantum circuit C i The number of single-bit quantum gates U used in the process and the number of single-bit quantum gates N used on each quantum bit U,q ; Get all the quantum bit pairs (q1, q2) in quantum device M in quantum circuit C i The number of two-bit quantum gates U applied in the qubit pair and the number of two-bit quantum gates applied on each qubit pair All N U,q and Arranged into a vector V C , then V Cand L i Concatenate to get the feature vector V i , where V C The length of is the number of qubits plus the number of qubit pairs.
[0039] According to one embodiment of the present invention, in step S2, the label configuration of each feature vector is (1-f i ), where f i is the fidelity of the ith quantum circuit on the specified quantum computing device. The present invention converts the fidelity into (1-f i ) and using it as the label of the feature vector is beneficial to improving the convergence speed of model training and prediction accuracy.
[0040] According to one embodiment of the present invention, in step S3, the initial quantum circuit fidelity prediction model is iteratively trained multiple times using the constructed training set with the final feature vector of the quantum circuit as input and the fidelity of the quantum circuit on the specified device as output to obtain the quantum circuit fidelity prediction model, wherein the structure of the initial quantum circuit fidelity prediction model is as follows: Figure 3 As shown, the initial quantum circuit fidelity prediction model is configured as a fully connected neural network, which includes d fully connected layers, each layer includes h nodes, the activation function in each layer is ReLU, d and h are adjustable parameters, and the initial quantum circuit fidelity prediction model also includes a Tanh output node for normalizing the output to between -1 and 1, and the Tanh output node is configured as:
[0041]
[0042] Where x represents the data input to the Tanh output node, and y represents the output of the quantum circuit fidelity prediction model.
[0043] According to one embodiment of the present invention, the loss function of the initial quantum circuit fidelity prediction model is configured as:
[0044]
[0045] Among them, MSE represents the mean square loss value, n represents the number of samples in the training set, and x i represents the prediction fidelity of the ith quantum circuit on the specified quantum computing device, y i represents the actual fidelity of the ith quantum circuit on a specified quantum computing device.
[0046] According to one embodiment of the present invention, a construction device for implementing the above-mentioned quantum circuit fidelity prediction model construction method is proposed. The structure of the device is as follows: Figure 4As shown, the device includes three modules: parameter list construction module, feature vector encoding module, and fidelity prediction model construction module. The functions of each module are as follows:
[0047] 1) A parameter list building module, which is used to randomly generate multiple quantum circuits based on the configuration parameters of a specified quantum device and run them on the specified quantum circuits to obtain a parameter list and actual fidelity of each quantum circuit on the specified quantum computing device;
[0048] 2) A feature vector encoding module, which is used to obtain the initial feature vector of each randomly generated quantum circuit and concatenate it with the parameters of the quantum circuit on the specified quantum computing device to encode the final feature vector, and configure a label for the final feature vector of each quantum circuit based on the actual fidelity of each quantum circuit running on the specified device, and form the final feature vectors of all quantum circuits with labels into a training set;
[0049] 3) A fidelity prediction model construction module is used to perform multiple iterative training on the initial quantum circuit fidelity prediction model based on the constructed training set with the final feature vector of the quantum circuit as input and the fidelity of the quantum circuit on the specified device as output to obtain the quantum circuit fidelity prediction model.
[0050] According to one embodiment of the present invention, a fidelity prediction method based on the fidelity prediction model constructed by the aforementioned method is proposed, and the method includes: step T1, obtaining configuration information of a specified quantum computing device; step T2, obtaining a parameter list of a target quantum circuit executed on the specified quantum computing device based on the configuration information; step T3, obtaining an initial feature vector of the target quantum circuit and concatenating it with the parameter list of the target quantum circuit executed on the specified quantum computing device to construct a final feature vector of the target quantum circuit; step T4, using the quantum circuit fidelity prediction model constructed by the aforementioned quantum circuit fidelity prediction model construction method to process the final feature vector of the target quantum circuit constructed in step T3 to obtain the predicted fidelity of the target quantum circuit.
[0051] According to an embodiment of the present invention, in step T2, it is necessary to determine whether the constructed quantum circuit fidelity prediction model can predict the target quantum circuit, and obtain a parameter list of the target quantum circuit that can be predicted, wherein the determination is made in the following manner: determining whether the specified quantum computing device configuration information contains all types of single-bit quantum gates, two-bit quantum gates, and quantum bit pairs in the target quantum circuit, if so, the quantum circuit fidelity prediction model can predict the fidelity of the target quantum circuit executed on the specified quantum computing device, otherwise, it cannot predict the fidelity of the target quantum circuit executed on the specified quantum computing device. Wherein, the following method is used to determine whether the specified quantum computing device configuration information contains the quantum bit pair in the target quantum circuit, and to check whether the two quantum bits in the quantum bit pair in the target quantum circuit are topologically connected on the specified quantum computing device, and if so, it is deemed that the quantum bit pair consisting of the two quantum bits is contained on the specified quantum computing device.
[0052] In order to more clearly describe the steps of the quantum circuit prediction method, the following will combine Figure 5 A flowchart of a quantum circuit fidelity prediction method is described in detail, the flowchart comprising:
[0053] 1) Given a quantum computing device, a quantum circuit fidelity prediction model is constructed using the quantum circuit fidelity prediction model construction method for predicting the execution fidelity of a quantum circuit on the quantum computing device.
[0054] 2) Obtain the target quantum circuit and its parameter list L for execution on the specified quantum computing device.
[0055] 3) Whether the quantum computing system supports all quantum gates used in the quantum circuit. If there are unsupported quantum gates, the fidelity of the target quantum circuit on the specified device cannot be achieved.
[0056] 4) Whether the two quantum bits in each quantum bit pair in the quantum circuit have a topological connection structure on the quantum computing device M. If not, the fidelity of the target quantum circuit on the specified device cannot be determined.
[0057] 5) Obtain the number of single-bit quantum gates U applied to all quantum bits q in quantum device M in quantum circuit C, and the number of single-bit quantum gates N applied to each quantum bit U,q .
[0058] 6) Obtain the number of two-bit quantum gates U applied by all quantum bit pairs (q1, q2) in quantum device M in quantum circuit C, and the number of two-bit quantum gates applied on each quantum bit pair
[0059]
[0060] 7) Set all N U,q and Arranged into a vector V C , then V C and L to obtain the final feature vector V, where V C The length of is the number of qubits plus the number of qubit pairs.
[0061] 8) The final feature vector V of the target quantum circuit is input into the quantum circuit prediction model to obtain the output y of the quantum circuit prediction model.
[0062] 9) The predicted fidelity of the target quantum circuit on the specified quantum device is 1-max(0,y).
[0063] In order to more clearly illustrate the beneficial effects of the present invention, the inventor designed a test experiment to verify the accuracy of the quantum circuit fidelity prediction proposed by the present invention. The test experiment configuration is as follows: Experimental environment: Ubuntu22.04 operating system, Python programming language, PyTorch framework; Initial quantum circuit prediction model parameters: 4 fully connected layers, each layer contains 200 neurons, using ReLU activation function; Dataset: 6 groups of IBM quantum computing devices. The corresponding quantum computing devices are: IBM simulator, IBM Geneva, IBM Hanoi, IBM Montreal, IBM Mumbai, IBM Toronto. Each group of devices contains 1000 samples, of which 70% are used as training data and 30% are used as test data; Optimization algorithm: Adam optimizer, learning rate is 0.01; Loss function: mean square error loss function (MSE); Number of training iterations: 20,000 times.
[0064] The experimental results are as follows Figure 6 , 7 As shown, analysis of the results in the figure shows that the quantum circuit fidelity and measurement method proposed in the present invention can accurately predict the fidelity of the quantum circuit, and the average MSE on six data sets is only 0.48%; at the same time, the prediction model constructed by the present invention has a simple network structure (including only 4 hidden layers) and has a low computational cost.
[0065] It should be noted that although the above describes the various steps in a specific order, it does not mean that the various steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently or even in a different order as long as the required functions can be achieved.
[0066] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.
[0067] Computer readable storage medium can be a tangible device that holds and stores instructions used by an instruction execution device. Computer readable storage medium can include, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a protruding structure in a groove on which instructions are stored, and any suitable combination thereof.
[0068] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for constructing a prediction model for quantum circuit fidelity, wherein the quantum circuit fidelity prediction model is used to predict the fidelity of a quantum circuit on a specified quantum computing device, characterized in that: The method comprises: Step S1, obtaining configuration information of a specified quantum computing device, randomly generating multiple quantum circuits based on the configuration information of the specified quantum computing device and executing them on the specified quantum computing device, so as to obtain a parameter list and actual fidelity of each randomly generated quantum circuit on the specified quantum computing device, wherein each quantum circuit includes multiple quantum bits and / or multiple quantum bit pairs; Step S2, counting the number of single-bit gates applied to each quantum bit of each randomly generated quantum circuit and the number of two-bit gates applied to each quantum bit pair, and using this to encode the initial feature vector of the quantum circuit, and concatenating the initial feature vector of each quantum circuit with its parameter list on a designated quantum computing device to encode the final feature vector of the quantum circuit, and configuring a label for the final feature vector of each quantum circuit based on the actual fidelity of each quantum circuit running on the designated device, and the final feature vectors of all quantum circuits configured with labels constitute a training set; Step S3, constructing an initial quantum circuit fidelity prediction model, using the constructed training set to take the final feature vector of the quantum circuit as input and the fidelity of the quantum circuit on a specified device as output to perform multiple iterative training on the initial quantum circuit fidelity prediction model to obtain a quantum circuit fidelity prediction model, wherein the initial quantum circuit fidelity prediction model is configured as a fully connected neural network with an adjustable number of network layers and nodes.
2. The method according to claim 1, characterized in that: The configuration information includes all types of single-bit quantum gates, two-bit quantum gates, quantum bits, and quantum bit pairs consisting of two topologically connected quantum bits supported by the specified quantum computing device.
3. The method according to claim 1, characterized in that: The parameter list includes the fidelity of each single-bit quantum gate applied to each quantum bit of the quantum circuit on a specified quantum computing device, the fidelity of each two-bit quantum gate applied to each quantum bit pair, the read fidelity of each quantum bit, and the longitudinal relaxation time and transverse relaxation time of each quantum bit.
4. The method according to claim 3, characterized in that The reading fidelity of each quantum bit is the average of the fidelity of reading 0 and the fidelity of reading 1 of the quantum circuit to which the quantum bit belongs on the specified quantum computing device.
5. The method according to claim 1, characterized in that: The loss function of the fully connected neural network is configured as: Among them, MSE represents the mean square loss value, n represents the number of samples in the training set, and x i represents the prediction fidelity of the ith quantum circuit on the specified quantum computing device, y i represents the actual fidelity of the ith quantum circuit on a specified quantum computing device.
6. A prediction model construction system for implementing the method according to any one of claims 1 to 5, for constructing a quantum circuit fidelity prediction model, characterized in that: The system comprises: A parameter list building module, used to randomly generate multiple quantum circuits based on the configuration parameters of a specified quantum computing device and run them on the specified quantum circuits to obtain a parameter list and actual fidelity of each quantum circuit on the specified quantum computing device; A feature vector encoding module is used to obtain the initial feature vector of each randomly generated quantum circuit and concatenate it with the parameters of the quantum circuit on the specified quantum computing device to encode the final feature vector, and configure a label for the final feature vector of each quantum circuit based on the actual fidelity of each quantum circuit running on the specified device, and form the final feature vectors of all quantum circuits with labels into a training set; The fidelity prediction model building module is used to perform multiple iterative training on the initial quantum circuit fidelity prediction model based on the constructed training set, with the final feature vector of the quantum circuit as input and the fidelity of the quantum circuit on the specified device as output, so as to obtain the quantum circuit fidelity prediction model.
7. A quantum circuit fidelity prediction method for predicting the fidelity of a target quantum circuit in a specified quantum computing device, characterized in that: The method comprises: Step T1, obtaining configuration information of a specified quantum computing device; Step T2, obtaining a parameter list for executing the target quantum circuit on a specified quantum computing device based on the configuration information; Step T3, obtaining an initial feature vector of the target quantum circuit and concatenating it with a parameter list of the target quantum circuit executed on a specified quantum computing device to construct a final feature vector of the target quantum circuit; Step T4: using the quantum circuit fidelity prediction model constructed by the method according to any one of claims 1 to 5 to process the final feature vector of the target quantum circuit constructed in step T3 to obtain the predicted fidelity of the target quantum circuit.
8. The method according to claim 7, characterized in that In step T2, it is determined whether the constructed quantum circuit fidelity prediction model can predict the target quantum circuit, and a parameter list of the target quantum circuit that can be predicted is obtained, wherein the determination is made in the following manner: It is determined whether the specified quantum computing device configuration information contains all types of single-bit quantum gates, two-bit quantum gates, and quantum bit pairs in the target quantum circuit. If so, the quantum circuit fidelity prediction model can predict the fidelity of the target quantum circuit executed on the specified quantum computing device. Otherwise, the fidelity of the target quantum circuit executed on the specified quantum computing device cannot be predicted.
9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program can be executed by a processor to implement the steps of the method according to any one of claims 1 to 5, 7 to 8.
10. An electronic device, characterized in that: include: one or more processors; as well as A memory, wherein the memory is used to store executable instructions; The one or more processors are configured to implement the steps of the method of any one of claims 1 to 5, 7 to 8 by executing the executable instructions.
Citation Information
Patent Citations
Estimating the fidelity of quantum logic gates and quantum circuits
CN114026575A
Multi-classification method and device based on variable component calculation
CN116756663A
Quantum circuit fidelity analysis method and device based on context and topological feature extraction
CN117350393A
Quantum neural network training method and device for resisting quantum noise
CN118036699A
Flexible initializer for arbitrarily-sized parametrized quantum circuits
WO2022192525A1
