CN114004361A - Label identification and segmentation method and device for quantum-classical hybrid algorithm and storage medium - Google Patents

Label identification and segmentation method and device for quantum-classical hybrid algorithm and storage medium Download PDF

Info

Publication number
CN114004361A
CN114004361A CN202111119588.9A CN202111119588A CN114004361A CN 114004361 A CN114004361 A CN 114004361A CN 202111119588 A CN202111119588 A CN 202111119588A CN 114004361 A CN114004361 A CN 114004361A
Authority
CN
China
Prior art keywords
quantum
classical
program
algorithm
source code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111119588.9A
Other languages
Chinese (zh)
Inventor
张新
李红珍
赵雅倩
李仁刚
姜金哲
李辰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202111119588.9A priority Critical patent/CN114004361A/en
Publication of CN114004361A publication Critical patent/CN114004361A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Computational Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Condensed Matter Physics & Semiconductors (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The application relates to a label identification and segmentation method, a label identification and segmentation device and a storage medium for a quantum-classical hybrid algorithm. The method comprises the following steps: receiving a source code of a quantum-classical hybrid algorithm, and segmenting the source code to obtain a quantum program and a classical program; and running the quantum program and the classical program, and simultaneously executing the quantum computing task and the classical computing task. The method completes the automatic identification and segmentation of the quantum-classical hybrid algorithm, realizes the simultaneous execution of the quantum program and the classical program, and improves the utilization efficiency of computing resources.

Description

Label identification and segmentation method and device for quantum-classical hybrid algorithm and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a label identification and segmentation method and apparatus for a quantum-classical hybrid algorithm, and a storage medium.
Background
Cloud computing is a service delivery mode, namely, a cloud service provider constructs a data center as a resource sharing pool through a virtualization technology and takes charge of operation and maintenance, and a user only needs to access computing resources through the internet, use the computing resources as required and pay the computing resources according to the amount. Based on the underlying infrastructure that provides cloud computing, classical and quantum clouds can be distinguished: the classic cloud deploys a virtual computing resource pool based on a classic server, computing power is improved through a large-scale cluster, computing power is provided by extending from a data center to an edge side close to a data source or a user at present, and services with huge computing power requirements and sensitive time delay, such as industrial visual detection, community perception management, cloud games, 4K high-definition live broadcast and the like, are supported, but the problems of low efficiency and limitation of a memory wall when a computing intensive algorithm is executed exist; quantum cloud is used as a novel cloud computing mode containing quantum computing resources, based on the powerful parallel computing characteristics of quantum processors (quantum chips or quantum simulators), the information density capable of being stored is higher, exponential performance improvement is achieved in solving the problem of difficult specific computing, breakthrough is achieved in application scenarios which are difficult to solve by classical computing such as quantum chemical simulation, combinatorial optimization solution and network encryption security, potential powerful computing capability is achieved in the field of artificial intelligence, and at present, the industry is not achieved in a quantum hardware system. By the nature of computing, quantum clouds and classical clouds differ only in the physical properties of the underlying infrastructure's computing vehicles, and can both be industrially energized for different application scenarios.
The quantum-classical hybrid strategy is a decision for classical computers to invoke quantum systems or perform critical computations. The quantum algorithm is also an instruction program written by a classical language for operating the quantum logic gate and comprises classical calculation, so that a real quantum computer in the future is of a mixed structure and comprises a quantum system part for executing the quantum program to realize the quantum calculation and a classical computer part for executing the classical calculation and control, the classical computer sends an instruction sequence of a calculation task to the vector subsystem, the quantum system executes the instruction sequence to obtain a measurement result and stores the measurement result in a classical register, and then the measurement result is fed back to a user in a classical information mode, and the whole process is connected and coordinated by a cloud computing platform. Quantum-classical hybrid programming refers to regarding the programming process of a Quantum Algorithm as a part of the operation of a classical program, such as VQE (variable Quantum eigen solver), QAOA (Quantum Approximation Optimization Algorithm), QAE (Quantum Assisted eigen solver) Algorithm, etc., defining a Quantum operator through a classical language, estimating an expected value of a test state through a throughput subsystem, and finding an approximately optimal solution through an optimizer program of a classical computer, which is a typical Quantum-classical hybrid Algorithm based on a hybrid strategy.
At present, classical clouds have been expanded from a central cloud based on a large data center to an edge cloud near a data source or a user side, quantum clouds are only built by individual large internet enterprises, quantum computing initial companies and scientific research institutes at present, test services of online quantum chips or quantum simulators only containing pure quantum computing resources are provided, and researches on combination of the quantum clouds and the classical clouds are few. With the development of quantum computing hardware and quantum-classical hybrid algorithms, a great number of application scenarios such as quantum neural networks, quantum artificial intelligence and the like require cooperative work of quantum computing and classical computing, and a great number of and frequent communications are required between quantum processors and classical chips. The current quantum cloud platform executes a quantum-classical hybrid algorithm task according to an algorithm logic structure sequence, a classical chip is in an idle state when a quantum program is executed, the classical chip is called to execute the classical program and needs local setting, so that not only is computing resources wasted, but also data delay between a quantum processor and the classical chip is too large, and even the original quantum advantage is lost.
Disclosure of Invention
Therefore, it is necessary to provide a label identification and segmentation method, device and storage medium for a quantum-classical hybrid algorithm, which are directed to the above technical problems, complete the automatic identification and segmentation of the quantum-classical hybrid algorithm, implement the simultaneous execution of a quantum program and a classical program, and improve the utilization efficiency of computing resources.
In one aspect, a label recognition segmentation method for a quantum-classical hybrid algorithm is provided, and the method includes:
receiving a source code of a quantum-classical hybrid algorithm, and segmenting the source code to obtain a quantum program and a classical program;
and running the quantum program and the classical program, and simultaneously executing the quantum computing task and the classical computing task.
In one of the embodiments, the first and second electrodes are,
the identifier in the source code has a tag; and traversing the source code, identifying the label of the identifier, and dividing the source code into a quantum algorithm code segment and a classical algorithm code segment according to an identification result.
In one of the embodiments, the first and second electrodes are,
and performing completion operation on the quantum algorithm code segment and the classical algorithm code segment to obtain a complete and compilable quantum program and a classical program.
In one of the embodiments, the first and second electrodes are,
if one of the quantum algorithm code segment and the classical algorithm code segment contains a local variable defined by the operation result of the other, the operation result of the other is called from the register and then compiled.
In one of the embodiments, the first and second electrodes are,
and calculating the calculation task load of the quantum program and the classical program, dynamically distributing quantum calculation resources and classical calculation resources according to the load, and then sending the quantum program and the classical program to a compiler for compiling.
In one of the embodiments, the first and second electrodes are,
compiling the quantum program and the classical program into a quantum instruction set and a classical instruction set respectively, executing a quantum computing task and a classical computing task according to the quantum instruction set and the classical instruction set respectively, and storing a computing result in a register.
In one of the embodiments, the first and second electrodes are,
and segmenting the source code by adopting a label identification segmentation protocol, wherein the label identification segmentation protocol is a core protocol of a platform as a service (PaaS) layer cloud operating system, and the label identification segmentation protocol is executed before code compiling.
In one of the embodiments, the first and second electrodes are,
the quantum-classical hybrid algorithm comprises a variational quantum feature solver algorithm VQE, a quantum approximate optimization algorithm QOA and a quantum auxiliary feature solver algorithm QAE; the identifier includes a variable name, a class name, and a function name.
In another aspect, a label recognition segmentation apparatus for a quantum-classical hybrid algorithm is provided, the apparatus including:
the segmentation module is used for receiving a source code of a quantum-classical hybrid algorithm and segmenting the source code to obtain a quantum program and a classical program;
and the execution module is used for running the quantum program and the classical program and simultaneously executing the quantum computing task and the classical computing task.
In yet another aspect, a computer-readable storage medium is provided, having stored thereon a computer program which, when executed by a processor, performs the steps of:
receiving a source code of a quantum-classical hybrid algorithm, and segmenting the source code to obtain a quantum program and a classical program;
and running the quantum program and the classical program, and simultaneously executing the quantum computing task and the classical computing task.
According to the label identification and segmentation method, device and storage medium for the quantum-classical hybrid algorithm, the labels of the identifiers in the source code of the hybrid algorithm are segmented to obtain the quantum program and the classical program, so that the automatic identification and segmentation of the quantum-classical hybrid algorithm are completed; by executing the quantum program and the classical program simultaneously, the utilization efficiency of computing resources is improved.
Drawings
FIG. 1 is a schematic flow chart of a label recognition and segmentation method according to the present invention;
FIG. 2 is a flow chart of the implementation of the simultaneous execution of a quantum computing task and a classical computing task by the tag identification segmentation method of the present invention;
FIG. 3 is a flow chart of calculating molecular ground state energy by a VQE algorithm after the tag identification segmentation method of the present invention is adopted;
fig. 4 is a block diagram of a tag identification and separation apparatus according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In one embodiment, as shown in fig. 1, there is provided a label recognition segmentation method for a quantum-classical hybrid algorithm, the method comprising:
s102: and receiving a source code of the quantum-classical hybrid algorithm, and segmenting the source code to obtain a quantum program and a classical program.
Specifically, source codes of the quantum-classical hybrid algorithm are received, the source codes are written in a classical language and can support C, C + +, Python and other programming languages. The user can input the hybrid algorithm source code through the hybrid programming interface of the quantum-classic hybrid cloud platform user portal. The quantum algorithm code supports two forms of quantum line drag generation and code direct input, and is nested in the classical algorithm code. And transmitting the source code of the hybrid algorithm to a cloud operating system, and inputting the source code of the hybrid algorithm to a quantum-classic hybrid algorithm label identification segmentation protocol for segmentation.
Wherein the identifiers in the source code have labels indicating which of the source code are quantum algorithm codes and which are classical algorithm codes. By segmenting the tags, quantum programs and classical programs are obtained.
S104: and running the quantum program and the classical program, and simultaneously executing the quantum computing task and the classical computing task.
Specifically, a completely executable quantum program and a classical program are output after the division is completed, the required quantum computing resources and the required classical computing resources are dispatched from the virtual computing resource pool, and the quantum computing tasks and the classical computing tasks are executed at the same time.
According to the label identification and segmentation method for the quantum-classical hybrid algorithm, the labels of the identifiers in the source code of the hybrid algorithm are segmented to obtain a quantum program and a classical program, and the automatic identification and segmentation of the quantum-classical hybrid algorithm are completed; by executing the quantum program and the classical program simultaneously, the utilization efficiency of computing resources is improved.
In one of the embodiments, the first and second electrodes are,
the identifier in the source code has a tag; and traversing the source code, identifying the label of the identifier, and dividing the source code into a quantum algorithm code segment and a classical algorithm code segment according to an identification result.
Specifically, the source code identifier (including variable name, class name, function name, etc.) is set with labels to distinguish, for example, adding "_ q" at the time of naming represents quantum algorithm code, "_ c" represents classical code, and without adding represents common code.
Traversing the source code, identifying the label of the identifier, and if the _ q is identified, representing the quantum algorithm code; if _ c is identified, the classical algorithm code is represented; if the label is not identified, the code is the common code. Through the segmentation, the source code is segmented into a quantum algorithm code segment and a classical algorithm code segment.
In one of the embodiments, the first and second electrodes are,
and performing completion operation on the quantum algorithm code segment and the classical algorithm code segment to obtain a complete and compilable quantum program and a classical program.
Specifically, common codes, called macro commands, third-party library commands and the like are filled in specific positions of corresponding code segments according to the context, and a complete compilable quantum program and a classical program are formed.
In one of the embodiments, the first and second electrodes are,
if one of the quantum algorithm code segment and the classical algorithm code segment contains a local variable defined by the operation result of the other, the operation result of the other is called from the register and then compiled.
Specifically, if the quantum algorithm code segment has a local variable defined by a calculation result of the classical algorithm code segment, or the classical algorithm code segment has a local variable defined by a measurement result of the quantum algorithm code segment, the classical algorithm code segment can be compiled after calling a calculation result of the other party from the classical register.
In one of the embodiments, the first and second electrodes are,
and calculating the calculation task load of the quantum program and the classical program, dynamically distributing quantum calculation resources and classical calculation resources according to the load, and then sending the quantum program and the classical program to a compiler for compiling.
The method comprises the following steps of scheduling, allocating and deploying quantum computing resources and classical computing resources by computing the computing task load of a quantum program and a classical program, sending the quantum program and the classical program to a compiler to enter a compiling stage, completing automatic identification and segmentation of a quantum-classical hybrid algorithm and dynamically scheduling and allocating the computing resources, and realizing simultaneous execution of the quantum program and the classical program.
In one of the embodiments, the first and second electrodes are,
compiling the quantum program and the classical program into a quantum instruction set and a classical instruction set respectively, executing a quantum computing task and a classical computing task according to the quantum instruction set and the classical instruction set respectively, and storing a computing result in a register.
In particular, referring to fig. 2, a quantum program is compiled into a quantum instruction set, and a classical program is compiled into a classical instruction set.
A quantum processor (a real quantum chip or a quantum virtual machine) executes a quantum computing task according to a quantum instruction set, measures a computing result and stores the computing result in a classical register; the classical processor (CPU or classical virtual machine or classical physical machine) performs classical computational tasks according to a classical instruction set, with the results of the computation also stored in classical registers.
If the quantum program needs the local variable defined by the operation result of the classical program, or the classical program has the local variable defined by the measurement result of the quantum program, the calculation result is transmitted back to the quantum program or the classical program for the next calculation; otherwise, the data is fed back to the cloud computing platform for visualization or directly fed back to the user.
In one of the embodiments, the first and second electrodes are,
and segmenting the source code by adopting a label identification segmentation protocol, wherein the label identification segmentation protocol is a core protocol of a platform as a service (PaaS) layer cloud operating system, and the label identification segmentation protocol is executed before code compiling.
Specifically, a label recognition segmentation protocol for a quantum-classical hybrid algorithm is positioned before a source code of the hybrid algorithm is input into a code and compiled, and can be used as one of core protocols of a Platform as a Service (PaaS) layer cloud operating system and integrated into a quantum-classical hybrid cloud Platform, so that a quantum computing task and a classical computing task oriented to the quantum-classical hybrid algorithm can be executed simultaneously.
In one of the embodiments, the first and second electrodes are,
the quantum-classical hybrid algorithm comprises a variational quantum feature solver algorithm VQE, a quantum approximate optimization algorithm QOA and a quantum auxiliary feature solver algorithm QAE; the identifier includes a variable name, a class name, and a function name.
Specifically, referring to fig. 3, the VQE algorithm is used as an example to describe how to divide the quantum-classical hybrid algorithm into a quantum program and a classical program according to the tag identification division protocol of the present invention.
The VQE algorithm, namely a Variational Quantum eigenvalue solver (Variational Quantum eigen equation) is a typical Quantum-classical hybrid algorithm for finding the eigenvalue of a matrix H (usually a larger matrix), and when the algorithm is used for Quantum simulation, H is the hamiltonian of a certain system. The VQE algorithm can be used for quantum chemical simulation, namely mapping the Hamiltonian of a real chemical system to quantum bits, and finding out the eigenstate and the eigenenergy capable of reflecting the real system through modulating parameters and evolution time. The VQE algorithm for calculating the molecular ground state energy comprises the following steps:
step one, calling a quantum chemistry calculation package Psi4, and defining the once quantized Hamilton quantity of molecules through a lifting operator;
secondly, converting the quantized result into a twice quantized Hamiltonian represented by a Paglie operator by using J-W conversion or B-K conversion;
third, initializing the initial state
Figure BDA0003276540960000081
Preparation of the composition containing the parameters
Figure BDA0003276540960000082
Test state of (1)
Figure BDA0003276540960000083
Fourthly, constructing a quantum circuit, and calculating an expected value E of the test state by a quantum processor through a quantum expected estimation methodn
The fifth step, put the expected value into the optimizer program of the classical computer, if | En-En-1If | is not less than the threshold value L (or the maximum step of optimization is not reached), the optimizer will modify the parameters
Figure BDA0003276540960000084
And repeating from the third step. Otherwise, the optimal expected value of the current state, namely the ground state energy of the molecule is obtained.
As can be seen from the steps of calculating molecular ground state energy by the current VQE algorithm, parameter optimization is a classical calculation task, and quantum calculation tasks are concentrated on preparing experimental states
Figure BDA0003276540960000085
And calculating the expected value EnAnd finally, converting the quantum circuit into a quantum algorithm code to be embedded into a classical algorithm code to form a quantum-classical hybrid algorithm.
By using the label identification and segmentation protocol provided by this embodiment, for a VQE algorithm that needs to be optimized for multiple times, labels are set for identifiers of source codes, such as a bubble-tree operator hamilton function, a trial function, an expectation function set "_ q" label, a molecular hamilton function, an optimizer function set "_ c" label, and a parameter
Figure BDA0003276540960000086
As a common global variable, split into experimental states including preparation
Figure BDA0003276540960000087
And calculating the expected value EnAnd a classical program comprising a parametric optimizer program. Execution of quantum program output expectation value mnSending the parameters to the classical program, and executing the optimized parameters of the classical program output
Figure BDA0003276540960000091
Sends back the quantum program again until the desired value EnThe judgment condition is satisfied.
The protocol applies the idle time of waiting of a classical program when executing a quantum program, or the idle time of waiting of the quantum program when executing the classical program, and the communication time of sending a calculation result from a quantum processor to the classical processor, or the communication time of sending the calculation result from the classical processor to the quantum processor to the working time of executing the quantum program or the classical program by the source code division of a hybrid arithmetic method, realizes the simultaneous execution of a quantum calculation task and the classical calculation task, and improves the utilization efficiency of calculation resources.
It should be understood that, although the steps in the flowchart of fig. 1 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 1 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 4, there is provided a label recognition segmentation apparatus for a quantum-classical hybrid algorithm, the apparatus including:
the segmentation module 401 is configured to receive a source code of a quantum-classical hybrid algorithm, and segment the source code to obtain a quantum program and a classical program;
an execution module 402, configured to run the quantum program and the classical program, and execute the quantum computing task and the classical computing task at the same time.
In one of the embodiments, the first and second electrodes are,
the identifier in the source code has a tag; the segmenting module 401 is further configured to traverse the source code, identify the tag of the identifier, and segment the source code into a quantum algorithm code segment and a classical algorithm code segment according to an identification result.
In one embodiment, the segmentation module 401 is further configured to:
and performing completion operation on the quantum algorithm code segment and the classical algorithm code segment to obtain a complete and compilable quantum program and a classical program.
In one of the embodiments, the first and second electrodes are,
if one of the quantum algorithm code segment and the classical algorithm code segment contains a local variable defined by the operation result of the other, the operation result of the other is called from the register and then compiled.
In one embodiment, the segmentation module 401 is further configured to:
and calculating the calculation task load of the quantum program and the classical program, dynamically distributing quantum calculation resources and classical calculation resources according to the load, and then sending the quantum program and the classical program to a compiler for compiling.
In one embodiment, the segmentation module 401 is further configured to:
compiling the quantum program and the classical program into a quantum instruction set and a classical instruction set respectively, executing a quantum computing task and a classical computing task according to the quantum instruction set and the classical instruction set respectively, and storing a computing result in a register.
In one embodiment, the segmentation module 401 is further configured to:
and segmenting the source code by adopting a label identification segmentation protocol, wherein the label identification segmentation protocol is a core protocol of a platform as a service (PaaS) layer cloud operating system, and the label identification segmentation protocol is executed before code compiling.
In one of the embodiments, the first and second electrodes are,
the quantum-classical hybrid algorithm comprises a variational quantum feature solver algorithm VQE, a quantum approximate optimization algorithm QOA and a quantum auxiliary feature solver algorithm QAE; the identifier includes a variable name, a class name, and a function name.
For specific limitations of the label recognition and segmentation apparatus for the quantum-classical hybrid algorithm, reference may be made to the above limitations of the label recognition and segmentation method for the quantum-classical hybrid algorithm, which are not described herein again. The above-mentioned various modules in the label identification and segmentation device for the quantum-classical hybrid algorithm can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer-readable storage medium is provided, having stored thereon a computer program which, when executed by a processor, performs the steps of:
receiving a source code of a quantum-classical hybrid algorithm, and segmenting the source code to obtain a quantum program and a classical program;
and running the quantum program and the classical program, and simultaneously executing the quantum computing task and the classical computing task.
In one embodiment, the computer program when executed by the processor implements the steps of:
traversing the source code, identifying the label of the identifier, and dividing the source code into a quantum algorithm code segment and a classical algorithm code segment according to an identification result; wherein the identifier in the source code has a tag.
In one embodiment, the computer program when executed by the processor implements the steps of:
and performing completion operation on the quantum algorithm code segment and the classical algorithm code segment to obtain a complete and compilable quantum program and a classical program.
In one embodiment, the computer program when executed by the processor implements the steps of:
if one of the quantum algorithm code segment and the classical algorithm code segment contains a local variable defined by the operation result of the other, the operation result of the other is called from the register and then compiled.
In one embodiment, the computer program when executed by the processor implements the steps of:
and calculating the calculation task load of the quantum program and the classical program, dynamically distributing quantum calculation resources and classical calculation resources according to the load, and then sending the quantum program and the classical program to a compiler for compiling.
In one embodiment, the computer program when executed by the processor implements the steps of:
compiling the quantum program and the classical program into a quantum instruction set and a classical instruction set respectively, executing a quantum computing task and a classical computing task according to the quantum instruction set and the classical instruction set respectively, and storing a computing result in a register.
In one embodiment, the computer program when executed by the processor implements the steps of:
and segmenting the source code by adopting a label identification segmentation protocol, wherein the label identification segmentation protocol is a core protocol of a platform as a service (PaaS) layer cloud operating system, and the label identification segmentation protocol is executed before code compiling.
In one of the embodiments, the first and second electrodes are,
the quantum-classical hybrid algorithm comprises a variational quantum feature solver algorithm VQE, a quantum approximate optimization algorithm QOA and a quantum auxiliary feature solver algorithm QAE; the identifier includes a variable name, a class name, and a function name.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A label identification segmentation method for a quantum-classical hybrid algorithm is characterized by comprising the following steps:
receiving a source code of a quantum-classical hybrid algorithm, and segmenting the source code to obtain a quantum program and a classical program;
and running the quantum program and the classical program, and simultaneously executing the quantum computing task and the classical computing task.
2. The method of claim 1,
the identifier in the source code has a tag; and traversing the source code, identifying the label of the identifier, and dividing the source code into a quantum algorithm code segment and a classical algorithm code segment according to an identification result.
3. The method of claim 2,
and performing completion operation on the quantum algorithm code segment and the classical algorithm code segment to obtain a complete and compilable quantum program and a classical program.
4. The method of claim 3,
if one of the quantum algorithm code segment and the classical algorithm code segment contains a local variable defined by the operation result of the other, the operation result of the other is called from the register and then compiled.
5. The method of claim 4,
and calculating the calculation task load of the quantum program and the classical program, dynamically distributing quantum calculation resources and classical calculation resources according to the load, and then sending the quantum program and the classical program to a compiler for compiling.
6. The method of claim 5,
compiling the quantum program and the classical program into a quantum instruction set and a classical instruction set respectively, executing a quantum computing task and a classical computing task according to the quantum instruction set and the classical instruction set respectively, and storing a computing result in a register.
7. The method of any one of claims 1 to 6,
and segmenting the source code by adopting a label identification segmentation protocol, wherein the label identification segmentation protocol is a core protocol of a platform as a service (PaaS) layer cloud operating system, and the label identification segmentation protocol is executed before code compiling.
8. The method of any one of claims 2 to 6,
the quantum-classical hybrid algorithm comprises a variational quantum feature solver algorithm VQE, a quantum approximate optimization algorithm QOA and a quantum auxiliary feature solver algorithm QAE; the identifier includes a variable name, a class name, and a function name.
9. A label recognition segmentation apparatus for a quantum-classical hybrid algorithm, the apparatus comprising:
the segmentation module is used for receiving a source code of a quantum-classical hybrid algorithm and segmenting the source code to obtain a quantum program and a classical program;
and the execution module is used for running the quantum program and the classical program and simultaneously executing the quantum computing task and the classical computing task.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 8.
CN202111119588.9A 2021-09-24 2021-09-24 Label identification and segmentation method and device for quantum-classical hybrid algorithm and storage medium Pending CN114004361A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111119588.9A CN114004361A (en) 2021-09-24 2021-09-24 Label identification and segmentation method and device for quantum-classical hybrid algorithm and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111119588.9A CN114004361A (en) 2021-09-24 2021-09-24 Label identification and segmentation method and device for quantum-classical hybrid algorithm and storage medium

Publications (1)

Publication Number Publication Date
CN114004361A true CN114004361A (en) 2022-02-01

Family

ID=79921547

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111119588.9A Pending CN114004361A (en) 2021-09-24 2021-09-24 Label identification and segmentation method and device for quantum-classical hybrid algorithm and storage medium

Country Status (1)

Country Link
CN (1) CN114004361A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115271078A (en) * 2022-08-04 2022-11-01 无锡江南计算技术研究所 Software stack with cooperation of supercomputer and quantum computer and working method
CN115271084A (en) * 2022-08-04 2022-11-01 无锡江南计算技术研究所 Mixed compiling method for quantum acceleration equipment
CN115456188A (en) * 2022-02-28 2022-12-09 合肥本源量子计算科技有限责任公司 Quantum computing task optimization processing method and device and quantum computer
CN116257222A (en) * 2023-02-28 2023-06-13 中国人民解放军战略支援部队信息工程大学 Classical-quantum collaborative computing programming method and model based on task flow

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020047426A1 (en) * 2018-08-30 2020-03-05 Rigetti & Co, Inc. Low-latency, high-performance hybrid computing
CN111310929A (en) * 2020-03-12 2020-06-19 苏州浪潮智能科技有限公司 Quantum computation-oriented data interaction equipment, method, device and medium
CN112465146A (en) * 2020-11-19 2021-03-09 苏州浪潮智能科技有限公司 Quantum and classical hybrid cloud platform and task execution method
CN112771549A (en) * 2018-10-04 2021-05-07 国际商业机器公司 Enhancing mixed quantum classical algorithms for optimization

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020047426A1 (en) * 2018-08-30 2020-03-05 Rigetti & Co, Inc. Low-latency, high-performance hybrid computing
CN112771549A (en) * 2018-10-04 2021-05-07 国际商业机器公司 Enhancing mixed quantum classical algorithms for optimization
CN111310929A (en) * 2020-03-12 2020-06-19 苏州浪潮智能科技有限公司 Quantum computation-oriented data interaction equipment, method, device and medium
CN112465146A (en) * 2020-11-19 2021-03-09 苏州浪潮智能科技有限公司 Quantum and classical hybrid cloud platform and task execution method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
范洪强;胡滨;袁征;: "用经典计算机模拟量子计算机", 密码学报, no. 03, 15 June 2018 (2018-06-15) *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115456188A (en) * 2022-02-28 2022-12-09 合肥本源量子计算科技有限责任公司 Quantum computing task optimization processing method and device and quantum computer
CN115456188B (en) * 2022-02-28 2024-04-05 本源量子计算科技(合肥)股份有限公司 Quantum computing task optimization processing method and device and quantum computer
CN115271078A (en) * 2022-08-04 2022-11-01 无锡江南计算技术研究所 Software stack with cooperation of supercomputer and quantum computer and working method
CN115271084A (en) * 2022-08-04 2022-11-01 无锡江南计算技术研究所 Mixed compiling method for quantum acceleration equipment
CN115271084B (en) * 2022-08-04 2024-08-30 无锡江南计算技术研究所 Quantum acceleration device-oriented hybrid compiling method
CN116257222A (en) * 2023-02-28 2023-06-13 中国人民解放军战略支援部队信息工程大学 Classical-quantum collaborative computing programming method and model based on task flow
CN116257222B (en) * 2023-02-28 2024-05-28 中国人民解放军战略支援部队信息工程大学 Classical-quantum collaborative computing programming method and model based on task flow

Similar Documents

Publication Publication Date Title
CN114004361A (en) Label identification and segmentation method and device for quantum-classical hybrid algorithm and storage medium
US9053067B2 (en) Distributed data scalable adaptive map-reduce framework
CN110232087B (en) Big data increment iteration method and device, computer equipment and storage medium
CN114008594A (en) Scheduling operations on a computational graph
CN115461763A (en) Efficient quantum adaptive execution method for quantum circuit
CN104778079A (en) Method and device used for dispatching and execution and distributed system
CN108255613B (en) SOA system resource management method based on graph coloring
US11443173B2 (en) Hardware-software co-design for accelerating deep learning inference
US12026590B2 (en) Quantum computing task processing method, system and apparatus, and operating system
US20200044938A1 (en) Allocation of Shared Computing Resources Using a Classifier Chain
CN105786619A (en) Virtual machine distribution method and device
Xu et al. Litereconfig: Cost and content aware reconfiguration of video object detection systems for mobile gpus
Usha Kirana et al. Energy-efficient enhanced Particle Swarm Optimization for virtual machine consolidation in cloud environment
CN103593221A (en) Method and apparatus for dynamic data configuration
CN108134848B (en) SOA system resource optimization method based on graph theory K-segmentation
CN110580527B (en) Method and device for generating universal machine learning model and storage medium
CN115269204B (en) Memory optimization method and device for neural network compiling
CN113609806A (en) Quantum line program universal conversion method combined with subgraph isomorphism
CN115796041A (en) Neural network model deployment method, system, device and storage medium
Franceschinis et al. Interfaces and binding in component based development of formal models
CN115473838A (en) Network request processing method and device, computer readable medium and electronic equipment
CN115390986A (en) Intelligent contract parallel execution system based on state cryptographic chip
CN112329267B (en) Combined geometric neutron transport processing method and device based on characteristic line method
US11550696B2 (en) Quantum compute estimator and intelligent infrastructure
Cheng et al. EPOC: A Novel Pulse Generation Framework Incorporating Advanced Synthesis Techniques for Quantum Circuits

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination