[go: up one dir, main page]

CN116542338A - Quantum computing method and device - Google Patents

Quantum computing method and device Download PDF

Info

Publication number
CN116542338A
CN116542338A CN202210091299.0A CN202210091299A CN116542338A CN 116542338 A CN116542338 A CN 116542338A CN 202210091299 A CN202210091299 A CN 202210091299A CN 116542338 A CN116542338 A CN 116542338A
Authority
CN
China
Prior art keywords
quantum computing
execution environment
quantum
user
program 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
CN202210091299.0A
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202210091299.0A priority Critical patent/CN116542338A/en
Publication of CN116542338A publication Critical patent/CN116542338A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena

Landscapes

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

Abstract

The embodiment of the application provides a quantum computing method, which comprises the following steps: acquiring parameters of a program code and a code operation request submitted by a user on a user interface, wherein the parameters of the code operation request comprise quantum computing execution environment information, and the quantum computing execution environment information is generated according to quantum computing execution environment selected by the user on the user interface; transmitting the program codes to a quantum computing execution environment corresponding to the quantum computing execution environment information to operate so as to obtain an operation result; and sending the operation result to the user interface. According to the quantum computing method and device, for the same set of quantum program codes, a user does not need to manually modify the codes or package again when switching quantum execution environments, and the use experience of the user is improved.

Description

量子计算方法和装置Quantum Computing Method and Device

技术领域technical field

本申请实施例涉及量子计算云服务领域,更具体地,涉及一种量子计算方法和装置。The embodiments of the present application relate to the field of quantum computing cloud services, and more specifically, to a quantum computing method and device.

背景技术Background technique

量子计算是一种新兴的计算技术,通过利用微观粒子(电子或光子等)的量子效应(量子纠缠、并行性)等特性,实现对特定问题的加速计算,作为一种有希望突破半导体摩尔定律限制的新兴计算技术,量子计算收到广泛关注。应用量子计算的量子计算机可以将在经典计算机上耗时成千上万年的计算任务,压缩在几小时甚至几分钟内完成,然而,目前的量子计算机基于超导、离子阱等技术,对设备环境要求非常高,导致单个量子计算机的成本高、按照部署条件严格,因此,量子计算设备通过云服务的方式服务于研究机构、企业或个人将是一种可预见的趋势。Quantum computing is an emerging computing technology. By using the quantum effects (quantum entanglement, parallelism) and other characteristics of microscopic particles (electrons or photons, etc.), it can realize accelerated computing for specific problems. Limiting emerging computing technologies, quantum computing has received widespread attention. Quantum computers using quantum computing can compress computing tasks that take thousands of years on classical computers into hours or even minutes. However, current quantum computers are based on technologies such as superconductivity and ion traps. The environmental requirements are very high, resulting in high cost of a single quantum computer and strict deployment conditions. Therefore, it will be a foreseeable trend for quantum computing devices to serve research institutions, enterprises or individuals through cloud services.

发明内容Contents of the invention

本申请实施例提供一种量子计算方法和装置,对于同一套量子程序代码,用户在切换量子执行环境时无需手动修改代码或重新进行封装,提升用户使用感受。The embodiment of the present application provides a quantum computing method and device. For the same set of quantum program codes, the user does not need to manually modify the code or repackage when switching the quantum execution environment, which improves the user experience.

第一方面,提供了一种量子计算方法,该方法包括:获取用户在用户界面提交的程序代码和代码运行请求的参数,代码运行请求的参数包括量子计算执行环境信息,量子计算执行环境信息为根据用户在用户界面上选择的量子计算执行环境生成;将程序代码发送到量子计算执行环境信息对应的量子计算执行环境中运行,以得到运行结果;将运行结果发送到用户界面。In the first aspect, a quantum computing method is provided, the method includes: obtaining the program code submitted by the user on the user interface and the parameters of the code running request, the parameters of the code running request include quantum computing execution environment information, and the quantum computing execution environment information is Generate according to the quantum computing execution environment selected by the user on the user interface; send the program code to run in the quantum computing execution environment corresponding to the quantum computing execution environment information to obtain the running result; send the running result to the user interface.

本申请实施例的量子计算方法相比于现有技术,可以支持复杂的量子与经典混合的程序的执行,且支持同一套代码在多个不同的量子执行环境中执行。对于同一套程序代码,用户在切换量子执行环境时无需手动修改代码或重新进行封装,只需在用户界面上选择相应的执行环境,即可实现指定不同的量子芯片或量子模拟器来执行量子计算。Compared with the existing technology, the quantum computing method of the embodiment of the present application can support the execution of complex quantum and classical mixed programs, and support the execution of the same set of codes in multiple different quantum execution environments. For the same set of program code, the user does not need to manually modify the code or repackage when switching the quantum execution environment, just select the corresponding execution environment on the user interface, and then specify different quantum chips or quantum simulators to perform quantum calculations .

结合第一方面,在第一方面的某些实现方式中,用户界面上包括一个或多个量子计算执行环境选项,一个或多个量子计算执行环境选项包括默认选项或用户自定义选项。With reference to the first aspect, in some implementations of the first aspect, the user interface includes one or more quantum computing execution environment options, and the one or more quantum computing execution environment options include default options or user-defined options.

其中,默认选项为系统提供,而用户自定义选项则是用户预先根据需要修改或编辑的量子计算执行环境,本申请实施例的量子计算方法中,用户可以根据实际需要自行定义量子计算执行环境,提升了量子编程的灵活性。Among them, the default option is provided by the system, and the user-defined option is the quantum computing execution environment modified or edited by the user in advance according to the needs. In the quantum computing method of the embodiment of the present application, the user can define the quantum computing execution environment according to actual needs. Improves the flexibility of quantum programming.

结合第一方面,在第一方面的某些实现方式中,用户自定义选项为根据用户编辑的自定义量子计算执行环境的代码生成。With reference to the first aspect, in some implementations of the first aspect, the user-defined option is code generation based on a user-edited custom quantum computing execution environment.

本申请实施例的量子计算方法中,可以根据用户编辑的自定义量子计算执行环境的代码生成自定义量子计算执行环境的配置参数,然后将该自定义量子计算执行环境的配置参数保存为相应的选项。In the quantum computing method of the embodiment of the present application, the configuration parameters of the custom quantum computing execution environment can be generated according to the code of the custom quantum computing execution environment edited by the user, and then the configuration parameters of the custom quantum computing execution environment are saved as the corresponding option.

结合第一方面,在第一方面的某些实现方式中,一个或多个量子计算执行环境选项为根据用户在用户界面上选择的量子计算执行环境的配置选项确定,用户界面上包括多个配置选项。With reference to the first aspect, in some implementations of the first aspect, one or more quantum computing execution environment options are determined according to the configuration options of the quantum computing execution environment selected by the user on the user interface, and the user interface includes multiple configurations option.

本申请实施例的量子计算方法中,量子计算执行环境和经典计算执行环境均还可以由用户根据用户界面的菜单栏中的选项做出选择,且量子计算执行环境和经典计算执行环境均由多个配置选项组合确定。In the quantum computing method of the embodiment of the present application, both the quantum computing execution environment and the classical computing execution environment can also be selected by the user according to the options in the menu bar of the user interface, and both the quantum computing execution environment and the classical computing execution environment are controlled by multiple A combination of configuration options is determined.

结合第一方面,在第一方面的某些实现方式中,用户界面上还包括一个或多个量子计算执行的参数选项,参数选项包括量子计算执行的预留资源,参数选项包括默认选项或用户自定义选项。In combination with the first aspect, in some implementations of the first aspect, the user interface further includes one or more parameter options for quantum computing execution, the parameter options include reserved resources for quantum computing execution, and the parameter options include default options or user Customization options.

本申请实施例的量子计算方法中,用户除了可以在用户界面上选择执行环境,还可以在用户界面上选择执行环境的参数,例如选择在该执行环境中执行程序代码时预留一定的量子计算资源,避免程序运行期间有其他的程序占用资源,提高运行效率。In the quantum computing method of the embodiment of the present application, in addition to selecting the execution environment on the user interface, the user can also select the parameters of the execution environment on the user interface. Resources, to avoid other programs occupying resources during the running of the program, and improve operating efficiency.

结合第一方面,在第一方面的某些实现方式中,程序代码包括量子计算程序代码和经典计算程序代码,将程序代码发送到量子计算执行环境信息对应的量子计算执行环境中运行,包括:确定程序代码中的量子计算程序代码和经典计算程序代码;将量子计算程序代码发送到量子计算执行环境信息对应的量子计算执行环境中运行;将经典计算程序代码在经典计算执行环境中运行。In combination with the first aspect, in some implementations of the first aspect, the program code includes quantum computing program code and classical computing program code, and the program code is sent to run in the quantum computing execution environment corresponding to the quantum computing execution environment information, including: Determine the quantum computing program code and the classical computing program code in the program code; send the quantum computing program code to run in the quantum computing execution environment corresponding to the quantum computing execution environment information; run the classical computing program code in the classical computing execution environment.

