WO2024125325A1 - 量子计算的方法和装置 - Google Patents

量子计算的方法和装置 Download PDF

Info

Publication number
WO2024125325A1
WO2024125325A1 PCT/CN2023/135883 CN2023135883W WO2024125325A1 WO 2024125325 A1 WO2024125325 A1 WO 2024125325A1 CN 2023135883 W CN2023135883 W CN 2023135883W WO 2024125325 A1 WO2024125325 A1 WO 2024125325A1
Authority
WO
WIPO (PCT)
Prior art keywords
quantum
result
electronic device
measurement
circuit
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.)
Ceased
Application number
PCT/CN2023/135883
Other languages
English (en)
French (fr)
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 EP23902522.4A priority Critical patent/EP4625269A4/en
Publication of WO2024125325A1 publication Critical patent/WO2024125325A1/zh
Anticipated expiration legal-status Critical
Ceased 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
    • G06N10/20Models of quantum computing, e.g. quantum circuits or universal quantum computers
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • G06N10/60Quantum algorithms, e.g. based on quantum optimisation, quantum Fourier or Hadamard transforms
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/04817Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance using icons
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/0482Interaction with lists of selectable items, e.g. menus
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04842Selection of displayed objects or displayed text elements
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0486Drag-and-drop
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • G06N10/80Quantum programming, e.g. interfaces, languages or software-development kits for creating or handling programs capable of running on quantum computers; Platforms for simulating or accessing quantum computers, e.g. cloud-based quantum computing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • G06N10/40Physical realisations or architectures of quantum processors or components for manipulating qubits, e.g. qubit coupling or qubit control

