Qubit calibration method and apparatus, electronic device, computer program product, and computer-readable storage medium

By constructing a universal functor structure for qubit calibration functions, the high modification cost caused by inconsistent interfaces in existing technologies is solved, achieving low-cost automated qubit calibration while maintaining the degree of freedom and consistency of the calibration functions.

WO2025256119A1PCT designated stage Publication Date: 2025-12-18TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/144467
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-06-13
Filing Date
2024-12-31
Publication Date
2025-12-18

AI Technical Summary

Technical Problem

In existing technologies, qubit calibration functions do not adhere to a consistent programming abstraction interface definition, resulting in high modification costs and difficulty in achieving automated calibration.

Method used

By obtaining the general functor structure of the qubit calibration function, constructing the general function prototype structure, and calling the generated second calibration function, qubit calibration is achieved without directly modifying the original calibration function.

Benefits of technology

Automated qubit calibration is achieved with low modification costs, while maintaining the freedom and consistency of the original calibration function, thus avoiding resource waste caused by inconsistent interfaces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024144467_18122025_PF_FP_ABST
    Figure CN2024144467_18122025_PF_FP_ABST
Patent Text Reader

Abstract

The present application discloses a qubit calibration method and apparatus, and a storage medium. The method comprises: for a first calibration function in a qubit calibration graph, acquiring a general function substructure corresponding to the first calibration function; on the basis of the general function substructure, constructing a general function prototype structure corresponding to the first calibration function, the general function prototype structure having a function pointer, and the function pointer pointing to the first calibration function; on the basis of the general function prototype structure, constructing a second calibration function corresponding to the first calibration function; calling the second calibration function, so as to call the first calibration function by means of the function pointer; and running the first calibration function, so as to execute qubit calibration on the basis of the qubit calibration graph.
Need to check novelty before this filing date? Find Prior Art

Description

Quantum bit calibration method and device, electronic equipment, computer program product and computer readable storage medium

[0001] Cross-reference to related applications

[0002] The present application is based on and claims priority to Chinese Patent Application No. 202410764930.8, filed on June 13, 2024, the entire contents of which are incorporated herein by reference. TECHNICAL FIELD

[0003] The present application relates to the technical field of quantum computing, and in particular to a quantum bit calibration method and device, electronic equipment, computer program product and computer readable storage medium. BACKGROUND

[0004] Quantum bit calibration is a process to ensure that quantum bits can correctly represent quantum information and maintain their coherence and entanglement during quantum computing. For quantum bit calibration, the related technology proposes an automated data and algorithm implementation, which predefines explicit programming abstraction interfaces, and then various calibration functions for quantum bit calibration are written based on these interfaces, so that quantum bit calibration can be automatically implemented through these calibration functions.

[0005] This method requires that the calibration functions for quantum bit calibration all comply with consistent programming abstraction interface definitions, that is, all calibration functions for quantum bit calibration must be written based on these programming abstraction interfaces to implement corresponding calibration functions. However, there are still a large number of manually written calibration functions that do not comply with consistent programming abstraction interface definitions. If these manually written calibration functions are to be used to implement quantum bit calibration, the original manually written calibration functions need to be completely reworked and reengineered, resulting in a large amount of reengineering costs and thus making quantum bit calibration difficult and costly. SUMMARY

[0006] The embodiments of the present application provide a quantum bit calibration method and device, electronic equipment, computer program product and computer readable storage medium, which can implement automated quantum bit calibration using original manually written calibration functions at a lower reengineering cost, thereby improving the efficiency and accuracy of quantum bit calibration.

[0007] The embodiments of the present application provide a quantum bit calibration method, comprising the following steps:

[0008] For a first calibration function in a quantum bit calibration graph, a general functor structure corresponding to the first calibration function is obtained;

[0009] According to the general functor structure, a general function prototype structure corresponding to the first calibration function is constructed, wherein the general function prototype structure has a function pointer pointing to the first calibration function;

[0010] According to the general function prototype structure, a second calibration function corresponding to the first calibration function is constructed, wherein the second calibration function has the function pointer;

[0011] The second calibration function is called to call the first calibration function through the function pointer;

[0012] A function body of the first calibration function is run to perform quantum bit calibration based on the quantum bit calibration graph.

[0013] Embodiments of the present application also provide a quantum bit calibration device, comprising:

[0014] A structure obtaining unit is configured to obtain, for a first calibration function in a quantum bit calibration graph, a general functor structure corresponding to the first calibration function;

[0015] A structure constructing unit is configured to construct, according to the general functor structure, a general function prototype structure corresponding to the first calibration function, wherein the general function prototype structure has a function pointer pointing to the first calibration function;

[0016] A function constructing unit is configured to construct, according to the general function prototype structure, a second calibration function corresponding to the first calibration function, wherein the second calibration function has the function pointer;

[0017] A function calling unit is configured to call the second calibration function to call the first calibration function through the function pointer, and run a function body of the first calibration function to perform quantum bit calibration based on the quantum bit calibration graph.

[0018] Embodiments of the present application also provide an electronic device, comprising:

[0019] A memory is configured to store computer executable instructions;

[0020] A processor is configured to execute the computer executable instructions stored in the memory to implement the quantum bit calibration method provided by embodiments of the present application.

[0021] Embodiments of the present application provide a computer readable storage medium storing computer executable instructions for being executed by a processor to implement the quantum bit calibration method provided by embodiments of the present application.

[0022] The embodiment of the present application provides a computer program product, including a computer program or computer executable instructions, which, when executed by a processor, implements the quantum bit calibration method provided by the embodiment of the present application.

[0023] In the technical solution provided by the embodiments of the present application, for the first calibration function in the quantum bit calibration graph, a corresponding general functor structure is first acquired, then a corresponding general function prototype structure is constructed according to the general functor structure, and then a corresponding second calibration function is constructed according to the general function prototype structure, where the second calibration function has a function pointer pointing to the first calibration function. Then the second calibration function is called, so that the second calibration function calls the first calibration function through the function pointer to run the function body of the first calibration function, thereby completing the quantum bit calibration based on the quantum bit calibration graph. In this process, the first calibration function is not directly called, but a corresponding general functor structure is first constructed according to the first calibration function, then a corresponding general function prototype structure is constructed according to the general functor structure, and then a second calibration function constructed according to the general function prototype structure is called to realize quantum bit calibration. In this way, even if the first calibration function is a manually written calibration function that does not comply with the consistent programming abstract interface definition, its original function structure can be converted into a unified general function prototype structure by using the corresponding general functor structure, so that different first calibration functions can realize their original function functions based on the unified general function prototype structure. In this way, the interfaces of different first calibration functions can be aligned to realize automatic quantum bit calibration without modifying the first calibration function. Since the first calibration function does not need to be modified in this process, the technical solution provided by the embodiments of the present application can realize automatic quantum bit calibration using the original manually written calibration function at a lower modification cost. In addition, since the process of manually writing calibration functions no longer needs to comply with the standardized programming abstract interface definition, the consistency of automatic calibration can be realized while fully preserving the freedom of manually writing calibration functions. Quantum calibration can actually be realized by calling the first calibration function, but since it cannot be guaranteed that the first calibration function complies with the general programming abstract interface definition, the present application does not directly call the first calibration function, but regenerates a second calibration function using the corresponding general functor structure. Here, the second calibration function can be called to realize the function of the first calibration function, and since it is generated based on the general functor structure, it has generality in interface calling. Since the first calibration function itself does not need to be modified in this process, the processing resources of the hardware device originally used for modifying the code can be saved, and if the first calibration function is directly called, the return parameters of a first calibration function may not be used as calling parameters for a second calibration function, thereby failing to complete quantum calibration, which also wastes the processing resources of the hardware device for function calling. BRIEF DESCRIPTION OF DRAWINGS

[0024] The accompanying drawings are used to provide a further understanding of the technical solutions of the present application, and constitute a part of the specification, and are used to explain the technical solutions of the present application together with the embodiments of the present application, and do not constitute a limitation on the technical solutions of the present application.

[0025] Fig. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application;

[0026] Fig. 2 is a flowchart of a quantum bit calibration method provided by an embodiment of the present application;

[0027] Figs. 3A and 3B are schematic diagrams of the overall architecture of a quantum bit calibration method provided by an embodiment of the present application;

[0028] Fig. 4 is a schematic diagram of a quantum bit calibration graph provided by an embodiment of the present application;

[0029] Fig. 5 is a schematic diagram of an automated calibration function library provided by an embodiment of the present application;

[0030] Fig. 6 is a schematic diagram of the construction of an automated calibration function library based on an initial function library provided by an embodiment of the present application;

[0031] Fig. 7 is a schematic diagram of the establishment of a mapping relationship formula provided by an embodiment of the present application;

[0032] Fig. 8 is another schematic diagram of the construction of an automated calibration function library based on an initial function library provided by an embodiment of the present application;

[0033] Fig. 9 is a schematic diagram of a second calibration function provided by an embodiment of the present application;