本申请实施例的量子计算方法还支持将复杂的量子与经典混合的程序中的量子计算程序和经典计算程序进行区分,从而可以将量子计算程序发送到量子计算执行环境中运行,而将经典计算程序由本地的经典计算执行环境运行。The quantum computing method of the embodiment of the present application also supports the distinction between the quantum computing program and the classical computing program in the complex quantum and classical mixed program, so that the quantum computing program can be sent to the quantum computing execution environment to run, while the classical computing program The program is run by the local classical computing execution environment.

结合第一方面,在第一方面的某些实现方式中,经典计算执行环境包括运行在GPU、CPU或NPU上的容器或虚拟机。With reference to the first aspect, in some implementation manners of the first aspect, the classical computing execution environment includes a container or a virtual machine running on a GPU, a CPU, or an NPU.

第二方面,提供了一种量子计算装置,该装置包括:获取单元,用于获取用户在用户界面提交的程序代码和代码运行请求的参数,代码运行请求的参数包括量子计算执行环境信息,量子计算执行环境信息为根据用户在用户界面上选择的量子计算执行环境生成;处理单元,用于将程序代码发送到量子计算执行环境信息对应的量子计算执行环境中运行,以得到运行结果;输出单元,用于将运行结果发送到用户界面。In a second aspect, a quantum computing device is provided, which includes: an acquisition unit, configured to acquire the program code submitted by the user on the user interface and the parameters of the code running request, the parameters of the code running request include quantum computing execution environment information, quantum The computing execution environment information is generated according to the quantum computing execution environment selected by the user on the user interface; the processing unit is used to send the program code to the quantum computing execution environment corresponding to the quantum computing execution environment information to run in order to obtain the operation result; the output unit , used to send the run results to the UI.

结合第二方面,在第二方面的某些实现方式中,用户界面上包括一个或多个量子计算执行环境选项,一个或多个量子计算执行环境选项包括默认选项或用户自定义选项。With reference to the second aspect, in some implementations of the second aspect, the user interface includes one or more quantum computing execution environment options, and the one or more quantum computing execution environment options include default options or user-defined options.

结合第二方面,在第二方面的某些实现方式中,用户自定义选项为根据用户编辑的自定义量子计算执行环境的代码生成。With reference to the second aspect, in some implementations of the second aspect, the user-defined option is code generation based on a user-edited custom quantum computing execution environment.

结合第二方面,在第二方面的某些实现方式中,一个或多个量子计算执行环境选项为根据用户在用户界面上选择的量子计算执行环境的配置选项确定,用户界面上包括多个配置选项。With reference to the second aspect, in some implementations of the second aspect, one or more quantum computing execution environment options are determined according to the configuration options of the quantum computing execution environment selected by the user on the user interface, and the user interface includes multiple configuration options options.

结合第二方面,在第二方面的某些实现方式中,用户界面上还包括一个或多个量子计算执行的参数选项,参数选项包括量子计算执行的预留资源,参数选项包括默认选项或用户自定义选项。In conjunction with the second aspect, in some implementations of the second aspect, the user interface also includes one or more parameter options for quantum computing execution, the parameter options include reserved resources for quantum computing execution, and the parameter options include default options or user Customization options.

结合第二方面,在第二方面的某些实现方式中,程序代码包括量子计算程序代码和经典计算程序代码,处理单元具体用于:确定程序代码中的量子计算程序代码和经典计算程序代码;将量子计算程序代码发送到量子计算执行环境信息对应的量子计算执行环境中运行;将经典计算程序代码在经典计算执行环境中运行。In combination with the second aspect, in some implementations of the second aspect, the program code includes a quantum calculation program code and a classical calculation program code, and the processing unit is specifically used to: determine the quantum calculation program code and the classical calculation program code in the program code; The quantum computing program code is sent to run in the quantum computing execution environment corresponding to the quantum computing execution environment information; the classical computing program code is run in the classical computing execution environment.

结合第二方面,在第二方面的某些实现方式中,经典计算执行环境包括运行在GPU、CPU或NPU上的容器或虚拟机。With reference to the second aspect, in some implementation manners of the second aspect, the classical computing execution environment includes a container or a virtual machine running on a GPU, a CPU, or an NPU.

第三方面,提供了一种芯片,该芯片包括:逻辑电路,逻辑电路用于与输入/输出接口耦合,通过输入/输出接口传输数据,以执行上述第一方面或第一方面任一种可能的实现方式的方法。In the third aspect, a chip is provided, the chip includes: a logic circuit, the logic circuit is used to couple with the input/output interface, and transmit data through the input/output interface, so as to implement any one of the above-mentioned first aspect or the first aspect method of implementation.

第四方面,提供了一种计算机可读介质,该计算机可读介质存储有程序代码,当计算机程序代码在计算机上运行时,使得计算机执行上述第一方面或第一方面任一种可能的实现方式的方法。In a fourth aspect, a computer-readable medium is provided, the computer-readable medium stores program codes, and when the computer program codes run on a computer, the computer executes the above-mentioned first aspect or any possible implementation of the first aspect way of way.

第五方面,本申请实施例提供一种计算机系统,该计算机系统包括量子计算机和经典计算机,该经典计算机用于控制量子计算机,使得量子计算机实现第一方面或第一方面任一种可能的实现方式的方法。In the fifth aspect, the embodiment of the present application provides a computer system, the computer system includes a quantum computer and a classical computer, and the classical computer is used to control the quantum computer, so that the quantum computer realizes the first aspect or any possible implementation of the first aspect way of way.

附图说明Description of drawings

图1是本申请实施例的系统架构示意图;Fig. 1 is a schematic diagram of the system architecture of the embodiment of the present application;

图2是本申请实施例的量子计算方法的示意性流程图;Fig. 2 is the schematic flowchart of the quantum computing method of the embodiment of the present application;

图3是本申请实施例的一种浏览器用户界面的示意图;FIG. 3 is a schematic diagram of a browser user interface according to an embodiment of the present application;

图4是本申请实施例的另一种浏览器用户界面的示意图;FIG. 4 is a schematic diagram of another browser user interface according to the embodiment of the present application;

图5是根据本申请实施例的量子计算方法实现用户编辑的程序代码的运行的示意性流程图;Fig. 5 is a schematic flowchart of implementing the operation of the program code edited by the user according to the quantum computing method of the embodiment of the present application;

图6是本申请实施例提供的一种计算集群子系统的示意图;FIG. 6 is a schematic diagram of a computing cluster subsystem provided by an embodiment of the present application;

图7是本申请实施例的量子计算引擎的分配程序代码的示意图;Fig. 7 is a schematic diagram of the distribution program code of the quantum computing engine of the embodiment of the present application;

图8是本申请实施例的量子计算方法的具体过程;Fig. 8 is the specific process of the quantum computing method of the embodiment of the present application;

图9是本申请实施例的量子计算装置的示意性框图;Fig. 9 is a schematic block diagram of a quantum computing device according to an embodiment of the present application;

图10是本申请实施例的量子计算系统的结构示意图。FIG. 10 is a schematic structural diagram of a quantum computing system according to an embodiment of the present application.

具体实施方式Detailed ways

下面将结合附图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.

目前多个厂商和研究机构均通过云服务的方式提供了量子编程的服务,包括基于浏览器的图形化量子编程服务和基于浏览器的集成开发环境(integrateddevelopmentenvironment,IDE)编程服务。At present, many manufacturers and research institutions provide quantum programming services through cloud services, including browser-based graphical quantum programming services and browser-based integrated development environment (integrated development environment, IDE) programming services.

基于浏览器的图形化量子编程服务是用户在浏览器中通过拖拽等方式搭建量子线路,然后将量子线路程序提交给后台运行,进行相应的量子计算。一般来说,基于浏览器的图形化量子编程服务仅适用于教学和演示目的的程序编写,不适合进行大规模的量子计算,此外,基于浏览器的图形化量子编程服务一般只支持量子程序的执行,不支持复杂的量子与经典混合的程序的执行,而就当前量子计算的发展来看,量子计算任务通常需要和经典计算任务配合来完成一个实际的计算任务,因此基于浏览器的图形化量子编程服务无法胜任现有的大多计算任务。The browser-based graphical quantum programming service enables users to build quantum circuits in the browser by dragging and dropping, and then submits the quantum circuit program to the background to perform corresponding quantum calculations. Generally speaking, browser-based graphical quantum programming services are only suitable for programming for teaching and demonstration purposes, and are not suitable for large-scale quantum computing. In addition, browser-based graphical quantum programming services generally only support the development of quantum programs. Execution does not support the execution of complex mixed quantum and classical programs. As far as the current development of quantum computing is concerned, quantum computing tasks usually need to cooperate with classical computing tasks to complete an actual computing task. Therefore, browser-based graphical Quantum programming services cannot handle most existing computing tasks.