Definitions

  • the embodiments of the present application relate to the quantum field, and in particular, to a method and device for quantum computing.
  • Quantum computing is a new type of computing method that utilizes quantum properties such as quantum superposition and quantum entanglement.
  • quantum computing there is a quantum circuit writer at the bottom of the interface, which contains symbols representing quantum operations and linear elements representing quantum bits. Users can drag and drop symbols representing quantum operations to the corresponding quantum bits, and then the quantum circuit can be translated into a script language (which can be understood as a computer language for quantum operations). Alternatively, user commands provided through the command line interface can also be converted into quantum circuits, which can be translated into script languages and dynamically generate graphical representations.
  • the quantum elements representing quantum operations only provide probability measurements in a single direction (generally the Z direction).
  • Another way of quantum computing is to obtain two quantum circuits, then compile and run the first quantum circuit first, and then dynamically compile and run the second quantum circuit based on the running results of the first quantum circuit.
  • the two quantum circuits can run on different hardware.
  • this method converts a single parameter-containing quantum circuit into multiple quantum circuits for operation, which requires repeated compilation and running of quantum circuits, and the operation is complicated.
  • the returned results are all the probability results of the quantum state in a single direction (generally the Z direction). If you want to get the results in other directions, you need to rotate the projection in the X direction or Y direction to the Z direction and then measure it.
  • the embodiments of the present application provide a method and apparatus for quantum computing, which can simplify the operation process of repeated compilation and can also return operation results in multiple directions in one operation, without the need for the user to repeatedly send quantum circuits for desired measurements in different directions.
  • a method of quantum computing which is applied to a first electronic device, and includes: splitting a first quantum circuit to obtain n second quantum circuits; sending the n second quantum circuits to a second electronic device; and receiving an operation result sent by the second electronic device, wherein the operation result indicates a result obtained by running the n second quantum circuits.
  • the first electronic device can split the first quantum circuit and send n second quantum circuits obtained after the splitting to the second electronic device, so that the second electronic device can operate the n second quantum circuits, and the first electronic device can receive the operation result sent by the second electronic device, and the operation result indicates the result obtained by operating the n second quantum circuits.
  • the solution provided by the embodiment of the present application can not only simplify the operation process of repeated compilation, but also return the operation results of multiple directions in one operation, without the need for the user to repeatedly send quantum circuits for desired measurements in different directions.
  • the first quantum circuit includes quantum measurements in n directions, and any second quantum circuit among the n second quantum circuits includes quantum measurements in one direction among the n directions.
  • the directions of quantum measurements in different second quantum circuits are different.
  • the first quantum circuit includes quantum measurements in n directions.
  • n second quantum circuits can be obtained, and each second quantum circuit includes quantum measurements in one direction, which can ensure the accuracy of splitting the first quantum circuit, and is conducive to the second electronic device improving the accuracy of the n first operation results obtained after running the n second quantum circuits.
  • splitting the first quantum circuit includes: splitting the first quantum circuit according to a measurement operator corresponding to the first quantum circuit.
  • the solution provided in the embodiment of the present application can split the first quantum circuit according to the measurement operator corresponding to the first quantum circuit, which can improve the accuracy of splitting the first quantum circuit, and further improve the accuracy of the second electronic device running n quantum circuits.
  • the accuracy of the n first run results obtained after two quantum circuits.
  • the measurement operators corresponding to the first quantum circuit include M
  • the splitting of the first quantum circuit according to the measurement operators corresponding to the first quantum circuit includes: for the jth measurement operator, adding the jth measurement operator to the measurement operator set, where j is any value less than or equal to M; for the kth measurement operator, determining whether there is a measurement operator with the same quantum bit as the kth measurement operator and a different direction in the measurement operator set, where k traverses 1 to M and k ⁇ j; and according to the determination result, merging the kth measurement operator with the measurement operator already existing in the measurement operator set, or adding the kth measurement operator to the measurement operator set.
  • the first electronic device can add the j-th measurement operator to the measurement operator set, and for the k-th measurement operator, the first electronic device can determine whether there is a measurement operator with the same quantum bit as the k-th measurement operator and a different direction in the measurement operator set, and perform further operations based on the determination result to split the first quantum circuit.
  • the number of second quantum circuits obtained after splitting the first quantum circuit by this method is the minimum, thereby ensuring that the second electronic device runs the minimum number of second quantum circuits, reducing the running time and improving efficiency.
  • merging the kth measurement operator with the measurement operator already existing in the measurement operator set according to the judgment result, or adding the kth measurement operator to the measurement operator set includes: if there is a measurement operator with the same quantum bit as the kth measurement operator and a different direction in the measurement operator set, adding the kth measurement operator to the measurement operator set; if there is no measurement operator with the same quantum bit as the kth measurement operator and/or a different direction in the measurement operator set, merging the kth measurement operator with the measurement operator already existing in the measurement operator set.
  • the first electronic device may add the kth measurement operator to the measurement operator set; if there does not exist a measurement operator with the same quantum bit as the kth measurement operator and/or a different direction in the measurement operator set, the first electronic device may merge the kth measurement operator with the measurement operator already existing in the measurement operator set to split the first quantum circuit.
  • the number of second quantum circuits obtained after splitting the first quantum circuit by this method is minimized, thereby ensuring that the second electronic device runs the least number of second quantum circuits, reducing the running time and improving the efficiency.
  • the first quantum circuit includes a quantum operation including a first parameter, and a specific value of the first parameter is variable.
  • the first quantum circuit may include a quantum operation including a first parameter, and the specific value of the first parameter is variable.
  • the method provided in the present application can obtain different quantum circuits by changing the specific value of the parameter, thereby improving flexibility and diversity.
  • the quantum operation containing the first parameter includes multiple quantum operations
  • the first quantum circuit also includes a quantum operation containing a second parameter
  • the quantum operation containing the second parameter is obtained through a combination operation gate
  • the combination operation gate is a combination gate including the multiple quantum operations.
  • the first quantum circuit may further include a quantum operation containing a second parameter, that is, the first quantum circuit may include a quantum operation containing the first parameter and a quantum operation containing the second parameter, and the quantum operation containing the second parameter is obtained through a combined operation gate. Since the quantum operation containing the second parameter in the first quantum circuit is obtained through a combined operation gate, compared with the solution in the prior art that requires the user to drag each quantum operation to the quantum circuit separately, the solution provided by the embodiment of the present application can simplify the user's operation.
  • the operation result includes n first operation results or a first combination result determined based on the n first operation results, and the n first operation results are results obtained by the second electronic device running the n second quantum circuits.
  • the operation result includes n first operation results
  • the method further includes: determining a first combination result according to the n first operation results and the coefficients of the corresponding measurement operators in the first quantum circuit.
  • the first electronic device can determine the first combination result according to the n first operation results and the coefficients of the corresponding measurement operators in the first quantum circuit. Different first combination results can be obtained by setting different coefficients, which can improve the flexibility of quantum computing.
  • the method further includes: receiving an operation of updating the first parameter by a user for the wth time, and sending a second quantum circuit after updating the first parameter to a second electronic device, where w starts to take values from 1; receiving an operation result after the (w+1)th operation sent by the second electronic device, where the operation result after the (w+1)th operation includes n (w+1)th operation results or (w+1)th combination results, and the (w+1)th combination result is obtained based on the n (w+1)th operation results; judging whether the (w+1)th combination result converges; and when the (w+1)th combination result converges, displaying the target result and the target parameter, The target result is the combination result with the smallest value, and the target parameter is the parameter corresponding to the combination result with the smallest value.
  • the user can update the first parameter multiple times, the first electronic device can send the second quantum circuit after the wth update to the second electronic device, and receive the operation result after the (w+1)th operation sent by the second electronic device; after receiving the operation result after the (w+1)th operation, the first electronic device can determine whether the (w+1)th combination result (wherein the (w+1)th combination result is obtained based on the n (w+1)th operation results) converges, and display the target result and target parameter when the (w+1)th combination result converges. Since the user can update the first parameter in the first quantum circuit multiple times, the second electronic device can respectively run the second quantum circuit after each update, and send the operation result to the first electronic device.
  • the first electronic device After receiving the operation result each time, the first electronic device can determine whether the combination result (the combination result may be the operation result, or may be the result obtained based on the operation result) converges, and display the target result and target parameter when the combination result converges.
  • the solution provided in the embodiment of the present application can be calculated through an iterative operation method. Compared with the prior art where the iterative operation method cannot be used because the constructed circuit is a fixed circuit, the solution provided in the embodiment of the present application can optimize the parameters of the quantum circuit to achieve the best measurement result.
  • the method further includes: in response to the first operation of the user, displaying the n second quantum circuits.
  • a first electronic device in response to a first operation of a user, can display n second quantum circuits, and can show the specific adaptation made by the second electronic device to run a variational quantum algorithm, so that the user can intuitively see the underlying operating logic and enhance the perception of quantum hardware.
  • a method of quantum computing which is applied to a second electronic device, and includes: receiving n second quantum circuits sent by a first electronic device, where the n quantum circuits are quantum circuits obtained by splitting the first quantum circuit; running the n second quantum circuits to obtain n first running results; and sending the running results to the first electronic device, where the running results indicate results obtained by running the n second quantum circuits.
  • the second electronic device can receive n second quantum circuits sent by the first electronic device, and obtain n first operation results after running the n second quantum circuits.
  • the solution provided in the embodiment of the present application can not only simplify the operation process of repeated compilation, but also return the operation results of multiple directions in one operation, without the need for the user to repeatedly send quantum circuits for desired measurements in different directions.
  • the first quantum circuit includes quantum measurements in n directions
  • the second quantum circuit includes quantum measurements in one direction
  • the first quantum circuit includes quantum measurements in n directions.
  • n second quantum circuits can be obtained, and each second quantum circuit includes quantum measurements in one direction, which is conducive to improving the accuracy of the first electronic device splitting the first quantum circuit, thereby improving the accuracy of the n first operation results obtained after the second electronic device runs the n second quantum circuits.
  • the first quantum circuit includes a quantum operation including a first parameter, and a specific value of the first parameter is variable.
  • the first quantum circuit may include a quantum operation including a first parameter, and the specific value of the first parameter is variable.
  • the method provided in the present application can obtain different quantum circuits by changing the specific value of the parameter, thereby improving flexibility and diversity.
  • the quantum operation containing the first parameter includes multiple quantum operations
  • the first quantum circuit also includes a quantum operation containing a second parameter
  • the quantum operation containing the second parameter is obtained through a combination operation gate
  • the combination operation gate is a combination gate including the multiple quantum operations.
  • the first quantum circuit may further include a quantum operation containing a second parameter, that is, the first quantum circuit may include a quantum operation containing the first parameter and a quantum operation containing the second parameter, and the quantum operation containing the second parameter is obtained through a combined operation gate. Since the quantum operation containing the second parameter in the first quantum circuit is obtained through a combined operation gate, compared with the solution in the prior art that requires the user to drag each quantum operation to the quantum circuit separately, the solution provided by the embodiment of the present application can simplify the user's operation.
  • the operation result includes the n first operation results or the first combination results
  • the n first operation results are the results obtained by the second electronic device running the n second quantum circuits
  • the first combination result is obtained based on the n first operation results.
  • the first combination result is determined based on the n first operation results and the coefficients of the corresponding measurement operators in the first quantum circuit.
  • the first combination result can be based on n first
  • the running result is determined by the coefficient of the corresponding measurement operator in the first quantum circuit. Different first combination results can be obtained by setting different coefficients, which can improve the flexibility of quantum computing.
  • the method also includes: receiving a second quantum circuit after the first parameter is updated for the wth time and sent by the first electronic device, where w starts from 1; running the second quantum circuit after the first parameter is updated for the wth time to obtain n (w+1)th running results; and sending the running results after the (w+1)th running to the first electronic device, where the running results after the (w+1)th running include n (w+1)th running results or (w+1)th combination results, and the (w+1)th combination result is obtained based on the n (w+1)th running results.
  • the second electronic device can receive the second quantum circuit after the wth update sent by the first electronic device, and run the second quantum circuit after the first parameter is updated for the wth time to obtain n (w+1)th running results, and then send the running results after the (w+1)th running to the first electronic device; so that the first electronic device can judge whether the (w+1)th combination result converges according to the running results after the (w+1)th running of the received second electronic device, and display the target result and target parameter when the (w+1)th combination result converges.
  • the second electronic device can run the second quantum circuit after each update respectively, and send the running results to the first electronic device, so that the first electronic device can judge whether the combination result (the combination result may be the running result, or the result obtained based on the running result) converges after each receiving of the running results, and display the target result and target parameter when the combination result converges.
  • the solution provided in the embodiment of the present application can be calculated through an iterative operation method. Compared with the prior art where the iterative operation method cannot be used because the constructed circuit is a fixed circuit, the solution provided in the embodiment of the present application can optimize the parameters of the quantum circuit to achieve the best measurement result.
  • a device which includes a module or unit corresponding to a method for executing any possible implementation of the first aspect or the second aspect.
  • a device comprising: one or more processors; a memory; one or more applications; and one or more computer programs.
  • the one or more computer programs are stored in the memory, and the one or more computer programs include instructions.
  • the device When the instructions are executed by the device, the device performs the method in any possible implementation of the first aspect or the second aspect.
  • a chip system comprising at least one processor.
  • program instructions are executed in the at least one processor, the function of the method in any possible implementation of the first aspect or any possible implementation of the second aspect is implemented on the electronic device.
  • a computer storage medium comprising computer instructions.
  • the computer instructions When the computer instructions are executed on an electronic device, the electronic device executes a method in any possible implementation of the first aspect or the second aspect.
  • a computer program product is provided.
  • the computer program product runs on an electronic device, the electronic device executes a method in any possible design of the first aspect or any possible design of the second aspect.
  • FIG. 1 is a schematic diagram of a model to which the present application can be applied.
  • FIG. 2 is a schematic diagram of a GUI provided in an embodiment of the present application.
  • FIG3 is a schematic diagram of a quantum circuit provided in an embodiment of the present application.
  • FIG. 4 is a schematic diagram of another GUI provided in an embodiment of the present application.
  • FIG5 is a schematic diagram of a quantum computing method provided in an embodiment of the present application.
  • FIG6 is a schematic diagram of a method for adding quantum measurement to a quantum bit provided in an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a parameter-containing subcircuit provided in an embodiment of the present application.
  • FIG8 is a schematic diagram of a method for calculating a measurement operator set provided in an embodiment of the present application.
  • FIG9 is a schematic diagram of two actual circuits running on hardware obtained by decomposing the quantum circuit of FIG7 according to an embodiment of the present application.
  • FIG. 10 is a schematic diagram of another parameter-containing subcircuit provided in an embodiment of the present application.
  • FIG11 is a schematic diagram of two actual circuits running on hardware obtained by decomposing the quantum circuit of FIG10 according to an embodiment of the present application.
  • FIG12 is a schematic diagram of a quantum computing method provided in an embodiment of the present application.
  • FIG13 is a schematic block diagram of a quantum computing device proposed in an embodiment of the present application.
  • FIG14 is a schematic block diagram of another quantum computing device proposed in an embodiment of the present application.
  • the technical solution of the embodiment of the present application can be applied to various computer devices, which can be terminal devices, such as mobile phones, tablet computers, computers with wireless transceiver functions, and wireless terminals used in scenarios such as virtual reality (VR), augmented reality (AR), industrial control, self-driving, remote medical, smart grid, transportation safety, smart city, and smart home.
  • terminal devices such as mobile phones, tablet computers, computers with wireless transceiver functions, and wireless terminals used in scenarios such as virtual reality (VR), augmented reality (AR), industrial control, self-driving, remote medical, smart grid, transportation safety, smart city, and smart home.
  • terminal devices such as mobile phones, tablet computers, computers with wireless transceiver functions
  • wireless terminals used in scenarios such as virtual reality (VR), augmented reality (AR), industrial control, self-driving, remote medical, smart grid, transportation safety, smart city, and smart home.
  • the aforementioned terminal devices and chips applicable to the aforementioned terminal devices are collectively referred to as terminal devices.
  • the computer device may also be a network device, such as a server in a data center, a home base station, an access point (AP) in a wireless fidelity (WIFI) system, a wireless relay node, a wireless backhaul node, a transmission point (TP) or a transmission and reception point (TRP), etc., or a component or a part of a base station, such as a central unit (CU), a distributed unit (DU) or a baseband unit (BBU).
  • a network device may refer to the network device itself, or it may be a chip used in the network device to complete the wireless communication processing function.
  • the terminal device or network device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer.
  • the hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and a memory (also called main memory).
  • the operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux operating system, Unix operating system, Android operating system, iOS operating system, or Windows operating system.
  • the application layer includes applications such as browsers, address books, word processing software, and instant messaging software.
  • computer-readable storage media may include, but are not limited to: magnetic storage devices (e.g., hard disks, floppy disks, or tapes, etc.), optical disks (e.g., compact discs (CDs), digital versatile discs (DVDs), etc.), smart cards, and flash memory devices (e.g., erasable programmable read-only memory (EPROM), cards, sticks, or key drives, etc.).
  • magnetic storage devices e.g., hard disks, floppy disks, or tapes, etc.
  • optical disks e.g., compact discs (CDs), digital versatile discs (DVDs), etc.
  • smart cards e.g., erasable programmable read-only memory (EPROM), cards, sticks, or key drives, etc.
  • EPROM erasable programmable read-only memory
  • various storage media described herein may represent one or more devices and/or other machine-readable storage media for storing information.
  • machine-readable storage medium may include, but is not limited to, wireless channels and various other media capable of storing, containing and/or carrying instructions and/or data.
  • first, second, and third in the embodiments of the present application are only for distinction and should not constitute any limitation to the present application.
  • first information and second information in the embodiments of the present application refer to information transmitted between the network device and the terminal device.
  • the size of the serial number of each process does not mean the order of execution.
  • the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
  • pre-definition and the like can be implemented by pre-saving corresponding codes, tables or other methods that can be used to indicate relevant information in devices (for example, including terminal devices and network devices).
  • the present application does not limit its specific implementation method, such as the preset rules and preset constants in the embodiments of the present application.
  • a and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone.
  • the character "/" generally indicates that the associated objects are in an "or” relationship.
  • Quantum computing is a new type of computing that utilizes quantum properties such as quantum superposition and quantum entanglement. Similar to traditional computers based on transistor gate circuits, quantum circuits composed of quantum gates can also be used to implement quantum computing. Specific quantum circuits construct quantum algorithms. Common classical quantum algorithms include the prime factorization algorithm proposed by Shor, the database search algorithm proposed by Grover, and the Harrow-Hassidim-Lloyd (HHL) linear equations solution algorithm. The common feature of these quantum algorithms is that they utilize specific quantum circuits, and the results can be obtained by running them once, and the entire process does not require the participation of classical computing. However, since there is no real universal quantum computer on hardware at present, the application of these quantum algorithms is extremely limited.
  • NISQ intermediate-scale quantum computing
  • Quantum computer gives full play to its computing speed advantage and quickly completes some calculation results that are difficult for classical computers to handle.
  • Common classical-quantum hybrid algorithms include quantum approximate optimization algorithm (QAOA), variational quantum eigensolver (VQE), and neural network training using quantum circuits.
  • Cloud services can be understood as follows: an interactive interface and a command line interface are provided on the web page. Users can use these two methods to write quantum circuits (users can write according to predetermined rules when writing quantum circuits. The predetermined rules may be operations that require measurement of a certain quantum bit), and then send them to the quantum computer on the server side.
  • the quantum computer executes the user's code command and returns the result to the user.
  • the result returned each time is in a single direction.
  • what is returned is the projection of the quantum state in the Z direction, that is, the probability of the quantum state in the Z direction.
  • the result of quantum calculation is Tr( ⁇ H).
  • the expectation value in the X direction i.e., b + b *
  • the expectation value in the Y direction i.e., bb *
  • the expectation measurement operator in any direction can be decomposed by the expectation operators in the X, Y, and Z directions.
  • the simulator can directly obtain the density matrix representation of the quantum state, and thus can directly calculate the expected measurement results in multiple directions (including X, Y and Z directions).
  • quantum computing there is a quantum circuit writer at the bottom of the interface, which contains symbols representing quantum operations and linear elements representing quantum bits. Users can drag and drop symbols representing quantum operations to the corresponding quantum bits, and then the quantum circuit can be translated into a script language (which can be understood as a computer language for quantum operations). Alternatively, user commands provided through the command line interface can also be converted into quantum circuits, which can be translated into script languages and dynamically generate graphical representations.
  • the quantum elements representing quantum operations only provide probability measurements in a single direction (generally the Z direction).
  • Another way of quantum computing is to obtain two quantum circuits, then compile and run the first quantum circuit first, and then dynamically compile and run the second quantum circuit based on the running results of the first quantum circuit.
  • the two quantum circuits can run on different hardware.
  • this method converts a single parameter-containing quantum circuit into multiple quantum circuits for operation, which requires repeated compilation and running of quantum circuits, and the operation is complicated.
  • the returned results are all the probability results of the quantum state in a single direction (generally the Z direction). If you want to get the results in other directions, you need to rotate the projection in the X direction or Y direction to the Z direction and then measure it.
  • the present application provides a method for quantum computing.
  • the quantum circuit can be decomposed into actual quantum circuits expected to be measured in multiple directions.
  • the actual quantum circuits expected to be measured in multiple directions can be independently run on the hardware to obtain multiple running results.
  • the multiple running results can be sent, which not only simplifies the operation process of repeated compilation, but also returns the running results in multiple directions in one run, without the need for the user to repeatedly send quantum circuits expected to be measured in different directions.
  • This application can be applied to the model shown in Figure 1.
  • Users can control the quantum computer on hardware through a quantum computing platform.
  • the quantum computing platform encapsulates some functions of the quantum computer and provides an interface to the user. Users can conveniently control the quantum computer and run various quantum algorithms and functions through the quantum computing platform.
  • the quantum computing platform applicable to the present application is usually implemented on a classical computer device, which can be a personal computer, a server in a data center, or a portable personal mobile phone, etc.
  • the black solid circle indicates a specific quantum operation, for example, It is a Hadamard gate that can operate on a quantum bit.
  • This gate can be represented by a matrix: It is a rotation operation gate around the X axis, containing a parameter a, which can operate one quantum bit.
  • the black dotted circles in Figure 2 represent quantum measurements, which, from left to right, represent: the probability of the measurement result in the Z direction being 0 or 1; the expected value in the X direction, the expected value in the Y direction, and the expected value in the Z direction.
  • the operators representing the expected value in the X direction, the expected value in the Y direction, and the expected value in the Z direction can be combined.
  • the icons in the upper right corner of Figure 2 represent functions that users can operate, including initialization, operation, backend, and actual circuit.
  • initialization means setting all the parameters in the quantum circuit to a certain value, which can be all a certain value or all random numbers.
  • the operation can be selected as a single run, or iterative operation based on the results returned by the quantum measurement.
  • the backend can choose a simulator or actual hardware.
  • the actual circuit can show the user the actual quantum circuit and how the results are processed when the quantum circuit is run on the hardware.
  • quantum operations or quantum measurements shown in the figure include but are not limited to those shown in the figure, and quantum operations may also include other operations, and quantum measurements may also include desired measurement operators in other directions without limitation.
  • Figure 3 is a schematic diagram of a quantum circuit provided in an embodiment of the present application.
  • the user can drag and drop quantum operations and quantum measurements to the line representing the quantum bit to form a quantum circuit.
  • the figure includes two quantum circuits, namely q0 and q1, wherein each quantum circuit represents an operation on a quantum bit, and therefore, the two quantum circuits included in the figure represent operations on two quantum bits.
  • FIG. 4 shows a set of graphical user interfaces (GUIs) of a computer, wherein (a) to (l) in FIG. 4 show a method of quantum computing.
  • GUIs graphical user interfaces
  • the GUI is the desktop of the computer.
  • the computer desktop may include a recycle bin, My Computer, a browser, etc.
  • the browser may be started and the GUI shown in (b) of FIG4 may be displayed.
  • the GUI may be referred to as the main interface of the browser.
  • the interface displays a new blank web page, and the user can enter the URL the user wants to visit in the upper bar box. For example, the user can enter the first URL in the bar box, and the GUI shown in (c) of FIG. 4 is displayed.
  • the first URL is displayed in the URL input box.
  • the GUI shown in (d) of FIG. 4 is displayed.
  • the interface displays the main page of quantum computing, wherein the items encircled by a solid black circle in the figure represent specific quantum operations, and the items encircled by a dotted black circle represent quantum measurements.
  • the quantum operations or quantum measurements shown in (d) of FIG4 include but are not limited to those shown in the figure, and the quantum operations may also include other operations, and the quantum measurements may also include other measurements, without limitation.
  • the user can drag any quantum operation or quantum measurement onto the line (such as lines q0, q1, and q2 shown in the figure). Drag it to line q0 and add the quantum operation Drag it onto line q1 to display the GUI shown in (e) of FIG4 .
  • the interface shows that the line q0 includes quantum operations
  • the circuit q1 includes quantum operations Among them, the parameters a, b, c, and d in the quantum operation are variable parameters.
  • the user can also combine the quantum operations on the two lines. For example, the user can select all four quantum operations and right-click the mouse, and choose to combine them into a new quantum operation gate in the pop-up menu.
  • the computer detects the user's above operation, it displays the GUI shown in (f) in Figure 4.
  • the interface shows that the line q0 includes quantum operations And quantum measurement
  • the circuit q1 includes quantum operations And quantum measurement
  • the four quantum measurements can be combined into a combined measurement gate, that is, The new combined measurement gate is displayed on the top of the interface.
  • a coefficient box is displayed above the interface, and the user can set the coefficient in the coefficient box.
  • the coefficient measured in the Z direction is 0.22
  • the coefficient measured in the X direction is 0.05.
  • the user has completed the construction of the quantum circuit with parameters.
  • the user can set it in the function area in the upper right corner of the interface.
  • the GUI shown in (h) of Figure 4 is displayed.
  • a menu is displayed below the function button “Initialize”, including: all 0 and random initial value, wherein, if the user selects all 0, it means that the initial values of all parameters in the quantum operation are set to 0; if the user selects random initial value, it means that the initial values of all parameters in the quantum operation are random values.
  • the user can select any initialization setting, such as the user selects all 0, when the computer detects that the user clicks “all 0”, the GUI shown in (i) of FIG4 is displayed.
  • a menu is displayed under “Backend”, including: Simulator and Hardware, and the user can select any backend setting.
  • “Backend” including: Simulator and Hardware
  • the GUI shown in (k) of FIG4 is displayed.
  • the lower right corner of the interface shows the actual circuit of the quantum circuit running on the hardware.
  • the circuit above the dotted line is the actual circuit of the hardware running in the Z direction
  • the circuit below the dotted line is the actual circuit of the hardware running in the X direction.
  • users can also update the parameters in the quantum operation to obtain different quantum circuits. For example, users can click on any quantum operation And update the parameter a in the quantum operation.
  • the quantum computing method provided in the present application can construct a quantum circuit containing parameters, while in the prior art, when constructing a quantum circuit, it is necessary to specify the parameters as specific values, resulting in the constructed quantum circuit being a fixed circuit. Therefore, the method for constructing a quantum circuit provided in the present application can obtain different quantum circuits by changing the specific values of the parameters; since the quantum circuit of the present application can be changed according to the change of the parameters, it can be calculated by an iterative operation method.
  • the scheme provided in the embodiment of the present application can optimize the parameters of the quantum circuit to achieve the best measurement result; in addition, for the quantum circuit running on the hardware, the present application is based on The quantum circuit is decomposed according to the expected measurement operators combined in the quantum circuit, and is decomposed into actual quantum circuits for expected measurements in multiple directions. The actual quantum circuits for expected measurements in multiple directions can be independently run on hardware to obtain multiple results. Finally, the multiple results can be combined to obtain measurement results of a multi-directional combination.
  • the solution provided in the embodiment of the present application can not only simplify the operation process of repeated compilation, but also return a combination of expected measurement results in multiple directions in one operation even if the quantum circuit is run on hardware, without the need for the user to repeatedly send quantum circuits for expected measurements in different directions.
  • FIG. 5 it is a schematic diagram of a quantum computing method provided in an embodiment of the present application, and the method may include steps S710 to S730.
  • the embodiment of the present application takes a computer as an example of a quantum computing platform.
  • the user can select any quantum operation to add to the first quantum bit.
  • the user can select the quantum operation Added to qubit 1, as shown in (e) of FIG. 4 above, the user adds the quantum operation Drag it to line q0, the quantum operation It occupies 1 qubit, and here the qubit occupied by circuit q0 can be considered as qubit 1.
  • users can add multiple quantum operations to qubits in a similar way.
  • the user may also add quantum measurement to the quantum bit, and the user may perform the operation according to the method shown in FIG. 6 , which may include steps S810 to S850 .
  • the user can select any quantum measurement to be added to the first quantum bit.
  • the user can select quantum measurement Added to qubit 1, as shown in (g) of Figure 4 above, the user will quantum measurement Drag it to line q0, the quantum measurement It occupies 1 quantum bit.
  • the quantum bit occupied by line q0 can be considered as quantum bit 1.
  • the user selects the next quantum measurement to be added to the next qubit. At this point, the user may add the quantum measurement to qubit 1 or other qubits (such as qubit 2) without restriction.
  • step S840 If not, execute step S840; if so, execute step S850.
  • step S820 If not, return to step S820; if so, end.
  • the computer When the computer recognizes that the user has added two quantum measurements in succession, it can first determine whether the two quantum measurements are on the same quantum bit. If the two quantum measurements are on the same quantum bit, it can continue to determine whether all quantum measurements have been added; if the two quantum measurements are on the same quantum bit, the two quantum measurements can be separated by a dotted line. The purpose of using a dotted line to separate them is to indicate that the two consecutive quantum measurements are not executed in sequence on the quantum circuit, but need to be integrated into a single measurement result according to the expression corresponding to the measurement symbol and returned.
  • step S820 If the user chooses to measure the quantum Add to qubit 1, and select in step S820 to add quantum measurement Added to qubit 2, as shown in (g) of Figure 4 above, the user will quantum measurement Drag it to line q1. Since the two consecutive quantum measurements are added to different quantum bits respectively, the computer can proceed to the next step to determine whether all quantum measurements have been added. If it is determined that all quantum measurements have not been added, return to step S820 to select the next quantum measurement.
  • next quantum measurement selected by the user is a quantum measurement
  • add this quantum measurement to qubit 2 because now the quantum measurement
  • the quantum measurement can be With the last added quantum measurement
  • the dotted line separates the two consecutive quantum measurements on the quantum circuit, indicating that they are not performed in sequence, but need to be integrated into a single measurement result according to the expression corresponding to the measurement symbol.
  • the parameter-containing quantum circuit may include two parameter-containing quantum circuits, namely q0 and q1, wherein the parameter-containing quantum circuit q0 includes quantum operations
  • the parameterized quantum circuit q1 includes quantum operations These four quantum operations are combined into a new quantum operation gate, the quantum operation
  • the parameters a, b, c, and d are variable.
  • the parameter-containing quantum circuit q0 also includes quantum measurement It means that the parameterized quantum circuit q0 can calculate the expectation in the Z direction and the X direction; similarly, the parameterized quantum circuit q1 also includes quantum measurement It means that the parameterized quantum circuit q1 can calculate the expectations in the Z and X directions.
  • the order in which the symbols are dragged and dropped on the same quantum bit represents the order in which the quantum operations are performed.
  • the two quantum measurements can be separated by a dotted line, and the consecutive quantum measurements on different quantum bits can be framed together with a solid line, indicating that the measurements should be completed at the same time and a measurement result needs to be returned.
  • both the parameter-containing quantum circuits q0 and q1 include quantum measurements Then, in the actual quantum computing process, the expectations of the parameterized quantum circuits q0 and q1 in the Z direction are completed at the same time, and the expectations of the parameterized quantum circuits q0 and q1 in the X direction are completed at the same time.
  • the parameters in the quantum operation can be initialized, and all the parameters can be set to 0, or the parameters can be set to any other numerical value without restriction.
  • step S714 can be executed, that is, the computer can simulate the quantum computer to run the quantum circuit on the computer, and output the integrated result, that is, jump to step S726.
  • the computer simulates the quantum computer to run the quantum circuit on the computer, the output result is the combined value of the operation results in multiple directions.
  • step S716 may be executed, that is, decomposing the quantum circuit to construct an actual circuit running on the hardware.
  • the quantum circuit when decomposing a quantum circuit, the quantum circuit can be decomposed according to the measurement combination method selected by the user.
  • FIG8 a schematic diagram of a method for calculating a measurement operator set provided in an embodiment of the present application is shown. The method may include steps S1010 to S1070.
  • step S1040 can be directly executed; for any comparison of one of the measurement operators with all operators in the measurement operator set G other than the first time, since the measurement operator set G is not empty at this time, the measurement operator can be compared with the measurement operator set G. All operators in G are compared, and the execution of step S1040 or S1050 is determined according to the comparison result.
  • step S1040 If yes, execute step S1040; if no, execute step S1050.
  • S1050 merge the operator with an operator in the existing measurement operator set G.
  • step S1070 If yes, execute step S1070; if no, return to step S1020.
  • the first operator of H is X 1 X 2 , so the first measurement operator in the measurement operator set G that needs to be run on the hardware is X 1 X 2 ; the second operator of H is Z 1 Z 2 , which overlaps with the first qubit and the second qubit in the first operator in the measurement operator set G, but the measurement directions of the overlapping first qubit and the second qubit are different, so the second measurement operator Z 1 Z 2 can be added to the measurement operator set G. Therefore, the operator set G that needs to be measured on the hardware is finally obtained as ⁇ X 1 X 2 , Z 1 Z 2 ⁇ , that is, it needs to be run twice on the hardware.
  • the quantum circuit corresponding to this expression can be decomposed into two actual circuits that run on the hardware.
  • the first operator of H is X 1 X 2 , so the first measurement operator in the measurement operator set G that needs to be run on the hardware is X 1 X 2 ;
  • the second operator of H is Z 1 , which overlaps with the first qubit in the first operator in the measurement operator set G, but the measurement direction of the overlapping first qubit is different, so the second measurement operator Z 1 can be added to the measurement operator set G;
  • the third operator of H is Z 2 , which overlaps with the second qubit in the first operator X 1 X 2 in the measurement operator set G, but the overlapping measurement direction is different, and at the same time, it does not overlap with the qubit of the second operator Z 1 in the measurement operator set G, so the measurement operator Z 2 can be merged into the second operator in the measurement operator set G, that is, the second measurement operator becomes Z 1 Z 2 ;
  • the fourth operator of H is Z 1 Z 2 , it completely overlaps with the qubit of the second measurement operator in the measurement operator set G, and the overlapping measurement directions are the
  • the operator set G that ultimately needs to be measured on the hardware for the Hamiltonian expression of the hydrogen molecule is ⁇ X 1 X 2 , Z 1 Z 2 ⁇ , it needs to be run twice on the hardware. Therefore, the quantum circuit corresponding to the Hamiltonian expression of the hydrogen molecule can be decomposed into two actual circuits that run on the hardware.
  • FIG 9 it is a schematic diagram of two actual circuits running on hardware obtained by decomposing the quantum circuit of Figure 7 provided in an embodiment of the present application.
  • the circuit above the dotted line in Figure 9 is the actual circuit running in the Z direction of the hardware
  • the circuit below the dotted line is the actual circuit running in the X direction of the hardware.
  • the computer obtains the operation result of the actual line.
  • step S726 If yes, execute step S726; if no, return to execute step S718.
  • the computer can select one of the actual lines and send the actual line to the quantum computer. For example, the computer can first select the actual line running in the Z direction and send it to the quantum computer. After the quantum computer completes the processing, the operation result can be sent to the computer; then send another actual line to the quantum computer. After the quantum computer completes the processing, the operation result is sent to the computer. When the computer determines that all the actual lines have been run, it can output the integrated result.
  • the integration result can be determined based on the operation result obtained after the quantum computer runs each actual circuit.
  • the actual circuits constructed by the computer after decomposing the quantum circuit include two, namely, quantum measurement in the Z direction and quantum measurement in the X direction, and the coefficient of the measurement in the Z direction is a1, and the coefficient of the measurement in the X direction is a2, then we can first calculate Calculate the product of the running result in each direction and the coefficient measured in that direction, and then sum the products in multiple directions.
  • step S730 If yes, execute step S730; if no, return to execute step S712.
  • the computer When the computer obtains the integration result, it can first determine whether the integration result has converged. If it has converged, the current parameters and the integration result can be output to the user. If it has not converged, the parameters in the parameter-containing quantum operation can be updated, and the actual circuit running on the hardware can be reconstructed. The quantum computer will process the reconstructed actual circuit. After the processing is completed, the running results will be sent to the computer. The computer can integrate the running results again and determine whether the integration results have converged.
  • the quantum computer after the quantum computer has run all actual circuits, it can obtain an integrated result based on the running results after running each actual circuit, and then send the integrated result to the computer without restriction.
  • the result in the embodiment of the present application converges can be understood as: whether the integration result is the minimum value among all the results.
  • the integration result obtained is w1; it is assumed that after the user updates the parameters for the second time (such as the user increases the first step length to the initialization parameters), the integration result obtained is w2, and w2 ⁇ w1, indicating that the direction of the step change is desirable at this time, and the user can update the parameters again; it is assumed that after the user updates the parameters for the third time (such as the user increases the second step length to the parameters after the second update, and the second step length is less than the first step length), the integration result obtained is w3, and w3 ⁇ w2 ⁇ w1, at this time the user can update the parameters again; it is assumed that after the user updates the parameters for the fourth time (such as the user increases the third step length to the parameters after the third update, and the third step length is less than the first step length), the integration result
  • the user can also set the number of iterations, and the computer runs according to the set number of iterations, and can record the results after each run.
  • the result with the smallest result can be selected from the results after multiple runs, and the result and the parameters corresponding to the result can be output.
  • the scheme provided by the embodiment of the present application can construct a quantum circuit containing parameters, and different quantum circuits can be obtained by changing the specific values of the parameters; since the quantum circuit of the present application can change according to the change of the parameters, it can be calculated by an iterative operation method, and the parameters of the quantum circuit can be optimized by an iterative method, so that the result of the combined measurement is optimal; in addition, for the quantum circuit running on the hardware, the present application decomposes the quantum circuit according to the expected measurement operator combined in the quantum circuit, decomposing it into actual quantum circuits expected to be measured in multiple directions, and the actual quantum circuits expected to be measured in multiple directions can be independently run on the hardware to obtain multiple results, and finally the multiple results can be combined to obtain the measurement results of the multi-directional combination, which can not only simplify the operation process of repeated compilation, but also return the combination of the expected measurement results of multiple directions in one operation even if the quantum circuit is run on the hardware, without the need for the user to repeatedly send the quantum circuits for the expected measurement in different directions.
  • the present application can return the combination of the measurement results of multiple directions to the user, and can preserve the measurement results of multiple directions, so that some quantum circuits that rely on more information can be run, and the variational quantum algorithm of the classical-quantum hybrid can also be run.
  • the VQE algorithm is used to solve the eigenenergy of the above Hamiltonian, since the algorithm requires interaction between the two qubits, the user can drag a controlled-not gate (CNOT) and 8 parameters are required to get a reasonable result, so the user can add the previously defined Drag and drop it onto the line again and remap the parameters to The parameters it needs to receive are the same as the previous The received parameters are completely different, namely a', b', c' and d'. Finally, select the measurement operation in the X direction from the quantum measurement and apply it to q0 and q1. Then continue to apply a measurement operation in the Z direction to q0.
  • CNOT controlled-not gate
  • the quantum circuit is decomposed according to the method shown in FIG8, and the actual circuit running on the hardware is shown in FIG11.
  • the circuit above the dotted line in FIG11 is the actual circuit running in the Z direction of the hardware, and the circuit below the dotted line is the actual circuit running in the X direction of the hardware.
  • FIG. 12 a schematic diagram of a quantum computing method provided in an embodiment of the present application is shown.
  • the method can be performed by a first electronic device and a second electronic device, wherein the first electronic device can be the computer in the above embodiment, and the second electronic device can be the computer in the above embodiment.
  • the method may include steps 1210 to 1260.
  • a first electronic device splits the first quantum circuit to obtain n second quantum circuits.
  • n can be an integer greater than or equal to 2.
  • n second quantum circuits in the embodiment of the present application are the actual circuits mentioned in the above example.
  • the number of second quantum circuits is the number of actual circuits in the above example.
  • the first electronic device sends the n second quantum circuits to a second electronic device.
  • the second electronic device receives n second quantum circuits sent by the first electronic device.
  • the second electronic device runs the n second quantum circuits to obtain n first running results.
  • the second electronic device sends an operation result to the first electronic device, where the operation result indicates a result obtained by operating the n second quantum circuits.
  • the first electronic device receives the operation result sent by the second electronic device.
  • the first quantum circuit includes quantum measurements in n directions
  • the second quantum circuit includes quantum measurements in one direction.
  • each second quantum circuit in the embodiment of the present application includes quantum measurement in one direction, and the directions of the quantum measurements included in each second quantum circuit are different.
  • the first quantum circuit includes quantum measurements in two directions (such as the X direction and the Z direction)
  • two second quantum circuits can be obtained, of which one second quantum circuit can include quantum measurement in one direction (such as the X direction), and the other second quantum circuit can include quantum measurement in another direction (such as the Z direction).
  • the first quantum circuit includes quantum measurements in n directions.
  • n second quantum circuits can be obtained, and each second quantum circuit includes quantum measurements in one direction, which can ensure the accuracy of splitting the first quantum circuit, and is conducive to the second electronic device improving the accuracy of the n first operation results obtained after running the n second quantum circuits.
  • splitting the first quantum circuit includes:
  • the first quantum circuit is split according to the measurement operator corresponding to the first quantum circuit.
  • the content of splitting the first quantum circuit according to the measurement operator corresponding to the first quantum circuit can refer to the content shown in Figure 8 above, and will not be repeated here.
  • the first electronic device can split the first quantum circuit according to the measurement operator corresponding to the first quantum circuit, which can improve the accuracy of splitting the first quantum circuit, and further improve the accuracy of n first operation results obtained after the second electronic device runs n second quantum circuits.
  • the measurement operators corresponding to the first quantum circuit include M, and splitting the first quantum circuit according to the measurement operators corresponding to the first quantum circuit includes:
  • j-th measurement operator For the j-th measurement operator, add the j-th measurement operator to the measurement operator set, where j is any value less than or equal to M;
  • For the kth measurement operator determine whether there is a measurement operator with the same qubit as the kth measurement operator and a different direction in the measurement operator set, where k traverses from 1 to M and k ⁇ j;
  • the kth measurement operator is merged with the measurement operator already existing in the measurement operator set, or the kth measurement operator is added to the measurement operator set.
  • the first electronic device can add the jth measurement operator to the measurement operator set, and for the kth measurement operator, the first electronic device can determine whether there is a measurement operator with the same quantum bit as the kth measurement operator and a different direction in the measurement operator set, and perform further operations based on the determination result to split the first quantum circuit.
  • the number of second quantum circuits obtained after splitting the first quantum circuit by this method is the minimum, thereby ensuring that the second electronic device runs the minimum number of second quantum circuits, reducing the running time and improving efficiency.
  • the kth measurement operator is compared with the existing measurement operator in the measurement operator set according to the judgment result.
  • the method comprises: merging the kth measurement operator with the kth measurement operator, or adding the kth measurement operator to the measurement operator set, comprising: if there exists a measurement operator with the same qubit as the kth measurement operator and a different direction in the measurement operator set, adding the kth measurement operator to the measurement operator set; if there does not exist a measurement operator with the same qubit as the kth measurement operator and/or a different direction in the measurement operator set, merging the kth measurement operator with the measurement operator already existing in the measurement operator set.
  • the first electronic device may add the kth measurement operator to the measurement operator set; if there does not exist a measurement operator with the same quantum bit as the kth measurement operator and/or a different direction in the measurement operator set, the first electronic device may merge the kth measurement operator with the measurement operator already existing in the measurement operator set to split the first quantum circuit.
  • the number of second quantum circuits obtained after splitting the first quantum circuit by this method is minimized, thereby ensuring that the second electronic device runs the least number of second quantum circuits, reducing the running time and improving the efficiency.
  • the first quantum circuit includes a quantum operation including a first parameter, and a specific value of the first parameter is variable.
  • the first quantum circuit may further include a quantum operation including a first parameter, and the specific value of the first parameter may be variable.
  • the method provided in the present application can obtain different quantum circuits by changing the specific values of the parameters, thereby improving flexibility and diversity.
  • the quantum operation containing the first parameter includes multiple quantum operations
  • the first quantum circuit also includes a quantum operation containing a second parameter
  • the quantum operation containing the second parameter is obtained through a combination operation gate
  • the combination operation gate is a combination gate including the multiple quantum operations.
  • the first quantum circuit may further include a quantum operation containing a second parameter, that is, the first quantum circuit may include a quantum operation containing the first parameter and a quantum operation containing the second parameter, and the quantum operation containing the second parameter is obtained through a combined operation gate. Since the quantum operation containing the second parameter in the first quantum circuit is obtained through a combined operation gate, compared with the solution in the prior art that requires the user to drag each quantum operation to the quantum circuit separately, the solution provided by the embodiment of the present application can simplify the user's operation.
  • the operation result includes n first operation results or a first combination result determined based on the n first operation results, and the n first operation results are results obtained by the second electronic device running the n second quantum circuits.
  • the operation result includes n first operation results
  • the method further includes: determining a first combination result according to the n first operation results and coefficients of corresponding measurement operators in the first quantum circuit.
  • the coefficients of the measurement operator corresponding to the first quantum circuit in the embodiment of the present application can be the coefficients 0.22 and 0.05 displayed above the quantum measurement shown in (g) in Figure 4; these n first operation results include the operation results in n directions, and the first combination result is the product of the first operation result in the X direction and the coefficient 0.05 measured in the X direction, and the product of the first operation result in the Z direction and the coefficient 0.22 measured in the Z direction, and the sum of the two.
  • the first electronic device can determine the first combination result according to the n first operation results and the coefficients of the corresponding measurement operators in the first quantum circuit. Different first combination results can be obtained by setting different coefficients, which can improve the flexibility of quantum computing.
  • the first quantum circuit is a quantum circuit after initializing the first parameter, and the method further includes:
  • the first electronic device receives the user's operation of updating the first parameter for the wth time, and sends a second quantum circuit after the first parameter is updated to the second electronic device, where w starts to take a value from 1;
  • the second electronic device receives the second quantum circuit sent by the first electronic device after the first parameter is updated for the wth time;
  • the second electronic device runs the second quantum circuit after the first parameter is updated for the wth time to obtain n (w+1)th running results;
  • the second electronic device sends an operation result after the (w+1)th operation to the first electronic device, where the operation result after the (w+1)th operation includes n (w+1)th operation results or (w+1)th combination results, and the (w+1)th combination result is obtained based on the n (w+1)th operation results;
  • the first electronic device receives the operation result after the (w+1)th operation sent by the second electronic device;
  • the first electronic device determines whether the (w+1)th combination result converges
  • the first electronic device displays a target result and a target parameter, wherein the target result is the combination result with the smallest value, and the target parameter is a parameter corresponding to the combination result with the smallest value.
  • the user can update the first parameter multiple times
  • the first electronic device can send the second quantum circuit after the wth update to the second electronic device
  • the second electronic device can run the second quantum circuit after the first parameter is updated for the wth time to obtain n (w+1)th running results, and send the running results after the (w+1)th running to the first electronic device
  • the first electronic device can determine whether the (w+1)th combination result (wherein the (w+1)th combination result is obtained based on the n (w+1)th running results) converges, and display the target result and target parameter when the (w+1)th combination result converges.
  • the second electronic device can run the second quantum circuit after each update respectively, and send the running results to the first electronic device. After receiving the running results each time, the first electronic device can determine whether the combination result (which may be the running result or the result obtained based on the running result) converges, and display the target result and target parameter when the combination result converges.
  • the solution provided in the embodiment of the present application can be calculated through an iterative operation method. Compared with the prior art where the iterative operation method cannot be used because the constructed circuit is a fixed circuit, the solution provided in the embodiment of the present application can optimize the parameters of the quantum circuit to achieve the best measurement result.
  • the method further comprises: in response to the first operation of the user, displaying the n second quantum circuits.
  • a first electronic device in response to a first operation of a user, can display n second quantum circuits, and can show the specific adaptation made by the second electronic device to run a variational quantum algorithm, so that the user can intuitively see the underlying operating logic and enhance the perception of quantum hardware.
  • the devices in the existing network architecture are mainly used as examples for exemplary description, and it should be understood that the embodiments of the present application do not limit the specific form of the devices. For example, devices that can achieve the same function in the future are applicable to the embodiments of the present application.
  • the methods and operations implemented by devices can also be implemented by components that can be used in the devices (such as chips or circuits).
  • the above is a detailed description of the quantum computing method provided by the embodiment of the present application in combination with FIG12.
  • the above quantum computing method is mainly introduced from the perspective of the interaction between the first electronic device and the second electronic device. It can be understood that the first electronic device and the second electronic device, in order to implement the above functions, include hardware structures and/or software modules corresponding to the execution of each function.
  • the embodiment of the present application can divide the functional modules of the transmitting end device or the receiving end device according to the above method example.
  • each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module.
  • the above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation. The following is an example of dividing each functional module corresponding to each function.
  • FIG. 13 is a schematic block diagram of a quantum computing device 1300 provided in an embodiment of the present application.
  • the quantum computing device 1300 may include a transceiver module 1310 and a processing module 1320.
  • the transceiver module 1310 may implement corresponding communication functions, and the processing module 1320 is used to perform data
  • the transceiver module 1310 may also be referred to as a communication interface or a communication unit.
  • the quantum computing device 1300 may further include a storage unit, which may be used to store instructions and/or data, and the processing module 1320 may read the instructions and/or data in the storage unit so that the device implements the aforementioned method embodiment.
  • a storage unit which may be used to store instructions and/or data
  • the processing module 1320 may read the instructions and/or data in the storage unit so that the device implements the aforementioned method embodiment.
  • the quantum computing device 1300 can be used to execute the actions executed by the electronic devices (such as the first electronic device and the second electronic device) in the above method embodiments.
  • the quantum computing device 1300 can be a first electronic device, such as a computer, and the transceiver module 1310 is used to execute the transceiver-related operations on the first electronic device side in the above method embodiments, and the processing module 1320 is used to execute the processing-related operations on the first electronic device side in the above method embodiments.
  • the quantum computing device 1300 is used to execute the actions performed by the first electronic device in the above method embodiment.
  • the processing module 1320 is configured to split the first quantum circuit to obtain n second quantum circuits
  • the transceiver module 1310 is used to send the n second quantum circuits to a second electronic device; and is also used to receive an operation result sent by the second electronic device, where the operation result indicates a result obtained by running the n second quantum circuits.
  • the quantum computing device 1300 can implement the steps or processes performed by the first electronic device in the method embodiment according to the embodiment of the present application, and the quantum computing device 1300 may include a unit for executing the method performed by the first electronic device in the method embodiment.
  • each unit in the quantum computing device 1300 and the above-mentioned other operations and/or functions are respectively for implementing the corresponding processes of the method embodiment in the first electronic device in the method embodiment.
  • the device 1300 is used to execute the actions performed by the second electronic device in the above method embodiment.
  • the transceiver module 1310 is configured to receive n second quantum circuits sent by the first electronic device, where the n quantum circuits are quantum circuits obtained by splitting the first quantum circuit;
  • a processing module 1320 is used to run the n second quantum circuits to obtain n first running results
  • the transceiver module 1310 is further configured to send the operation result to the first electronic device, where the operation result indicates a result obtained by operating the n second quantum circuits.
  • the quantum computing device 1300 can implement the steps or processes performed by the second electronic device in the method embodiment according to the embodiment of the present application, and the quantum computing device 1300 may include a unit for executing the method performed by the second electronic device in the method embodiment.
  • each unit in the quantum computing device 1300 and the above-mentioned other operations and/or functions are respectively for implementing the corresponding processes of the method embodiment in the second electronic device in the method embodiment.
  • the processing module 1320 in the above embodiment may be implemented by at least one processor or processor-related circuits.
  • the transceiver module 1310 may be implemented by a transceiver or a transceiver-related circuit.
  • the storage unit may be implemented by at least one memory.
  • the embodiment of the present application further provides a quantum computing device 1500.
  • the device 1500 includes a processor 1510 and may also include one or more memories 1520.
  • the processor 1510 is coupled to the memory 1520, and the memory 1520 is used to store computer programs or instructions and/or data.
  • the processor 1510 is used to execute the computer programs or instructions and/or data stored in the memory 1520, so that the method in the above method embodiment is executed.
  • the device 1500 includes one or more processors 1510.
  • the memory 1520 may be integrated with the processor 1510 or provided separately.
  • the device 1500 may further include a transceiver 1530, and the transceiver 1530 is used for receiving and/or sending signals.
  • the processor 1510 is used to control the transceiver 1530 to receive and/or send signals.
  • the device 1500 is used to implement the operations performed by the quantum computing device (such as the first electronic device or the second electronic device mentioned above) in the above method embodiments.
  • An embodiment of the present application also provides a computer-readable storage medium on which computer instructions for implementing the method executed by a quantum computing device (such as the first electronic device or the second electronic device) in the above method embodiment are stored.
  • a quantum computing device such as the first electronic device or the second electronic device
  • the computer when the computer program is executed by a computer, the computer can implement the method performed by the quantum computing device (such as the first electronic device or the second electronic device) in the above method embodiment.
  • the quantum computing device such as the first electronic device or the second electronic device
  • An embodiment of the present application also provides a computer program product comprising instructions, which, when executed by a computer, enables the computer to implement the method performed by the quantum computing device (such as the first electronic device or the second electronic device) in the above method embodiment.
  • An embodiment of the present application also provides a system, which includes the first electronic device and the second electronic device in the above embodiment.
  • processors mentioned in the embodiments of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • DSP digital signal processors
  • ASIC application-specific integrated circuits
  • FPGA field programmable gate arrays
  • a general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
  • the memory mentioned in the embodiments of the present application may be a volatile memory and/or a non-volatile memory.
  • the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.
  • the volatile memory may be a random access memory (RAM).
  • a RAM may be used as an external cache.
  • RAM may include the following forms: static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDR SDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous link DRAM
  • DR RAM direct rambus RAM
  • the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, the memory (storage module) can be integrated into the processor.
  • memory described herein is intended to include, but is not limited to, these and any other suitable types of memory.
  • the disclosed devices and methods can be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be 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 distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement the solution provided by the present application.
  • each functional unit in each embodiment of the present application may be integrated into one unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer can be a personal computer, a server, or a network device, etc.
  • the computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center.
  • the computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integrations.
  • the available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)).
  • the aforementioned available medium may include, but is not limited to: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Software 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)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Superconductor Devices And Manufacturing Methods Thereof (AREA)