[0034] Fig. 10 is a detailed diagram of a quantum bit calibration method provided by an embodiment of the present application;

[0035] Fig. 11 is a schematic diagram of the system architecture of a quantum bit calibration method provided by an embodiment of the present application;

[0036] Fig. 12 is a schematic diagram of a quantum bit calibration apparatus provided by an embodiment of the present application;

[0037] Fig. 13 is a schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0038] The present application will be further described below in conjunction with the accompanying drawings and specific embodiments. The described embodiments should not be regarded as limiting the present application, and all other embodiments obtained by those of ordinary skill in the art without making creative efforts fall within the scope of protection of the present application.

[0039] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same or different from one another and can be combined with one another without contradiction.

[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description herein is for describing the embodiments of the application only and is not intended to be limiting of the application.

[0041] Before the embodiments of the application are further described in detail, the terms and phrases involved in the embodiments of the application are explained, and the terms and phrases involved in the embodiments of the application are applicable to the following explanations.

[0042] Superconducting Quantum Chip: Central processing unit of superconducting quantum computer. Quantum computer is a machine that uses quantum mechanics to perform calculations. Based on the superposition principle and quantum entanglement of quantum mechanics, quantum computer has strong parallel processing capability and can solve some problems that are difficult for classical computers to calculate. The zero resistance characteristic of superconducting quantum bit and the manufacturing process close to integrated circuit make the quantum computing system constructed by superconducting quantum bit one of the most promising systems to realize practical quantum computing.

[0043] Qubit Calibration: Qubit is currently a storage and computing integrated structure, and its data storage and operation control need to be based on accurate control of quantum state. The standardization of this control process is the calibration process of qubit. After calibration, the qubit can maintain accurate control within a certain range of accuracy for a period of time. Unlike the gate logic of digital computers, qubit is essentially an analog computing control.

[0044] Qubit Calibration Graph: In order to meet the needs of formal computation, qubit will go through a series of calibration procedures based on physical models. It usually goes through a series of physical parameter calibration and setting links such as searching for the working frequency of quantum device, calibrating the quantum state of isolated qubit and quantum gate, and cooperative calibration of multi-bit gate. It can be abstracted as a directed graph structure. The calibration process may appear repeated calibration before and after the calibration link due to its analog characteristics. In the currently published calibration scheme, this phenomenon is decomposed into multiple isolated nodes for different calibration targets to avoid ring structure in the graph, so that the definition of the calibration graph may be more accurate.

[0045] Calibration automation: The calibration process of a qubit involves multiple sets of dependent calibration processes of multiple quantum devices that can be defined as a qubit calibration graph, and each actual node in these processes is involved.

[0046] Application Binary Interface (ABI): A set of rules that specifies how a binary executable should exchange information with certain services (such as those provided by the kernel or libraries) at runtime. ABI specifies in particular which registers and stack addresses are used to exchange information and the meaning of the exchanged values. Once compiled for a given ABI, a binary executable should run on any system with the same ABI. ABI contains programming conventions that an application must adhere to when running on this system, including a series of system calls and methods for using them, as well as specifications for memory addresses that programs can use and the use of machine registers.

[0047] In the currently disclosed superconducting qubit calibration automation scheme, an abstract interface is generally used to constrain the diversity of calibration functions, and a polymorphic calling method is used in actual scheduling. In practice, the quantum calibration automation process is a process of converting a manually written calibration process into a fine structure of calibration functions connected to each other through input and output by a Directed Acyclic Graph (DAG) system. In this key link of the conversion, a general structure is needed to adapt to the diversity of calibration functions, so that it can form an automatic and consistent prototype definition, thereby organizing various open calibration functions. However, due to the openness and diversity of actual calibration functions, the calibration process from manual calibration to automation requires all original calibration functions to be completely rebuilt, resulting in a large amount of reconstruction cost.

[0048] Based on this, the embodiment of the application provides a quantum bit calibration method, a quantum bit calibration device, an electronic device, a computer readable storage medium and a computer program product. In the quantum bit calibration process, the first calibration function is not directly called, but a corresponding general function prototype structure body is constructed according to the general functor structure body corresponding to the first calibration function, and then a second calibration function constructed according to the general function prototype structure body is called to realize quantum bit calibration. In this way, even if the first calibration function is a manually written calibration function that does not comply with the consistent programming abstract interface definition, the corresponding general functor structure body can be used to convert its original function structure body into a unified general function prototype structure body, so that different first calibration functions can realize their original function functions based on the unified general function prototype structure body. In this way, the interfaces of different first calibration functions can be aligned to realize automatic quantum bit calibration without modifying the first calibration function. Since the first calibration function does not need to be modified in this process, the original manually written calibration function can be used to realize automatic quantum bit calibration at a lower modification cost. In addition, since the process of manually writing calibration functions no longer needs to comply with the standardized programming abstract interface definition, the consistency of automatic calibration can be realized while fully retaining the freedom of manually writing calibration functions.

[0049] Referring to FIG. 1, FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the application, which includes a terminal 101 and a server 102. The terminal 101 and the server 102 can be directly or indirectly connected through wired or wireless communication. The terminal 101 and the server 102 can be nodes in a block chain, and the embodiment is not limited in this regard.

[0050] In some embodiments, the terminal 101 can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart voice interaction device, a smart home appliance, a vehicle-mounted terminal, an aircraft, a VR (Virtual Reality) device, an AR (Augmented Reality) device, etc., but is not limited thereto. Optionally, the terminal 101 can obtain a first calibration function in a quantum bit calibration graph and send a calibration request to the server 102.

[0051] In some embodiments, the server 102 can be a standalone server, a server cluster composed of multiple servers, or a distributed system, and can also be a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms. In some embodiments, the server 102 mainly undertakes the computing work, and the terminal 101 undertakes the secondary computing work; or the server 102 undertakes the secondary computing work, and the terminal 101 undertakes the main computing work; or the server 102 and the terminal 101 adopt a distributed computing architecture for collaborative computing. Optionally, the server 102 can provide calibration services according to the received calibration request, that is, calibrate the quantum bits based on the first calibration function in the quantum bit calibration graph.

[0052] Referring to FIG. 1, in an application scenario, it is assumed that the terminal 101 is a computer, and the terminal 101 provides calibration services. In the process of calibrating quantum bits by the target object using the terminal 101, the terminal 101 first acquires a general functor structure corresponding to the first calibration function. The terminal 101 constructs a general function prototype structure corresponding to the first calibration function according to the general functor structure, wherein the general function prototype structure has a function pointer, and the function pointer points to the first calibration function. The terminal 101 constructs a second calibration function corresponding to the first calibration function according to the general function prototype structure, wherein the second calibration function has the function pointer. Finally, the terminal 101 calls the second calibration function to complete the quantum bit calibration based on the quantum bit calibration graph, wherein when the second calibration function is called, the second calibration function calls the first calibration function through the function pointer to run the function body of the first calibration function.

[0053] Referring to FIG. 1, the calibration service can be divided into an obtaining sub-service, a constructing sub-service, and a calling sub-service. In some embodiments, the obtaining sub-service and the calling sub-service can be provided by the terminal 101, and the constructing sub-service can be provided by the server 102. Specifically, in the process of providing the obtaining sub-service by the terminal 101, a general functor structure corresponding to a first calibration function in a quantum bit calibration graph is obtained for the first calibration function. The terminal 101 sends the general functor structure and a construction request to the server 102. In the process of providing the constructing sub-service by the server 102, a general function prototype structure corresponding to the first calibration function is constructed from the general functor structure according to the received construction request, where the general function prototype structure has a function pointer pointing to the first calibration function. The server 102 further constructs a second calibration function corresponding to the first calibration function from the general function prototype structure, and sends the second calibration function to the terminal 101, where the second calibration function has the function pointer. In the process of providing the calling sub-service by the terminal 101, the second calibration function is called to complete the quantum bit calibration based on the quantum bit calibration graph, where when the second calibration function is called, the second calibration function calls the first calibration function through the function pointer to execute a function body of the first calibration function.

[0054] In some embodiments, the calibration service including the obtaining sub-service, the constructing sub-service, and the calling sub-service can also be provided by the server 102. The process of providing the calibration service by the server 102 is similar to the process of providing the calibration service by the terminal 101 described above, and will not be described here.

[0055] FIG. 2 is a flowchart of a quantum bit calibration method provided by an embodiment of the present application, which is executed by a terminal or a server alone or jointly by a terminal and a server. In this embodiment, the method is taken as an example of being executed by a terminal.

[0056] Step 210: For a first calibration function in a quantum bit calibration graph, a general functor structure corresponding to the first calibration function is obtained.

[0057] As an example, the quantum bit calibration graph is a directed graph structure used to represent the relationships between various calibration functions and parameters in the quantum bit calibration process. In quantum computing, the calibration of quantum bits is to ensure that they can accurately perform quantum operations. In the structure of the calibration graph, each node represents a calibration function or parameter in the calibration process, and the edge represents the processing relationship between the calibration functions or the dependency between the parameters. Such a directed graph structure of the calibration graph not only helps to understand the calibration process, but also provides guidance for the design of the calibration algorithm, making the calibration process more efficient and reliable. Through such a calibration graph, researchers and engineers can more intuitively see the key steps and dependencies in the calibration process, so as to carry out targeted optimization and adjustment.

[0058] As an example, quantum bit calibration is a key step in quantum computing, aiming to reduce or eliminate errors between quantum bits.

[0059] Step 220: According to the universal functor structure, a universal function prototype structure corresponding to the first calibration function is constructed;

[0060] As an example, the function prototype structure is a data structure used to represent functions and their related attributes, and the universal function prototype structure refers to a function structure with member variables and universality. Constructing a universal function prototype structure corresponding to the first calibration function usually involves defining a class that encapsulates the parameters and methods of performing a specific quantum operation. First, the type of quantum operation corresponding to the calibration function needs to be determined. This can be a basic quantum gate or a more complex operation. Then define the class structure, and finally define a class that contains the parameters and necessary functions to perform the operation.

[0061] Step 230: According to the universal function prototype structure, a second calibration function corresponding to the first calibration function is constructed;

[0062] Step 240: The second calibration function is called to call the first calibration function through the function pointer.

[0063] Step 250: Run the function body of the first calibration function to perform quantum bit calibration based on the quantum bit calibration graph.

[0064] As an example, the second calibration function is called to complete the quantum bit calibration based on the quantum bit calibration graph. When the second calibration function is called, the second calibration function calls the first calibration function through the function pointer to run the function body of the first calibration function.

[0065] It should be noted that the quantum bit calibration method provided by the embodiments of the present application is a method for calibrating quantum bits based on a quantum bit calibration graph.

[0066] FIG. 3A-3B are overall architecture diagrams of a quantum bit calibration method according to embodiments of the present application.

[0067] The uppermost layer of FIG. 3A is a general functor structure in step 210. In step 210, the quantum bit calibration graph has been described above and will not be repeated here. The first calibration function is a program code, specifically a program code / code block corresponding to a function node in the quantum bit calibration graph that is waiting to be calibrated. Functor is a category theory concept introduced in functional programming to represent a special type of container object that can operate on the values it contains while maintaining its structure. In simple terms, a functor is an object that implements a specific protocol (such as providing a map method) that can apply a function to the internal values. Functor is a commonly used concept in quantum computing, which represents an abstract function that can perform operations on quantum bits. Each functor has a specific structure that contains the parameters and execution logic required for the operation. The functor structure refers to a general data structure used to represent a callable function object or function pointer that can accept any number and type of parameters and return a value. By defining a functor structure, any first calibration function can be wrapped into a callable object, making it easy to pass and manipulate functions in the program. The functor structure usually contains member variables and member functions for storing function objects or function pointers and performing function calls. By defining different member functions or operator overloads, different behaviors of the functor structure can be achieved, such as function object invocation, composition, mapping, etc. The functor structure can be used to implement functional programming operations such as mapping, filtering, folding, etc., improving code flexibility and reusability.

[0068] The general quantum bit calibration graph includes multiple first calibration functions (to be called calibration functions), and each first calibration function outputs a return parameter after executing a specific function based on a call parameter. There is usually a dependency relationship between multiple first calibration functions, such as the return parameter of the previous first calibration function being the call parameter of the next first calibration function. Since multiple first calibration functions may be defined by different developers or different development companies, there may be a case where the return parameter of the previous first calibration function cannot be used as the call parameter of the next first calibration function, resulting in the inability to complete the calibration of the quantum bit. In embodiments of the present application, instead of directly calling the first calibration function, the general functor structure corresponding to the first calibration function is first obtained, so as to regenerate the second calibration function (actually called calibration function) according to the general functor structure, thereby reducing the case where the return parameter of the previous first calibration function cannot be used as the call parameter of the next first calibration function in the calibration process.

[0069] Steps 220 and 230 correspond to the reflection in FIG. 3A, and the second calibration function can be obtained by performing steps 220 and 230. Referring to FIG. 3B, the general functor structure can be obtained from the automated calibration function library by an application binary interface (ABI) call engine. The ABI call engine is a software component for processing the ABI of a smart contract, which allows users to interact with the smart contract on the blockchain. The ABI call engine can be integrated in a blockchain client, a wallet application, a development tool, or any other environment that needs to interact with the smart contract. After obtaining the general functor structure, steps 220 and 230 are performed to obtain the second calibration function. Then the second calibration function is called to perform the corresponding function function to complete the calibration of the qubit.

[0070] It should be noted that the implementation of the automated calibration function in the related art needs to be based on a set of pre-defined programming abstract interfaces, and all calibration functions must implement functions based on these abstract interfaces to achieve interface consistency through the traditional polymorphic manner, so as to achieve scheduling harmony with the scheduling state machine. The embodiments of the present application solve the problem that a plurality of calibration functions can achieve ABI level interface consistency alignment through reflective functor definition in the background of not complying with consistent abstract interface definition, so that a large number of calibration functions written by different people in history can be added to the calibration automation system without modification, reducing a large amount of modification cost, enabling a smooth transition from manual calibration to automatic calibration, and at the same time, retaining the openness of the development of calibration functions in the manual calibration process.

[0071] In some embodiments, the qubit calibration graph includes a plurality of function nodes corresponding to calibration functions for performing the qubit calibration, and the naming of the function nodes in the qubit calibration graph is the same as the function name of the calibration function corresponding to the function node. Before step 210, the following technical solution can be performed: among the plurality of function nodes of the qubit calibration graph, a to-be-executed function node is determined; the calibration function corresponding to the to-be-executed function node is determined as a first calibration function; and step 210 can be implemented by the following technical solution: according to the naming of the function node corresponding to the first calibration function, a general functor structure corresponding to the first calibration function is obtained from a pre-stored automated calibration function library.

[0072] As an example, the function node is named with a function name of the calibration function in the quantum bit calibration graph, the function name of the first calibration function is obtained according to the function name corresponding to the function node to be executed, and the general functor structure corresponding to the first calibration function is obtained from the preset automatic calibration function library according to the function name of the first calibration function.

[0073] Specifically, the quantum bit calibration graph includes a plurality of function nodes. The function node represents a node for performing a specific operation (such as calibration, rotation, measurement, etc.). For example, the function node can represent a quantum gate operation, a quantum entanglement operation, a measurement operation, etc. The function node also refers to a basic unit for actually performing an operation, which is used to describe the relationship and action between quantum bits. In this embodiment, the function node corresponds to a calibration function used for quantum bit calibration, and the function node is named with a function name of the calibration function in the quantum bit calibration graph.

[0074] In an example, referring to FIG. 4, the quantum bit calibration graph includes five function nodes, namely function node 401, function node 402, function node 403, function node 404, and function node 405. The function node 401 corresponds to a calibration function J1 used for quantum bit calibration, and the function node 401 is named with a function name of the calibration function J1, such as FunctorJ1. The function node 402 corresponds to a calibration function J2 used for quantum bit calibration, and the function node 402 is named with a function name of the calibration function J2, such as FunctorJ2. The function node 403 corresponds to a calibration function J3 used for quantum bit calibration, and the function node 403 is named with a function name of the calibration function J3, such as FunctorJ3. The function node 404 corresponds to a calibration function J4 used for quantum bit calibration, and the function node 404 is named with a function name of the calibration function J4, such as FunctorJ4. The function node 405 corresponds to a calibration function J5 used for quantum bit calibration, and the function node 405 is named with a function name of the calibration function J5, such as FunctorJ5.

[0075] According to actual calibration requirements, the function node to be executed can be determined from a plurality of function nodes. In some embodiments, the above process of determining the function node to be executed from a plurality of function nodes can include: first obtaining a calibration object and a target calibration accuracy, the calibration object including a qubit or a quantum gate operation; and determining the function node to be executed from the plurality of function nodes according to the calibration object and the target calibration accuracy, where the function node to be executed is related to the calibration object and the target calibration accuracy. Specifically, it is first necessary to determine which qubits or quantum gate operations are to be calibrated and the accuracy requirement of calibration. According to the calibration object and the target calibration accuracy, the specific operation to be executed is determined, and thus the appropriate function node is selected. Through the embodiments of the present application, the function node to be executed can be determined according to the calibration object and the target calibration accuracy, so that the function node to be executed can be adapted to the calibration object and the target calibration accuracy, and the accuracy of determining the function node to be executed can be improved. For example, referring to FIG. 4, the function nodes to be executed include the function node 401, the function node 402, and the function node 403, which are determined from the function node 401 to the function node 405. Then, according to the function names corresponding to the function nodes to be executed, the function names of the first calibration function include FunctorJ1, FunctorJ2, and FunctorJ3.

[0076] The automatic calibration function library is a database storing a plurality of general functor structures. Referring to FIG. 5, the automatic calibration function library stores five general functor structures, which are a general functor structure H1 corresponding to FunctorJ1, a general functor structure H2 corresponding to FunctorJ2, a general functor structure H3 corresponding to FunctorJ3, a general functor structure H4 corresponding to FunctorJ4, and a general functor structure H5 corresponding to FunctorJ5. In combination with the above example, in the case where the function names of the first calibration function include FunctorJ1, FunctorJ2, and FunctorJ3, the general functor structure H1, the general functor structure H2, and the general functor structure H3 can be obtained from the automatic calibration function library.

[0077] Through the embodiments of the present application, the general functor structure can be directly obtained from the automatic calibration function library based on the name, which can not only improve the acquisition efficiency but also improve the acquisition flexibility.

[0078] In some embodiments, the automatic calibration function library is constructed by the following steps: establishing an initial function library; obtaining a plurality of calibration functions and determining the function function of each calibration function; determining the call parameter mnemonic and the return parameter mnemonic of each calibration function according to the function function of each calibration function; for each calibration function, generating a corresponding universal functor structure according to the call parameter mnemonic and the return parameter mnemonic; and saving the universal functor structure corresponding to each calibration function to the initial function library according to the function name of each calibration function to obtain the automatic calibration function library.

[0079] The initial function library is a database for storing data. The initial function library can be established on the terminal or on the server. For example, the terminal establishes the initial function library on the local storage space. The calibration function is a function for calibrating the qubit. Generally, one qubit calibration graph corresponds to a plurality of calibration functions, but there are actually a plurality of qubit calibration graphs, so the plurality of calibration functions in this embodiment can correspond to one qubit calibration graph or a plurality of qubit calibration graphs. Each calibration function performs a specific operation when calibrating the qubit, i.e., has a specific function function (such as calibration, rotation, measurement, etc.). Although each calibration function has a specific function function, the function functions of different calibration functions can be the same, such as rotation functions.

[0080] Referring to the above, each first calibration function outputs a return parameter after performing a specific function based on a call parameter, and the return parameter of a previous first calibration function in the plurality of first calibration functions is the call parameter of a subsequent first calibration function. In this embodiment, the call parameter and the return parameter of each calibration function are mainly processed. Specifically, since calibration functions with different function functions should have different call parameters and return parameters, the call parameter mnemonic and the return parameter mnemonic of each calibration function are determined according to the function function of each calibration function, which is actually determined according to the correspondence between the function function and the call parameter and the return parameter. The call parameter mnemonic is a mnemonic that replaces the call parameter. The return parameter mnemonic is a mnemonic that replaces the return parameter. The mnemonic is a technique used in programming to simplify the reference to the function parameter in the code. By using the mnemonic, the call parameter and the return parameter of the calibration function are effectively replaced, which can make the code clearer, simpler and easier to understand on the premise of preserving the function function.

[0081] It should be noted that for two calibration functions with different function functions, different call parameter mnemonics and return parameter mnemonics correspond to each of them. For two calibration functions with the same function function, the same call parameter mnemonic and return parameter mnemonic correspond to each of them.

[0082] After the call parameter mnemonic and the return parameter mnemonic are determined, the general functor structure corresponding to each calibration function can be generated. The specific generation process will be described in detail in the embodiments below, which is omitted here.

[0083] In an example, as shown in FIG. 6, the function functions of the calibration functions J1 to J5 are different from each other, and then five mutually different general functor structures are generated, which are the general functor structure H1, the general functor structure H2, the general functor structure H3, the general functor structure H4 and the general functor structure H5. The general functor structure H1 is put into the initial function library according to the function name (such as FunctorJ1) corresponding to the calibration function J1; the general functor structure H2 is put into the initial function library according to the function name (such as FunctorJ2) corresponding to the calibration function J2; the general functor structure H3 is put into the initial function library according to the function name (such as FunctorJ3) corresponding to the calibration function J3; the general functor structure H4 is put into the initial function library according to the function name (such as FunctorJ4) corresponding to the calibration function J4; and the general functor structure H5 is put into the initial function library according to the function name (such as FunctorJ5) corresponding to the calibration function J5. After all the general functor structures are put into the initial function library, the automatic calibration function library can be obtained.

[0084] According to the embodiments of the present application, the automatic calibration function library can be constructed in advance, and the application of the function parameters in the code can be simplified by using the call parameter mnemonic and the return parameter mnemonic, thereby reducing the construction complexity of the automatic calibration function library.

[0085] In some embodiments, the process of generating the corresponding general functor structure according to the call parameter mnemonic and the return parameter mnemonic can be implemented by the following technical solution: generating the functor main structure corresponding to the calibration function according to the call parameter mnemonic and the return parameter mnemonic, the functor main structure including the call parameter mnemonic and the return parameter mnemonic; determining the first data type and the first data structure supported by the call parameter mnemonic, generating the first call parameter substructure according to the first data type, and generating the second call parameter substructure according to the first data structure; determining the second data type and the second data structure supported by the return parameter mnemonic, generating the first return parameter substructure according to the second data type, and generating the second return parameter substructure according to the second data structure; and obtaining the general functor structure corresponding to the calibration function according to the functor main structure, the first call parameter substructure, the second call parameter substructure, the first return parameter substructure and the second return parameter substructure.

[0086] The functor main structure is a meta function definition structure. The meta function needs to define a handle. The handle has two forms of expression. One is a digital handle functor_id, which is used for ABI interface. The other is a mnemonic handle name, which is used for upper code writing. To support open function definition, the embodiment supports multi-parameter and multi-return value function definition. The number of parameters and the number of return values are variable.

[0087] In some embodiments, the functor main structure corresponding to the calibration function is generated according to the calling parameter mnemonic and the return parameter mnemonic. The functor main structure can be generated by the following technical scheme: creating a blank structure; obtaining the functor identifier of the general functor structure corresponding to the calibration function, and the function name of the calibration function; setting the corresponding parameter types for the function name, the functor identifier, the calling parameter mnemonic and the return parameter mnemonic; and filling the function name, the functor identifier, the calling parameter mnemonic, the return parameter mnemonic and the corresponding parameter types into the blank structure to obtain the functor main structure corresponding to the calibration function.

[0088] Specifically, the blank structure refers to a structure without any member variable. For example, the blank structure is message Functor{}. For each calibration function, the function name (name) of the calibration function and the functor identifier (functor_id) of the corresponding general functor structure should be obtained. Taking the calibration function J1 as an example, the general functor structure corresponding to the calibration function J1 is the general functor structure H1. The function name (for example, name is J1) of the calibration function J1 and the functor identifier (for example, functor_id is H1) of the general functor structure H1 should be obtained. The parameter type is a specific data type, such as integer (uint32), string, and custom type (repeated ArgumentValuePair).

[0089] In an example, the functor main structure can be as follows:

[0090] In this example, uint32, string and repeated ArgumentValuePair are all parameter types. functor_id refers to the functor identifier of the general functor structure. name refers to the function name of the corresponding calibration function. param represents the calling parameter mnemonic. ret represents the return parameter mnemonic.

[0091] The embodiment of generating the functor main structure corresponding to the calibration function has the advantage of reducing the complexity of generating the functor main structure by filling the function name, the functor identifier, the calling parameter mnemonic, the return parameter mnemonic and the corresponding parameter types into the blank structure.

[0092] After the generation of the functor main structure, the following describes a scheme for determining the data type and data structure according to the calling parameter mnemonic and the return parameter mnemonic, and then generating the parameter sub-structure according to the data type and data structure.

[0093] For the calling parameter mnemonic, the first data type and the first data structure are determined. The first data type refers to the data type supported by the calling parameter mnemonic. The first data structure refers to the data structure supported by the calling parameter mnemonic. Then, the first calling parameter sub-structure is generated according to the first data type, and the second calling parameter sub-structure is generated according to the first data structure. In an example, the first calling parameter sub-structure is as follows:

[0094] In the above example, enum AtomicDataType represents an enumerated atomic data type, i.e., a non-divisible data type. UNKNOWN_DataType, BYTES, BOOL, INT, STRING, FLOAT, NONE, and ARRAY1D all represent a field type. The above numbers (such as 0 to 7) all represent a field type identifier.

[0095] In an example, the second calling parameter sub-structure is as follows:

[0096] In the above example, message ValueList and message Value represent a data structure. repeated Value, NullValue, double, int64, string, bytes, bool, Array1D, and ValueList all represent a field type. null_value, double_value, int_value, string_value, byte_value, bool_value, array_value, and list_value all represent a field name. The above numbers (such as 1 to 8) all represent a field identifier. oneof kind{} represents that only one field in message Value{} can be taken for serialization. It is ensured that only one field is set to a non-zero value, and other fields will be automatically cleared to zero.

[0097] For the return parameter mnemonic, a second data type and a second data structure are determined. The second data type refers to a data type supported by the return parameter mnemonic. The second data structure refers to a data structure supported by the return parameter mnemonic. Then, a first return parameter sub-structure is generated according to the second data type, and a second return parameter sub-structure is generated according to the second data structure. In an example, the first return parameter sub-structure is as follows:

[0098] enum NullValue{

[0099] NULL_VALUE = 0;

[0100] }.

[0101] In the above example, enum NullValue represents an enumerated atomic data type, i.e., a data type that cannot be subdivided. NULL_VALUE represents a field type. The above number (e.g., 0) represents a field type identifier.

[0102] In an example, the second return parameter sub-structure is as follows:

[0103] In the above example, message SingleValue represents a data structure. AtomicDataType and Value each represent a field type. type and value each represent a field name.

[0104] The following are the mnemonic definition and pass-by-value storage definition for the leaf parameter:

[0105] In the above example, message ArgumentValuePair represents a data structure. Pass-by-value storage is a concept in programming, especially in function calls and parameter passing. In pass-by-value storage, when a function is called and a parameter is passed, the value of this parameter is copied into the function's internal. This means that any modification made to the parameter inside the function will not affect the original variable or object.

[0106] After obtaining the functor main structure, the first call parameter sub-structure, the second call parameter sub-structure, the first return parameter sub-structure, and the second return parameter sub-structure, the general functor structure corresponding to the calibration function can be integrated based on these structures.

[0107] The application allows the general functor structure to be encapsulated by the functor main structure, the first call parameter substructure, the second call parameter substructure, the first return parameter substructure and the second return parameter substructure, so as to facilitate expansion and management, and the general functor structure can be easily expanded or modified without changing the codes of other parts.

[0108] In some embodiments, the process of saving the general functor structure corresponding to each calibration function to the initial function library according to the function name of each calibration function to obtain the automatic calibration function library can be implemented by the following technical scheme: for each calibration function, the function name of the calibration function is taken as a handle, and the structure body name of the general functor structure corresponding to the calibration function is taken as a pointer to the general functor structure, and a mapping relationship between each calibration function and the corresponding general functor structure is established based on the handle and the pointer; and the general functor structure corresponding to each calibration function and the mapping relationship are saved to the initial function library to obtain the automatic calibration function library.

[0109] In computer programming, a handle usually refers to an identifier or a reference for identifying the association between a database. The handle can be an integer, a pointer or other unique identifier. In the embodiment, the function name of the calibration function is taken as the handle. In an example, the handle B1 is obtained based on the function name (FunctorJ1) of the calibration function J1, the handle B2 is obtained based on the function name (FunctorJ2) of the calibration function J2, the handle B3 is obtained based on the function name (FunctorJ3) of the calibration function J3, the handle B4 is obtained based on the function name (FunctorJ4) of the calibration function J4, and the handle B5 is obtained based on the function name (FunctorJ5) of the calibration function J5.

[0110] The structure body name of the general functor structure corresponding to each calibration function is taken as a pointer to the general functor structure. In an example, the pointer F1 is obtained based on the structure body name of the general functor structure H1 corresponding to the calibration function J1, the pointer F2 is obtained based on the structure body name of the general functor structure H2 corresponding to the calibration function J2, the pointer F3 is obtained based on the structure body name of the general functor structure H3 corresponding to the calibration function J3, the pointer F4 is obtained based on the structure body name of the general functor structure H4 corresponding to the calibration function J4, and the pointer F5 is obtained based on the structure body name of the general functor structure H5 corresponding to the calibration function J5.

[0111] Based on the handle and the pointer, a mapping relationship between each calibration function and the corresponding general functor structure is established. Referring to FIG. 7, in an example, based on the handle B1 and the pointer F1, a mapping relationship Y1 between the calibration function J1 and the general functor structure H1 is established; based on the handle B2 and the pointer F2, a mapping relationship Y2 between the calibration function J2 and the general functor structure H2 is established; based on the handle B3 and the pointer F3, a mapping relationship Y3 between the calibration function J3 and the general functor structure H3 is established; based on the handle B4 and the pointer F4, a mapping relationship Y4 between the calibration function J4 and the general functor structure H4 is established; and based on the handle B5 and the pointer F5, a mapping relationship Y5 between the calibration function J5 and the general functor structure H5 is established.

[0112] Then, the general functor structure corresponding to each calibration function and the mapping relationship are saved to the initial function library, to obtain the automatic calibration function library. In an example, as shown in FIG. 8, the general functor structure H1 and the mapping relationship Y1 are saved to the initial function library; the general functor structure H2 and the mapping relationship Y2 are saved to the initial function library; the general functor structure H3 and the mapping relationship Y3 are saved to the initial function library; the general functor structure H4 and the mapping relationship Y4 are saved to the initial function library; and the general functor structure H5 and the mapping relationship Y5 are saved to the initial function library. After all the general functor structures are put into the initial function library, the automatic calibration function library can be obtained.

[0113] The embodiment described above has the benefit that the mapping relationship is established based on the function name and the structure name, and then saved to the initial function library, to finally obtain the automatic calibration function library, which facilitates obtaining the general functor structure corresponding to the first calibration function from the automatic calibration function library based on the mapping relationship, and helps to improve the obtaining efficiency.

[0114] In some embodiments, the above-mentioned obtaining, from the preset automatic calibration function library, the general functor structure corresponding to the first calibration function according to the naming of the function node corresponding to the first calibration function can be implemented by the following technical solutions: first, obtaining, from the preset automatic calibration function library, a target mapping relationship corresponding to the naming of the function node corresponding to the first calibration function; second, obtaining the structure name corresponding to the first calibration function according to the target mapping relationship; and then, obtaining the general functor structure corresponding to the first calibration function from the automatic calibration function library according to the structure name.

[0115] Referring to FIG. 8, for example, the first calibration function is a calibration function J1. A handle B1 is obtained according to the function name (for example, Functor J1) of the calibration function J1. Since the mapping relationship Y1 indicates the relationship between the handle B1 and the pointer F1, the target mapping relationship Y1 is obtained from the automatic calibration function library according to the handle B1. According to the pointer F1 in the mapping relationship Y1, the structure body name corresponding to the first calibration function is obtained as the structure body name of the general functor structure body H1. According to the structure body name of the general functor structure body H1, the general functor structure body corresponding to the calibration function J1, that is, the general functor structure body H1, is obtained from the automatic calibration function library.

[0116] The embodiment has the benefit that the general functor structure body corresponding to the first calibration function is obtained from the automatic calibration function library based on the mapping relationship, which can improve the efficiency of obtaining.

[0117] In step 220, a general function prototype structure body corresponding to the first calibration function is constructed according to the general functor structure body. Referring to the foregoing, the general functor structure body includes a call parameter mnemonic and a return parameter mnemonic. Different behaviors of the general functor structure body, such as the call, combination, and mapping of the function object, can be implemented by defining different member functions or operator overloads. The first calibration function has a specific function function, and the member function or operator overload in the general functor structure body can be obtained based on the function function to obtain the general function prototype structure body.

[0118] It should be noted that two calibration functions with different function functions correspond to different general function prototype structure bodies. Two calibration functions with the same function function correspond to the same general function prototype structure body.

[0119] In addition, the general function prototype structure body has a function pointer, and the function pointer points to the first calibration function. The function pointer is a pointer to a function, which can store the address of the calibration function, so that the program can execute the first calibration function through the function pointer. The declaration and use of the function pointer are similar to those of the ordinary pointer, but it should be noted that the parameter type and return type of the function need to match the function pointer.

[0120] In some embodiments, the general functor structure body includes a call parameter mnemonic and a return parameter mnemonic; and the general function prototype structure body corresponding to the first calibration function is constructed according to the general functor structure body by the following technical solution: constructing a blank function prototype structure body; generating a call parameter structure block and a return parameter structure block according to the call parameter mnemonic and the return parameter mnemonic of the general functor structure body; and filling the call parameter structure block and the return parameter structure block into the blank function prototype structure body to obtain the general function prototype structure body corresponding to the first calibration function.

[0121] Specifically, the blank function prototype structure refers to a structure without any member variable. For example, the blank function prototype structure is: Func<>. Assuming that the first calibration function is calibration function J1, the corresponding generic functor structure is generic functor structure H1. According to the call parameter mnemonic and the return parameter mnemonic of the generic functor structure H1, a call parameter structure block and a return parameter structure block are generated. The call parameter structure block and the return parameter structure block of the generic functor structure H1 are filled into the blank function prototype structure, to obtain a generic function prototype structure corresponding to the calibration function J1. For example, the generic function prototype structure is: Func<PARAM, PARAM, …>. PARAM represents the call parameter structure block or the return parameter structure block.

[0122] The embodiment of the present application can allow the call parameter structure block and the return parameter structure block to be filled into the blank function prototype structure, facilitating expansion and management, and can also be easily expanded or modified without changing the codes of other parts.

[0123] In some embodiments, the first calibration function includes an input parameter name and an output parameter name, and the above-mentioned generation of the call parameter structure block and the return parameter structure block according to the call parameter mnemonic and the return parameter mnemonic of the generic functor structure can be implemented by the following technical solution: generating the call parameter structure block according to the input parameter name of the first calibration function and the call parameter mnemonic of the generic functor structure; and generating the return parameter structure block according to the output parameter name of the first calibration function and the return parameter mnemonic of the generic functor structure.

[0124] Referring to the above, generally, quantum bit calibration graph calibration needs multiple first calibration functions, and generally, the return parameter of a first calibration function in the multiple first calibration functions is the call parameter of a subsequent first calibration function. The input parameter name of the embodiment refers to the name of the call parameter, and the output parameter name refers to the name of the return parameter.

[0125] The input parameter name is an individualized name in the first calibration function, and the call parameter mnemonic is a general symbol in the generic functor structure. The output parameter name is an individualized name in the first calibration function, and the return parameter mnemonic is a general symbol in the generic functor structure. Therefore, the generation of the call parameter structure block based on the input parameter name and the call parameter mnemonic, and the generation of the return parameter structure block based on the output parameter name and the return parameter mnemonic can make neither the function of the first calibration function be affected, nor the subsequent first calibration function be able to use the return parameter of the previous first calibration function as the call parameter.

[0126] The embodiment of the application can generate the calling parameter structure block and the return parameter structure block based on the calling parameter mnemonic and the return parameter mnemonic, can simplify the application of the function parameters in the code, and thus reduces the generation difficulty of the calling parameter structure block and the return parameter structure block.

[0127] In step 230, a second calibration function corresponding to the first calibration function is constructed according to the general function prototype structure body. The second calibration function has a function pointer.

[0128] It can be understood that the function pointer in the second calibration function is the same as the function pointer in the general function prototype structure body, and both point to the first calibration function.

[0129] The second calibration function is a program code, specifically a program code / code block for calibrating the waiting corresponding to the function node in the quantum bit calibration graph. The second calibration function is generated based on the first calibration function, and has the same function function as the first calibration function. The second calibration function is different from the first calibration function in that the calling parameters and the return parameters of the second calibration function are more general than those of the first calibration function, and can reduce the situation that the return parameters of the first calibration function cannot be used as the calling parameters of the second calibration function.

[0130] In some embodiments, the general function prototype structure body includes a calling parameter structure block, and the second calibration function corresponding to the first calibration function is constructed according to the general function prototype structure body by the following technical solution: obtaining the corresponding input parameter input into the first calibration function according to the calling parameter structure block of the general function prototype structure body; generating an input parameter structure block according to the input parameter; filling the input parameter structure block into the position corresponding to the calling parameter structure block in the general function prototype structure body to obtain the second calibration function corresponding to the first calibration function.

[0131] Specifically, the general function prototype structure body has been described above and will not be described here. The calling parameter structure block is a part of the code block / code segment constituting the general function prototype structure body. The calling parameter structure block mainly includes a calling parameter name.

[0132] According to the embodiment of the application, the calling parameters and the return parameters of the second calibration function are more general than those of the first calibration function, which can reduce the situation that the return parameters of the first calibration function cannot be used as the calling parameters of the second calibration function.

[0133] In some embodiments, the process of obtaining the corresponding input parameters of the first calibration function according to the calling parameter structure block of the general function prototype structure can include: obtaining a plurality of return parameters corresponding to the calling parameter name according to the calling parameter name, to obtain the plurality of input parameters.

[0134] The input parameter structure block is a code block / code segment mainly used to represent the code block formed by the input parameters. In some embodiments, the input parameters include an input parameter type and an input parameter value, and the process of generating the input parameter structure block according to the input parameters can be implemented by the following technical solutions: creating a blank parameter sub-structure block; generating a parameter type definition statement according to the input parameter type; generating a parameter assignment statement according to the input parameter value; and filling the parameter type definition statement and the parameter assignment statement into the parameter sub-structure block to obtain the input parameter structure block.

[0135] The blank parameter sub-structure block refers to a code block without any member variable. For example, the blank parameter sub-structure block is param{}. Assuming that the input parameter type includes INT, the parameter type definition statement is type: INT. Assuming that the input parameter value is 102, the parameter assignment statement is int_val: 102. Finally, the input parameter structure block is val{type: INT, int_val: 102}. Wherein, val represents the parameter block name of the input parameter structure block, type represents the type name of the input parameter type, INT represents the input parameter type, int_val represents the parameter name of the input parameter value, and 102 represents the input parameter value.

[0136] The above embodiments have the benefit of being able to generate the input parameter structure block, and since the corresponding statements are generated based on the input parameter type and the input parameter value to obtain the input parameter structure block, the generation complexity can be reduced.

[0137] After obtaining the input parameter structure block, the input parameter structure block can be filled into the general function prototype structure at a position corresponding to the calling parameter structure block to obtain a second calibration function corresponding to the first calibration function. For example, the general function prototype structure is param{param: "sample_uuid"}, param{param: "measure"}, and the like. Wherein, param: "sample_uuid" and param: "measure" both represent the calling parameter structure block. The second calibration function obtained by filling the input parameter structure block into the general function prototype structure at the position corresponding to the calling parameter structure block is shown in FIG. 9. Referring to FIG. 9, functor represents the second calibration function, name represents the name of the second calibration function, and the remaining part is the general function prototype structure, which will not be described in detail.

[0138] As an example, taking the calibration of qubit relaxation time T1 as an example (ignoring the return value in the example), the calibration function is: T1 (int32 sample_uuid, repeated string measure, Array delay_us, int32 stats, Status state, string name, bool save, bool update, bool noisy, bool reset, bool plot). "int32 sample_uuid" is a sample unique identifier, usually an integer value, "repeated string measure" refers to a series of measurement values, "Array delay_us" refers to an array of delay microseconds, "int32 stats" refers to statistical information, which can be an integer, "Status state" refers to the state, which can be an enumeration type, "string name" refers to the name, which is a string, "bool save" refers to the save Boolean value, "bool update" refers to the update Boolean value, "bool noisy" refers to the noise Boolean value, "bool reset" refers to the repeat Boolean value, and "bool plot" refers to the plot Boolean value. For T1 (int32 sample_uuid), after abstracting T1, the following example can be obtained:

[0139] In step 240, a second calibration function is called to complete the qubit calibration based on the qubit calibration graph. In combination with the foregoing, the qubit calibration based on the qubit calibration graph generally requires multiple first calibration functions.

[0140] As an example, assuming that 3 first calibration functions are required, including calibration function J1, calibration function J2 and calibration function J3, the second calibration function includes the second calibration function S1 corresponding to the calibration function J1, the second calibration function includes the second calibration function S2 corresponding to the calibration function J2, and the second calibration function includes the second calibration function S3 corresponding to the calibration function J3. The second calibration function S1, the second calibration function S1 and the second calibration function S3 are called to complete the qubit calibration based on the qubit calibration graph.

[0141] It should be noted that when the second calibration function is called, the second calibration function calls the first calibration function through the function pointer to run the function body of the first calibration function. For example, when the second calibration function S1 is called, the second calibration function S1 calls the calibration function J1 through the function pointer to run the function body of the first calibration function S1.

[0142] Referring to FIG. 10, the implementation details of the quantum bit calibration method of the embodiment of the present application are illustrated in detail.

[0143] In step 1001, among the plurality of function nodes, a function node to be executed is determined, a calibration function corresponding to the function node to be executed is determined as a first calibration function, and a function name of the first calibration function is obtained according to a function name corresponding to the function node to be executed;

[0144] In step 1002, a target mapping relationship formula corresponding to the first calibration function is obtained from a preset automatic calibration function library according to the function name of the first calibration function, a structure body name corresponding to the first calibration function is obtained according to the target mapping relationship formula, and a general functor structure body corresponding to the first calibration function is obtained from the automatic calibration function library according to the structure body name;

[0145] In step 1003, a blank function prototype structure body is constructed, a calling parameter structure block is generated according to the input parameter name of the first calibration function and the calling parameter mnemonic of the general functor structure body, a return parameter structure block is generated according to the output parameter name of the first calibration function and the return parameter mnemonic of the general functor structure body, the calling parameter structure block and the return parameter structure block are filled into the blank function prototype structure body, and a general function prototype structure body corresponding to the first calibration function is obtained; the general function prototype structure body includes the calling parameter structure block;

[0146] In step 1004, the corresponding input parameter input into the first calibration function is obtained according to the calling parameter structure block of the general function prototype structure body, a blank parameter sub-structure block is created, a parameter type definition statement is generated according to the input parameter type, a parameter assignment statement is generated according to the input parameter value, the parameter type definition statement and the parameter assignment statement are filled into the parameter sub-structure block, and an input parameter structure block is obtained;

[0147] In step 1005, the input parameter structure block is filled into the general function prototype structure body at a position corresponding to the calling parameter structure block, and a second calibration function corresponding to the first calibration function is obtained.

[0148] In step 1006, the second calibration function is called to complete the quantum bit calibration based on the quantum bit calibration graph, wherein when the second calibration function is called, the second calibration function calls the first calibration function through a function pointer to run the function body of the first calibration function.

[0149] Referring to FIG. 11, the system architecture for executing the quantum bit calibration method of the embodiment of the present application is illustrated in detail.

[0150] The system architecture shown in FIG. 11 includes a console, a control center, and an experimental platform. The console includes a view window (MDI View), a model (Model), a controller (Controller), and a client (gRPC CLient). The control center includes a first server (gRPC Service), a configuration center, a multi-calibration session scheduling engine, a single-calibration session scheduling engine, and a calibration node engine. The experimental platform includes a second server (gRPC Service), a calibration session management, a collection function library, an analysis function library, a registry, a data channel, and an automation system (LabRAD system).

[0151] The quantum bit calibration method described above is mainly run in the calibration node engine in the control center, and other modules are matched to form a complete automatic calibration system around the quantum bit calibration method. For example, the calibration log shown in FIG. 11 is used to record log data in the calibration process. For another example, the calibration database shown in FIG. 11 is used to store calibration data in the calibration process.

[0152] The experimental platform is a console for early manual calibration, which can store some experimental data. A consistent automatic calibration function library can also be constructed by a general functor structure body, and a console interaction module is introduced to realize the control and display of the automatic process.

[0153] It can be understood that the embodiments of the present application provide a reflective functor calling algorithm (i.e., the quantum bit calibration method) for smoothly transitioning from a calibration function to an automatic system in the process of building a chip calibration automation system. Through the mechanism of a general functor structure body and a generic type, the conflict between the openness of the calibration process and the consistency of the calibration automation is considered, which greatly liberates the construction cost and conversion efficiency of the automatic calibration. In the calibration automation system of the quantum laboratory, the reflective functor calling algorithm is used as the core structure to realize the upgrade from the past bulk manual calibration process to the full-automatic system calibration. The entire calibration process can be improved from several months to several days, which improves the calibration efficiency.

[0154] Referring to FIG. 12, the application further discloses a quantum bit calibration device, which can implement the quantum bit calibration method in the foregoing embodiments. The quantum bit calibration device 1200 comprises: a structure obtaining unit 1210 configured to obtain a general functor structure corresponding to a first calibration function in a quantum bit calibration graph; a structure constructing unit 1220 configured to construct a general function prototype structure corresponding to the first calibration function according to the general functor structure, wherein the general function prototype structure has a function pointer, and the function pointer points to the first calibration function; a function constructing unit 1230 configured to construct a second calibration function corresponding to the first calibration function according to the general function prototype structure, wherein the second calibration function has a function pointer; and a function calling unit 1240 configured to call the second calibration function to call the first calibration function through the function pointer, and run a function body of the first calibration function to perform quantum bit calibration based on the quantum bit calibration graph.

[0155] In some embodiments, the quantum bit calibration graph comprises a plurality of function nodes corresponding to calibration functions used for quantum bit calibration, and the naming of the function nodes in the quantum bit calibration graph is the same as the function name of the calibration functions corresponding to the function nodes; the structure obtaining unit 1210 is specifically configured to: before obtaining the general functor structure corresponding to the first calibration function in the quantum bit calibration graph, determine a to-be-executed function node in the plurality of function nodes; determine the calibration function corresponding to the to-be-executed function node as the first calibration function; and obtain the general functor structure corresponding to the first calibration function from a preset automatic calibration function library according to the naming of the function node corresponding to the first calibration function.

[0156] In some embodiments, the structure obtaining unit 1210 is specifically configured to: obtain a calibration object and a target calibration precision, wherein the calibration object comprises a quantum bit or a quantum gate operation; and determine the to-be-executed function node in the plurality of function nodes according to the calibration object and the target calibration precision.

[0157] In some embodiments, the quantum bit calibration device further comprises a function library constructing unit (not shown in the figure), which is configured to: establish an initial function library; obtain a plurality of calibration functions and determine the function function of each calibration function; determine the call parameter mnemonic and the return parameter mnemonic of each calibration function according to the function function of each calibration function; for each calibration function, generate a corresponding general functor structure according to the call parameter mnemonic and the return parameter mnemonic; and save the general functor structure corresponding to each calibration function to the initial function library according to the function name of each calibration function to obtain an automatic calibration function library.

[0158] In some embodiments, the function library building unit (not shown in the figure) is specifically configured to: generate a functor main structure corresponding to the calibration function according to the call parameter mnemonic and the return parameter mnemonic, the functor main structure including the call parameter mnemonic and the return parameter mnemonic; determine a first data type and a first data structure supported by the call parameter mnemonic, generate a first call parameter substructure according to the first data type, and generate a second call parameter substructure according to the first data structure; determine a second data type and a second data structure supported by the return parameter mnemonic, generate a first return parameter substructure according to the second data type, and generate a second return parameter substructure according to the second data structure; and obtain a general functor structure corresponding to the calibration function according to the functor main structure, the first call parameter substructure, the second call parameter substructure, the first return parameter substructure, and the second return parameter substructure.

[0159] In some embodiments, the function library building unit (not shown in the figure) is specifically configured to: create a blank structure; obtain a structure name and a functor identifier of the general functor structure corresponding to the calibration function; set corresponding parameter types for the structure name, the functor identifier, the call parameter mnemonic, and the return parameter mnemonic, respectively; and fill the structure name, the functor identifier, the call parameter mnemonic, the return parameter mnemonic, and the respective corresponding parameter types into the blank structure to obtain a functor main structure corresponding to the calibration function.

[0160] In some embodiments, the function library building unit (not shown in the figure) is specifically configured to: for each calibration function, take the function name of the calibration function as a handle, and take the structure name of the general functor structure corresponding to the calibration function as a pointer to the general functor structure, and based on the handle and the pointer, establish a mapping relationship between each calibration function and the corresponding general functor structure; save the general functor structure corresponding to each calibration function and the mapping relationship to an initial function library to obtain an automatic calibration function library.

[0161] In some embodiments, the structure obtaining unit (not shown in the figure) is specifically configured to: according to the function name of the first calibration function, obtain a target mapping relationship from a plurality of mapping relationships saved in the preset automatic calibration function library; obtain the structure name corresponding to the first calibration function according to the target mapping relationship; and obtain the general functor structure corresponding to the first calibration function from the automatic calibration function library according to the structure name.

[0162] In some embodiments, the general functor structure includes a call parameter mnemonic and a return parameter mnemonic; the structure building unit 1220 is specifically configured to: build a blank function prototype structure; generate a call parameter structure block and a return parameter structure block according to the call parameter mnemonic and the return parameter mnemonic of the general functor structure; and fill the call parameter structure block and the return parameter structure block into the blank function prototype structure to obtain the general function prototype structure corresponding to the first calibration function.

[0163] In some embodiments, the first calibration function includes an input parameter name and an output parameter name; the structure building unit 1220 is specifically configured to: generate a call parameter structure block according to the input parameter name of the first calibration function and the call parameter mnemonic of the general functor structure; and generate a return parameter structure block according to the output parameter name of the first calibration function and the return parameter mnemonic of the general functor structure.

[0164] In some embodiments, the general function prototype structure includes the call parameter structure block; the function building unit 1230 is specifically configured to: obtain a corresponding input parameter input to the first calibration function according to the call parameter structure block of the general function prototype structure; generate an input parameter structure block according to the input parameter; and fill the input parameter structure block into a position corresponding to the call parameter structure block in the general function prototype structure to obtain a second calibration function corresponding to the first calibration function.

[0165] In some embodiments, the input parameter includes an input parameter type and an input parameter value; the function building unit 1230 is specifically configured to: create a blank parameter sub-structure block; generate a parameter type definition statement according to the input parameter type; generate a parameter assignment statement according to the input parameter value; and fill the parameter type definition statement and the parameter assignment statement into the parameter sub-structure block to obtain the input parameter structure block.

[0166] Referring to FIG. 13, the embodiments of the present application also disclose an electronic device, which includes:

[0167] at least one processor 1310;

[0168] at least one memory 1320 for storing computer executable instructions;

[0169] When the computer executable instructions are executed by the at least one processor 1310, the quantum bit calibration method as described above is implemented.

[0170] The embodiments of the present application also disclose a computer readable storage medium, which stores processor executable computer executable instructions, and the processor executable computer executable instructions are executed by a processor to implement the quantum bit calibration method as described above.

[0171] The embodiment of the present application further discloses a computer program product comprising computer executable instructions stored in a computer readable storage medium, and a processor of an electronic device reads the computer executable instructions from the computer readable storage medium, and the processor executes the computer executable instructions to enable the electronic device to perform the quantum bit calibration method.

[0172] The terms "first", "second", "third", "fourth" and the like in the description of the application and in the claims, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of the terms so termed is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of accomplishing functionalities that are either the same or similar to other embodiments of the application described herein without commencing the use or function of other embodiments of the application. Moreover, the terms "comprise", "have" and any variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or units uses "comprising" or "having" is not necessarily limited to those steps or units but can include other not expressly listed steps or units.

[0173] It should be understood that, in the present application, "at least one" means one or more, and "multiple" means two or more. "And / or" is used to describe the association relationship of the associated objects, which means that there can be three relationships, for example, "A and / or B" can mean: only A, only B, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally represents that the associated objects before and after are in an "or" relationship. "At least one of the following" or the like means any combination of these items, including single item or any combination of multiple items. For example, at least one of a, b or c, can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0174] In several embodiments provided by the present application, it should be understood that the disclosed system, device and method can be implemented by other manners. For example, the above-described device embodiments are only schematic, and the division of the units is only a logical function division, and there can be another division manner in actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.

[0175] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined target, and can be implemented entirely or partially by using software, hardware (such as a processing circuit or a memory) or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an integral module or unit that includes the functions of the module or unit.

[0176] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., they can be located in one place, or they can be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0177] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0178] The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a number of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0179] For the step numbers in the above method embodiments, only the order between the steps is not limited, and the execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.

Claims

1. A quantum bit calibration method, the method being performed by an electronic device, comprising the steps of: obtaining, for a first calibration function in a quantum bit calibration graph, a general functor structure corresponding to the first calibration function; constructing, according to the general functor structure, a general function prototype structure corresponding to the first calibration function, wherein the general function prototype structure has a function pointer pointing to the first calibration function; constructing, according to the general function prototype structure, a second calibration function corresponding to the first calibration function, wherein the second calibration function has the function pointer; calling the second calibration function to call the first calibration function through the function pointer; running the first calibration function to perform quantum bit calibration based on the quantum bit calibration graph.

2. The method of claim 1, wherein, The quantum bit calibration graph includes a plurality of function nodes corresponding to calibration functions used to perform the quantum bit calibration, and the naming of the function nodes in the quantum bit calibration graph is the same as the function name of the calibration function corresponding to the function nodes. Before the step of obtaining, for a first calibration function in a quantum bit calibration graph, a general functor structure corresponding to the first calibration function, the method further comprises: determining a to-be-executed function node among a plurality of function nodes in the quantum bit calibration graph; determining the calibration function corresponding to the to-be-executed function node as the first calibration function; The step of obtaining, for a first calibration function in a quantum bit calibration graph, a general functor structure corresponding to the first calibration function comprises: According to the naming of the function node corresponding to the first calibration function, obtaining the general functor structure corresponding to the first calibration function from a preset automated calibration function library.