现有的基于浏览器的IDE编程服务是由用户在浏览器中编辑代码,同时用户需要在代码中指定量子计算在后台的执行环境,然后浏览器将编辑好的代码提交到网络服务器,网络服务器再将代码提交到容器或虚拟机中,容器或虚拟机用于执行代码,其中,如果该代码为量子与经典混合的程序代码,则经典程序代码由经典处理器(例如中央处理器(centralprocessing unit,CPU)或图形处理器(graphics processing unit,GPU)等)执行,而量子计算程序代码由用户在代码中指定的量子计算执行环境执行。这种现有的基于浏览器的IDE编程服务虽然支持复杂的量子与经典混合的程序的执行,但也有其不足,例如对于一套原本在第一种量子执行环境中执行的代码,如果用户需要该代码在第二种量子执行环境中执行,则只能由用户在浏览器中手动修改相关的代码,即重新指定该代码的量子执行环境为第二种量子执行环境,或者量子执行环境的代码已经通过命令行参数或者配置文件进行封装,则需要用户在浏览器中修改相关的配置文件或命令行参数,如此会增加用户编辑代码的工作量。In the existing browser-based IDE programming service, the user edits the code in the browser. At the same time, the user needs to specify the execution environment of quantum computing in the background in the code, and then the browser submits the edited code to the network server, and the network server The code is then submitted to a container or a virtual machine, and the container or virtual machine is used to execute the code, wherein, if the code is a program code mixed with quantum and classical, the classical program code is executed by a classical processor (such as a central processing unit (CPU) , CPU) or graphics processing unit (graphics processing unit, GPU, etc.) execution, while the quantum computing program code is executed by the quantum computing execution environment specified by the user in the code. Although this existing browser-based IDE programming service supports the execution of complex mixed quantum and classical programs, it also has its shortcomings. For example, for a set of codes originally executed in the first quantum execution environment, if the user needs to If the code is executed in the second quantum execution environment, the user can only manually modify the relevant code in the browser, that is, redesignate the quantum execution environment of the code as the second quantum execution environment, or the code of the quantum execution environment If it has been encapsulated through command line parameters or configuration files, the user needs to modify the relevant configuration files or command line parameters in the browser, which will increase the workload of users to edit the code.

因此本申请实施例提供一种量子计算方法,不仅支持复杂的量子与经典混合的程序的执行,还支持同一套代码在多个不同的量子执行环境中执行,同时用户在切换量子执行环境时无需手动修改代码或重新进行封装,提升用户使用感受。图1示出了本申请实施例的系统架构示意图,如图1所示,该系统包括代码编辑界面101、IDE服务器102、计算集群子系统103、量子计算引擎104、量子计算机或量子模拟器105等。图1所示的系统可以用于实现本申请实施例的量子计算方法,其中,代码编辑界面101为用户进行代码编辑的界面,包括通过前端技术(Javascript等)实现在线编辑代码的代码编辑器,例如各种浏览器等。IDE服务器102用于实现用户的鉴权、量子计算引擎所需的计算节点管理、IDE的配置文件或配置参数管理等,对于基于浏览器的IDE编程服务,IDE服务器可以是网络服务器等。计算集群子系统103用于调度和管理计算节点,计算节点是量子计算引擎的运行环境,计算节点通常可以是容器或虚拟机等。量子计算引擎104运行在经典的操作系统(例如CPU或GPU等)上,用于将量子与经典混合的程序中的量子计算程序代码分配到量子计算执行环境中运行,将经典计算程序代码分配到经典计算执行环境中运行,经典计算执行环境包括运行在GPU、CPU或嵌入式神经网络处理器(neural network processing unit,NPU)上的容器或虚拟机等,并且在代码执行结束后,量子计算引擎104还用于将量子计算程序代码的执行结果和经典计算程序代码的执行结果进行合并,再将合并后的结果返回。量子计算子系统或量子模拟器105即为量子计算执行环境,其中量子计算子系统通常为量子芯片及相应的配套软硬件,而量子模拟器为能够实现量子计算的软件模块,量子计算子系统和量子模拟器均有不同的种类,在实际操作中可以由用户根据需要预先进行指定。Therefore, the embodiment of this application provides a quantum computing method, which not only supports the execution of complex quantum and classical mixed programs, but also supports the execution of the same set of codes in multiple different quantum execution environments, and at the same time, users do not need to switch between quantum execution environments. Manually modify the code or repackage to improve user experience. Figure 1 shows a schematic diagram of the system architecture of the embodiment of the present application, as shown in Figure 1, the system includes a code editing interface 101, an IDE server 102, a computing cluster subsystem 103, a quantum computing engine 104, a quantum computer or a quantum simulator 105 wait. The system shown in Figure 1 can be used to implement the quantum computing method of the embodiment of the present application, wherein, the code editing interface 101 is an interface for users to edit codes, including a code editor that implements online editing codes through front-end technologies (Javascript, etc.), For example various browsers etc. The IDE server 102 is used to implement user authentication, computing node management required by the quantum computing engine, IDE configuration file or configuration parameter management, etc. For browser-based IDE programming services, the IDE server can be a web server or the like. The computing cluster subsystem 103 is used to schedule and manage computing nodes, which are the operating environment of the quantum computing engine, and computing nodes can usually be containers or virtual machines. The quantum computing engine 104 runs on a classical operating system (such as CPU or GPU, etc.), and is used to distribute the quantum computing program code in the program mixed with quantum and classical to run in the quantum computing execution environment, and distribute the classical computing program code to Running in the classical computing execution environment, the classical computing execution environment includes containers or virtual machines running on the GPU, CPU or embedded neural network processor (neural network processing unit, NPU), etc., and after the code execution ends, the quantum computing engine 104 is also used to merge the execution result of the quantum computing program code and the execution result of the classical computing program code, and then return the combined result. The quantum computing subsystem or quantum simulator 105 is the quantum computing execution environment, wherein the quantum computing subsystem is usually a quantum chip and corresponding supporting software and hardware, and the quantum simulator is a software module capable of realizing quantum computing. The quantum computing subsystem and There are different types of quantum simulators, which can be pre-specified by users according to their needs in actual operation.

图2示出了本申请实施例的量子计算方法的示意性流程图,其中图2的方法可以由图1所示的系统执行,如图2所示的量子计算方法包括步骤201和步骤202,以下分别介绍。Fig. 2 shows a schematic flowchart of a quantum computing method according to an embodiment of the present application, wherein the method in Fig. 2 can be executed by the system shown in Fig. 1 , and the quantum computing method shown in Fig. 2 includes steps 201 and 202, The following are introduced separately.

S201,获取用户在用户界面提交的程序代码和代码运行请求的参数,代码运行请求的参数包括量子计算执行环境信息,量子计算执行环境信息为根据用户在用户界面上选择的量子计算执行环境生成。S201. Obtain the program code submitted by the user on the user interface and the parameters of the code running request. The parameters of the code running request include quantum computing execution environment information, and the quantum computing execution environment information is generated according to the quantum computing execution environment selected by the user on the user interface.

用户在用户界面编辑程序代码,用户界面可以是浏览器,也可以是用户的本地客户端程序。图3示出了本申请实施例的一种浏览器用户界面的示意图,如图3所示,该浏览器用户界面包括菜单栏和代码编辑器等,其中代码编辑区用于输入代码。本申请实施例中,用户无需在代码中指定量子计算执行环境,只需在菜单栏中的执行环境选项中选择需要的量子计算执行环境即可,对于同一套代码,在需要切换量子执行环境时,用户只需在菜单栏重新选择相应的执行环境,无需重新编辑或修改代码。具体的,菜单栏中的可选的执行环境选项包括默认选项和用户自定义选项,其中,默认选项为系统提供,例如图3中的“高性能量子模拟器”为系统提供的默认的量子计算执行环境,而用户自定义选项则是用户预先根据需要修改或编辑的量子计算执行环境,例如根据用户编辑的自定义量子计算执行环境的代码生成自定义量子计算执行环境的配置参数,然后将该自定义量子计算执行环境的配置参数保存为相应的选项,例如图3中的“量子处理器(quantum processing unit,QPU)类型1”、“QPU类型2”、“QPU类型1 100Qubit”等均为用户自定义的量子计算执行环境选项,以“QPU类型1 100Qubit”为例,表示该量子计算执行环境为类型为1的QPU同时申请100量子比特的预留资源,其中申请100量子比特的预留资源是在程序要求性能高的情况下,执行期间先申请100量子比特的资源执行期间不释放,执行完成后再释放。除了图3中的直接选择对应的量子计算执行环境选项之外,本申请实施例还提供如图4所示的用户界面,如图4所示,量子计算执行环境和经典计算执行环境均可以由用户根据菜单栏中的选项做出选择,且量子计算执行环境和经典计算执行环境均由多个配置选项组合确定,例如图4中,量子计算执行环境由处理器、类型等配置选项确定,处理器的可选项包括高性能量子模拟器和QPU,类型的可选项包括类型1和类型2等,用户选择了处理器、类型的选项,即可确定相应的量子执行环境;相应的,经典计算执行环境由处理器和计算节点等配置选项确定,其中处理器的可选项包括CPU、GPU等,计算节点的可选项包括容器和虚拟机等,用户选择了处理器和计算节点的选项,即可确定相应的经典计算执行环境。除此之外,用户界面上还可以包括一个或多个量子计算执行的参数选项,例如图4中的量子计算执行的预留资源,参数选项包括默认选项或用户自定义选项,图4中100Qubit、200Qubit为用户自定义选项,0为系统提供的默认选项。The user edits the program code on the user interface, and the user interface may be a browser or a local client program of the user. Fig. 3 shows a schematic diagram of a browser user interface according to an embodiment of the present application. As shown in Fig. 3, the browser user interface includes a menu bar and a code editor, etc., wherein the code editing area is used for inputting codes. In the embodiment of this application, the user does not need to specify the quantum computing execution environment in the code, but only needs to select the required quantum computing execution environment in the execution environment option in the menu bar. For the same set of code, when it is necessary to switch the quantum computing execution environment , the user only needs to re-select the corresponding execution environment in the menu bar, without re-editing or modifying the code. Specifically, the optional execution environment options in the menu bar include default options and user-defined options, where the default options are provided by the system, for example, the "high-performance quantum simulator" in Figure 3 is the default quantum computing provided by the system The user-defined option is the quantum computing execution environment modified or edited by the user in advance according to the needs, for example, the configuration parameters of the custom quantum computing execution environment are generated according to the user-edited custom quantum computing execution environment code, and then The configuration parameters of the custom quantum computing execution environment are saved as corresponding options, for example, "quantum processing unit (quantum processing unit, QPU) type 1", "QPU type 2", "QPU type 1 100Qubit" in Figure 3 are all The user-defined quantum computing execution environment option, taking "QPU type 1 100Qubit" as an example, indicates that the quantum computing execution environment is a QPU of type 1 and simultaneously applies for 100 qubits of reserved resources, among which the reserved resources of 100 qubits are applied for When the program requires high performance, the resource is applied for 100 qubit resources during the execution and will not be released during the execution, and will be released after the execution is completed. In addition to the direct selection of the corresponding quantum computing execution environment option in Figure 3, the embodiment of the present application also provides a user interface as shown in Figure 4, as shown in Figure 4, both the quantum computing execution environment and the classical computing execution environment can be controlled by The user makes a choice according to the options in the menu bar, and both the quantum computing execution environment and the classical computing execution environment are determined by a combination of multiple configuration options. For example, in Figure 4, the quantum computing execution environment is determined by configuration options such as processor and type. The options for processors include high-performance quantum simulators and QPUs, and the options for types include Type 1 and Type 2, etc., and the user can determine the corresponding quantum execution environment after selecting the processor and type options; correspondingly, classical computing execution The environment is determined by configuration options such as processors and computing nodes. The options for processors include CPU, GPU, etc., and the options for computing nodes include containers and virtual machines. Users select the options for processors and computing nodes to determine The corresponding classical computing execution environment. In addition, the user interface can also include one or more parameter options for quantum computing execution, such as the reserved resources for quantum computing execution in Figure 4, the parameter options include default options or user-defined options, 100Qubit in Figure 4 、 200Qubit is user-defined option, 0 is the default option provided by the system.