Abstract

本申请提供了一种量子计算的方法和装置,所述方法应用于第一电子设备,所述方法包括:对第一量子线路进行拆分,获得n个第二量子线路;向第二电子设备发送所述n个第二量子线路;接收所述第二电子设备发送的运行结果,所述运行结果指示运行所述n个第二量子线路得到的结果。本申请提供的方案可以简化重复编译的操作过程,也可以在一次运行中返回多个方向的运行结果,不需要用户重复下发进行不同方向的期望测量的量子线路。

Description

量子计算的方法和装置
本申请要求在2022年12月13日提交中国国家知识产权局、申请号为202211600214.3的中国专利申请的优先权,发明名称为“量子计算的方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及量子领域,尤其涉及一种量子计算的方法和装置。
背景技术
量子计算是一种利用了量子叠加和量子纠缠等量子性质的新型计算方式。
目前一种量子计算的方式为:界面下方有一个量子线路编写器,里面有代表量子操作的符号和代表量子比特的线性元件。用户通过拖放操作可以将代表量子操作的符号放到对应的量子比特上,然后量子线路可以被翻译成脚本语言(可以理解为对量子进行操作的计算机语言)。或者,通过命令行接口提供的用户命令也可以转换成量子线路,该量子线路可以被翻译成脚本语言,并且动态生成图形表示。然而这种方式中,代表量子操作的量子元件中,只提供单个方向(一般情况下是Z方向)上的概率测量。
另外一种量子计算的方式为:获取两个量子线路,然后首先编译运行第一个量子线路,然后动态的根据第一个量子线路的运行结果编译运行第二个量子线路。两个量子线路可以在不同的硬件上运行。然而这种方式是将单个含参量子线路变成多个量子线路进行运行,需要重复编译和运行量子线路,操作复杂。而且在硬件上运行,返回的都是处于单个方向(一般情况下是Z方向)上的量子态的概率结果,若要得到其他方向上的结果,则需要将X方向或Y方向的投影旋转到Z方向之后进行测量才可得到。
发明内容
本申请实施例提供一种量子计算的方法和装置,可以简化重复编译的操作过程,也可以在一次运行中返回多个方向的运行结果,不需要用户重复下发进行不同方向的期望测量的量子线路。
第一方面,提供了一种量子计算的方法,所述方法应用于第一电子设备,所述方法包括:对第一量子线路进行拆分,获得n个第二量子线路;向第二电子设备发送所述n个第二量子线路;接收所述第二电子设备发送的运行结果,所述运行结果指示运行所述n个第二量子线路得到的结果。
本申请实施例提供的方案,第一电子设备可以对第一量子线路进行拆分,并向第二电子设备发送拆分后获得的n个第二量子线路,以便于第二电子设备可以对这n个第二量子线路进行运行,第一电子设备可以接收第二电子设备发送的运行结果,该运行结果指示运行n个第二量子线路得到的结果,与现有技术中重复编译和运行量子线路且一次只能返回单个方向的测量结果的方案相比,本申请实施例提供的方案不仅可以简化重复编译的操作过程,而且也可以在一次运行中返回多个方向的运行结果,不需要用户重复下发进行不同方向的期望测量的量子线路。
结合第一方面,在一些可能的实现方式中,所述第一量子线路包括n个方向的量子测量,所述n个第二量子线路中的任一第二量子线路包括所述n个方向中的一个方向的量子测量。不同的第二量子线路中量子测量的方向不同。
本申请实施例提供的方案,第一量子线路包括n个方向的量子测量,第一电子设备对第一量子线路进行拆分时,可以获得n个第二量子线路,且每一个第二量子线路包括一个方向的量子测量,可以确保对第一量子线路进行拆分的准确性,有利于第二电子设备提高其运行n个第二量子线路后所得到的n个第一运行结果的准确性。
结合第一方面,在一些可能的实现方式中,所述对所述第一量子线路进行拆分,包括:根据所述第一量子线路所对应的测量算符对所述第一量子线路进行拆分。
本申请实施例提供的方案,第一电子设备可以根据第一量子线路所对应的测量算符对第一量子线路进行拆分,可以提升对第一量子线路进行拆分的准确性,进一步地,可以提高第二电子设备运行n个第 二量子线路后所得到的n个第一运行结果的准确性。
结合第一方面,在一些可能的实现方式中,所述第一量子线路所对应的测量算符包括M个,所述根据所述第一量子线路所对应的测量算符对所述第一量子线路进行拆分,包括:对于第j个测量算符,将所述第j个测量算符添加至测量算符集合中,j为小于或等于M的任一数值;对于第k个测量算符,判断所述测量算符集合中是否存在与所述第k个测量算符相同量子比特且不同方向的测量算符,k遍历1至M且k≠j;根据判断结果将所述第k个测量算符与所述测量算符集合中已存在的测量算符合并,或,将所述第k个测量算符添加至所述测量算符集合中。
本申请实施例提供的方案,对于第j个测量算符,第一电子设备可以将第j个测量算符添加至测量算符集合中,对于第k个测量算符,第一电子设备可以判断测量算符集合中是否存在与第k个测量算符相同量子比特且不同方向的测量算符,并根据判断结果进行进一步地操作,以对第一量子线路进行拆分,通过该方法对第一量子线路进行拆分后获得的第二量子线路的数量最少,从而可以确保第二电子设备运行第二量子线路的数量最少,减少运行时间,提高效率。
结合第一方面,在一些可能的实现方式中,所述根据判断结果将所述第k个测量算符与所述测量算符集合中已存在的测量算符合并,或,将所述第k个测量算符添加至所述测量算符集合中,包括:若所述测量算符集合中存在与所述第k个测量算符相同量子比特且不同方向的测量算符,将所述第k个测量算符添加至所述测量算符集合中;若所述测量算符集合中不存在与所述第k个测量算符相同量子比特和/或不同方向的测量算符,将所述第k个测量算符与所述测量算符集合中已存在的测量算符合并。
本申请实施例提供的方案,若测量算符集合中存在与第k个测量算符相同量子比特且不同方向的测量算符,第一电子设备可以将第k个测量算符添加至测量算符集合中;若测量算符集合中不存在与第k个测量算符相同量子比特和/或不同方向的测量算符,第一电子设备可以将第k个测量算符与测量算符集合中已存在的测量算符合并,以对第一量子线路进行拆分,通过该方法对第一量子线路进行拆分后获得的第二量子线路的数量最少,从而可以确保第二电子设备运行第二量子线路的数量最少,减少运行时间,提高效率。
结合第一方面,在一些可能的实现方式中,所述第一量子线路包括含第一参数的量子操作,所述第一参数的具体数值可变。
本申请实施例提供的方案,第一量子线路可以包括含第一参数的量子操作,且第一参数的具体数值可变,现有技术中在构建量子线路时需要指定参数为具体数值,导致构建的量子线路为固定线路,因此,本申请提供的方法可以通过改变参数的具体数值即可得到不同的量子线路,提升灵活性和多样性。
结合第一方面,在一些可能的实现方式中,所述含第一参数的量子操作包括多个量子操作,所述第一量子线路还包括含第二参数的量子操作,所述含第二参数的量子操作通过组合操作门获得,所述组合操作门为包括所述多个量子操作的组合门。
本申请实施例提供的方案,第一量子线路还可以包括含第二参数的量子操作,即第一量子线路可以包括含第一参数的量子操作和含第二参数的量子操作,且含第二参数的量子操作通过组合操作门获得。由于该第一量子线路中的含第二参数的量子操作通过组合操作门获得,与现有技术中需要用户单独将每一个量子操作拖拽至量子线路的方案相比,本申请实施例提供的方案可以简化用户的操作。
结合第一方面,在一些可能的实现方式中,所述运行结果包括n个第一运行结果或基于所述n个第一运行结果确定的第一组合结果,所述n个第一运行结果为所述第二电子设备运行所述n个第二量子线路得到的结果。
结合第一方面,在一些可能的实现方式中,所述运行结果包括n个第一运行结果,所述方法还包括:根据所述n个第一运行结果和所述第一量子线路中所对应的测量算符的系数确定第一组合结果。
本申请实施例提供的方案,若所述运行结果包括n个第一运行结果,第一电子设备可以根据n个第一运行结果和第一量子线路中所对应的测量算符的系数确定第一组合结果,通过设置不同的系数即可得到不同的第一组合结果,可以提升量子计算的灵活性。
结合第一方面,在一些可能的实现方式中,所述方法还包括:接收用户第w次更新所述第一参数的操作,并向第二电子设备发送更新所述第一参数后的第二量子线路,w从1开始取值;接收所述第二电子设备发送的第(w+1)次运行后的运行结果,所述第(w+1)次运行后的运行结果包括n个第(w+1)运行结果或第(w+1)组合结果,所述第(w+1)组合结果基于所述n个第(w+1)运行结果得到;判断所述第(w+1)组合结果是否收敛;在所述第(w+1)组合结果收敛的情况下,显示目标结果和目标参数, 所述目标结果为组合结果中数值最小的,所述目标参数为所述数值最小的组合结果所对应的参数。
本申请实施例提供的方案,用户可以多次对第一参数进行更新,第一电子设备可以向第二电子设备发送第w次更新后的第二量子线路,并接收第二电子设备发送的第(w+1)次运行后的运行结果;第一电子设备在接收到第(w+1)次运行后的运行结果后,可以判断第(w+1)组合结果(其中,第(w+1)组合结果基于所述n个第(w+1)运行结果得到)是否收敛,在第(w+1)组合结果收敛的情况下,显示目标结果和目标参数。由于用户可以对第一量子线路中的第一参数进行多次更新,从而第二电子设备可以分别运行每一次更新后的第二量子线路,并将运行结果发送至第一电子设备,第一电子设备在每一次接收到运行结果后,可以判断组合结果(该组合结果可能为运行结果,也可能为基于该运行结果得到的结果)是否收敛,并在该组合结果收敛的情况下,显示目标结果和目标参数。换句话说,本申请实施例提供的方案可以通过迭代运行的方法进行计算,与现有技术中由于构建的线路为固定线路无法使用迭代运行的方法相比,本申请实施例提供的方案可以优化量子线路的参数,使得测量的结果最佳。
结合第一方面,在一些可能的实现方式中,所述方法还包括:响应于所述用户的第一操作,显示所述n个第二量子线路。
本申请实施例提供的方案,响应于用户的第一操作,第一电子设备可以显示n个第二量子线路,可以展现第二电子设备运行变分量子算法所做的特定适配,可以让用户直观的看到底层的运行逻辑,提升对量子硬件的感知。
第二方面,提供了一种量子计算的方法,所述方法应用于第二电子设备,所述方法包括:接收第一电子设备发送的n个第二量子线路,所述n个量子线路为对第一量子线路进行拆分后的量子线路;运行所述n个第二量子线路,得到n个第一运行结果;向所述第一电子设备发送运行结果,所述运行结果指示运行所述n个第二量子线路得到的结果。
本申请实施例提供的方案,第二电子设备可以接收第一电子设备发送的n个第二量子线路,并运行这n个第二量子线路后得到n个第一运行结果,与现有技术中重复编译和运行量子线路且一次只能返回单个方向的测量结果的方案相比,本申请实施例提供的方案不仅可以简化重复编译的操作过程,而且也可以在一次运行中返回多个方向的运行结果,不需要用户重复下发进行不同方向的期望测量的量子线路。
结合第二方面,在一些可能的实现方式中,所述第一量子线路包括n个方向的量子测量,所述第二量子线路包括一个方向的量子测量。
本申请实施例提供的方案,第一量子线路包括n个方向的量子测量,第一电子设备对第一量子线路进行拆分时,可以获得n个第二量子线路,且每一个第二量子线路包括一个方向的量子测量,有利于提高第一电子设备对第一量子线路进行拆分的准确性,从而可以提高第二电子设备运行n个第二量子线路后所得到的n个第一运行结果的准确性。
结合第二方面,在一些可能的实现方式中,所述第一量子线路包括含第一参数的量子操作,所述第一参数的具体数值可变。
本申请实施例提供的方案,第一量子线路可以包括含第一参数的量子操作,且第一参数的具体数值可变,现有技术中在构建量子线路时需要指定参数为具体数值,导致构建的量子线路为固定线路,因此,本申请提供的方法可以通过改变参数的具体数值即可得到不同的量子线路,提升灵活性和多样性。
结合第二方面,在一些可能的实现方式中,所述含所述第一参数的量子操作包括多个量子操作,所述第一量子线路还包括含第二参数的量子操作,所述含第二参数的量子操作通过组合操作门获得,所述组合操作门为包括所述多个量子操作的组合门。
本申请实施例提供的方案,第一量子线路还可以包括含第二参数的量子操作,即第一量子线路可以包括含第一参数的量子操作和含第二参数的量子操作,且含第二参数的量子操作通过组合操作门获得。由于该第一量子线路中的含第二参数的量子操作通过组合操作门获得,与现有技术中需要用户单独将每一个量子操作拖拽至量子线路的方案相比,本申请实施例提供的方案可以简化用户的操作。
结合第二方面,在一些可能的实现方式中,所述运行结果包括所述n个第一运行结果或第一组合结果,所述n个第一运行结果为所述第二电子设备运行所述n个第二量子线路得到的结果,所述第一组合结果基于所述n个第一运行结果获得。
结合第二方面,在一些可能的实现方式中,若所述运行结果包括所述第一组合结果,所述第一组合结果基于所述n个第一运行结果和所述第一量子线路中所对应的测量算符的系数确定。
本申请实施例提供的方案,若所述运行结果包括第一组合结果,该第一组合结果可以基于n个第一 运行结果和第一量子线路中所对应的测量算符的系数确定,通过设置不同的系数即可得到不同的第一组合结果,可以提升量子计算的灵活性。
结合第二方面,在一些可能的实现方式中,所述方法还包括:接收所述第一电子设备发送的第w次更新所述第一参数后的第二量子线路,w从1开始取值;运行所述第w次更新所述第一参数后的第二量子线路,以得到n个第(w+1)运行结果;向所述第一电子设备发送第(w+1)次运行后的运行结果,所述第(w+1)次运行后的运行结果包括n个第(w+1)运行结果或第(w+1)组合结果,所述第(w+1)组合结果基于所述n个第(w+1)运行结果得到。
本申请实施例提供的方案,第二电子设备可以接收第一电子设备发送的第w次更新后的第二量子线路,并第w次运行更新第一参数后的第二量子线路,以得到n个第(w+1)运行结果,然后向第一电子设备发送第(w+1)次运行后的运行结果;以便于第一电子设备可以根据接收的第二电子设备第(w+1)次运行后的运行结果判断第(w+1)组合结果是否收敛,在第(w+1)组合结果收敛的情况下,显示目标结果和目标参数。由于用户可以对第一量子线路中的第一参数进行多次更新,第二电子设备可以分别运行每一次更新后的第二量子线路,并将运行结果发送至第一电子设备,以便于第一电子设备在每一次接收到运行结果后,可以判断组合结果(该组合结果可能为运行结果,也可能为基于该运行结果得到的结果)是否收敛,并在该组合结果收敛的情况下,显示目标结果和目标参数。换句话说,本申请实施例提供的方案可以通过迭代运行的方法进行计算,与现有技术中由于构建的线路为固定线路无法使用迭代运行的方法相比,本申请实施例提供的方案可以优化量子线路的参数,使得测量的结果最佳。
第三方面,提供一种装置,该装置包括执行上述第一方面任一项或第二方面任一项可能的实现中的方法相对应的模块或单元。
第四方面,提供了一种装置,包括:一个或多个处理器;存储器;一个或者多个应用程序;以及一个或多个计算机程序。其中,一个或多个计算机程序被存储在存储器中,一个或多个计算机程序包括指令。当指令被装置执行时,使得装置执行上述第一方面任一项或第二方面任一项可能的实现中的方法。
第五方面,提供了一种芯片系统,包括至少一个处理器,当程序指令在所述至少一个处理器中执行时,使得上述第一方面任一项或第二方面任一项可能的实现中的方法在所述电子设备上的功能得以实现。
第六方面,提供了一种计算机存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行上述第一方面任一项或第二方面任一项可能的实现中的方法。
第七方面,提供了一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行上述第一方面任一项或第二方面任一项可能的设计中的方法。
附图说明
图1为本申请可以应用的模型的示意图。
图2为本申请实施例提供的一种GUI的示意图。
图3为本申请实施例提供的一种量子线路的示意图。
图4为本申请实施例提供的另一种GUI的示意图。
图5为本申请实施例提供的一种量子计算的方法的示意图。
图6为本申请实施例提供的一种添加量子测量至量子比特的方法的示意图。
图7为本申请实施例提供的一种含参量子线路的示意图。
图8为本申请实施例提供的一种计算测量算符集合的方法示意图。
图9为本申请实施例提供的针对图7的量子线路进行分解后得到的在硬件上运行的两条实际线路的示意图。
图10为本申请实施例提供的另一种含参量子线路的示意图。
图11为本申请实施例提供的针对图10的量子线路进行分解后得到的在硬件上运行的两条实际线路的示意图。
图12为本申请实施例提供的一种量子计算的方法的示意图。
图13为本申请实施例提出的一种量子计算装置的示意性框图。
图14为本申请实施例提出的又一种量子计算装置的示意性框图。
具体实施方式
下面将结合附图,对本申请实施例中的技术方案进行描述。
本申请实施例的技术方案可以应用于各种计算机设备,该计算机设备可以为终端设备,例如,手机(mobile phone)、平板电脑(Pad)、带无线收发功能的电脑,还可以是应用于虚拟现实(virtual reality,VR)、增强现实(augmented reality,AR)、工业控制(industrial control)、无人驾驶(self driving)、远程医疗(remote medical)、智能电网(smart grid)、运输安全(transportation safety)、智慧城市(smart city)以及智慧家庭(smart home)等场景中的无线终端。本申请中将前述终端设备及可应用于前述终端设备的芯片统称为终端设备。应理解,本申请实施例对终端设备所采用的具体技术和具体设备形态不做限定。
该计算机设备也可以为网络设备,例如数据中心的服务器、家庭基站、无线保真(wireless fidelity,WIFI)系统中的接入点(access point,AP)、无线中继节点、无线回传节点、传输点(transmission point,TP)或者发送接收点(transmission and reception point,TRP)等,或者,还可以是构成基站的组件或一部分设备,如集中单元(central unit,CU)、分布式单元(distributed unit,DU)或基带单元(baseband unit,BBU)等。应理解,本申请的实施例中,对网络设备所采用的具体技术和具体设备形态不做限定。在本申请中,网络设备可以是指网络设备本身,也可以是应用于网络设备中完成无线通信处理功能的芯片。
应理解,在本申请实施例中,终端设备或网络设备包括硬件层、运行在硬件层之上的操作系统层,以及运行在操作系统层上的应用层。该硬件层包括中央处理器(central processing unit,CPU)、内存管理单元(memory management unit,MMU)和内存(也称为主存)等硬件。该操作系统可以是任意一种或多种通过进程(process)实现业务处理的计算机操作系统,例如,Linux操作系统、Unix操作系统、Android操作系统、iOS操作系统或windows操作系统等。该应用层包含浏览器、通讯录、文字处理软件、即时通信软件等应用。
另外,本申请的各个方面或特征可以实现成方法、装置或使用标准编程和/或工程技术的制品。本申请中使用的术语“制品”涵盖可从任何计算机可读器件、载体或介质访问的计算机程序。例如,计算机可读存储介质可以包括,但不限于:磁存储器件(例如,硬盘、软盘或磁带等),光盘(例如,压缩盘(compact disc,CD)、数字通用盘(digital versatile disc,DVD)等),智能卡和闪存器件(例如,可擦写可编程只读存储器(erasable programmable read-only memory,EPROM)、卡、棒或钥匙驱动器等)。
另外,本文描述的各种存储介质可代表用于存储信息的一个或多个设备和/或其它机器可读存储介质。术语“机器可读存储介质”可包括但不限于,无线信道和能够存储、包含和/或承载指令和/或数据的各种其它介质。
应理解,本申请实施例中的方式、情况、类别以及实施例的划分仅是为了描述的方便,不应构成特别的限定,各种方式、类别、情况以及实施例中的特征在不矛盾的情况下可以相结合。
还应理解,本申请实施例中的“第一”、“第二”以及“第三”仅为了区分,不应对本申请构成任何限定。例如,本申请实施例中的“第一信息”和“第二信息”,表示网络设备和终端设备之间传输的信息。
还应理解,在本申请的各种实施例中,各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
还需要说明的是,本申请实施例中,“预先定义”等可以通过在设备(例如,包括终端设备和网络设备)中预先保存相应的代码、表格或其他可用于指示相关信息的方式来实现,本申请对于其具体的实现方式不做限定,例如本申请实施例中预设的规则、预设的常数等。
还需要说明的是,“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。
为了便于理解本申请的方案,下文先简单介绍下与本申请相关的背景技术。
量子计算是一种利用了量子叠加和量子纠缠等量子性质的新型计算方式。与传统的基于晶体管的门电路的计算机类似,由量子门组成的量子线路也可以用来实现量子计算。特定的量子线路构建了量子算法。常见的经典量子算法有Shor提出的质因数分解算法、Grover提出的数据库搜索算法、哈罗-哈西迪-劳埃德(harrow-hassidim-lloyd,HHL)线性方程组求解算法等。这些量子算法的共同特点是利用了特定的量子线路,运行一次就可以得到结果,整个过程中不需要经典计算的参与。但是由于目前硬件上没有真正的通用量子计算机,导致这些量子算法的应用极为受限。
量子计算的发展可以用含噪声中等规模量子计算(noisy intermediate-scale quantum computing,NISQ) 来描述,为了充分发挥现有量子硬件的计算能力,一些经典-量子混合的算法被提了出来,这类算法的共同特点是,在整个计算过程可以有经典计算机的辅助。通常的做法是让量子计算机运行特定的量子线路得到一个运算结果,然后经典计算机根据当前的计算结果进行迭代,确定下一个需要运行的量子线路。如此循环多次后,量子计算机的结果变得收敛,得到最终的运算结果。因此,经典-量子混合的算法的关键之处就是经典计算机可以参与到整个运算过程中,为量子计算机指明优化的方向。而量子计算机则充分发挥了其计算上的速度优势,快速完成一些经典计算机难以处理的计算结果。常见的经典-量子混合算法有量子组合优化算法(quantum approximate optimization algorithm,QAOA)、变分量子本征值求解器(variational quantum eigensolver,VQE)以及用量子线路进行神经网络训练等。
常见的构建量子计算机的方法包括超导电路、离子阱、里德堡原子、半导体量子点等,然而这些方法通常都需要极端的实验条件,比如几十毫开尔文的低温、强激光、高真空等,而这些极端的实验条件对于普通用户来说并不容易获得。因此,用户希望可以有一些比较便捷的提供量子硬件服务的方式,云服务应运而生。云服务可以理解为:网页上提供一个交互式的界面以及命令行接口,用户可以通过这两种方式将编写量子线路(用户在编写量子线路时可以按照预定的规则进行编写,该预定的规则可以是需要有对某个量子比特进行测量的操作),然后发送到服务器端的量子计算机,量子计算机执行用户的代码命令,并将结果返回给用户。其中,一次量子计算过程中的完整结果通常是所有参与运算的量子比特的量子态,而量子态可以用密度矩阵的方法来表示,以单量子比特为例,其状态可以表示为ρ=(a b; b* 1-a),a为实数,b为复数,b*为b的复共轭。
若用于执行用户的代码命令是量子计算机的硬件,则每次返回的结果是单个方向上的,一般情况下,返回的是量子态在Z方向上的投影,即Z方向上量子态的概率。以上述单比特的量子态ρ为例,Z方向上的处于0态的概率为P(0)=a,Z方向上的处于1态的概率为P(1)=1-a。如果要得到其他方向(如X方向或Y方向)上的结果,则需要将X方向或Y方向的投影旋转到Z方向之后进行测量才可得到。期望测量是另一种可以用于反映量子计算结果的方法。对于期望的测量算符H,量子计算的结果是Tr(ρH)。以前面的单比特为例,期望算符为泡利算符Z=[1 0;0 -1]时,得到的期望值为P(0)-P(1)=2a-1,称作Z方向上的期望值。同样的,用泡利算符X=[0 1;1 0]作为期望测量算符可以得到X方向的期望值,即b+b*,用泡利算符Y=[0 -i;i 0]作为期望测量算符可以得到Y方向的期望值,即b-b*。另外,任意方向的期望测量算符都可以通过X、Y和Z方向的期望算符进行分解得到。
若用于执行用户的代码命令是量子计算机的模拟器,模拟器可以直接得到量子态的密度矩阵表示,因此可以直接计算出多个方向(包括X方向、Y方向和Z方向)的期望测量结果。
目前一种量子计算的方式为:界面下方有一个量子线路编写器,里面有代表量子操作的符号和代表量子比特的线性元件。用户通过拖放操作可以将代表量子操作的符号放到对应的量子比特上,然后量子线路可以被翻译成脚本语言(可以理解为对量子进行操作的计算机语言)。或者,通过命令行接口提供的用户命令也可以转换成量子线路,该量子线路可以被翻译成脚本语言,并且动态生成图形表示。然而这种方式中,代表量子操作的量子元件中,只提供单个方向(一般情况下是Z方向)上的概率测量。
另外一种量子计算的方式为:获取两个量子线路,然后首先编译运行第一个量子线路,然后动态的根据第一个量子线路的运行结果编译运行第二个量子线路。两个量子线路可以在不同的硬件上运行。然而这种方式是将单个含参量子线路变成多个量子线路进行运行,需要重复编译和运行量子线路,操作复杂。而且在硬件上运行,返回的都是处于单个方向(一般情况下是Z方向)上的量子态的概率结果,若要得到其他方向上的结果,则需要将X方向或Y方向的投影旋转到Z方向之后进行测量才可得到。
因此,本申请提供一种量子计算的方法,对于在硬件(该硬件即为量子计算机)上运行的量子线路,可以对量子线路进行分解,将其分解为多个方向期望测量的实际量子线路,这多个方向期望测量的实际量子线路可以独立在硬件上运行,得到多个运行结果,最后可以将多个运行结果进行发送,不仅可以简化重复编译的操作过程,而且可以在一次运行中返回多个方向的运行结果,不需要用户重复下发进行不同方向的期望测量的量子线路。
本申请可应用于图1所示的模型,用户通过一个量子计算平台即可完成对硬件上的量子计算机的操控。量子计算平台将量子计算机的一些功能封装,并向用户提供接口。用户通过量子计算的平台可以方便的控制量子计算机,运行各种量子算法和功能。
本申请可应用的量子计算平台通常是在经典的计算机设备上实现的,可以是个人电脑,或者是数据中心的服务器,也可以是便携式的个人手机等。
本申请在用户的界面上可以有类似如下图2的呈现。其中,图中用黑色实线圈出的表示特定的量子操作,例如,为Hadamard门,可以对一个量子比特进行操作,这个门可以用矩阵表示: 为绕X轴的旋转操作门,含一个参数a,可以操作一个量子比特,这个门可以用以下的矩阵表示:RX(a)=[cos(a/2) -isin(a/2);-isin(a/2) cos(a/2)];为绕Y轴的旋转操作门,含一个参数a,可以操作一个量子比特,这个门可以用以下的矩阵表示Y=[cos(a/2) -sin(a/2);-sin(a/2) cos(a/2)];为绕Z轴的旋转操作门,含一个参数a,可以操作一个量子比特,这个门可以用以下的矩阵表示:Z=[e-i(a/2) 0;0 ei(a/2)];为互换门,可以操作两个量子比特,可以用矩阵表示: 为受控非门,可以操作两个量子比特,可以用矩阵表示:
其中,的物理意义为绕X轴旋转角度a,例如,以某一个单量子比特为例,其初始状态可以表示为ρ0=(a b;b* 1-a),将该单量子比特绕X轴旋转角度a后的最终状态可以表示为ρ1=RX(a)*×ρ0×RX(a)。其它类似,不再赘述。
图2中黑色虚线圈出的表示量子测量,从左到右依次分别表示:在Z方向测量结果为0或为1的概率值;在X方向的期望值,在Y方向的期望值,在Z方向的期望值。其中表示X方向的期望值,Y方向的期望值和Z方向的期望值这几个算符是可以进行组合的。
是由用户将多个量子操作组合起来形成的组合操作,而是用户将多个量子期望测量操作组合起来形成的组合期望测量。
此外,图2中右上角的图标代表用户可以操作的功能,包括初始化、运行、后端和实际线路。其中,初始化表示将量子线路中的参数全部都设置为某个值,可以是全部为某个值,也可以是都是随机数字。运行可以选择单次运行,或者是根据量子测量返回的结果进行迭代运行。后端可以选择模拟器或者实际硬件。实际线路则可以向用户展示在硬件上运行量子线路的时候,实际的量子线路以及对结果的处理方式。
应理解,图中所示出的量子操作或量子测量包括但不限制图中所示出的,量子操作还可以包括其它操作,量子测量还可以包括其它方向的期望测量算符,不予限制。
图3为本申请实施例提供的一种量子线路的示意图。其中,用户可以用拖拽的方式,将量子操作和量子测量放置到代表量子比特的线上形成量子线路。从图中可以看出,该图中包括两条量子线路,分别是q0和q1,其中,每一条量子线路代表对一个量子比特的操作,因此,该图中包括的两条量子线路代表对两个量子比特的操作。其最终输出的结果可以包括4种结果:P(q0:0&q1:0)=A,P(q0:0&q1:1)=B,P(q0:1&q1:0)=C,P(q0:1&q1:1)=D,且A+B+C+D=1。其中,P(q0:0&q1:0)=A表示量子线路q0和q1的输出结果均为0的概率为A,P(q0:0&q1:1)=B表示量子线路q0的输出结果为0且q1的输出结果为1的概率为B,P(q0:1&q1:0)=C表示量子线路q0的输出结果为1且q1的输出结果为0的概率为C,P(q0:1&q1:1)=D表示量子线路q0和q1的输出结果均为1的概率为D。
本申请以下实施例将结合附图和应用场景,对本申请实施例提供的量子计算的方法进行具体阐述。
图4示出了电脑的一组图形用户界面(graphical user interface,GUI),其中,从图4中的(a)到图4中的(l)示出了量子计算的方法。
参见图4中的(a)所示的GUI,该GUI为电脑的桌面。电脑桌面可以包括回收站、我的电脑、浏览器等。当电脑检测到用户点击桌面上的浏览器的图标401的操作后,可以启动该浏览器,显示如图4中的(b)所示的GUI,该GUI可以称为浏览器的主界面。
参见图4中的(b)所示的GUI,界面显示一个新的空白网页,用户可以在上方条形框中输入用户想要访问的网址,例如用户可以在该条形框中输入第一网址,显示如图4中的(c)所示的GUI。
参见图4中的(c)所示的GUI,此时,网址输入框中显示第一网址,当电脑检测到用户输入第一网址且点击确认键后,显示如图4中的(d)所示的GUI。
参见图4中的(d)所示的GUI,界面显示量子计算的主页面,其中,图中用黑色实线圈出的表示特定的量子操作,用黑色虚线圈出的表示量子测量,每一个量子操作或量子测量所表示的具体含义请参考上文中图2所示的内容。应理解,图4中的(d)所示出的量子操作或量子测量包括但不限制图中所示出的,量子操作还可以包括其它操作,量子测量还可以包括其它测量,不予限制。
用户可以将任意量子操作或量子测量拖拽至线路上(如图中所示的线路q0、q1、q2上),假设用户将量子操作拖拽至线路q0上,将量子操作拖拽至线路q1上,显示图4中的(e)所示的GUI。
参见图4中的(e)所示的GUI,界面显示:线路q0上包括量子操作线路q1上包括量子操作其中,量子操作中的参数a、b、c、d为可变参数。此时,用户还可以将这两个线路上的量子操作进行组合,例如,用户可以将这4个量子操作全部选中后点击鼠标右键,并在弹出的菜单中选择将其组合为一个新的量子操作门,当电脑检测到用户上述操作后,显示如图4中的(f)所示的GUI。
参见图4中的(f)所示的GUI,可以看出,上述四个独立的量子操作此时已被组合为一个新的量子操作门,即且界面上方显示了该新的量子操作门。进一步地,用户可以将量子测量拖拽至线路上,假设用户将量子测量均分别拖拽至线路q0和线路q1上,显示如图4中的(g)所示的GUI。
参见图4中的(g)所示的GUI,界面显示:线路q0上包括量子操作以及量子测量 线路q1上包括量子操作以及量子测量此外,当用户将上述量子操作拖拽至线路q0和线路q1后,这四个量子测量可以被合并为一个组合测量门,即且界面上方显示了该新的组合测量门,同时,该内的上方显示系数框,用户可以在该系数框中设置系数,例如,界面上显示的在Z方向测量的系数为0.22,在X方向测量的系数为0.05。至此,用户已完成了含参数的量子线路的构建。当用户构建完含参数的量子线路后,可以在界面的右上角的功能区进行设置。当电脑检测到用户点击“初始化”的图标402的操作后,显示如图4中的(h)所示的GUI。
参见图4中的(h)所示的GUI,“初始化”这一功能按钮的下方显示一个菜单,包括:全部为0和随机初值,其中,若用户选择全部为0,则表示量子操作中的所有参数的初始值均设置为0;若用户选择随机初值,则表示量子操作中的所有参数的初始值均为随机值。用户可以选择任一种初始化设置,如用户选择全部为0,当电脑检测到用户点击“全部为0”后,显示如图4中的(i)所示的GUI。
参见图4中的(i)所示的GUI,可以看出,“初始化”的这一功能按钮处已显示为全部为0,进一步地,用户还可以对其它功能按钮进行设置。当电脑检测到用户点击“后端”的图标403的操作后,显示如图4中的(j)所示的GUI。
参见图4中的(j)所示的GUI,“后端”下方显示一个菜单,包括:模拟器和硬件,用户可以选择任一种后端设置,当电脑检测到用户点击“硬件”后,显示如图4中的(k)所示的GUI。
参见图4中的(k)所示的GUI,可以看出,“后端”的这一功能按钮处已显示为硬件,进一步地,用户还可以对其它功能按钮进行设置。当电脑检测到用户点击“实际线路”的图标404的操作后,显示如图4中的(l)所示的GUI。
参见图4中的(l)所示的GUI,界面右下方显示该量子线路在硬件上运行的实际线路。其中,虚线以上的线路为硬件在Z方向运行的实际线路,虚线以下的线路为硬件在X方向运行的实际线路。
此外,用户还可以更新量子操作中的参数,以得到不同的量子线路,示例性地,用户可以点击任意量子操作并对该量子操作中的参数a进行更新。
本申请提供的量子计算的方法,可以构建含参数的量子线路,而现有技术中在构建量子线路时需要指定参数为具体数值,导致构建的量子线路为固定线路,因此,本申请提供的构建量子线路的方法可以通过改变参数的具体数值即可得到不同的量子线路;由于本申请的量子线路可以根据参数的变化而变化,可以通过迭代运行的方法进行计算,与现有技术中由于构建的线路为固定线路无法使用迭代运行的方法相比,本申请实施例提供的方案可以优化量子线路的参数,使得测量的结果最佳;此外,对于在硬件上运行的量子线路,本申请是根据量子线路中组合起来的期望测量算符对量子线路进行分解,将其分解为多个方向期望测量的实际量子线路,这多个方向期望测量的实际量子线路可以独立在硬件上运行,得到多个结果,最后将多个结果组合起来可以得到多方向组合的测量结果,与现有技术中重复编译和运行量子线路且一次只能返回单个方向的测量结果相比,本申请实施例提供的方案不仅可以简化重复编译的操作过程,而且即使在硬件上运行量子线路,也可以在一次运行中返回多个方向期望测量结果的组合,不需要用户重复下发进行不同方向的期望测量的量子线路。
下文将结合图5详细说明本申请的方案。如图5所示,为本申请实施例提供的一种量子计算的方法的示意图,该方法可以包括步骤S710~S730。本申请实施例以量子计算平台为电脑为例。
S710,选取含参量子操作和量子测量,构建含参量子线路。
本申请实施例中,用户可以选择任一量子操作添加到第一个量子比特上,示例性地,用户可以选择量子操作添加到量子比特1上,如上述图4中的(e)示出的用户将量子操作拖拽至线路q0上,该量子操作占1个量子比特,此处可以认为线路q0所占的量子比特为量子比特1。类似地,用户可以按照类似方法将多个量子操作添加到量子比特上。
进一步地,用户还可以将量子测量添加至量子比特上,用户可以按照图6所示的方法进行,该方法可以包括步骤S810~S850。
S810,选取第一个量子测量,添加到第一个量子比特上。
本申请实施例中,用户可以选择任一量子测量添加到第一个量子比特上,示例性地,用户可以选择量子测量添加到量子比特1上,如上述图4中的(g)示出的用户将量子测量拖拽至线路q0上,该量子测量占1个量子比特,此处可以认为线路q0所占的量子比特为量子比特1。
S820,选取下一个量子测量,添加到下一个量子比特上。
用户选择下一个量子测量添加到下一个量子比特上,此时,用户可能将量子测量添加到量子比特1上或其它量子比特(如量子比特2)上,不予限制。
S830,是否有连续的两个量子测量在同一个量子比特上。
若否,则执行步骤S840;若是,则执行步骤S850。
S840,增加系数输入框,将该量子测量与第一个量子测量用虚线隔离。
S850,量子测量是否已全部添加。
若否,则返回步骤S820;若是,则结束。
当电脑识别到用户连续添加了两个量子测量后,可以先判断这两个量子测量是否在同一个量子比特上,若这两个量子测量在同一个量子比特上,则可以继续判断量子测量是否已全部添加;若这两个量子测量在同一个量子比特上,则可以将这两个量子测量用虚线隔离,用虚线隔离的目的是示意这两个连续的量子测量在量子线路上并不是按先后顺序执行,而是需要按测量符号对应的表达式整合成单个测量结果返回。
示例一:
若用户在步骤S810中,选择将量子测量添加到量子比特1上,在步骤S820中选择将量子测量添加到量子比特2上,如上述图4中的(g)所示出的用户将量子测量拖拽至线路q1上,由于连续的这两个量子测量分别被添加到不同的量子比特上,则电脑可以进行下一步的判断,判断量子测量是否已全部添加,若确定量子测量没有全部添加,则返回步骤S820中选取下一个量子测量。
若用户选择的下一个量子测量为量子测量且将该量子测量添加到量子比特2,由于此时该量子测量所添加至的量子比特2上已经有上一次添加的量子测量则可以将该量子测量与上一次添加的量子测量用虚线隔离,表示这两个连续的量子测量在量子线路上并不是按先后顺序执行,而是需要按测量符号对应的表达式整合成单个测量结果返回。当电脑判断量子测量已全部添加时,则此次含参量子线路的构建结束。
如图7所示,为本申请实施例提供的一种含参量子线路的示意图。从图中可以看出,该含参量子线路可以包括两条含参量子线路,分别为q0和q1,其中,含参量子线路q0上包括量子操作含参量子线路q1上包括量子操作这四个量子操作被组合为一个新的量子操作门,量子操作中的参数a、b、c、d是可变的。
此外,含参量子线路q0上还包括量子测量表示含参量子线路q0可以计算Z方向和X方向上的期望;类似地,含参量子线路q1上还包括量子测量表示含参量子线路q1可以计算Z方向和X方向上的期望。
需要说明的是,在同一个量子比特上拖放的符号的先后顺序代表量子操作执行的先后顺序。而对于连续的两个量子测量在同一个量子比特上,则可以将这两个量子测量用虚线隔离,并且将在不同量子比特上连续的量子测量用实线框到一起,说明该测量应该是在同一时间完成的,需要返回一个测量结果。
如上述图7所示,含参量子线路q0和q1上均包括量子测量则在实际量子计算的过程中,含参量子线路q0和q1在Z方向上的期望是在同一时间完成的,含参量子线路q0和q1在X方向上的期望是在同一时间完成的。
S712,参数初始化/更新。
本申请实施例中,在完成含参量子线路的构建后,可以对量子操作中的参数进行初始化,可以将参数全部设置为0,也可以将参数设置为其它任意数值,不予限制。
若执行该含参量子线路的是模拟器,则可以执行步骤S714,即电脑可以模拟量子计算机在电脑上运行量子线路,并输出整合结果,即跳转到步骤S726。而且,需要说明的是,本申请实施例中,若电脑模拟量子计算机在电脑上运行量子线路,则输出的结果为多个方向的运行结果的组合值。
若执行该含参量子线路的是硬件(即量子计算机),则可以执行步骤S716,即分解量子线路,构建出在硬件上运行的实际线路。
具体在分解量子线路时,可以根据用户选择的测量组合方式对量子线路进行分解,如图8所示,为本申请实施例提供的一种计算测量算符集合的方法示意图,该方法可以包括步骤S1010~S1070。
S1010,从用户输入中获取目标期望算符。
S1020,选取其中一个测量算符,并与测量算符集合G中的所有算符进行对比。
以表达式H=0.22Z1Z2+0.05X1X2为例,本申请实施例中的目标期望算符可以为该表达式H=0.22Z1Z2+0.05X1X2中所包括的算符X1X2、Z1Z2
S1030,是否存在对相同比特进行不同方向的测量/G是否为空。
可以理解的是,若首次将其中一个测量算符与测量算符集合G中的所有算符进行对比,由于此时测量算符集合G为空,因此,可以直接执行步骤S1040;对于除首次之外的将其中一个测量算符与测量算符集合G中的所有算符进行对比,由于此时测量算符集合G不为空,则可以将该测量算符与测量算符集 合G中的所有算符进行对比,并根据对比结果确定执行步骤S1040或S1050。
若是,则执行步骤S1040;若否,则执行步骤S1050。
S1040,将该测量算符添加至G测量算符集合中。
S1050,将该算符与现有测量算符集合G中的某个算符合并。
S1060,是否遍历所有目标期望中的测量算符。
若是,则执行步骤S1070;若否,则返回步骤S1020。
S1070,输出测量算符集合G。
以下将以上述示例中提及的表达式H=0.22Z1Z2+0.05X1X2为例,计算该表达式的测量算符集合G。
H的第一个算符为X1X2,因此,硬件上需要运行的测量算符集合G中的第一个测量算符为X1X2;H的第二个算符为Z1Z2,它与测量算符集合G中的第一个算符中的第一个量子比特和第二个量子比特存在重合,但是重合的第一个量子比特的测量方向和第二个量子比特的测量方向均不同,因此,测量算符集合G中可以添加第二个测量算符Z1Z2。因此,最终得到硬件上需要测量的算符集合G为{X1X2,Z1Z2},即在硬件上需要运行两次。
由于该表达式最终在硬件上需要测量的算符集合G为{X1X2,Z1Z2},在硬件上需要运行两次,因此,可以将该表达式所对应的量子线路分解为在硬件上运行的两条实际线路。
为了更好理解测量算符集合的计算,本申请实施例将以氢分子的哈密顿量表达式H=0.22X1X2+0.15Z1+0.15Z2+0.005Z1Z2为例进行说明。
H的第一个算符为X1X2,因此,硬件上需要运行的测量算符集合G中的第一个测量算符为X1X2;H的第二个算符为Z1,它与测量算符集合G中的第一个算符中的第一个量子比特存在重合,但是重合的第一个量子比特的测量方向不同,因此,测量算符集合G中可以添加第二个测量算符Z1;H的第三个算符为Z2,它与测量算符集合G中的第一个算符X1X2中的第二个量子比特存在重合,但是重合的测量方向不同,同时,它与测量算符集合G中的第二个算符Z1的量子比特不存在重合,因此,测量算符集合G中可以将测量算符Z2合并至第二个算符上,即第二个测量算符变成Z1Z2;H的第四个算符为Z1Z2,它与测量算符集合G中的第二个测量算符的量子比特完全重合,且重合的测量方向相同,因此不需要继续添加该测量算符。因此,最终得到硬件上需要测量的算符集合G为{X1X2,Z1Z2},即在硬件上需要运行两次。
由于该氢分子的哈密顿量表达式最终在硬件上需要测量的算符集合G为{X1X2,Z1Z2},在硬件上需要运行两次,因此,可以将该氢分子的哈密顿量表达式所对应的量子线路分解为在硬件上运行的两条实际线路。
如图9所示,为本申请实施例提供的针对图7的量子线路进行分解后得到的在硬件上运行的两条实际线路的示意图。其中,图9中虚线以上的线路为硬件在Z方向运行的实际线路,虚线以下的线路为硬件在X方向运行的实际线路。
S718,选择一个实际线路,并将该线路发送到量子计算机。
S720,量子计算机处理该实际线路。
S722,电脑获取该实际线路的运行结果。
S724,是否已运行所有实际线路。
若是,则执行步骤S726;若否,则返回执行步骤S718。
S726,输出整合结果。
本申请实施例中,对于上述两条实际线路,电脑可以选择其中一个实际线路,并将该实际线路发送至量子计算机,例如,电脑可以先选择在Z方向运行的实际线路发送至量子计算机,由量子计算机处理完成后,可以将运行结果发送至电脑;然后再将另外一个实际线路发送至量子计算机,经量子计算机处理完成后,将运行结果发送至电脑。当电脑确定已经运行所有的实际线路后,可以输出整合结果。
其中,整合结果可以基于量子计算机运行每一条实际线路后获得的运行结果确定,示例性地,假设电脑对量子线路进行分解后所构建的在量子计算机上运行的实际线路包括2条,分别为Z方向的量子测量和X方向的量子测量,且Z方向上的测量的系数为a1,X方向上的测量的系数为a2,则可以先分别计 算每一个方向的运行结果和该方向上的测量的系数的乘积,然后再对多个方向的乘积求和。
S728,结果是否收敛。
若是,则执行步骤S730;若否,则返回执行步骤S712。
当电脑得到整合结果后,可以先判断该整合结果是否收敛,若收敛,则可以向用户输出当前参数和该整合结果;若未收敛,则可以更新含参量子操作中的参数,并重新构建出在硬件上运行的实际线路,由量子计算机对重新构建的实际线路进行处理,在处理完成后,将运行结果发送到电脑,电脑可以再次对运行结果进行整合并判断整合结果是否收敛。
当然,在一些可能的实现方式中,当量子计算机运行完所有实际线路后,可以基于运行每一条实际线路后的运行结果获得整合结果,然后向电脑发送整合结果,不予限制。
本申请实施例中的结果是否收敛可以理解为:整合结果是否为所有结果中的最小值。在一种可能的实现方式中,假设用户第一次初始化参数后,得到的整合结果为w1;假设用户第二次更新参数后(如用户对初始化参数增加第一步长),得到的整合结果为w2,且w2<w1,说明此时步长改变的方向是可取的,用户可以再次更新参数;假设用户第三次更新参数后(如用户对第二次更新后的参数增加第二步长,且第二步长小于第一步长),得到的整合结果为w3,且w3<w2<w1,此时用户可以再次更新参数;假设用户第四次更新参数后(如用户对第三次更新后的参数增加第三步长,且第三步长小于第一步长),得到的整合结果为w4,且w4>w3<w2<w1,此时可以判断w3为所有结果中的最小值,从而可以判断w3这一结果收敛。最终输出的也是w3以及w3所对应的参数的数值。
在另一种可能的实现方式中,用户也可以设置迭代次数,电脑按照设置的迭代次数运行,同时可以记录每一次运行完成后的结果,当迭代结束,可以从多次运行后的结果中选取结果最小的,并输出该结果与该结果所对应的参数。
本申请实施例提供的方案,可以构建含参数的量子线路,通过改变参数的具体数值即可得到不同的量子线路;由于本申请的量子线路可以根据参数的变化而变化,可以通过迭代运行的方法进行计算,通过用迭代的方式可以优化量子线路的参数,使得组合测量的结果最佳;此外,对于在硬件上运行的量子线路,本申请是根据量子线路中组合起来的期望测量算符对量子线路进行分解,将其分解为多个方向期望测量的实际量子线路,这多个方向期望测量的实际量子线路可以独立在硬件上运行,得到多个结果,最后将多个结果组合起来可以得到多方向组合的测量结果,不仅可以简化重复编译的操作过程,而且即使在硬件上运行量子线路,也可以在一次运行中返回多个方向期望测量结果的组合,不需要用户重复下发进行不同方向的期望测量的量子线路。对于在模拟器上运行的量子线路,本申请可以向用户返回多个方向的测量结果的组合,可以保全多个方向的测量结果,从而可以运行一些依赖于更多信息的量子线路,也可以运行经典-量子混合的变分量子算法。
此外,上述步骤S1070中说明了氢分子的哈密顿量表达式为H=0.22X1X2+0.15Z1+0.15Z2+0.005Z1Z2,并将该氢分子的哈密顿量表达式所对应的量子线路分解为在硬件上运行的两条实际线路。
若应用VQE算法求解上述哈密顿量的本征能量,由于该算法需要两个量子比特之间存在相互作用,因此用户可以再拖拽一个可控非门(controlled-not gate,CNOT),并且需要8个参数才能得到合理的结果,因此用户可以再将之前定义的再次拖放到线路上,并且重新映射参数,使其变成它需要接收的参数与前面的接收的参数完全不同,为a',b',c'和d'。最后,从量子测量中选择X方向的测量操作,应用到q0和q1上。之后继续给q0应用1个Z方向的测量操作。由于在同一个量子比特上有两个测量操作,因此这些测量操作可以自动变成组合测量M,继续给q1添加Z方向的测量操作,最后同时给q0和q1添加Z方向的测量操作,并且在相应的操作上面添加特定值(该特定值即为上述氢分子的哈密顿量表达式中对应的系数),从而完成量子线路的构建,如图10所示。
按照上述图8所示的方法对该量子线路进行分解,得到在硬件上运行的实际线路如图11所示。其中,图11中虚线以上的线路为硬件在Z方向运行的实际线路,虚线以下的线路为硬件在X方向运行的实际线路。
应理解,上述各示例中示出的数值仅为举例说明,还可以为其他数值,不应对本申请造成特别限定。
如图12所示,为本申请实施例提供的一种量子计算的方法的示意图,该方法可以由第一电子设备和第二电子设备执行,其中,第一电子设备可以为上述实施例中的电脑,第二电子设备可以为上述实施例 的量子计算机,该方法可以包括步骤1210~1260。
1210,第一电子设备对第一量子线路进行拆分,获得n个第二量子线路。
其中,n可以为大于或等于2的整数。
可以理解的是,本申请实施例中的n个第二量子线路即为上述示例中提及的实际线路,换句话说,第二量子线路的数量即为上述示例中的实际线路的数量。
1220,所述第一电子设备向第二电子设备发送所述n个第二量子线路。
1230,第二电子设备接收第一电子设备发送的n个第二量子线路。
1240,所述第二电子设备运行所述n个第二量子线路,得到n个第一运行结果。
1250,所述第二电子设备向所述第一电子设备发送运行结果,所述运行结果指示运行所述n个第二量子线路得到的结果。
1260,所述第一电子设备接收所述第二电子设备发送的运行结果。
本申请实施例提供的方案,第一电子设备可以对第一量子线路进行拆分,并向第二电子设备发送拆分后获得的n个第二量子线路,第二电子设备在接收到n个第二量子线路后,对这n个第二量子线路进行运行,得到n个第一运行结果,然后向第一电子设备发送运行结果,该运行结果指示运行n个第二量子线路得到的结果,与现有技术中重复编译和运行量子线路且一次只能返回单个方向的测量结果的方案相比,本申请实施例提供的方案不仅可以简化重复编译的操作过程,而且也可以在一次运行中返回多个方向的运行结果,不需要用户重复下发进行不同方向的期望测量的量子线路。
可选地,在一些实施例中,所述第一量子线路包括n个方向的量子测量,所述第二量子线路包括一个方向的量子测量。
可以理解的是,本申请实施例中的每一个第二量子线路包括一个方向的量子测量,这每一个第二量子线路所包括的量子测量的方向不同。例如,假设第一量子线路包括2个方向(如X方向和Z方向)的量子测量,第一电子设备对其进行拆分后,可以获得2个第二量子线路,这2个第二量子线路中,其中一个第二量子线路可以包括某一个方向(如X方向)的量子测量,另一个第二量子线路可以包括另一个方向(如Z方向)的量子测量。
本申请实施例提供的方案,第一量子线路包括n个方向的量子测量,第一电子设备对第一量子线路进行拆分时,可以获得n个第二量子线路,且每一个第二量子线路包括一个方向的量子测量,可以确保对第一量子线路进行拆分的准确性,有利于第二电子设备提高其运行n个第二量子线路后所得到的n个第一运行结果的准确性。
可选地,在一些实施例中,所述对所述第一量子线路进行拆分,包括:
根据所述第一量子线路所对应的测量算符对所述第一量子线路进行拆分。
本申请实施例中,关于根据第一量子线路所对应的测量算符对第一量子线路进行拆分的内容可以参考上述图8所示的内容,不再赘述。
本申请实施例提供的方案,第一电子设备可以根据第一量子线路所对应的测量算符对第一量子线路进行拆分,可以提升对第一量子线路进行拆分的准确性,进一步地,可以提高第二电子设备运行n个第二量子线路后所得到的n个第一运行结果的准确性。
可选地,在一些实施例中,所述第一量子线路所对应的测量算符包括M个,所述根据所述第一量子线路所对应的测量算符对所述第一量子线路进行拆分,包括:
对于第j个测量算符,将所述第j个测量算符添加至测量算符集合中,j为小于或等于M的任一数值;
对于第k个测量算符,判断所述测量算符集合中是否存在与所述第k个测量算符相同量子比特且不同方向的测量算符,k遍历1至M且k≠j;
根据判断结果将所述第k个测量算符与所述测量算符集合中已存在的测量算符合并,或,将所述第k个测量算符添加至所述测量算符集合中。
本申请实施例提供的方案,对于第j个测量算符,第一电子设备可以将第j个测量算符添加至测量算符集合中,对于第k个测量算符,第一电子设备可以判断测量算符集合中是否存在与第k个测量算符相同量子比特且不同方向的测量算符,并根据判断结果进行进一步地操作,以对第一量子线路进行拆分,通过该方法对第一量子线路进行拆分后获得的第二量子线路的数量最少,从而可以确保第二电子设备运行第二量子线路的数量最少,减少运行时间,提高效率。
可选地,在一些实施例中,所述根据判断结果将所述第k个测量算符与所述测量算符集合中已存在 的测量算符合并,或,将所述第k个测量算符添加至所述测量算符集合中,包括:若所述测量算符集合中存在与所述第k个测量算符相同量子比特且不同方向的测量算符,将所述第k个测量算符添加至所述测量算符集合中;若所述测量算符集合中不存在与所述第k个测量算符相同量子比特和/或不同方向的测量算符,将所述第k个测量算符与所述测量算符集合中已存在的测量算符合并。
本申请实施例提供的方案,若测量算符集合中存在与第k个测量算符相同量子比特且不同方向的测量算符,第一电子设备可以将第k个测量算符添加至测量算符集合中;若测量算符集合中不存在与第k个测量算符相同量子比特和/或不同方向的测量算符,第一电子设备可以将第k个测量算符与测量算符集合中已存在的测量算符合并,以对第一量子线路进行拆分,通过该方法对第一量子线路进行拆分后获得的第二量子线路的数量最少,从而可以确保第二电子设备运行第二量子线路的数量最少,减少运行时间,提高效率。
可选地,在一些实施例中,所述第一量子线路包括含第一参数的量子操作,所述第一参数的具体数值可变。
本申请实施例提供的方案,第一量子线路还可以包括含第一参数的量子操作,且第一参数的具体数值可变,现有技术中在构建量子线路时需要指定参数为具体数值,导致构建的量子线路为固定线路,因此,本申请提供的方法可以通过改变参数的具体数值即可得到不同的量子线路,提升灵活性和多样性。
可选地,在一些实施例中,所述含所述第一参数的量子操作包括多个量子操作,所述第一量子线路还包括含第二参数的量子操作,所述含第二参数的量子操作通过组合操作门获得,所述组合操作门为包括所述多个量子操作的组合门。
本申请实施例提供的方案,第一量子线路还可以包括含第二参数的量子操作,即第一量子线路可以包括含第一参数的量子操作和含第二参数的量子操作,且含第二参数的量子操作通过组合操作门获得。由于该第一量子线路中的含第二参数的量子操作通过组合操作门获得,与现有技术中需要用户单独将每一个量子操作拖拽至量子线路的方案相比,本申请实施例提供的方案可以简化用户的操作。
可选地,在一些实施例中,所述运行结果包括n个第一运行结果或基于所述n个第一运行结果确定的第一组合结果,所述n个第一运行结果为所述第二电子设备运行所述n个第二量子线路运行得到的结果。
可选地,在一些实施例中,所述运行结果包括n个第一运行结果,所述方法还包括:根据所述n个第一运行结果和所述第一量子线路中所对应的测量算符的系数确定第一组合结果。
本申请实施例中的第一量子线路中所对应的测量算符的系数可以为图4中的(g)中所示出的量子测量的上方显示的系数0.22和0.05;这n个第一运行结果包括n个方向的运行结果,则第一组合结果即为X方向的第一运行结果与X方向测量的系数0.05的乘积,以及Z方向的第一运行结果与Z方向测量的系数0.22的乘积,这两者的和。
本申请实施例提供的方案,若运行结果包括n个第一运行结果,第一电子设备可以根据n个第一运行结果和第一量子线路中所对应的测量算符的系数确定第一组合结果,通过设置不同的系数即可得到不同的第一组合结果,可以提升量子计算的灵活性。
可选地,在一些实施例中,所述第一量子线路为初始化所述第一参数后的量子线路,所述方法还包括:
第一电子设备接收用户第w次更新所述第一参数的操作,并向第二电子设备发送更新所述第一参数后的第二量子线路,w从1开始取值;
第二电子设备接收所述第一电子设备发送的第w次更新所述第一参数后的第二量子线路;
所述第二电子设备运行所述第w次更新所述第一参数后的第二量子线路,以得到n个第(w+1)运行结果;
所述第二电子设备向所述第一电子设备发送第(w+1)次运行后的运行结果,所述第(w+1)次运行后的运行结果包括n个第(w+1)运行结果或第(w+1)组合结果,所述第(w+1)组合结果基于所述n个第(w+1)运行结果得到;
所述第一电子设备接收所述第二电子设备发送的第(w+1)次运行后的运行结果;
所述第一电子设备判断所述第(w+1)组合结果是否收敛;
在所述第(w+1)组合结果收敛的情况下,所述第一电子设备显示目标结果和目标参数,所述目标结果为组合结果中数值最小的,所述目标参数为所述数值最小的组合结果所对应的参数。
本申请实施例中,关于判断组合结果是否收敛的具体内容请参考上述步骤728的相关内容,不再赘述。
本申请实施例提供的方案,用户可以多次对第一参数进行更新,第一电子设备可以向第二电子设备发送第w次更新后的第二量子线路,第二电子设备可以第w次运行更新第一参数后的第二量子线路,以得到n个第(w+1)运行结果,并向第一电子设备发送第(w+1)次运行后的运行结果;第一电子设备在接收到第二电子设备第(w+1)次运行后的运行结果后,可以判断第(w+1)组合结果(其中,第(w+1)组合结果基于所述n个第(w+1)运行结果得到)是否收敛,在第(w+1)组合结果收敛的情况下,显示目标结果和目标参数。由于用户可以对第一量子线路中的第一参数进行多次更新,第二电子设备可以分别运行每一次更新后的第二量子线路,并将运行结果发送至第一电子设备,第一电子设备在每一次接收到运行结果后,可以判断组合结果(该组合结果可能为运行结果,也可能为基于运行结果得到的结果)是否收敛,并在该组合结果收敛的情况下,显示目标结果和目标参数。换句话说,本申请实施例提供的方案可以通过迭代运行的方法进行计算,与现有技术中由于构建的线路为固定线路无法使用迭代运行的方法相比,本申请实施例提供的方案可以优化量子线路的参数,使得测量的结果最佳。
可选地,在一些实施例中,所述方法还包括:响应于所述用户的第一操作,显示所述n个第二量子线路。
本申请实施例中的第一操作可以为上述图4中的(k)中用户点击“实际线路”的图标404的操作,且若n=2,则n个第二量子线路可以为上述图4中的(l)所示的界面右下方所显示的2条实际线路。
本申请实施例提供的方案,响应于用户的第一操作,第一电子设备可以显示n个第二量子线路,可以展现第二电子设备运行变分量子算法所做的特定适配,可以让用户直观的看到底层的运行逻辑,提升对量子硬件的感知。
应理解,本申请实施例中的图12所示的具体的例子只是为了帮助本领域技术人员更好地理解本申请实施例,而非限制本申请实施例的范围。还应理解,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
还应理解,在本申请的各个实施例中,如果没有特殊说明以及逻辑冲突,不同的实施例之间的术语和/或描述具有一致性、且可以相互引用,不同的实施例中的技术特征根据其内在的逻辑关系可以组合形成新的实施例。
还应理解,在上述一些实施例中,主要以现有的网络架构中的设备为例进行了示例性说明,应理解,对于设备的具体形式本申请实施例不作限定。例如,在未来可以实现同样功能的设备都适用于本申请实施例。
可以理解的是,上述各个方法实施例中,由设备(如第一电子设备和第二电子设备)实现的方法和操作,也可以由可用于设备的部件(例如芯片或者电路)实现。
以上,结合图12详细说明了本申请实施例提供的量子计算的方法。上述量子计算的方法主要从第一电子设备和第二电子设备之间交互的角度进行了介绍。可以理解的是,第一电子设备和第二电子设备,为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。
本领域技术人员应该可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
以下,结合图13和图14详细说明本申请实施例提供的量子计算的装置。应理解,装置实施例的描述与方法实施例的描述相互对应,因此,未详细描述的内容可以参见上文方法实施例,为了简洁,部分内容不再赘述。
本申请实施例可以根据上述方法示例对发送端设备或者接收端设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。下面以采用对应各个功能划分各个功能模块为例进行说明。
图13是本申请实施例提供的量子计算的装置1300的示意性框图。该量子计算的装置1300可以包括收发模块1310和处理模块1320。收发模块1310可以实现相应的通信功能,处理模块1320用于进行数据 处理。收发模块1310还可以称为通信接口或通信单元等。
可选地,该量子计算的装置1300还可以包括存储单元,该存储单元可以用于存储指令和/或数据,处理模块1320可以读取存储单元中的指令和/或数据,以使得装置实现前述方法实施例。
该量子计算的装置1300可以用于执行上文方法实施例中电子设备(如第一电子设备和第二电子设备)所执行的动作,这时,该量子计算的装置1300可以为第一电子设备,比如电脑,收发模块1310用于执行上文方法实施例中第一电子设备侧的收发相关的操作,处理模块1320用于执行上文方法实施例中第一电子设备侧的处理相关的操作。
作为一种设计,该量子计算的装置1300用于执行上文方法实施例中第一电子设备所执行的动作。
一种可能的实现方式,处理模块1320,用于对第一量子线路进行拆分,获得n个第二量子线路;
收发模块1310,用于向第二电子设备发送所述n个第二量子线路;还用于接收所述第二电子设备发送的运行结果,所述运行结果指示运行所述n个第二量子线路得到的结果。
该量子计算的装置1300可实现对应于根据本申请实施例的方法实施例中的第一电子设备执行的步骤或者流程,该量子计算的装置1300可以包括用于执行方法实施例中的第一电子设备执行的方法的单元。并且,该量子计算的装置1300中的各单元和上述其他操作和/或功能分别为了实现方法实施例中的第一电子设备中的方法实施例的相应流程。
应理解,各单元执行上述相应步骤的具体过程在上述方法实施例中已经详细说明,为了简洁,在此不再赘述。
作为另一种设计,该装置1300用于执行上文方法实施例中第二电子设备所执行的动作。
一种可能的实现方式,收发模块1310,用于接收第一电子设备发送的n个第二量子线路,所述n个量子线路为对第一量子线路进行拆分后的量子线路;
处理模块1320,用于运行所述n个第二量子线路,得到n个第一运行结果;
收发模块1310,还用于向所述第一电子设备发送所述运行结果,所述运行结果指示运行所述n个第二量子线路得到的结果。
该量子计算的装置1300可实现对应于根据本申请实施例的方法实施例中的第二电子设备执行的步骤或者流程,该量子计算的装置1300可以包括用于执行方法实施例中的第二电子设备执行的方法的单元。并且,该量子计算的装置1300中的各单元和上述其他操作和/或功能分别为了实现方法实施例中的第二电子设备中的方法实施例的相应流程。
应理解,各单元执行上述相应步骤的具体过程在上述方法实施例中已经详细说明,为了简洁,在此不再赘述。
上文实施例中的处理模块1320可以由至少一个处理器或处理器相关电路实现。收发模块1310可以由收发器或收发器相关电路实现。存储单元可以通过至少一个存储器实现。
如图14所示,本申请实施例还提供一种量子计算的装置1500。该装置1500包括处理器1510,还可以包括一个或多个存储器1520。处理器1510与存储器1520耦合,存储器1520用于存储计算机程序或指令和/或数据,处理器1510用于执行存储器1520存储的计算机程序或指令和/或数据,使得上文方法实施例中的方法被执行。可选地,该装置1500包括的处理器1510为一个或多个。
可选地,该存储器1520可以与该处理器1510集成在一起,或者分离设置。
可选地,如图14所示,该装置1500还可以包括收发器1530,收发器1530用于信号的接收和/或发送。例如,处理器1510用于控制收发器1530进行信号的接收和/或发送。
作为一种方案,该装置1500用于实现上文方法实施例中由量子计算的装置(如上述第一电子设备或第二电子设备)执行的操作。
本申请实施例还提供一种计算机可读存储介质,其上存储有用于实现上述方法实施例中由量子计算的装置(如上述第一电子设备或第二电子设备)执行的方法的计算机指令。
例如,该计算机程序被计算机执行时,使得该计算机可以实现上述方法实施例中由量子计算的装置(如上述第一电子设备或第二电子设备)执行的方法。
本申请实施例还提供一种包含指令的计算机程序产品,该指令被计算机执行时使得该计算机实现上述方法实施例中由量子计算的装置(如上述第一电子设备或第二电子设备)执行的方法。
本申请实施例还提供一种系统,该系统包括上文实施例中的第一电子设备和第二电子设备。
上述提供的任一种装置中相关内容的解释及有益效果均可参考上文提供的对应的方法实施例,此处 不再赘述。
应理解,本申请实施例中提及的处理器可以是中央处理单元(central processing unit,CPU),还可以是其他通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
还应理解,本申请实施例中提及的存储器可以是易失性存储器和/或非易失性存储器。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM)。例如,RAM可以用作外部高速缓存。作为示例而非限定,RAM可以包括如下多种形式:静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。
需要说明的是,当处理器为通用处理器、DSP、ASIC、FPGA或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件时,存储器(存储模块)可以集成在处理器中。
还需要说明的是,本文描述的存储器旨在包括但不限于这些和任意其它适合类型的存储器。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的保护范围。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。此外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元实现本申请提供的方案。
另外,在本申请各个实施例中的各功能单元可以集成在一个单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。例如,所述计算机可以是个人计算机,服务器,或者网络设备等。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD)等。例如,前述的可用介质可以包括但不限于:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。 因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (21)

  1. 一种量子计算的方法,其特征在于,所述方法应用于第一电子设备,所述方法包括:
    对第一量子线路进行拆分,获得n个第二量子线路;
    向第二电子设备发送所述n个第二量子线路;
    接收所述第二电子设备发送的运行结果,所述运行结果指示运行所述n个第二量子线路得到的结果。
  2. 根据权利要求1所述的方法,其特征在于,所述第一量子线路包括n个方向的量子测量,所述n个第二量子线路中的任一第二量子线路包括所述n个方向中的一个方向的量子测量。
  3. 根据权利要求1或2所述的方法,其特征在于,所述对所述第一量子线路进行拆分,包括:
    根据所述第一量子线路所对应的测量算符对所述第一量子线路进行拆分。
  4. 根据权利要求3所述的方法,其特征在于,所述第一量子线路所对应的测量算符包括M个,所述根据所述第一量子线路所对应的测量算符对所述第一量子线路进行拆分,包括:
    对于第j个测量算符,将所述第j个测量算符添加至测量算符集合中,j为小于或等于M的任一数值;
    对于第k个测量算符,判断所述测量算符集合中是否存在与所述第k个测量算符相同量子比特且不同方向的测量算符,k遍历1至M且k≠j;
    根据判断结果将所述第k个测量算符与所述测量算符集合中已存在的测量算符合并,或,将所述第k个测量算符添加至所述测量算符集合中。
  5. 根据权利要求4所述的方法,其特征在于,所述根据判断结果将所述第k个测量算符与所述测量算符集合中已存在的测量算符合并,或,将所述第k个测量算符添加至所述测量算符集合中,包括:
    若所述测量算符集合中存在与所述第k个测量算符相同量子比特且不同方向的测量算符,将所述第k个测量算符添加至所述测量算符集合中;
    若所述测量算符集合中不存在与所述第k个测量算符相同量子比特和/或不同方向的测量算符,将所述第k个测量算符与所述测量算符集合中已存在的测量算符合并。
  6. 根据权利要求1至5中任一项所述的方法,其特征在于,所述第一量子线路包括含第一参数的量子操作,所述第一参数的具体数值可变。
  7. 根据权利要求6所述的方法,其特征在于,所述含所述第一参数的量子操作包括多个量子操作,所述第一量子线路还包括含第二参数的量子操作,所述含第二参数的量子操作通过组合操作门获得,所述组合操作门为包括所述多个量子操作的组合门。
  8. 根据权利要求1至7中任一项所述的方法,其特征在于,所述运行结果包括n个第一运行结果或基于所述n个第一运行结果确定的第一组合结果,所述n个第一运行结果为所述第二电子设备运行所述n个第二量子线路得到的结果。
  9. 根据权利要求8所述的方法,其特征在于,所述运行结果包括n个第一运行结果,所述方法还包括:
    根据所述n个第一运行结果和所述第一量子线路中所对应的测量算符的系数确定第一组合结果。
  10. 根据权利要求8或9所述的方法,其特征在于,所述第一量子线路为初始化第一参数后的量子线路,所述方法还包括:
    接收用户第w次更新所述第一参数的操作,并向第二电子设备发送更新所述第一参数后的第二量子线路,w从1开始取值;
    接收所述第二电子设备发送的第(w+1)次运行后的运行结果,所述第(w+1)次运行后的运行结果包括n个第(w+1)运行结果或第(w+1)组合结果,所述第(w+1)组合结果基于所述n个第(w+1)运行结果得到;
    判断所述第(w+1)组合结果是否收敛;
    在所述第(w+1)组合结果收敛的情况下,显示目标结果和目标参数,所述目标结果为组合结果中数值最小的,所述目标参数为所述数值最小的组合结果所对应的参数。
  11. 根据权利要求1至10中任一项所述的方法,其特征在于,所述方法还包括:
    响应于所述用户的第一操作,显示所述n个第二量子线路。
  12. 一种量子计算的方法,其特征在于,所述方法应用于第二电子设备,所述方法包括:
    接收第一电子设备发送的n个第二量子线路,所述n个量子线路为对第一量子线路进行拆分后的量子线路;
    运行所述n个第二量子线路,得到n个第一运行结果;
    向所述第一电子设备发送运行结果,所述运行结果指示运行所述n个第二量子线路得到的结果。
  13. 根据权利要求12所述的方法,其特征在于,所述第一量子线路包括n个方向的量子测量,所述n个第二量子线路中的任一第二量子线路包括所述n个方向中的一个方向的量子测量。
  14. 根据权利要求12或13所述的方法,其特征在于,所述第一量子线路包括含第一参数的量子操作,所述第一参数的具体数值可变。
  15. 根据权利要求14所述的方法,其特征在于,所述含所述第一参数的量子操作包括多个量子操作,所述第一量子线路还包括含第二参数的量子操作,所述含第二参数的量子操作通过组合操作门获得,所述组合操作门为包括所述多个量子操作的组合门。
  16. 根据权利要求12至15中任一项所述的方法,其特征在于,所述运行结果包括所述n个第一运行结果或第一组合结果,所述n个第一运行结果为所述第二电子设备运行所述n个第二量子线路得到的结果,所述第一组合结果基于所述n个第一运行结果获得。
  17. 根据权利要求16所述的方法,其特征在于,若所述运行结果包括所述第一组合结果,所述第一组合结果基于所述n个第一运行结果和所述第一量子线路中所对应的测量算符的系数确定。
  18. 根据权利要求16或17所述的方法,其特征在于,所述方法还包括:
    接收所述第一电子设备发送的第w次更新所述第一参数后的第二量子线路,w从1开始取值;
    运行所述第w次更新所述第一参数后的第二量子线路,以得到n个第(w+1)运行结果;
    向所述第一电子设备发送第(w+1)次运行后的运行结果,所述第(w+1)次运行后的运行结果包括n个第(w+1)运行结果或第(w+1)组合结果,所述第(w+1)组合结果基于所述n个第(w+1)运行结果得到。
  19. 一种量子计算的装置,其特征在于,所述装置包括用于执行如权利要求1至11或12至18中任一项所述的方法的模块。
  20. 一种电子设备,其特征在于,包括:
    一个或多个处理器;
    一个或多个存储器;
    所述一个或多个存储器存储有一个或多个计算机程序,所述一个或多个计算机程序包括指令,当所述指令被所述一个或多个处理器执行时,使得所述电子设备执行如权利要求1至11或12至18中任一项所述的方法。
  21. 一种计算机存储介质,其特征在于,包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如权利要求1至11或12至18中任一项所述的方法。