3. The method of claim 2, wherein, The step of determining a to-be-executed function node among a plurality of function nodes in the quantum bit calibration graph comprises: obtaining a calibration object and a target calibration accuracy, wherein the calibration object includes a quantum bit or a quantum gate operation, and determining the to-be-executed function node among the plurality of function nodes according to the calibration object and the target calibration accuracy.

4. The method of claim 2 or 3, wherein, The automated calibration function library is obtained by the following steps: establishing an initial function library; obtaining a plurality of calibration functions and determining the function function of each calibration function; determining the call parameter mnemonic and the return parameter mnemonic of each calibration function according to the function function of each calibration function; for each calibration function, generating a corresponding general functor structure according to the call parameter mnemonic and the return parameter mnemonic; saving the general functor structure corresponding to each calibration function to the initial function library according to the function name of each calibration function to obtain the automated calibration function library.

5. The method of claim 4, wherein, The step of generating a corresponding general functor structure according to the call parameter mnemonic and the return parameter mnemonic comprises: generating a functor main structure corresponding to the calibration function according to the call parameter mnemonic and the return parameter mnemonic, wherein the functor main structure includes the call parameter mnemonic and the return parameter mnemonic. determine a first data type and a first data structure supported by the calling parameter mnemonic, generate a first calling parameter sub-structure according to the first data type, and generate a second calling parameter sub-structure according to the first data structure; determine a second data type and a second data structure supported by the return parameter mnemonic, generate a first return parameter sub-structure according to the second data type, and generate a second return parameter sub-structure according to the second data structure; determine the general functor structure corresponding to the calibration function according to the functor main structure, the first calling parameter sub-structure, the second calling parameter sub-structure, the first return parameter sub-structure, and the second return parameter sub-structure.