S202,将程序代码发送到量子计算执行环境信息对应的量子计算执行环境中运行,以得到运行结果。S202. Send the program code to the quantum computing execution environment corresponding to the quantum computing execution environment information to run, so as to obtain the running result.

用户编辑完成程序代码后,并在用户界面选择了相应的量子计算执行环境(或者还包括经典计算执行环境),则在用户界面提交程序代码,同时根据用户选择的量子计算执行环境生成量子计算执行环境信息,量子计算执行环境信息作为代码运行请求的参数的一种,与程序代码一起被提交到后台,当程序代码中既包括量子计算程序代码又包括经典计算程序代码时,系统将程序代码中的量子计算程序代码发送到量子计算执行环境信息对应的量子计算执行环境中运行,以得到量子计算结果,将经典计算程序代码在经典计算执行环境中运行,以得到经典计算结果。After the user edits the program code and selects the corresponding quantum computing execution environment (or also includes the classical computing execution environment) on the user interface, the program code is submitted on the user interface, and the quantum computing execution environment is generated according to the quantum computing execution environment selected by the user. Environmental information, quantum computing execution environment information is one of the parameters of the code running request, and is submitted to the background together with the program code. When the program code includes both quantum computing program code and classical computing program code, the system will The quantum computing program code is sent to run in the quantum computing execution environment corresponding to the quantum computing execution environment information to obtain the quantum computing result, and the classical computing program code is run in the classical computing execution environment to obtain the classical computing result.

S203,将运行结果发送到用户界面。S203, sending the running result to the user interface.

后台将程序代码的运行结果反馈到用户界面,当程序代码中既包括量子计算程序代码又包括经典计算程序代码时,则将量子计算结果和经典计算结果合并后再反馈到用户界面。The background feeds back the running results of the program code to the user interface. When the program code includes both quantum computing program codes and classical computing program codes, the quantum computing results and classical computing results are combined and then fed back to the user interface.

以下结合图5介绍如何根据本申请实施例的量子计算方法实现用户编辑的程序代码的运行。图5示出了根据本申请实施例的量子计算方法实现用户编辑的程序代码的运行的示意性流程图,如图5所示,用户在浏览器的用户界面中编写程序代码,该用户界面可以是图3或图4所示的用户界面,该程序代码为量子与经典混合的程序代码,既包括量子计算程序代码,也包括经典计算程序代码。用户编写完成程序代码后,再在用户界面的菜单栏中选择该程序代码的执行环境,包括量子计算执行环境的选择和经典计算执行环境的选择,或者也可以只选择量子计算执行环境,而经典计算执行环境由系统默认指定,具体取决于具体情况中系统的设置。用户在选择了执行环境后,提交程序代码和相应的执行环境选择结果,而程序代码和根据执行环境选择结果生成的执行环境信息被提交到网络服务器,网络服务器对用户进行鉴权,即验证用户是否拥有访问系统的权利,鉴权成功后,网络服务器再将程序代码和执行环境信息发送到计算节点。在实际应用中,计算节点由计算集群子系统管理和调度,计算集群子系统通常可以采用容器技术或虚拟机技术实现,容器和虚拟机用于对应用程序提供封装和隔离,从而构建起一套能够随处运行的自容纳单元,摆脱了对物理硬件的需求,更高效地使用技术资源。图6示出了本申请实施例提供的一种计算集群子系统的示意图,该计算集群子系统采用容器管理技术实现,容器是一种轻量级、可移植、自包含的软件打包技术,使应用程序可以在任何地方以相同的方式运行。图6中的计算集群子系统接收网络服务器发送的请求信息,该请求信息包括程序代码和执行环境信息,计算集群子系统通过容器技术对计算资源进行隔离和分配管理,具体的,容器技术可以有效地将单个操作系统的资源划分到孤立的组中,以便更好地在孤立的组之间平衡有冲突的资源使用需求。存储服务/数据库服务用于存储该编程项目对应的配置文件或配置参数,配置文件或配置参数用于指示该编程项目中可用的执行环境,例如图5中的多种量子执行环境和经典执行环境等。如图6所示,每个容器中包含一个代理程序(agent),代理程序用于接收网络服务器发送的程序代码和执行环境信息,并启动相应的量子计算引擎,量子计算引擎是运行在经典计算资源(例如CPU或GPU)上的独立程序,用于确定程序代码中的量子计算程序代码和经典计算程序代码,并将量子计算程序代码发送到量子计算执行环境信息对应的量子计算执行环境中运行,将经典计算程序代码发送到经典计算执行环境中运行。图7示出了本申请实施例的量子计算引擎的分配程序代码的示意图,如图7所示,接收程序代码后首先判断该程序代码是量子计算程序代码还是经典计算程序代码,将量子计算程序代码发送到量子计算执行环境中运行,其中量子计算执行环境是根据接收的执行环境信息确定的,量子计算执行环境包括量子计算机或量子模拟器等,并接收量子计算程序在量子计算执行环境中的运行结果,即量子计算结果;如果判断该程序代码是经典计算程序代码,则将该经典计算程序代码在计算节点中运行,计算节点输出经典计算结果,然后根据量子计算结果和经典计算结果判断计算是否结束,如果结束,则将量子计算结果和经典计算结果合并然后逐级返回合并的运行结果,如图5所示,计算节点将合并后的运行结果返回给网络服务器,网络服务器再将合并后的运行结果返回浏览器界面,即将程序代码的运行结果反馈给用户,如果计算没有结束,则继续按照图7的流程继续进行量子计算和经典计算,直至计算结束。其中,量子计算引擎向量子计算机或量子模拟器发送量子计算程序代码可以通过应用程序接口(application programming interface,API)网关来实现,如图7所示,API网关用于管理远程量子计算资源的接口调用,将量子计算任务发送到相应的量子计算执行环境中。The following describes how to execute the program code edited by the user according to the quantum computing method of the embodiment of the present application with reference to FIG. 5 . Fig. 5 shows a schematic flowchart of implementing the operation of the program code edited by the user according to the quantum computing method of the embodiment of the present application. As shown in Fig. 5, the user writes the program code in the user interface of the browser, and the user interface can It is the user interface shown in Fig. 3 or Fig. 4, the program code is a program code mixed with quantum and classical, including both quantum computing program code and classical computing program code. After the user finishes writing the program code, he can select the execution environment of the program code in the menu bar of the user interface, including the selection of the quantum computing execution environment and the selection of the classical computing execution environment, or only the quantum computing execution environment can be selected, and the classical computing execution environment can be selected. The calculation execution environment is specified by the system by default, depending on the setting of the system in a specific situation. After the user selects the execution environment, he submits the program code and the corresponding execution environment selection result, and the program code and the execution environment information generated according to the execution environment selection result are submitted to the network server, and the network server authenticates the user, that is, verifies the user Whether you have the right to access the system, after the authentication is successful, the network server will send the program code and execution environment information to the computing node. In practical applications, the computing nodes are managed and scheduled by the computing cluster subsystem. The computing cluster subsystem can usually be implemented using container technology or virtual machine technology. Containers and virtual machines are used to provide packaging and isolation for applications, thus building a set of A self-contained unit that can run anywhere, freeing up the need for physical hardware and using technology resources more efficiently. FIG. 6 shows a schematic diagram of a computing cluster subsystem provided by an embodiment of the present application. The computing cluster subsystem is implemented using container management technology. A container is a lightweight, portable, and self-contained software packaging technology that enables Applications can run the same way everywhere. The computing cluster subsystem in Figure 6 receives the request information sent by the network server. The request information includes program code and execution environment information. The computing cluster subsystem isolates and allocates computing resources through container technology. Specifically, container technology can effectively The resources of a single operating system can be divided into isolated groups to better balance conflicting resource usage needs among the isolated groups. The storage service/database service is used to store configuration files or configuration parameters corresponding to the programming project, and the configuration files or configuration parameters are used to indicate the execution environments available in the programming project, such as various quantum execution environments and classical execution environments in Figure 5 wait. As shown in Figure 6, each container contains an agent program (agent), which is used to receive the program code and execution environment information sent by the network server, and start the corresponding quantum computing engine. An independent program on a resource (such as CPU or GPU), which is used to determine the quantum computing program code and classical computing program code in the program code, and send the quantum computing program code to the quantum computing execution environment corresponding to the quantum computing execution environment information to run , sending the classical computing program code to run in the classical computing execution environment. Fig. 7 shows a schematic diagram of the distribution program code of the quantum computing engine of the embodiment of the present application. As shown in Fig. 7, after receiving the program code, it is first judged whether the program code is a quantum computing program code or a classical computing program code. The code is sent to run in the quantum computing execution environment, where the quantum computing execution environment is determined according to the received execution environment information. The quantum computing execution environment includes quantum computers or quantum simulators, etc., and receives the quantum computing program in the quantum computing execution environment. The running result is the quantum computing result; if it is judged that the program code is a classical computing program code, run the classical computing program code in the computing node, and the computing node outputs the classical computing result, and then judge the computing based on the quantum computing result and the classical computing result Is it over? If it is over, the quantum calculation result and the classical calculation result will be combined and then the combined running result will be returned step by step. As shown in Figure 5, the computing node will return the combined running result to the network server, and the network server will then The running result of the program code is returned to the browser interface, that is, the running result of the program code is fed back to the user. If the calculation is not over, the quantum calculation and classical calculation are continued according to the flow in Figure 7 until the calculation is completed. Among them, the quantum computing engine can send the quantum computing program code to the quantum computer or quantum simulator through the application programming interface (application programming interface, API) gateway, as shown in Figure 7, the API gateway is used to manage the interface of remote quantum computing resources Call to send the quantum computing task to the corresponding quantum computing execution environment.