PCT/CN2023/135883 2022-12-13 2023-12-01 量子计算的方法和装置 Ceased WO2024125325A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP23902522.4A EP4625269A4 (en) 2022-12-13 2023-12-01 METHOD AND APPARATUS FOR QUANTUM COMPUTING

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211600214.3A CN118195016A (zh) 2022-12-13 2022-12-13 量子计算的方法和装置
CN202211600214.3 2022-12-13

Publications (1)

Publication Number Publication Date
WO2024125325A1 true WO2024125325A1 (zh) 2024-06-20

Family

ID=91402129

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/135883 Ceased WO2024125325A1 (zh) 2022-12-13 2023-12-01 量子计算的方法和装置

Country Status (3)

Country Link
EP (1) EP4625269A4 (zh)
CN (1) CN118195016A (zh)
WO (1) WO2024125325A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119476518B (zh) * 2025-01-15 2025-05-20 山东云海国创云计算装备产业创新中心有限公司 量子算符的测量方法和装置、存储介质及程序产品

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109213603A (zh) * 2018-05-31 2019-01-15 合肥本源量子计算科技有限责任公司 一种用于对接量子计算机与用户的云平台及平台运行方法
CN111092723A (zh) * 2019-12-23 2020-05-01 长春理工大学 一种数据隐私保护量子计算方法
CN111563598A (zh) * 2019-12-31 2020-08-21 合肥本源量子计算科技有限责任公司 预估量子计算模拟时间的方法、系统
US11144689B1 (en) * 2020-04-14 2021-10-12 Cambridge Quantum Computing Limited System and method for generating a quantum circuit
CN114330730A (zh) * 2021-12-25 2022-04-12 北京量子信息科学研究院 量子线路分块编译方法、装置、设备、存储介质和产品
CN114912619A (zh) * 2021-02-08 2022-08-16 合肥本源量子计算科技有限责任公司 一种量子计算任务调度方法、装置及量子计算机操作系统

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109213603A (zh) * 2018-05-31 2019-01-15 合肥本源量子计算科技有限责任公司 一种用于对接量子计算机与用户的云平台及平台运行方法
CN111092723A (zh) * 2019-12-23 2020-05-01 长春理工大学 一种数据隐私保护量子计算方法
CN111563598A (zh) * 2019-12-31 2020-08-21 合肥本源量子计算科技有限责任公司 预估量子计算模拟时间的方法、系统
US11144689B1 (en) * 2020-04-14 2021-10-12 Cambridge Quantum Computing Limited System and method for generating a quantum circuit
CN114912619A (zh) * 2021-02-08 2022-08-16 合肥本源量子计算科技有限责任公司 一种量子计算任务调度方法、装置及量子计算机操作系统
CN114330730A (zh) * 2021-12-25 2022-04-12 北京量子信息科学研究院 量子线路分块编译方法、装置、设备、存储介质和产品

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4625269A1