6. The method of claim 5, wherein, The generating the functor main structure corresponding to the calibration function according to the calling parameter mnemonic and the return parameter mnemonic comprises: creating a blank structure; obtaining a functor identifier of the general functor structure corresponding to the calibration function, and a function name of the calibration function; setting a corresponding parameter type for the function name, the functor identifier, the calling parameter mnemonic, and the return parameter mnemonic, respectively; filling the function name, the functor identifier, the calling parameter mnemonic, the return parameter mnemonic, and the respective parameter types into the blank structure to obtain the functor main structure corresponding to the calibration function.

7. The method according to any one of claims 4 to 6, wherein, The saving the general functor structure corresponding to each calibration function to the initial function library according to the function name of each calibration function to obtain the automatic calibration function library comprises: for each calibration function, taking the function name of the calibration function as a handle, and taking a structure body name of the general functor structure corresponding to the calibration function as a pointer to the general functor structure; establishing a mapping relationship between each calibration function and the corresponding general functor structure based on the handle and the pointer; saving the general functor structure corresponding to each calibration function and the mapping relationship to the initial function library to obtain the automatic calibration function library.

8. The method according to any one of claims 2 to 7, wherein, The obtaining the general functor structure corresponding to the first calibration function from the preset automatic calibration function library according to the naming of the function node corresponding to the first calibration function comprises: obtaining a target mapping relationship from a plurality of mapping relationships saved in the preset automatic calibration function library according to the naming of the function node corresponding to the first calibration function; obtaining the structure body name corresponding to the first calibration function according to the target mapping relationship; obtaining the general functor structure corresponding to the first calibration function from the automatic calibration function library according to the structure body name.