因此根据上述图2至图7的介绍可知,本申请实施例的量子计算方法相比于现有技术,可以支持复杂的量子与经典混合的程序的执行,且支持同一套代码在多个不同的量子执行环境中执行。对于同一套程序代码,用户在切换量子执行环境时无需手动修改代码或重新进行封装,只需在用户界面上选择相应的执行环境,即可实现指定不同的量子芯片或量子模拟器来执行量子计算;用户除了可以在用户界面上选择执行环境,还可以在用户界面上选择执行环境的参数,例如选择在该执行环境中执行程序代码时预留一定的量子计算资源,避免程序运行期间有其他的程序占用资源,提高运行效率。此外,本申请实施例的量子计算方法还支持将复杂的量子与经典混合的程序中的量子计算程序和经典计算程序进行区分,从而可以将量子计算程序发送到量子计算执行环境中运行,而将经典计算程序由本地的经典计算执行环境运行。Therefore, according to the introduction of the above-mentioned Figures 2 to 7, it can be known that the quantum computing method of the embodiment of the present application can support the execution of complex quantum and classical mixed programs, and support the same set of codes in multiple different Execute in the Quantum Execution Environment. For the same set of program code, the user does not need to manually modify the code or repackage when switching the quantum execution environment, just select the corresponding execution environment on the user interface, and then specify different quantum chips or quantum simulators to perform quantum calculations ; In addition to selecting the execution environment on the user interface, the user can also select the parameters of the execution environment on the user interface, such as choosing to reserve a certain amount of quantum computing resources when executing the program code in this execution environment, so as to avoid other problems during the running of the program. Programs take up resources and improve operating efficiency. In addition, the quantum computing method of the embodiment of the present application also supports the distinction between the quantum computing program and the classical computing program in the complex quantum and classical mixed program, so that the quantum computing program can be sent to the quantum computing execution environment to run, and the Classical computing programs are run by the local classical computing execution environment.

以下结合图8介绍本申请实施例的量子计算方法的具体过程。如图8所示,用户在用户界面进行登录,用户界面向网络服务器发起鉴权请求,验证用户是否有访问系统的权利,鉴权完成后,登录成功。用户在用户界面申请创建计算节点,用户界面将计算节点创建请求发送到网络服务器,网络服务器再将计算节点创建请求发送到计算集群子系统,计算集群子系统根据计算节点创建请求创建相应计算节点。用户在用户界面上创建自定义执行环境,创建自定义执行环境的过程可以参考上述图3和图4的描述,本申请实施例在此不再赘述,创建的自定义执行环境的配置文件被保存在本地,以便用户后续使用。用户在用户界面上创建项目,用户界面将创建项目请求发送到网络服务器,网络服务器自动生成该项目的配置文件,配置文件中写入了所有可选的后台执行环境的配置信息,包括系统默认提供的执行环境的配置信息和用户自定义执行环境的配置信息,网络服务器再将该项目的配置文件通过计算集群子系统发送到计算节点。用户在用户界面编写程序代码,编写完成后保存该程序代码,然后在用户界面上选择需要的执行环境,选择完成后用户提交该程序代码。用户界面发送程序代码运行请求、程序代码和执行环境信息到网络服务器,网络服务器再将程序代码运行请求、程序代码和执行环境信息通过计算集群子系统发送到计算节点,计算节点根据程序代码运行请求启动量子计算引擎。量子计算引擎从计算节点绑定的存储介质中获取项目的配置文件,根据配置文件获取该项目可选的多个执行环境信息,例如多个可选的执行环境为Type1 QPU、Type2 QPU和量子模拟器;然后量子计算引擎对程序代码进行区分,确定量子计算程序代码和经典计算程序代码,再根据获取的执行环境信息确定量子执行环境,例如为Type1 QPU,则量子计算引擎将经典计算程序代码发送到计算节点中进行计算,将量子计算程序代码编译后发送到Type1 QPU执行环境中进行计算。可选的,获取的执行环境信息还可以包括申请预留资源(例如100Qubit的预留资源),则量子计算引擎向Type1 QPU执行环境申请100Qubit的预留资源,如果Type1 QPU执行环境资源允许,且满足权限要求,则返回成功,并返回响应的sessionID,如此量子计算引擎将sessionID和量子计算程序代码一同发送到Type1 QPU执行环境中运行,且在程序代码运行期间可以不释放该100Qubit的预留资源,直到整个程序代码(包括量子计算程序代码和经典计算程序代码)运行完毕才释放该100Qubit的预留资源。Type1 QPU执行环境根据量子计算程序代码进行量子计算,计算完成后将量子计算结果发送给计算节点,计算节点根据经典计算程序代码进行计算,并得到经典计算结果,然后将量子计算结果和经典计算结果合并,以得到合并后的结果,最后将合并后的结果返回给用户界面。根据图8所示的方法,用户无需编写额外的适配代码,即可实现一套量子和经典混合的程序代码在多种不同的量子计算环境中运行,只需在基于浏览器或其他方式提供的用户界面上选择相应的执行环境即可实现不同执行环境的切换,此外,还可以在用户界面上配置执行环境的相应参数,可以方便的实现特殊配置的量子计算执行环境,例如程序运行中预留相应的计算资源等,使得本申请实施例的量子计算方法具有广泛的扩展空间。The specific process of the quantum computing method in the embodiment of the present application will be introduced below with reference to FIG. 8 . As shown in Figure 8, the user logs in on the user interface, and the user interface initiates an authentication request to the network server to verify whether the user has the right to access the system. After the authentication is completed, the login is successful. The user applies for creating a computing node in the user interface, the user interface sends the computing node creation request to the network server, and the network server sends the computing node creation request to the computing cluster subsystem, and the computing cluster subsystem creates the corresponding computing node according to the computing node creation request. The user creates a custom execution environment on the user interface. The process of creating a custom execution environment can refer to the descriptions of the above-mentioned Figures 3 and 4. The embodiment of the present application will not go into details here, and the configuration file of the created custom execution environment is saved. locally for subsequent use by users. When the user creates a project on the user interface, the user interface sends the project creation request to the web server, and the web server automatically generates the configuration file of the project, which contains all the configuration information of the optional background execution environment, including the default provided by the system. The configuration information of the execution environment and the configuration information of the user-defined execution environment, the network server then sends the configuration file of the project to the computing node through the computing cluster subsystem. The user writes the program code on the user interface, saves the program code after the writing is completed, and then selects the required execution environment on the user interface, and submits the program code after the selection is completed. The user interface sends the program code running request, program code and execution environment information to the network server, and the network server then sends the program code running request, program code and execution environment information to the computing node through the computing cluster subsystem, and the computing node runs the request according to the program code Start the quantum computing engine. The quantum computing engine obtains the configuration file of the project from the storage medium bound to the computing node, and obtains multiple optional execution environment information of the project according to the configuration file, for example, the multiple optional execution environments are Type1 QPU, Type2 QPU and quantum simulation Then the quantum computing engine distinguishes the program code, determines the quantum computing program code and the classical computing program code, and then determines the quantum execution environment according to the obtained execution environment information, such as Type1 QPU, then the quantum computing engine sends the classical computing program code to Go to the computing node for calculation, compile the quantum computing program code and send it to the Type1 QPU execution environment for calculation. Optionally, the obtained execution environment information may also include applying for reserved resources (for example, 100Qubit reserved resources), then the quantum computing engine applies to the Type1 QPU execution environment for 100Qubit reserved resources, if the Type1 QPU execution environment resources allow, and If the permission requirements are met, it will return success and return the corresponding sessionID. In this way, the quantum computing engine will send the sessionID and the quantum computing program code to the Type1 QPU execution environment to run, and the 100Qubit reserved resources may not be released during the running of the program code. , the reserved resource of 100 Qubit is not released until the entire program code (including the quantum computing program code and the classical computing program code) runs completely. The Type1 QPU execution environment performs quantum computing according to the quantum computing program code. After the calculation is completed, the quantum computing result is sent to the computing node. The computing node performs calculation according to the classical computing program code and obtains the classical computing result. merge to obtain the merged result, and finally return the merged result to the user interface. According to the method shown in Figure 8, users do not need to write additional adaptation codes to realize a set of mixed quantum and classical program codes running in a variety of different quantum computing environments. You can switch between different execution environments by selecting the corresponding execution environment on the user interface. In addition, you can also configure the corresponding parameters of the execution environment on the user interface, which can easily realize the special configuration of the quantum computing execution environment. Reserve corresponding computing resources, etc., so that the quantum computing method of the embodiment of the present application has a wide space for expansion.