Also Published As

Publication number Publication date
EP4625269A4 (en) 2026-04-01
EP4625269A1 (en) 2025-10-01
CN118195016A (zh) 2024-06-14

Similar Documents

Publication Publication Date Title
US10620921B2 (en) Application system for generating 3D applications
JP7350923B2 (ja) ディープラーニングフレームワークのオペレータ登録方法、装置、デバイス及び記憶媒体
JP2020068020A (ja) 計算ノートブックインターフェースのためのシステム、方法、プログラム、及び装置
US20170206188A1 (en) Manipulation of an ajax tree presentation
KR102676402B1 (ko) 이더리움 가상머신의 트랜잭션 처리 방법, 장치, 설비, 프로그램 및 매체
WO2023169316A1 (zh) 一种基于用户界面框架的处理方法、装置、设备及介质
WO2024125325A1 (zh) 量子计算的方法和装置
CN114168114A (zh) 一种算子注册方法、装置以及设备
CN115858078A (zh) 特效渲染方法、装置、材质制作系统、设备及存储介质
US20250384325A1 (en) Learning noise models to perform quantum error mitigation on unstructured quantum circuits
US20210392073A1 (en) Regular path queries (rpqs) for distributed graphs
KR20200040813A (ko) 단일 뷰에서의 검색 결과-기반 리스팅 생성
US20240428104A1 (en) Qubit sharing across simultaneous quantum job and/or trained model execution
Dutta et al. Correlated pair ansatz with a binary tree structure
Chen et al. MemRec: Collaborative Memory-Augmented Agentic Recommender System
US12602385B2 (en) Context-aware relevance modeling in conversational systems
US20250139481A1 (en) Synthesis of quantum circuits for preparing superposed states
US20240152790A1 (en) Assisting users in creating quantum circuits by displaying filters used to provide relevant information regarding grouped quantum logic gates
US12505367B2 (en) Visually depicting a topology of a quantum device that conveys quantum operational characteristics
EP4177798A1 (en) Method and apparatus for training a model
JP2025529322A (ja) 構成可能なエンティティベースのアンドゥおよびリドゥ動作
CN115803729A (zh) 中间件生成的记录的直接数据加载
JP7820611B2 (ja) 量子回路シミュレーション方法、装置、コンピュータ機器、及びコンピュータプログラム
US20250251920A1 (en) Integrating loop unrolling and loop splitting to reduce control overheads
US20240202559A1 (en) Reducing number of shots required to perform a noisy circuit simulation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23902522

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2023902522

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2023902522

Country of ref document: EP

Effective date: 20250624

NENP Non-entry into the national phase

Ref country code: DE

WWP Wipo information: published in national office

Ref document number: 2023902522

Country of ref document: EP