9. The method according to any one of claims 1 to 7, wherein, The general functor structure comprises a calling parameter mnemonic and a return parameter mnemonic; and the constructing the general function prototype structure corresponding to the first calibration function according to the general functor structure comprises: constructing a blank function prototype structure; generating a call parameter structure block and a return parameter structure block according to the call parameter mnemonic and the return parameter mnemonic of the general functor structure; filling the call parameter structure block and the return parameter structure block into the blank function prototype structure to obtain a general function prototype structure corresponding to the first calibration function.

10. The method of claim 9, wherein, The first calibration function includes an input parameter name and an output parameter name; and the generating a call parameter structure block and a return parameter structure block according to the call parameter mnemonic and the return parameter mnemonic of the general functor structure includes: generating a call parameter structure block according to the input parameter name of the first calibration function and the call parameter mnemonic of the general functor structure; generating a return parameter structure block according to the output parameter name of the first calibration function and the return parameter mnemonic of the general functor structure.

11. The method according to any one of claims 1 to 10, wherein, The general function prototype structure includes a call parameter structure block; and the constructing a second calibration function corresponding to the first calibration function according to the general function prototype structure includes: obtaining a corresponding input parameter input into the first calibration function according to the call parameter structure block of the general function prototype structure; generating an input parameter structure block according to the input parameter; filling the input parameter structure block into a position corresponding to the call parameter structure block in the general function prototype structure to obtain a second calibration function corresponding to the first calibration function.