上文结合附图对本申请实施例的方法进行了详细的描述,下面对本申请实施例的装置进行描述,应理解,本申请实施例的装置能够执行本申请实施例的方法的各个步骤,下面在介绍本申请实施例的装置时适当省略重复的描述。The method of the embodiment of the present application has been described in detail above with reference to the accompanying drawings, and the device of the embodiment of the present application is described below. It should be understood that the device of the embodiment of the present application can perform each step of the method of the embodiment of the present application. Repeated descriptions are appropriately omitted when introducing the devices of the embodiments of the present application.

图9为本申请实施例的量子计算装置的示意性框图,如图9所示,该量子计算装置不可获取单元901和处理单元902,以下进行简要介绍。FIG. 9 is a schematic block diagram of a quantum computing device according to an embodiment of the present application. As shown in FIG. 9 , the quantum computing device cannot acquire a unit 901 and a processing unit 902 , which will be briefly introduced below.

获取单元901,用于获取用户在用户界面提交的程序代码和代码运行请求的参数,代码运行请求的参数包括量子计算执行环境信息,量子计算执行环境信息为根据用户在用户界面上选择的量子计算执行环境生成。The obtaining unit 901 is configured to obtain the program code submitted by the user on the user interface and the parameters of the code running request, the parameters of the code running request include quantum computing execution environment information, and the quantum computing execution environment information is the quantum computing selected by the user on the user interface Execute environment generation.

处理单元902,用于将程序代码发送到量子计算执行环境信息对应的量子计算执行环境中运行,以得到运行结果。The processing unit 902 is configured to send the program code to the quantum computing execution environment corresponding to the quantum computing execution environment information to run, so as to obtain the running result.

输出单元903,用于将运行结果发送到用户界面。An output unit 903, configured to send the running result to the user interface.

在某些实现方式中,用户界面上包括一个或多个量子计算执行环境选项,一个或多个量子计算执行环境选项包括默认选项或用户自定义选项。In some implementations, the user interface includes one or more quantum computing execution environment options, and the one or more quantum computing execution environment options include default options or user-defined options.

在某些实现方式中,用户自定义选项为根据用户编辑的自定义量子计算执行环境的代码生成。In some implementations, the user-defined option is code generation from a user-edited custom quantum computing execution environment.

在某些实现方式中,一个或多个量子计算执行环境选项为根据用户在用户界面上选择的量子计算执行环境的配置选项确定,用户界面上包括多个配置选项。In some implementations, the one or more quantum computing execution environment options are determined according to the configuration options of the quantum computing execution environment selected by the user on the user interface, and the user interface includes multiple configuration options.

在某些实现方式中,用户界面上还包括一个或多个量子计算执行的参数选项,参数选项包括量子计算执行的预留资源,参数选项包括默认选项或用户自定义选项。In some implementation manners, the user interface further includes one or more parameter options for quantum computing execution, the parameter options include reserved resources for quantum computing execution, and the parameter options include default options or user-defined options.

在某些实现方式中,程序代码包括量子计算程序代码和经典计算程序代码,处理单元902具体用于:确定程序代码中的量子计算程序代码和经典计算程序代码;将量子计算程序代码发送到量子计算执行环境信息对应的量子计算执行环境中运行;将经典计算程序代码在经典计算执行环境中运行。In some implementations, the program codes include quantum computing program codes and classical computing program codes, and the processing unit 902 is specifically used to: determine the quantum computing program codes and classical computing program codes in the program codes; send the quantum computing program codes to the quantum Run in the quantum computing execution environment corresponding to the computing execution environment information; run the classical computing program code in the classical computing execution environment.

在某些实现方式中,经典计算执行环境包括运行在GPU、CPU或NPU上的容器或虚拟机。In some implementations, a classical computing execution environment includes containers or virtual machines running on GPUs, CPUs, or NPUs.

应理解,图9所示的量子计算的装置可以用于实现上述图2所示的量子计算的方法,其中获取单元901用于实现步骤201,处理单元902用于实现步骤202,图9所示的量子计算的装置还可以用于实现图5至图8所述的量子计算的方法,具体步骤可以参照上述对于图5至图8的描述,为了简洁,本申请在此不再赘述。It should be understood that the quantum computing device shown in FIG. 9 can be used to implement the quantum computing method shown in FIG. The quantum computing device can also be used to implement the quantum computing method described in FIG. 5 to FIG. 8 , and the specific steps can refer to the above description of FIG. 5 to FIG. 8 , and for the sake of brevity, the present application will not repeat them here.

应理解,图9所示的量子计算的装置为可以实现本申请实施例的方法的装置,既包括实现本申请实施例的量子计算的部分,也包括实现本申请实施例的经典计算的部分。It should be understood that the quantum computing device shown in FIG. 9 is a device that can implement the method of the embodiment of the present application, and includes both the part implementing the quantum computing of the embodiment of the present application and the part implementing the classical computing of the embodiment of the present application.

应理解的是,本申请实施例中的装置900可以由软件实现,例如,具有上述功能的计算机程序或指令来实现,相应计算机程序或指令可以存储在终端内部的存储器中,通过处理器读取该存储器内部的相应计算机程序或指令来实现上述功能。或者,本申请实施例中的装置900还可以由硬件来实现。其中处理单元902为处理器(如NPU、GPU、系统芯片中的处理器),获取单元901为数据接口。或者,本申请实施例中的装置900还可以由处理器和软件单元的结合实现。具体地,获取单元901可以为处理器的接口电路,用于获取用户在用户界面输入的程序代码和选择的执行环境信息,并发送给处理器接口电路。It should be understood that the apparatus 900 in the embodiment of the present application may be implemented by software, for example, a computer program or instruction having the above-mentioned functions, and the corresponding computer program or instruction may be stored in the internal memory of the terminal and read by the processor. The corresponding computer programs or instructions inside the memory realize the above functions. Alternatively, the apparatus 900 in the embodiment of the present application may also be implemented by hardware. The processing unit 902 is a processor (such as a processor in an NPU, GPU, or system chip), and the acquisition unit 901 is a data interface. Alternatively, the apparatus 900 in the embodiment of the present application may also be implemented by a combination of a processor and a software unit. Specifically, the obtaining unit 901 may be an interface circuit of the processor, configured to obtain the program code and the selected execution environment information input by the user on the user interface, and send them to the processor interface circuit.

图10示出了用于实现本申请实施例的量子计算方法的量子计算系统的示意图。如图10所示的系统1000可以分为量子计算部分1010和经典计算部分1020。量子计算部分1010是一种遵循量子力学规律进行高速数学和逻辑运算、存储和处理量子信息的物理装置,量子计算部分1010包括量子处理器1011、测量设备1012和外围控制器1013。经典计算部分1020包括经典处理器1021和存储器1022。存储器1022用于存储指令和/或代码,经典处理器1021用于运行存储器1022中运行的指令和/或代码,结合量子计算机部分实现量子计算。Fig. 10 shows a schematic diagram of a quantum computing system for implementing the quantum computing method of the embodiment of the present application. The system 1000 shown in FIG. 10 can be divided into a quantum computing part 1010 and a classical computing part 1020 . The quantum computing part 1010 is a physical device that follows the laws of quantum mechanics to perform high-speed mathematical and logical operations, and stores and processes quantum information. The classical computing part 1020 includes a classical processor 1021 and a memory 1022 . The memory 1022 is used to store instructions and/or codes, and the classical processor 1021 is used to run the instructions and/or codes running in the memory 1022, and realize quantum computing in combination with the quantum computer part.

经典处理器1021可以根据获取到的参数确定对应的量子线路。经典处理器1021可以根据确定的量子线路,控制量子计算部分1010中的外围控制器1013产生微波或激光等控制信号,操作在量子处理器1011上,实现对量子处理器1011的量子门操作,并控制量子计算部分1010中的测量设备1012对量子处理器1011生成的量子态进行测量。The classical processor 1021 may determine a corresponding quantum circuit according to the acquired parameters. The classical processor 1021 can control the peripheral controller 1013 in the quantum computing part 1010 to generate control signals such as microwaves or lasers according to the determined quantum circuit, and operate on the quantum processor 1011 to realize the quantum gate operation on the quantum processor 1011, and The measurement device 1012 in the quantum computing part 1010 is controlled to measure the quantum state generated by the quantum processor 1011 .

应理解,图10中的经典处理器1021既包括用于控制量子计算部分进行量子计算的处理器,也包括用于执行经典计算的处理器,因此经典计算部分还可以用于实现本申请实施例的经典计算,存储器1022存储有指令和/或代码,经典处理器1021用于运行存储器1022中运行的指令和/或代码,以实现对经典程序代码的计算。It should be understood that the classical processor 1021 in FIG. 10 includes both a processor for controlling the quantum computing part to perform quantum computing and a processor for performing classical computing, so the classical computing part can also be used to implement the embodiment of the present application Classical computing, the memory 1022 stores instructions and/or codes, and the classical processor 1021 is used to execute the instructions and/or codes running in the memory 1022, so as to realize the calculation of the classical program codes.

图10的量子计算系统1000还可以包括通信接口和总线(图中未示出),其中,图10中的量子计算部分和经典计算部分和通信接口可以通过总线实现彼此之间的通信连接。The quantum computing system 1000 in FIG. 10 may also include a communication interface and a bus (not shown in the figure), wherein, the quantum computing part and the classical computing part and the communication interface in FIG. 10 may realize communication connection between each other through the bus.

应理解,量子计算系统1000中的接口可以用于实现图9中的获取单元901和输出单元903的功能,经典处理器1021可以用于实现图9中处理单元902的功能。It should be understood that the interface in the quantum computing system 1000 can be used to realize the functions of the acquisition unit 901 and the output unit 903 in FIG. 9 , and the classical processor 1021 can be used to realize the functions of the processing unit 902 in FIG. 9 .

存储器1022可以是只读存储器(read only memory,ROM),静态存储设备,动态存储设备或者随机存取存储器(random access memory,RAM)。存储器1022可以存储程序,当存储器1022中存储的程序被经典处理器1021执行时,经典处理器1021用于执行本申请实施例的方法的各个步骤。The memory 1022 may be a read only memory (read only memory, ROM), a static storage device, a dynamic storage device or a random access memory (random access memory, RAM). The memory 1022 may store a program, and when the program stored in the memory 1022 is executed by the classical processor 1021, the classical processor 1021 is used to execute each step of the method in the embodiment of the present application.

具体地,经典处理器1021可用于执行图2所示的方法中的步骤202以及图5至图8所示的处理数据的过程。Specifically, the classic processor 1021 can be used to execute step 202 in the method shown in FIG. 2 and the process of processing data shown in FIGS. 5 to 8 .

当经典处理器1021执行步骤202以及图5至图8所示的处理数据的过程时,经典处理器1021可以通过通信接口从用户界面获取用户输入的程序代码和选择的执行环境信息,并将程序代码发送到量子计算执行环境信息对应的量子计算执行环境中运行。When the classic processor 1021 executes step 202 and the process of processing data shown in FIGS. The code is sent to run in the quantum computing execution environment corresponding to the quantum computing execution environment information.

经典处理器1021可以采用通用的中央处理器(central processing unit,CPU),微处理器,应用专用集成电路(application specific integrated circuit,ASIC),图形处理器(graphicsprocessing unit,GPU)或者一个或多个集成电路,用于执行相关程序,以实现本申请实施例的方法。The classic processor 1021 may be a general-purpose central processing unit (central processing unit, CPU), a microprocessor, an application specific integrated circuit (application specific integrated circuit, ASIC), a graphics processing unit (graphics processing unit, GPU) or one or more The integrated circuit is configured to execute related programs to implement the methods in the embodiments of the present application.

经典处理器1021还可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,本申请的方法的各个步骤可以通过经典处理器1021中的硬件的集成逻辑电路或者软件形式的指令完成。The classical processor 1021 may also be an integrated circuit chip, which has signal processing capabilities. In the implementation process, each step of the method of the present application may be completed by an integrated logic circuit of hardware in the classic processor 1021 or instructions in the form of software.