12. The method of claim 11, wherein, The input parameter includes an input parameter type and an input parameter value; The generating an input parameter structure block according to the input parameter includes: creating a blank parameter sub-structure block; generating a parameter type definition statement according to the input parameter type; generating a parameter assignment statement according to the input parameter value; filling the parameter type definition statement and the parameter assignment statement into the parameter sub-structure block to obtain an input parameter structure block.

13. A quantum bit calibration apparatus, comprising: including: a structure obtaining unit configured to obtain, for a first calibration function in a quantum bit calibration graph, a general functor structure corresponding to the first calibration function; a structure constructing unit configured to construct, according to the general functor structure, a general function prototype structure corresponding to the first calibration function, wherein the general function prototype structure has a function pointer, and the function pointer points to the first calibration function; a function constructing unit configured to construct, according to the general function prototype structure, a second calibration function corresponding to the first calibration function, wherein the second calibration function has the function pointer; a function calling unit configured to call the second calibration function to call the first calibration function through the function pointer, and run the first calibration function to perform quantum bit calibration based on the quantum bit calibration graph.

14. An electronic device, comprising: a memory configured to store computer executable instructions; a processor configured to execute the computer executable instructions stored in the memory to implement the quantum bit calibration method according to any one of claims 1 to 12.

14. An electronic device, comprising: a memory configured to store computer executable instructions; a processor configured to execute the computer executable instructions stored in the memory to implement the quantum bit calibration method according to any one of claims 1 to 12.

15. A computer readable storage medium storing computer executable instructions that, when executed by a processor, implement the qubit calibration method of any one of claims 1 to 12.

16. A computer program product comprising computer executable instructions that, when executed by a processor, implement the qubit calibration method of any one of claims 1 to 12.

Citation Information

Patent Citations

  • Quantum measurement equipment calibration method and device, electronic equipment and medium

    CN114037084A

  • Quantum chip calibration method, system and device and computer storage medium

    CN117744824A

  • Nonlinear calibration of a quantum computing apparatus

    US20210035005A1

  • Parameter calibration method and system, quantum chip control method

    US20220374754A1