上述经典处理器1021还可以是通用处理器、数字信号处理器(digital signalprocessing,DSP)、专用集成电路(ASIC)、现成可编程门阵列(field programmable gatearray,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件单元组合执行完成。软件单元可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器1022,经典处理器1021读取存储器1022中的信息,结合其硬件完成装置中包括的单元所需执行的功能,或者执行本申请方法实施例的方法。The above-mentioned classical processor 1021 may also be a general-purpose processor, a digital signal processor (digital signal processing, DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. Various methods, steps, and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like. The steps of the methods disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software units in the decoding processor. The software unit may be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register. The storage medium is located in the memory 1022, and the classical processor 1021 reads the information in the memory 1022, and combines its hardware to complete the functions required by the units included in the device, or execute the method of the method embodiment of the present application.

通信接口使用例如但不限于收发器一类的收发装置,来实现量子计算系统1000与其他设备或通信网络之间的通信。例如,可以通过通信接口从用户界面获取用户在待设置项目中输入的数据。The communication interface uses a transceiver device such as but not limited to a transceiver to implement communication between the quantum computing system 1000 and other devices or communication networks. For example, the data input by the user in the items to be set can be obtained from the user interface through the communication interface.

总线可包括在量子计算系统1000各个部件(例如,存储器1022、经典处理器1021、通信接口)之间传送信息的通路。A bus may include pathways for transferring information between various components of quantum computing system 1000 (eg, memory 1022, classical processor 1021, communication interfaces).

本申请实施例还提供了一种芯片,该芯片包括:逻辑电路,逻辑电路用于与输入/输出接口耦合,通过输入/输出接口传输数据,以执行上述图2至图8的方法。The embodiment of the present application also provides a chip, the chip includes: a logic circuit, the logic circuit is used to couple with the input/output interface, and transmit data through the input/output interface, so as to execute the above-mentioned methods in FIG. 2 to FIG. 8 .

本申请实施例还提供了一种计算机可读介质,该计算机可读介质存储有程序代码,当计算机程序代码在计算机上运行时,使得计算机执行上述图2至图8的方法。The embodiment of the present application also provides a computer-readable medium, the computer-readable medium stores program codes, and when the computer program codes run on the computer, the computer executes the above-mentioned methods in FIG. 2 to FIG. 8 .

本申请实施例还本申请实施例提供一种计算机系统,该计算机系统包括量子计算机和经典计算机,该经典计算机用于控制量子计算机,使得量子计算机实现图2至图8方法。The embodiment of the present application also provides a computer system in the embodiment of the present application, the computer system includes a quantum computer and a classical computer, and the classical computer is used to control the quantum computer so that the quantum computer implements the methods shown in FIG. 2 to FIG. 8 .

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.

在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。为避免重复,这里不再详细描述。In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software. The methods disclosed in the embodiments of the present application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register. The storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with its hardware. To avoid repetition, no detailed description is given here.

在本说明书中使用的术语“部件”、“模块”、“系统”等用于表示计算机相关的实体、硬件、固件、硬件和软件的组合、软件、或执行中的软件。例如,部件可以是但不限于,在处理器上运行的进程、处理器、对象、可执行文件、执行线程、程序和/或计算机。通过图示,在计算设备上运行的应用和计算设备都可以是部件。一个或多个部件可驻留在进程和/或执行线程中,部件可位于一个计算机上和/或分布在2个或更多个计算机之间。此外,这些部件可从在上面存储有各种数据结构的各种计算机可读介质执行。部件可例如根据具有一个或多个数据分组(例如来自与本地系统、分布式系统和/或网络间的另一部件交互的二个部件的数据,例如通过信号与其它系统交互的互联网)的信号通过本地和/或远程进程来通信。The terms "component", "module", "system" and the like are used in this specification to refer to a computer-related entity, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a component may be, but is not limited to being, a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and/or a computer. By way of illustration, both an application running on a computing device and the computing device can be components. One or more components can reside within a process and/or thread of execution and a component can be localized on one computer and/or distributed between two or more computers. In addition, these components can execute from various computer readable media having various data structures stored thereon. A component may, for example, be based on a signal having one or more packets of data (e.g., data from two components interacting with another component between a local system, a distributed system, and/or a network, such as the Internet via a signal interacting with other systems). Communicate through local and/or remote processes.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.

所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions described above are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other various media that can store program codes. .

以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above is only a specific implementation of the application, but the scope of protection of the application is not limited thereto. Anyone familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the application. Should be covered within the protection scope of this application. Therefore, the protection scope of the present application should be determined by the protection scope of the claims.

Claims (16)

1. A quantum computing method, comprising:
acquiring parameters of a program code and a code operation request submitted by a user on a user interface, wherein the parameters of the code operation request comprise quantum computing execution environment information, and the quantum computing execution environment information is generated according to quantum computing execution environments selected by the user on the user interface;
transmitting the program codes to a quantum computing execution environment corresponding to the quantum computing execution environment information to operate so as to obtain an operation result;
and sending the operation result to the user interface.
2. The method of claim 1, wherein the user interface includes one or more quantum computing execution environment options thereon, the one or more quantum computing execution environment options including default options or user-defined options.
3. The method of claim 2, wherein the user-defined option is code generation from a user-edited custom quantum computing execution environment.
4. A method according to claim 2 or 3, wherein the one or more quantum computing execution environment options are determined from configuration options of a quantum computing execution environment selected by a user on the user interface, the user interface comprising a plurality of the configuration options thereon.
5. The method of any of claims 2 to 4, further comprising one or more quantum computing execution parameter options on the user interface, the parameter options comprising reserved resources for quantum computing execution, the parameter options comprising default options or user-defined options.
6. The method of any of claims 1 to 5, wherein the program code comprises quantum computing program code and classical computing program code, the sending the program code to run in a quantum computing execution environment corresponding to the quantum computing execution environment information, comprising:
determining quantum computing program code and classical computing program code in the program code;
transmitting the quantum computing program codes to a quantum computing execution environment corresponding to the quantum computing execution environment information for operation;
the classical computing program code is run in a classical computing execution environment.
7. The method of claim 6, wherein the classical computing execution environment comprises a container or virtual machine running on a GPU, CPU, or NPU.
8. A quantum computing device, comprising:
The system comprises an acquisition unit, a code processing unit and a code processing unit, wherein the acquisition unit is used for acquiring parameters of a program code and a code operation request submitted by a user on a user interface, the parameters of the code operation request comprise quantum computing execution environment information, and the quantum computing execution environment information is generated according to quantum computing execution environment selected by the user on the user interface;
the processing unit is used for sending the program codes to the quantum computing execution environment corresponding to the quantum computing execution environment information to operate so as to obtain an operation result;
and the output unit is used for sending the operation result to the user interface.
9. The apparatus of claim 8, wherein one or more quantum computing execution environment options are included on the user interface, the one or more quantum computing execution environment options including default options or user-defined options.
10. The apparatus of claim 9, wherein the user-defined option is code generation from a user-edited custom quantum computing execution environment.
11. The apparatus of claim 8 or 9, wherein the one or more quantum computing execution environment options are determined from configuration options of a quantum computing execution environment selected by a user on the user interface, the user interface including a plurality of the configuration options thereon.
12. The apparatus of any of claims 9 to 11, further comprising one or more quantum computing execution parameter options on the user interface, the parameter options comprising reserved resources for quantum computing execution, the parameter options comprising default options or user-defined options.
13. The apparatus according to any one of claims 8 to 12, characterized in that the program code comprises quantum computing program code and classical computing program code, the processing unit being in particular for:
determining quantum computing program code and classical computing program code in the program code;
transmitting the quantum computing program codes to a quantum computing execution environment corresponding to the quantum computing execution environment information for operation;
the classical computing program code is run in a classical computing execution environment.
14. The apparatus of claim 13, wherein the classical computing execution environment comprises a container or virtual machine running on a GPU, CPU, or NPU.
15. A chip, comprising: logic circuitry for coupling with an input/output interface through which data is transferred to perform the method of any one of claims 1 to 7.
16. A computer readable medium, characterized in that the computer readable medium stores a program code which, when run on a computer, causes the computer to perform the method of any of claims 1 to 7.
CN202210091299.0A 2022-01-26 2022-01-26 Quantum computing method and device Pending CN116542338A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210091299.0A CN116542338A (en) 2022-01-26 2022-01-26 Quantum computing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210091299.0A CN116542338A (en) 2022-01-26 2022-01-26 Quantum computing method and device

Publications (1)

Publication Number Publication Date
CN116542338A true CN116542338A (en) 2023-08-04

Family

ID=87456554

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210091299.0A Pending CN116542338A (en) 2022-01-26 2022-01-26 Quantum computing method and device

Country Status (1)

Country Link
CN (1) CN116542338A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230186141A1 (en) * 2021-12-11 2023-06-15 International Business Machines Corporation Visual presentation of quantum-classical interface in a user experience
CN117850996A (en) * 2023-12-12 2024-04-09 天翼云科技有限公司 A fusion computing method and system for high-performance computing power and quantum computing power of cloud platforms

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110055712A1 (en) * 2009-08-31 2011-03-03 Accenture Global Services Gmbh Generic, one-click interface aspects of cloud console
US20170116038A1 (en) * 2015-10-27 2017-04-27 International Business Machines Corporation User interface and system supporting user decision making and readjustments in computer-executable job allocations in the cloud
CN107657172A (en) * 2016-07-25 2018-02-02 腾讯科技(深圳)有限公司 Code process method, apparatus and system
CN111258569A (en) * 2020-01-09 2020-06-09 卓望数码技术(深圳)有限公司 Webpage component editing method, device, equipment and computer readable storage medium
CN111612152A (en) * 2020-05-27 2020-09-01 济南浪潮高新科技投资发展有限公司 Simulation control method and system of quantum computer and related components
CN112465146A (en) * 2020-11-19 2021-03-09 苏州浪潮智能科技有限公司 Quantum and classical hybrid cloud platform and task execution method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110055712A1 (en) * 2009-08-31 2011-03-03 Accenture Global Services Gmbh Generic, one-click interface aspects of cloud console
US20170116038A1 (en) * 2015-10-27 2017-04-27 International Business Machines Corporation User interface and system supporting user decision making and readjustments in computer-executable job allocations in the cloud
CN107657172A (en) * 2016-07-25 2018-02-02 腾讯科技(深圳)有限公司 Code process method, apparatus and system
CN111258569A (en) * 2020-01-09 2020-06-09 卓望数码技术(深圳)有限公司 Webpage component editing method, device, equipment and computer readable storage medium
CN111612152A (en) * 2020-05-27 2020-09-01 济南浪潮高新科技投资发展有限公司 Simulation control method and system of quantum computer and related components
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
卞加柱: "参照AUTOSAR架构的柴油车后处理集成电控系统软件设计与研究", 中国优秀硕士电子期刊网, no. 02, 15 February 2021 (2021-02-15) *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230186141A1 (en) * 2021-12-11 2023-06-15 International Business Machines Corporation Visual presentation of quantum-classical interface in a user experience
US12327165B2 (en) * 2021-12-11 2025-06-10 International Business Machines Corporation Visual presentation of quantum-classical interface in a user experience
CN117850996A (en) * 2023-12-12 2024-04-09 天翼云科技有限公司 A fusion computing method and system for high-performance computing power and quantum computing power of cloud platforms
WO2025124434A1 (en) * 2023-12-12 2025-06-19 天翼云科技有限公司 Fusion computing method and system combining cloud platform high-performance computing power and quantum computing power

Similar Documents

Publication Publication Date Title
Pompili et al. Experimental demonstration of entanglement delivery using a quantum network stack
CN110383795B (en) Server-free cloud management platform based on service graph
JP5777692B2 (en) Remote system management using command line environment
WO2022222537A1 (en) Ai application deployment method, and related platform, cluster, medium and program product
US20130227560A1 (en) Mechanism for System Resource Sharing in a Multi-Tenant Platform-as-a-Service (PaaS) Environment in a Cloud Computing System
JP5259924B2 (en) Dynamic service generation for legacy components
CN112350978A (en) Service processing method, system, device and storage medium
US10324701B1 (en) Rapid deployment of computing instances
Quevedo et al. Evaluating apache openwhisk-faas
CN110895471A (en) Installation package generation method, device, medium and electronic device
CN114443215A (en) Business application deployment method, apparatus, computer equipment and storage medium
CN111427665A (en) A quantum application cloud platform and processing method for quantum computing tasks
CN116542338A (en) Quantum computing method and device
CN115202729A (en) Container service-based mirror image generation method, device, equipment and medium
CN113050940A (en) Method for previewing small program, related device and computer program product
US20230266996A1 (en) Distributed ai platform mesh for machine learning workflows
JP2018072907A (en) Information processing system
CN105141632A (en) Method and device used for checking pages
CN113127361B (en) Application development method and device, electronic equipment and storage medium
WO2024082985A1 (en) Unloading card provided with accelerator
WO2023093885A1 (en) Cloud technology-based graphic program online development method and system, and related device
CN115396441A (en) A kind of Kubernetes multi-cluster management method, device, equipment, storage medium
US12438770B2 (en) System and method for customization of onboarding process
US20210081254A1 (en) Dynamic integration flows in hybrid cloud environments
CN113961194B (en) Flutter cross-application-based engineering construction method, system, terminal and medium

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