[go: up one dir, main page]

CN110569979B - Logical-physical bit remapping method for noisy medium-sized quantum equipment - Google Patents

Logical-physical bit remapping method for noisy medium-sized quantum equipment Download PDF

Info

Publication number
CN110569979B
CN110569979B CN201910865893.9A CN201910865893A CN110569979B CN 110569979 B CN110569979 B CN 110569979B CN 201910865893 A CN201910865893 A CN 201910865893A CN 110569979 B CN110569979 B CN 110569979B
Authority
CN
China
Prior art keywords
gate
bit
physical
logic
quantum
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.)
Active
Application number
CN201910865893.9A
Other languages
Chinese (zh)
Other versions
CN110569979A (en
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.)
University of Science and Technology of China USTC
Original Assignee
University of Science and Technology of China USTC
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 University of Science and Technology of China USTC filed Critical University of Science and Technology of China USTC
Priority to CN201910865893.9A priority Critical patent/CN110569979B/en
Publication of CN110569979A publication Critical patent/CN110569979A/en
Application granted granted Critical
Publication of CN110569979B publication Critical patent/CN110569979B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • Condensed Matter Physics & Semiconductors (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Logic Circuits (AREA)
  • Advance Control (AREA)

Abstract

The invention discloses a logic-physical bit remapping method for noisy medium-sized quantum equipment, aiming at the limitation of quantum hardware, in order to effectively execute a quantum program on the quantum equipment, the necessary remapping is completed by changing the order of quantum instructions and inserting SWAP operation, so that the quantum program is suitable for the limitation of the quantum equipment, and the execution cost of execution time, the number of quantum gates and the like is as low as possible.

Description

面向嘈杂中型量子设备的逻辑-物理比特重映射方法A logical-physical bit remapping method for noisy medium-sized quantum devices

技术领域technical field

本发明涉及量子计算技术领域,尤其涉及一种面向嘈杂中型量子设备的逻辑-物理比特重映射方法。The invention relates to the technical field of quantum computing, in particular to a logic-physical bit remapping method for noisy medium-sized quantum devices.

背景技术Background technique

量子计算是利用量子力学现象(如叠加和纠缠等)进行计算的设备。目前已被证明量子计算可以在量子多项式时间内解决经典计算机中的某些NP难问题,例如Shor算法能在量子多项式时间内求解大数质因子和离散对数难题,使破解RSA公钥成为可能。Quantum computing is a device that uses quantum mechanical phenomena such as superposition and entanglement to perform calculations. It has been proven that quantum computing can solve some NP-hard problems in classical computers in quantum polynomial time. For example, Shor's algorithm can solve large prime factors and discrete logarithm problems in quantum polynomial time, making it possible to crack RSA public keys. .

在量子计算中,信息存储在量子比特中。与经典比特类似,量子比特也有状态,它可以是|0>或|1>这两种基态,也可以是|0>和|1>的线性组合,称为叠加态。比如,单量子比特的状态(即其波函数)|ψ>可表示为:In quantum computing, information is stored in qubits. Similar to classical bits, qubits also have states, which can be two ground states of |0> or |1>, or a linear combination of |0> and |1>, which is called a superposition state. For example, the state of a single qubit (that is, its wave function) |ψ> can be expressed as:

|ψ>=α|0>+β|1> (1)|ψ>=α|0>+β|1> (1)

α和β为复数,满足|α|2+|β|2=1,故单量子比特状态也可以表示成维度为2的向量(α,β)T,该向量的模长为1。α and β are complex numbers, satisfying |α| 2 +|β| 2 =1, so the single-qubit state can also be represented as a vector (α,β) T with dimension 2, and the modulo length of this vector is 1.

当多个量子比特纠缠在一起时,对应的基态数会呈指数上升。N量子比特纠缠的系统有2N种基态,系统状态可表示为基态的线性叠加。比如双量子比特系统就有|00>,|01>,|10>,|11>四个基态,其状态也可以处于这四个基态的线性叠加,如:When multiple qubits are entangled, the number of corresponding ground states increases exponentially. An N-qubit entangled system has 2 N ground states, and the system state can be expressed as a linear superposition of the ground states. For example, a two-qubit system has four ground states: |00>, |01>, |10>, |11>, and its state can also be in the linear superposition of these four ground states, such as:

|ψ>=a|00>+b|01>+c|10>+d|11>|ψ>=a|00>+b|01>+c|10>+d|11>

a,b,c,d为复数,且满足|a|2+|b|2+|c|2+|d|2=1。该状态同样可表示为一个模长为1、维度为4的向量(a,b,c,d)T。一般地,N个量子比特的波函数可以用一个2N维的向量表示。a,b,c,d are complex numbers and satisfy |a| 2 +|b| 2 +|c| 2 +|d| 2 =1. This state can also be represented as a vector (a,b,c,d) T of length 1 and dimension 4. In general, the wave function of N qubits can be represented by a 2N -dimensional vector.

利用量子比特的叠加性质,量子计算机储存信息的能力会随量子比特数增加而呈指数级上升。对量子系统的测量操作会使系统随机地坍缩到基态,概率取决于每个基态前的系数。如对于前述式(1)中的量子比特,有|α|2的概率坍缩到|0>、|β|2的概率坍缩到|1>。Taking advantage of the superposition properties of qubits, the ability of a quantum computer to store information increases exponentially with the number of qubits. A measurement operation on a quantum system causes the system to collapse to the ground state randomly, with a probability that depends on the coefficients preceding each ground state. As for the qubit in the aforementioned formula (1), the probability of |α| 2 collapses to |0>, and the probability of |β| 2 collapses to |1>.

量子计算在过去10年的发展中衍生出的技术栈大致如图1所示。最顶层为量子算法,如分解质因数的Shor算法;往下是各种量子编程语言以及对应的编译器;再往下是量子指令集体系结构以及量子计算平台(模拟器或量子硬件)。目前比较常见的独立量子编程语言有IBMQ推出的量子线路级别的OpenQASM、微软的Q#等;还有可以嵌入Python中供程序员使用的语言ProjectQ、Quil等。高级编程语言被编译器翻译为量子汇编语言或量子微指令集。The technology stack derived from the development of quantum computing in the past 10 years is roughly shown in Figure 1. The top layer is quantum algorithms, such as Shor's algorithm for decomposing prime factors; the bottom is various quantum programming languages and corresponding compilers; the bottom is quantum instruction set architecture and quantum computing platforms (simulators or quantum hardware). At present, the more common independent quantum programming languages are the quantum circuit-level OpenQASM launched by IBMQ, Microsoft's Q#, etc.; there are also languages that can be embedded in Python for programmers to use ProjectQ, Quil, etc. High-level programming languages are translated by compilers into quantum assembly language or quantum microinstruction sets.

量子程序的主体是一段对量子比特的操作序列,对量子比特的操作称为量子门,它可以改变一个或多个量子比特的状态。量子程序通过操作改变量子比特的状态来实现算法。例如图2为一段OpenQASM代码,第1-2行的qreg与creg分别声明了量子比特与经典比特寄存器,之后的每一行是一个作用于1个或2个量子比特的量子门操作。The main body of a quantum program is a sequence of operations on qubits, called quantum gates, which can change the state of one or more qubits. Quantum programs implement algorithms by operating to change the state of qubits. For example, Figure 2 shows a piece of OpenQASM code. qreg and creg in lines 1-2 declare qubit and classical bit registers, respectively, and each subsequent line is a quantum gate operation that acts on 1 or 2 qubits.

作用在n个量子比特上的量子门g可以用一个2n×2n的矩阵M来表示,该量子门操作g=g(q1,...,qn)相当于将量子门代表的矩阵乘上量子比特对应的向量(用波函数|ψ>表示),|ψ′>=M|ψ>是量子门作用后的波函数。其中,g是包含有参数信息的量子门操作,g是一个量子门名称。实际上,在N个量子比特的系统中,全局波函数|ψ>可以写作各个量子比特的直积形式:The quantum gate g acting on n qubits can be represented by a 2 n × 2 n matrix M, the quantum gate operation g=g(q 1 ,...,q n ) is equivalent to the quantum gate represented by The matrix is multiplied by the vector corresponding to the qubit (represented by the wave function |ψ>), and |ψ′>=M|ψ> is the wave function after the quantum gate acts. where g is the quantum gate operation that contains parameter information, and g is a quantum gate name. In fact, in a system of N qubits, the global wave function |ψ> can be written as the direct product of each qubit:

Figure BDA0002201261370000021
Figure BDA0002201261370000021

所以对作用在其中第i(1≤i≤N)个比特上的单量子门g,其矩阵为Mg,其对全局波函数|ψ>的作用可以用Mg与(N-1)个单位阵的直积,即

Figure BDA0002201261370000022
(Mg为直积运算中的第i个运算对象)来表示。矩阵M也即包含了门g作用于哪些比特上的信息。Therefore, for the single quantum gate g acting on the i-th (1≤i≤N) bit, its matrix is M g , and its effect on the global wave function |ψ> can be calculated by using M g and (N-1) The direct product of the unit matrix, i.e.
Figure BDA0002201261370000022
(M g is the ith operand in the direct product operation) to represent. The matrix M also contains the information on which bits the gate g acts on.

设两个量子门操作g1=g1(Q1)、g2=g2(Q2)分别作用在量子比特数组Q1和Q2上(Q1和Q2可能有交集),g1和g2对全局波函数的影响用矩阵M1、M2表示。如果先执行g1、随即执行g2,其效果|ψ′>=M2M1|ψ>和先执行g2、随即执行g1的效果|ψ">=M1M2|ψ>总是相同,即M2M1|ψ>=M1M2|ψ>,则称g1和g2对易。考虑到计算满足结合律,可以得到g1和g2对易的充分必要条件为M1M2=M2M1Suppose two quantum gate operations g 1 =g 1 (Q 1 ), g 2 =g 2 (Q 2 ) act on qubit arrays Q 1 and Q 2 respectively (Q 1 and Q 2 may have intersection), g 1 The effects of and g 2 on the global wave function are represented by matrices M 1 , M 2 . If g 1 is executed first, then g 2 is executed, the effect |ψ′>=M 2 M 1 |ψ> and the effect of g 2 first, then g 1 is executed |ψ">=M 1 M 2 |ψ> total are the same, that is, M 2 M 1 |ψ>=M 1 M 2 |ψ>, then g 1 and g 2 are called commuters. Considering that the calculation satisfies the associative law, the necessary and sufficient conditions for the commutation of g 1 and g 2 can be obtained is M 1 M 2 =M 2 M 1 .

量子程序在运行时有很强的并行能力。如果两个量子门所要操作的量子比特没有重叠,那么称这两个门可并行,两两相互并行的量子门一般可以同时执行。例如,图2中第3行是对量子比特Q[1]操作的量子门,第4行是对量子比特Q[2]操作的量子门,因此这两个量子门可以同时执行。为了减少程序运行的时间,量子计算机可以采用最大并行化策略,即每个时刻执行尽可能多的量子门。Quantum programs have strong parallelism at runtime. If the qubits to be operated by two quantum gates do not overlap, then the two gates are said to be parallel, and two parallel quantum gates can generally be executed at the same time. For example, row 3 in Figure 2 is a quantum gate that operates on qubit Q[1], and row 4 is a quantum gate that operates on qubit Q[2], so the two quantum gates can be executed simultaneously. In order to reduce the running time of the program, quantum computers can adopt a maximum parallelization strategy, that is, execute as many quantum gates as possible at each moment.

量子程序可以运行在量子程序模拟器或量子计算机上。ProjectQ、Qiskit、ScaffCC、HiQ等平台都提供量子程序模拟器;而潜在实现量子计算机的量子技术种类多样,如超导、离子阱、中性原子、光学等,目前已有基于超导、离子阱构建的量子计算机,其中基于超导的IBM Q5 Yorktown与Tenerife和Q14的Melbourne等可公开在线使用。Quantum programs can run on quantum program simulators or quantum computers. ProjectQ, Qiskit, ScaffCC, HiQ and other platforms all provide quantum program simulators; and there are various types of quantum technologies that can potentially realize quantum computers, such as superconductivity, ion traps, neutral atoms, optics, etc. Quantum computers constructed, of which the superconducting-based IBM Q5 Yorktown and Tenerife and Q14 Melbourne, among others, are publicly available online.

量子计算机在2018年进入NISQ(嘈杂中型量子)阶段。该阶段的量子计算机的特点有:1)由50到100个量子比特构成。量子比特数一方面已经超过经典计算机在合理时间能模拟的上限,另一方面远不足以完成和经典计算机类似的比特纠错功能。2)硬件含有大量噪声,导致信息失真。处于叠加态的量子比特会随时间推移和与周围环境产生纠缠而导致量子比特中储存的信息失真(量子的退相干性);并且由于量子门受限于硬件限制,其执行也存在一定的错误率,进一步导致量子比特储存的信息失真。Quantum computers entered the NISQ (Noisy Intermediate Scale Quantum) stage in 2018. The characteristics of the quantum computer at this stage are: 1) It consists of 50 to 100 qubits. On the one hand, the number of qubits has exceeded the upper limit that a classical computer can simulate in a reasonable time, and on the other hand, it is far from enough to complete the bit error correction function similar to that of a classical computer. 2) The hardware contains a lot of noise, resulting in information distortion. Qubits in a superposition state entangle with the surrounding environment over time, resulting in distortion of the information stored in the qubits (quantum decoherence); and since quantum gates are limited by hardware, there are certain errors in their execution. rate, which further leads to distortion of the information stored in the qubit.

此外,不同量子系统物理实现下的多个量子比特在布局和支持的量子门种类及操控上有不同的特点和限制。直接施加于多个量子比特的多量子门在物理上难实现,目前仅支持有限的双量子门(如量子受控非门CNOT)并且其仅能作用于某些量子比特对上。称这样的量子比特对所涉及的两个量子比特是相邻的。如果两个量子比特q1和q2相邻,假设双量子门g作用于q1和q2的两种操作g(q1,q2)和g(q2,q1)都是允许的;并且如果平台支持多种双量子门,则对任意两种量子门g1、g2,如果允许操作g1(q1,q2),则g2(q1,q2)也一定是允许的。作用在两个以上量子比特的门可以分解为一组单量子门和双量子门来间接实现。不同种类的量子门、甚至作用在不同量子比特位置的同一种量子门在执行时间和引入的失真率等方面都可能各不相同。In addition, multiple qubits under the physical realization of different quantum systems have different characteristics and limitations in layout and supported quantum gate types and manipulations. Multi-quantum gates directly applied to multiple qubits are physically difficult to implement. Currently, only limited two-quantum gates (such as quantum controlled NOT gates CNOT) are supported and they can only act on certain qubit pairs. The two qubits involved in such a qubit pair are said to be adjacent. If two qubits q 1 and q 2 are adjacent, it is assumed that both operations g(q 1 , q 2 ) and g(q 2 , q 1 ) of the double quantum gate g acting on q 1 and q 2 are allowed ; and if the platform supports multiple double quantum gates, for any two quantum gates g 1 , g 2 , if the operation g 1 (q 1 , q 2 ) is allowed, then g 2 (q 1 , q 2 ) must also be Allowed. Gates acting on more than two qubits can be decomposed into a set of single-quantum gates and double-quantum gates for indirect realization. Different kinds of quantum gates, or even the same quantum gate operating at different qubit positions, may vary in execution time and the rate of distortion introduced.

量子算法设计和编程人员往往并不了解或很难理解量子硬件上的限制。一般地,称量子程序中使用的量子比特为逻辑比特,不受量子硬件限制的影响;而称实际量子硬件中的受限量子比特为物理比特;称量子程序中作用于逻辑比特上的量子门为逻辑门,作用在物理比特上的门为物理门。为了使量子程序得以在量子硬件上执行,量子程序编译系统需要在其后端进行逻辑-物理比特映射和量子线路变换。Quantum algorithm designers and programmers often do not understand or have difficulty understanding the limitations of quantum hardware. Generally, the quantum bits used in quantum programs are called logical bits, which are not affected by the limitations of quantum hardware; the restricted quantum bits in actual quantum hardware are called physical bits; the quantum gates acting on logical bits in quantum programs are called quantum gates. For logic gates, the gates acting on physical bits are physical gates. In order for a quantum program to be executed on quantum hardware, the quantum program compilation system needs to perform logical-physical bit mapping and quantum circuit transformation in its backend.

针对逻辑-物理比特映射,一般先将量子程序中使用的每个逻辑比特映射到一个物理比特,称为初始映射π。程序中如果出现受量子硬件限制无法执行的门,就需要对程序加以变换并将相应逻辑比特重映射到其他物理比特上。一种常用的方法是利用SWAP门交换两个相邻物理比特间的信息,从而将量子比特信息路由到量子门可以执行的位置,这相当于改变了逻辑比特的映射位置。设在映射π时执行s=SWAP(q1',q2'),其中q1'和q2'为物理比特,SWAP(q1',q2')实际交换物理比特q1'和q2'间的状态,交换后映射将变为π|s,其中For the logical-physical bit mapping, generally each logical bit used in the quantum program is first mapped to a physical bit, which is called the initial mapping π. If there are gates in the program that cannot be executed due to the limitations of quantum hardware, the program needs to be transformed and the corresponding logical bits are remapped to other physical bits. A common approach is to use SWAP gates to exchange information between two adjacent physical bits, thereby routing qubit information to where the quantum gate can execute, which is equivalent to changing the mapping position of logical bits. Suppose s=SWAP(q 1 ', q 2 ') is executed when mapping π, where q 1 ' and q 2 ' are physical bits, and SWAP(q 1 ', q 2 ') actually exchanges physical bits q 1 ' and q 2 ', the mapping will become π| s after swapping, where

Figure BDA0002201261370000041
Figure BDA0002201261370000041

这里称需要路由操作的逻辑门为远程门;而无需路由即可执行的逻辑门为立即门。在多数量子系统下,SWAP门一般可以分解为三个CNOT门或其他门操作来实现。通过映射和重映射可以使量子程序适应硬件限制并得以执行。Here, the logic gate that needs routing operation is called remote gate; the logic gate that can be executed without routing is called immediate gate. In most subsystems, the SWAP gate can generally be decomposed into three CNOT gates or other gate operations to achieve. Quantum programs can be adapted to hardware constraints and executed by mapping and remapping.

量子比特映射问题已被证明为NP-complete问题,因此采用全局求解方式时空消耗过大,仅能处理极小规模的程序;实际多采用启发式方法求解该类问题。针对量子比特重映射问题,已有的研究成果均假设各种量子门的执行时间均相同,并在此基础上,求解使得程序运行时间较短的重映射方法。但是在实际量子硬件中,不同种类量子门的执行时间有较大偏差。这使得这些方法因未考虑量子门执行时间的差异性,而无法有效利用量子计算机的并行能力,找到尽可能减少实际运行时间的重映射方法。The qubit mapping problem has been proved to be NP-complete, so the global solution method consumes too much space and time, and can only handle extremely small-scale programs; in practice, heuristic methods are mostly used to solve such problems. For the qubit remapping problem, the existing research results assume that the execution time of various quantum gates is the same, and on this basis, solve the remapping method that makes the program running time shorter. However, in actual quantum hardware, the execution time of different types of quantum gates has a large deviation. This makes these methods unable to effectively utilize the parallel ability of quantum computers and find a remapping method that reduces the actual running time as much as possible because they do not consider the difference in the execution time of quantum gates.

发明内容SUMMARY OF THE INVENTION

本发明的目的是提供一种面向嘈杂中型量子设备的逻辑-物理比特重映射方法,能够使得量子程序适应量子设备的限制,并使执行时间和量子门的数目等执行代价尽可能小。本发明通过对量子硬件建模,并基于抽象模型设计考虑量子程序上下文以及量子门执行时间差异性的重映射方法。与传统映射方案相比,经本发明方法重映射后的代码执行时间较已有的同类方法普遍较短。The purpose of the present invention is to provide a logic-physical bit remapping method for noisy medium-sized quantum devices, which can make quantum programs adapt to the limitations of quantum devices, and make execution costs such as execution time and the number of quantum gates as small as possible. The invention designs a remapping method that considers the quantum program context and the execution time difference of the quantum gate by modeling the quantum hardware and based on the abstract model. Compared with the traditional mapping scheme, the code execution time after remapping by the method of the present invention is generally shorter than that of the existing similar methods.

本发明的目的是通过以下技术方案实现的:The purpose of this invention is to realize through the following technical solutions:

一种面向嘈杂中型量子设备的逻辑-物理比特重映射方法,其特征在于,包括:A logic-physical bit remapping method for noisy medium-sized quantum devices, characterized by comprising:

获取量子程序的逻辑门序列、以及逻辑-物理比特的初始映射;Obtain the logic gate sequence of the quantum program and the initial mapping of logic-physical bits;

结合准备运行该量子程序的量子设备的约束信息与逻辑-物理比特的初始映射,通过改变逻辑门的次序以及插入SWAP操作完成重映射,获得满足量子设备约束信息的指令调度序列,并确保执行代价最小;指令调度序列中每个元素是要执行的物理门及其起始执行时刻组成的二元组。Combining the constraint information of the quantum device ready to run the quantum program and the initial mapping of logical-physical bits, the remapping is completed by changing the order of logic gates and inserting SWAP operations to obtain an instruction scheduling sequence that satisfies the constraint information of the quantum device and ensures the execution cost Minimum; each element in the instruction scheduling sequence is a two-tuple composed of the physical gate to be executed and its initial execution time.

由上述本发明提供的技术方案可以看出,针对量子硬件存在的限制,为使量子程序得以在量子设备上有效执行,通过改变量子指令次序和插入SWAP操作完成必要的重映射,使得量子程序适应量子设备的限制,并使执行时间和量子门的数目等执行代价尽可能小。It can be seen from the above technical solutions provided by the present invention that, in view of the limitations of quantum hardware, in order to enable quantum programs to be effectively executed on quantum devices, necessary remapping is completed by changing the order of quantum instructions and inserting SWAP operations, so that quantum programs can adapt to Limits of quantum devices, and make execution costs such as execution time and the number of quantum gates as small as possible.

附图说明Description of drawings

为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他附图。In order to illustrate the technical solutions of the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort.

图1为本发明背景技术提供的量子计算机技术栈示意图;1 is a schematic diagram of a quantum computer technology stack provided by the background technology of the present invention;

图2为本发明背景技术提供的一段OpenQASM代码示意图;2 is a schematic diagram of a section of OpenQASM code provided by the background technology of the present invention;

图3为本发明实施例提供的量子程序的编译和执行过程示意图;3 is a schematic diagram of a compilation and execution process of a quantum program provided by an embodiment of the present invention;

图4为本发明实施例提供的物理比特的标志字示意图;4 is a schematic diagram of a sign word of a physical bit provided by an embodiment of the present invention;

图5为本发明实施例提供的量子指令模拟执行和最大并行化算法的示意图;5 is a schematic diagram of a quantum instruction simulation execution and a maximum parallelization algorithm provided by an embodiment of the present invention;

图6为本发明实施例提供的量子比特矩形网络示意图。FIG. 6 is a schematic diagram of a rectangular network of qubits provided by an embodiment of the present invention.

具体实施方式Detailed ways

下面结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明的保护范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present invention.

本发明实施例提供一种面向嘈杂中型量子设备的逻辑-物理比特重映射;首先,获取量子程序的逻辑门序列、以及逻辑-物理比特的初始映射;然后,结合准备运行该量子程序的量子设备的约束信息与逻辑-物理比特的初始映射,通过改变逻辑门的次序以及插入SWAP操作(交换操作)完成重映射,获得满足量子设备约束信息的指令调度序列,并确保执行代价最小;指令调度序列中每个元素是要执行的物理门及其起始执行时刻组成的二元组。Embodiments of the present invention provide a logic-physical bit remapping for noisy medium-sized quantum devices; first, obtain a logic gate sequence of a quantum program and an initial mapping of logic-physical bits; then, combine with a quantum device that is ready to run the quantum program The initial mapping between the constraint information and the logical-physical bits is completed by changing the order of the logic gates and inserting the SWAP operation (swap operation) to complete the remapping to obtain an instruction scheduling sequence that satisfies the constraint information of the quantum device, and ensures the minimum execution cost; the instruction scheduling sequence Each element in is a two-tuple consisting of the physical gate to be executed and its starting execution time.

本领域技术人员可以理解,交换操作,作用于两个物理比特,用来交换这两个物理比特的状态。Those skilled in the art can understand that the swap operation acts on two physical bits to swap the states of the two physical bits.

如图3所示,为量子程序的编译和执行过程示意图。量子程序是通过手工编写或由高级语言编译生成的线路级量子汇编程序(以OpenQASM为例)。首先,要对量子程序进行预处理,使其适应目标平台的指令集,并平展化(通过图3所示的平展化模块实现)为连续顺序执行的逻辑门序列;在预处理期间,还可以对量子程序实施其他优化技术。此后,预处理后的量子程序经初始映射与重映射(通过图3所示的重映射模块实现)得到作用在物理比特上的指令序列。初始映射负责在程序开始执行时将程序中的逻辑比特映射到物理比特,映射后的结果可能存在双量子门作用于不相邻物理比特的违例。重映射算法根据输入的初始映射和逻辑门序列,得到满足物理比特约束的指令序列,其中部分指令可以并行执行。重映射的输出会标注最大并行化下所有指令的计划开始时间与结束时间作为硬件发射指令时间的参考,这里的时间是相对时间。本发明的主要贡献集中在重映射算法的设计和实施。As shown in Figure 3, it is a schematic diagram of the compilation and execution process of the quantum program. Quantum programs are line-level quantum assemblers written by hand or compiled from high-level languages (take OpenQASM as an example). First, the quantum program is preprocessed to fit the instruction set of the target platform, and flattened (implemented by the flattening module shown in Figure 3) into a sequence of logic gates that are executed sequentially; during preprocessing, it is also possible to Implement other optimization techniques for quantum programs. After that, the preprocessed quantum program obtains an instruction sequence acting on physical bits through initial mapping and remapping (implemented by the remapping module shown in FIG. 3 ). The initial mapping is responsible for mapping the logical bits in the program to the physical bits when the program starts executing, and the result of the mapping may have a violation of two quantum gates acting on non-adjacent physical bits. The remapping algorithm obtains an instruction sequence that satisfies the physical bit constraints according to the input initial mapping and logic gate sequence, and some instructions can be executed in parallel. The output of the remapping will mark the planned start time and end time of all instructions under the maximum parallelization as a reference for the hardware issue instruction time, where the time is a relative time. The main contributions of the present invention focus on the design and implementation of the remapping algorithm.

本发明提出的重映射算法重点在于考虑重映射处的上下文环境和指令的并行化特征。因为量子程序中的量子门之间可能存在的并行性以及某些量子门对之间的可交换性,在不改变程序语义的条件下每个时刻可以开始执行的量子门往往有多个。重映射算法需要为其中希望开始执行、但因硬件几何限制(如所作用的量子比特不相邻)而无法执行的逻辑门安排路由。对于已经满足几何限制且可以执行的逻辑门,重映射算法会安排原位执行所要求的量子门;对于硬件限制无法原位执行的逻辑门,算法将按照一种启发式策略安排路由,将逻辑比特重映射到另一位置的物理比特并执行所要求的量子门。为了使路由路径尽可能合理,重映射算法会尽可能多地考虑路由对接下来可能执行的量子门的影响,并合理安排指令执行次序。因此,算法需要了解究竟哪些量子门的次序可以被改变、拟实施的路由对后续量子门的影响等。The remapping algorithm proposed in the present invention focuses on considering the context at the remapping location and the parallelization characteristics of the instruction. Because of the possible parallelism between quantum gates in a quantum program and the interchangeability between certain pairs of quantum gates, there are often multiple quantum gates that can start executing at each moment without changing the semantics of the program. The remapping algorithm requires routing logic gates where execution is desired to begin, but cannot be executed due to geometric constraints of the hardware (eg, non-adjacent qubits being acted upon). For logic gates that have met geometric constraints and can be executed, the remapping algorithm will arrange the required quantum gates to be executed in-situ; for logic gates that cannot be executed in-situ due to hardware constraints, the algorithm will arrange routes according to a heuristic strategy, and the logic The bits are remapped to physical bits in another location and the required quantum gates are executed. In order to make the routing path as reasonable as possible, the remapping algorithm will consider as much as possible the impact of routing on the quantum gates that may be executed next, and reasonably arrange the execution order of instructions. Therefore, the algorithm needs to know exactly which quantum gates can be changed in order, the impact of the proposed routing on subsequent quantum gates, and so on.

本发明中重映射算法将模拟一遍量子程序执行的过程,在不改变程序语义下可能部分打乱各门顺序并添加SWAP操作。在模拟执行过程中,针对未执行的逻辑门操作序列G及其中的一个门操作g,若g和g之前所有未执行的门操作都是对易的,则接下来先执行g并不会改变序列的执行结果,称这样的g为候选门。需要注意的是,量子程序中某程序点的候选门集合中的元素并不一定都可并行,比如作用在同一比特上的Y门和H门对易但不能并行。The remapping algorithm in the present invention will simulate the process of executing a quantum program once, and may partially disrupt the order of each gate and add a SWAP operation without changing the program semantics. During the simulation execution process, for the unexecuted logic gate operation sequence G and one of the gate operations g, if all the unexecuted gate operations before g and g are commutative, then executing g first will not change The execution result of the sequence, such g is called a candidate gate. It should be noted that the elements in the candidate gate set of a program point in a quantum program are not necessarily parallel, for example, the Y gate and the H gate acting on the same bit are commutative but not parallel.

在介绍重映射算法的具体实现方式之前,先对量子硬件进行抽象:Before introducing the specific implementation of the remapping algorithm, we first abstract the quantum hardware:

假设量子硬件有N个物理比特

Figure BDA0002201261370000072
并提供m种量子门
Figure BDA0002201261370000073
初始化和测量等操作,这些操作称为量子指令。Suppose quantum hardware has N physical bits
Figure BDA0002201261370000072
And provide m kinds of quantum gates
Figure BDA0002201261370000073
Operations such as initialization and measurement, these operations are called quantum instructions.

考虑两个逻辑门g1(Q1)和g2(Q2),若

Figure BDA0002201261370000074
则这两个门一定对易;否则,其是否对易取决于门g1、g2的性质。若比特q∈Q1∩Q2,则称q为g1(Q1)和g2(Q2)的共同作用比特。对于多比特量子门的情况,对易关系与共同作用比特位于多比特量子门的形参位置有关,记g的第i个形参位置为g.i。如果g是单比特门,可以直接用g表示其形参位置。如CX(q1,q2)和X(q1)不对易,CX(q2,q1)却和X(q1)对易,这里q1和q2为不同比特。为此,定义,若对任意量子门g1(Q1)和g2(Q2),且Q1∩Q2={q},q为g1的第i个实参并且为g2的第j个实参,必有g1(Q1)和g2(Q2)对易,则记g1.i与g2.j对易。若对受控门或单量子门g1(Q1)和g2(Q2)的每一共同作用比特qk,设qk为g1的第ik个参数且为g2的第jk个参数,都有g1.ik与g2.jk对易,则g1(Q1)和g2(Q2)对易。若
Figure BDA0002201261370000075
可以得到类似表1的对易关系表,该二维表是对称的。其中,H、X、Y、Rz、CX等为量子门符号。Consider two logic gates g 1 (Q 1 ) and g 2 (Q 2 ), if
Figure BDA0002201261370000074
Then the two gates must commute; otherwise, whether they commute depends on the properties of the gates g 1 , g 2 . If the bit q∈Q 1 ∩ Q 2 , then q is called the co-operating bit of g 1 (Q 1 ) and g 2 (Q 2 ). For the case of a multi-bit quantum gate, the commutation relationship is related to the position of the formal parameter of the multi-bit quantum gate where the cooperating bit is located, and the i-th formal parameter position of g is denoted as gi. If g is a single-bit gate, you can directly use g to represent its formal parameter position. For example, CX(q 1 , q 2 ) does not commute with X(q 1 ), but CX(q 2 , q 1 ) commutes with X(q 1 ), where q 1 and q 2 are different bits. To this end, define, if for any quantum gates g 1 (Q 1 ) and g 2 (Q 2 ), and Q 1 ∩ Q 2 ={q}, q is the i-th argument of g 1 and is the value of g 2 For the jth actual parameter, there must be a commutation between g 1 (Q 1 ) and g 2 (Q 2 ). If for each co-operating bit q k of the controlled gate or single quantum gate g 1 (Q 1 ) and g 2 (Q 2 ), let q k be the ith parameter of g 1 and be the j th parameter of g 2 For k parameters, g 1 .ik and g 2 .j k commute , then g 1 (Q 1 ) and g 2 (Q 2 ) commute. like
Figure BDA0002201261370000075
A commutation relation table similar to Table 1 can be obtained, and the two-dimensional table is symmetrical. Among them, H, X, Y, Rz, CX, etc. are quantum gate symbols.

注意:对易关系表表1中各行和各列的标题代表所支持的物理门的各个形参位置;由于单比特量子门g(g可以为H、X、Y、Z、Rz之一)只有一个参数,故将g.1简记为g;而双比特量子门CX的第一和第二个形参位置分别代表控制比特C和受控比特T,故将CX.1和CX.2也分别记为CX.C和CX.T。Note: The headings of each row and each column in Table 1 of the commutation relationship table represent the positions of the various formal parameters of the supported physical gates; since the single-bit quantum gate g (g can be one of H, X, Y, Z, Rz) only has is a parameter, so g.1 is abbreviated as g; and the first and second formal parameters of the two-bit quantum gate CX represent the control bit C and the controlled bit T respectively, so CX.1 and CX.2 are also They are denoted as CX.C and CX.T respectively.

Figure BDA0002201261370000071
Figure BDA0002201261370000071

表1量子操作之间的对易关系表Table 1 Commutation relationship between quantum operations

本发明假设不同的量子指令(包含量子门和测量等操作),尤其是各种量子门在执行时间上会有差异,同种量子门在不同时间或物理比特上的执行具有相同执行时长。为了设计适用不同量子硬件的量子比特映射算法,本发明以指令调度周期(以下简称调度周期)为基本单位对量子硬件的量子指令执行时间进行抽象。假定量子程序中第一条指令开始执行的时刻记为0,每条量子指令均从某个调度周期的开始时刻执行,执行时长为调度周期的整数倍(即保证该量子指令执行完的最小整数倍)。本发明用倍数表示指令的执行时长,并允许用户设置每种量子指令的执行时长。如在IBM实现的超导计算机中可以取单量子酉门(U)和量子受控非门(CNOT,也称CX)的执行时间为1和2,SWAP操作用三个CNOT门实现,故其执行时间设为6。The present invention assumes that different quantum instructions (including operations such as quantum gates and measurements), especially various quantum gates, have differences in execution time, and the execution of the same kind of quantum gates at different times or physical bits has the same execution time. In order to design a qubit mapping algorithm suitable for different quantum hardware, the present invention abstracts the quantum instruction execution time of the quantum hardware by taking the instruction scheduling cycle (hereinafter referred to as the scheduling cycle) as the basic unit. Assuming that the moment when the first instruction in the quantum program starts to execute is marked as 0, each quantum instruction is executed from the beginning of a certain scheduling period, and the execution time is an integer multiple of the scheduling period (that is, the minimum integer to ensure that the quantum instruction is executed completely) times). The present invention uses multiples to represent the execution time of the instruction, and allows the user to set the execution time of each quantum instruction. For example, in the superconducting computer implemented by IBM, the execution time of a single quantum unitary gate (U) and a quantum controlled NOT gate (CNOT, also called CX) can be taken as 1 and 2, and the SWAP operation is implemented with three CNOT gates, so its The execution time is set to 6.

如果一条量子指令正在执行,则称其作用的比特忙碌,否则称空闲。本发明假定无法并行化的两条指令(即它们都作用于某个相同比特)不能同时执行,其余情况下只要指令所需的所有物理比特空闲,该指令就可以在随后的任意调度周期开始时刻执行。If a quantum instruction is executing, the bit on which it acts is said to be busy, otherwise it is said to be idle. The present invention assumes that two instructions that cannot be parallelized (that is, they both act on the same bit) cannot be executed at the same time. In other cases, as long as all physical bits required by the instruction are free, the instruction can be executed at the beginning of any subsequent scheduling cycle. implement.

下面针对本发明所涉及的重映射方案以及执行重映射方案过程中所涉及的相关算法的优选实施方式进行详细的介绍。The following describes in detail the remapping scheme involved in the present invention and the preferred implementations of the related algorithms involved in the process of executing the remapping scheme.

一、量子比特重映射的总体方案。1. The overall scheme of qubit remapping.

在前文的量子硬件抽象下,给定量子程序的逻辑门序列G和初始映射π,量子比特重映射将输出满足量子硬件约束的指令调度序列,序列中每个元素是要执行的物理门及其起始执行时刻组成的二元组。重映射算法通过模拟量子指令的执行来完成量子比特映射和量子指令的调度。为了跟踪物理比特的空闲情况,为每个物理比特定义一个tend属性,来表示相应比特结束忙碌时刻,对于物理比特q,其tend属性记为q.tend,全体物理比特的tend属性集记为Tend;初始时,各比特的tend属性为0,若当前时刻t≥q.tend,则比特q空闲;Under the above quantum hardware abstraction, given the logic gate sequence G of the quantum subprogram and the initial mapping π, the qubit remapping will output an instruction scheduling sequence that satisfies the quantum hardware constraints. Each element in the sequence is the physical gate to be executed and its A 2-tuple consisting of the start execution time. The remapping algorithm completes qubit mapping and quantum instruction scheduling by simulating the execution of quantum instructions. In order to track the idle condition of physical bits, a t end attribute is defined for each physical bit to indicate the busy time when the corresponding bit ends. For physical bit q, its t end attribute is denoted as qt end , and the t end attribute set of all physical bits is denoted is T end ; initially, the t end attribute of each bit is 0, and if the current moment t ≥ qt end , the bit q is idle;

重映射的步骤包括:The steps of remapping include:

步骤A1、设置当前时刻t=0,初始化输出指令调度序列I={};Step A1, set the current time t=0, initialize the output instruction scheduling sequence I={};

步骤A2、初始化tend属性,将各物理比特的tend属性置为0;Step A2, initialize the t end attribute, and set the t end attribute of each physical bit to 0;

步骤A3、利用候选门集的近似求解算法结合逻辑门序列G、以及逻辑-物理比特的映射π(π是当前逻辑比特到物理比特的映射,在重映射开始执行时该映射称为初始映射,由外部传入;在重映射执行的过程中,π需要不断变化来适应量子硬件的限制),计算当前候选门集C;其中候选门是指,对于一个逻辑门g,如果逻辑门g与逻辑门g之前所有未执行的逻辑门都是对易的,则接下来先执行逻辑门g并不会改变序列的执行结果,则逻辑门g为候选门;Step A3, utilize the approximate solution algorithm of the candidate gate set in conjunction with the logic gate sequence G and the mapping π of the logic-physical bit (π is the mapping of the current logical bit to the physical bit, and this mapping is called the initial mapping when the remapping starts to execute, Incoming from the outside; in the process of remapping execution, π needs to change constantly to adapt to the limitations of quantum hardware), calculate the current candidate gate set C; where candidate gate refers to, for a logic gate g, if the logic gate g and the logic gate All unexecuted logic gates before gate g are commutative, then executing logic gate g first will not change the execution result of the sequence, then logic gate g is a candidate gate;

步骤A4、对于当前候选门集C中的立即门集合CI,依次遍历CI中的每个逻辑门g,执行:步骤A41、如果逻辑门g作用的逻辑比特所映射到的物理比特均空闲,则利用量子指令模拟执行和最大并行化算法,结合指令调度序列I以及属性集Tend发射逻辑门g对应的物理指令(由g对应的物理门及作用的物理比特组成),并从逻辑门序列G中去掉g;步骤A42、取立即门集合CI中的下一个逻辑门,继续执行步骤A41,直至立即门集合CI为空;否则执行步骤A5;Step A4, for the immediate gate set CI in the current candidate gate set C, traverse each logic gate g in the CI in turn, and execute: Step A41, if the physical bits mapped to the logical bits of the logic gate g are idle , then use the quantum instruction simulation execution and the maximum parallelization algorithm, combine the instruction scheduling sequence I and the attribute set T end to transmit the physical instruction corresponding to the logic gate g (composed of the physical gate corresponding to g and the physical bits that function), and from the logic gate Remove g in the sequence G; Step A42 , take the next logic gate in the immediate gate set CI, continue to execute step A41, until the immediate gate set CI is empty; otherwise, execute step A5;

步骤A5、对于当前候选门集C中的远程门集合CR,执行:步骤A51、利用最优路由的启发式算法,结合逻辑-物理比特映射π、属性集Tend、以及远程门集合CR得到SWAP操作序列S;步骤A52、对于SWAP操作序列S中的每个SWAP操作,首先根据相应SWAP操作所交换的两个物理比特来更新逻辑-物理比特映射π中对应的比特映射,再利用量子指令模拟执行和最大并行化算法,结合指令调度序列I以及属性集Tend发射对应的物理指令(如SWAP操作对应于3条CX指令);所述远程门是指需要路由操作的逻辑门,所述立即门是指无需路由即可执行的逻辑门;Step A5, for the remote gate set CR in the current candidate gate set C, execute: Step A51, utilize the heuristic algorithm of the optimal route, combine the logical-physical bit map π, the attribute set T end , and the remote gate set CR Obtain the SWAP operation sequence S; Step A52, for each SWAP operation in the SWAP operation sequence S, first update the corresponding bit map in the logical-physical bit map π according to the two physical bits exchanged by the corresponding SWAP operation, and then use the quantum The instruction simulation execution and the maximum parallelization algorithm are combined with the instruction scheduling sequence I and the attribute set T end to transmit the corresponding physical instructions (such as the SWAP operation corresponding to three CX instructions); the remote gate refers to the logic gate that requires routing operations, so The aforementioned immediate gate refers to a logic gate that can be executed without routing;

步骤A6、令当前时刻t=t+1;Step A6, make the current time t=t+1;

步骤A7、返回步骤A3,直到逻辑门序列G为空。Step A7: Return to step A3 until the logic gate sequence G is empty.

需要说明的是,在上述步骤A5中,采用最优路由的启发式算法有时可能不会输出路由SWAP,这将在后文中进行详细说明。在极特殊的情况下,可能出现全局或某一局域内各个比特空闲,但候选门中既没有立即门可被执行,启发式算法也没有给出可行的路由比特的情况。类似的情况称作“死锁”。有关死锁的讨论详见后文。It should be noted that, in the above step A5, the heuristic algorithm that adopts the optimal route may sometimes not output the route SWAP, which will be described in detail later. In a very special case, there may be a situation where each bit is free globally or in a local area, but there is neither an immediate gate that can be executed in the candidate gates, nor a feasible routing bit given by the heuristic algorithm. A similar situation is called a "deadlock". A discussion of deadlocks is discussed later.

二、候选门集的近似求解算法。Second, the approximate solution algorithm of the candidate gate set.

在前文的步骤A3中,使用候选门集的近似求解算法来求解当前候选门集C。In the foregoing step A3, the current candidate gate set C is solved using the approximate solution algorithm of the candidate gate set.

给定当前时刻t下的未执行逻辑门序列G,由候选门的定义可以求解候选门集,但是会比较费时。考虑到实际硬件支持的量子比特数量和量子门种类十分有限,为每个物理比特引入长度固定的标志字,在标志字中,为每个物理门g的每个形参位置g.i设置一个标志位;随后依次读入逻辑门序列G中的逻辑门,标志位为真表示逻辑门对应参数位置和已经读入的所有逻辑门都对易。图4给出了物理比特标志字的示意图。Given the unexecuted logic gate sequence G at the current time t, the candidate gate set can be solved by the definition of the candidate gate, but it will be time-consuming. Considering that the number of qubits and types of quantum gates supported by actual hardware are very limited, a fixed-length flag word is introduced for each physical bit. In the flag word, a flag bit is set for each formal parameter position g.i of each physical gate g. ; Then read the logic gates in the logic gate sequence G in turn, and the flag bit is true, indicating that the corresponding parameter position of the logic gate and all the logic gates that have been read are commutative. Figure 4 shows a schematic diagram of the physical bit flag word.

本发明实施例提供两种快速求解候选集的方法,第一种方法如下:The embodiment of the present invention provides two methods for quickly solving the candidate set, the first method is as follows:

步骤B1、初始时,当前候选门集C为空集,每个物理比特的各标志位均为真;Step B1, initially, the current candidate gate set C is an empty set, and each flag bit of each physical bit is true;

步骤B2、依次正向遍历所有未执行的逻辑门,执行:Step B2, traverse all the unexecuted logic gates forward in turn, and execute:

步骤B21、设当前逻辑门为g=g(Q),Q表示逻辑门g所作用的逻辑比特数组;如果对每个逻辑比特q∈Q,q是g的第i个参数,其对应的物理比特q’=π(q)的g.i标志位都为真,则将逻辑门g放入候选门集C;Step B21, set the current logic gate to be g=g(Q), and Q represents the logic bit array that the logic gate g acts on; if for each logic bit q∈Q, q is the ith parameter of g, and its corresponding physical If the g.i flag bits of the bit q'=π(q) are all true, put the logic gate g into the candidate gate set C;

步骤B22、对所有逻辑比特q∈Q,设q是g的第i个参数,查找逻辑比特q对应的物理比特q’的g.i标志位所在的列(可通过查对易关系表表1找到名为g.i的列),若该列存在有值为0的单元,该单元的行名为g'.j,表示g'.j与g.i不对易,则置物理比特q’的g'.j对应标志位为假;Step B22: For all logical bits q∈Q, let q be the i-th parameter of g, and find the column where the g.i flag bit of the physical bit q' corresponding to the logical bit q is located (you can find the name by looking up the commutation relationship table 1). is the column of g.i), if there is a unit with a value of 0 in the column, the row name of the unit is g'.j, indicating that g'.j and g.i are not commutative, then set the physical bit q' g'.j corresponds to The flag bit is false;

步骤B23、取下一个逻辑门,继续循环,直到遍历结束或所有的标志位都为假。Step B23, remove a logic gate, and continue the cycle until the traversal ends or all flag bits are false.

第一种方法理论上可以找出所有的候选门。但对于门种类较多或未执行的量子门序列较长时,算法的时间消耗和空间消耗仍然很大。另外,由于随后的算法需要频繁更新候选门集,上述算法不能有效利用上次的结果。假设上一次获取到的候选门集为C0,之后执行了C0中的几个门,使C0变为C0',则此时C0'中的门仍然都是候选门,因此,可以对第一种方法进行改进:The first method can theoretically find all candidate gates. However, when there are many kinds of gates or a long sequence of quantum gates that are not executed, the time consumption and space consumption of the algorithm are still very large. In addition, since subsequent algorithms need to frequently update the candidate gate set, the above algorithm cannot effectively utilize the results of the last time. Assuming that the candidate gate set obtained last time is C 0 , and then several gates in C 0 are executed, so that C 0 becomes C 0 ', then the gates in C 0 ' are still candidate gates at this time. Therefore, The first method can be improved:

1)初始候选门集利用上一次的结果,避免大量重复计算。1) The initial candidate gate set uses the previous results to avoid a large number of repeated calculations.

2)增加循环终止条件,只在一定范围内的门中筛选候选门,避免过长的时间消耗。2) Increase the loop termination condition, and only select the candidate gates in a certain range of gates to avoid excessive time consumption.

以上改进可以进一步显著缩小算法的执行时间。改进后的算法为近似算法,求出的集合是实际候选门集的子集,但差别不会很显著。The above improvements can further significantly reduce the execution time of the algorithm. The improved algorithm is an approximate algorithm, and the obtained set is a subset of the actual candidate gate set, but the difference is not very significant.

则第二种方法为:Then the second method is:

步骤C1、重映射每一次迭代过程中,均需要求解候选门集,第一次求解候选门集时,候选门集C为空集;Step C1. In each iteration process of remapping, the candidate gate set needs to be solved. When the candidate gate set is solved for the first time, the candidate gate set C is an empty set;

步骤C2、之后的重映射迭代过程求解候选门集时,将上一次求解的候选门集记为Clast,设Clast子集Cemitted已经在上一次重映射中被发射和去除,则记集合C0=Clast-CemittedStep C2. When the candidate gate set is solved in the subsequent remapping iterative process, the last solved candidate gate set is recorded as C last , and if the C last subset C emitted has been emitted and removed in the last remapping, it is recorded as the set C 0 =C last -C emitted ;

步骤C3、记每个物理比特的各标志位均为真;Step C3, note that each flag bit of each physical bit is true;

步骤C4、遍历集合C0中逻辑门g=g(Q),Q表示逻辑门g所作用的逻辑比特数组;对每个逻辑比特q∈Q,设q是g的第i个参数,查找逻辑比特q对应的物理比特q’的g.i标志位所在的列,若相应列存在有值为0的单元,则相应单元的行名记为g'.j,表示g'.j与g.i不对易,则置物理比特q’=π(q)的g'.j对应标志位为假;Step C4, traverse the logic gate g=g(Q) in the set C 0 , Q represents the logic bit array that the logic gate g acts on; for each logic bit q∈Q, let q be the ith parameter of g, and find the logic The column where the gi flag bit of the physical bit q' corresponding to the bit q is located. If there is a unit with a value of 0 in the corresponding column, the row name of the corresponding unit is recorded as g'.j, indicating that g'.j and gi are not commutative. Then set the corresponding flag bit of g'.j of physical bit q'=π(q) to false;

步骤C5、依次正向遍历所有未执行的逻辑门,设当前逻辑门为g=g(Q),执行:Step C5, traverse all the unexecuted logic gates forward in turn, set the current logic gate to be g=g(Q), and execute:

步骤C51、如果g已经在候选门集C中,则继续取下一个逻辑门;否则,执行步骤C52;Step C51, if g is already in the candidate gate set C, then continue to take the next logic gate; otherwise, execute step C52;

步骤C52、如果对每个逻辑比特q∈Q,q是g的第i个参数,其对应的物理比特q’的g.i标志位都为真,则将g放入候选门集C;否则,执行步骤C53;Step C52, if for each logical bit q∈Q, q is the ith parameter of g, and the g.i flag bits of the corresponding physical bit q' are all true, then put g into the candidate gate set C; otherwise, execute Step C53;

步骤C53、对所有逻辑比特q∈Q,设q是g的第i个参数,查找逻辑比特q对应的物理比特q’的g.i标志位所在的列,若相应列存在有值为0的单元,则相应单元的行名记为g'.j,表示g'.j与g.i不对易,则置物理比特q’的g'.j对应标志位为假;Step C53: For all logical bits q∈Q, let q be the i-th parameter of g, and find the column where the g.i flag bit of the physical bit q' corresponding to the logical bit q is located. If there is a unit with a value of 0 in the corresponding column, Then the row name of the corresponding unit is denoted as g'.j, indicating that g'.j and g.i are not commutative, then set the corresponding flag bit of g'.j of physical bit q' to false;

步骤C54、取下一个逻辑门,继续循环,直到遍历结束或遍历的逻辑门总数超过设定值N。Step C54, remove the next logic gate, and continue the cycle until the traversal ends or the total number of logic gates traversed exceeds the set value N.

三、量子指令模拟执行和最大并行化算法。3. Quantum instruction simulation execution and maximum parallelization algorithm.

所述量子指令模拟执行和最大并行化算法,应用在前述步骤A4与A5中,负责发射作用于物理比特的物理门g’或者SWAP操作对应的物理指令,设置和判断物理比特的忙碌或空闲状态。The quantum instruction simulation execution and maximum parallelization algorithm are applied in the aforementioned steps A4 and A5, responsible for transmitting the physical instruction corresponding to the physical gate g' or SWAP operation acting on the physical bit, and setting and judging the busy or idle state of the physical bit. .

本发明实施例中,在进行量子指令模拟执行和最大并行化算法之前,已经利用映射π将逻辑门g作用的逻辑比特数组Q通过映射π转换为物理比特数组Q’=π(Q),则逻辑门g变为物理门g’,需要说明的是,逻辑门与物理门的实际操作内容没有改变,区别仅在于操作对象由逻辑比特改为物理比特。In the embodiment of the present invention, before performing the quantum instruction simulation execution and the maximum parallelization algorithm, the logical bit array Q acting by the logic gate g has been converted into the physical bit array Q'=π(Q) by mapping π, then The logic gate g becomes the physical gate g'. It should be noted that the actual operation content of the logic gate and the physical gate has not changed. The only difference is that the operation object is changed from a logical bit to a physical bit.

每当重映射算法中要发射一条指令g’=g(Q’)(这里Q’为物理比特数组)或者SWAP操作时,量子指令模拟执行和最大并行化算法接收相应指令,然后执行如下操作:Whenever an instruction g'=g(Q') (where Q' is a physical bit array) or a SWAP operation is to be issued in the remapping algorithm, the quantum instruction simulation execution and the maximum parallelization algorithm receive the corresponding instruction, and then perform the following operations:

1)对于物理门g’作用的每个物理比特q’∈Q’,求出其最晚结束忙碌时刻tm=max{q’.tend},由于只有物理比特空闲时才能发射指令,显然,tm≤t;设物理门g’执行时长为τ,则对每一物理比特q’∈Q’,置q’.tend=tm+τ。1) For each physical bit q'∈Q' acting on the physical gate g', find its latest busy end time t m =max{q'.t end }, since the instruction can only be issued when the physical bit is idle, obviously , t m ≤ t; set the execution duration of the physical gate g' as τ, then for each physical bit q'∈Q', set q'.t end =t m +τ.

2)对于SWAP操作,则发射SWAP操作对应的物理实现指令,如3条CX操作及其起始执行时刻。2) For the SWAP operation, the physical implementation instructions corresponding to the SWAP operation are transmitted, such as three CX operations and their initial execution time.

本发明实施例中,量子指令模拟执行和最大并行化算法在t时刻接收到的物理指令g’并没有直接在t时刻执行,而是向前追溯其作用的所有物理比特都结束忙碌状态后的最早时刻作为g’开始执行的时刻,此时刻是g’可以执行的最早时刻。考虑到重映射算法有一定的局部性,可能出现未及时预料的指令(通常是SWAP)被较晚发送。量子指令模拟执行和最大并行化算法假设在量子计算机有足够的并行能力,能在所有指令可以开始执行时立即执行,因此为最大并行化算法。在给定了指令序列的情况下,量子指令模拟执行和最大并行化算法保证了指令的尽早执行,使接收的量子指令得以最大并行化。In the embodiment of the present invention, the physical instruction g' received by the quantum instruction simulation execution and the maximum parallelization algorithm at time t is not directly executed at time t, but after all physical bits whose functions are traced back to the end of the busy state The earliest moment is the moment when g' starts to execute, and this moment is the earliest moment when g' can be executed. Considering the locality of the remapping algorithm, it may happen that an unanticipated command (usually SWAP) is sent later. The simulation execution of quantum instructions and the maximum parallelization algorithm assume that the quantum computer has sufficient parallelism to execute immediately when all instructions can start to be executed, so it is a maximum parallelization algorithm. Given the instruction sequence, the quantum instruction simulation execution and the maximum parallelization algorithm ensure the early execution of instructions, so that the received quantum instructions can be parallelized to the maximum.

如图5的(a)部分所示,当前需要执行CX(q1,q3),由于q1和q3不相邻,故最优路由的启发式算法安排一个SWAP(q2,q3)操作,使得之后可以在相邻的q1和q2上实施CX操作。量子指令模拟执行和最大并行化算法并未直接安排SWAP指令在当前时刻(虚线处)开始执行,而是向前追溯到尽可能早的时刻(如图5的(b)部分所示),从而使SWAP和后续的CX(以及其他可能受影响的门)都得以提前(如图5的(c)部分所示)。As shown in part (a) of Figure 5, CX(q1, q3) needs to be executed at present. Since q1 and q3 are not adjacent, the heuristic algorithm of optimal routing arranges a SWAP (q2, q3) operation, so that the Implement CX operations on adjacent q1 and q2. The quantum instruction simulation execution and the maximum parallelization algorithm do not directly schedule the SWAP instruction to start executing at the current moment (at the dotted line), but go back to the earliest possible moment (as shown in part (b) of Figure 5), so that Advances both SWAP and subsequent CXs (and other potentially affected gates) (as shown in part (c) of Figure 5).

四、最优路由的启发式算法。Fourth, the heuristic algorithm of optimal routing.

本发明实施例提供一种最优路由的启发式算法,用于为非空的候选远程门集合CR给出一组近似最优的SWAP操作S。设CR中每个门作用的物理比特组成的集合为Q’。对于物理比特数组Q’中的空闲比特q1’,如果存在与物理比特q1’相邻的物理比特q2’且q2’空闲,则称q1’与q2’之间的SWAP操作为候选SWAP,所有候选SWAP组成的集合称为SWAP候选集。The embodiment of the present invention provides an optimal routing heuristic algorithm, which is used to provide a set of approximately optimal SWAP operations S for the non-empty candidate remote gate set CR. Let the set of physical bits for each gate in CR be Q'. For an idle bit q 1 ' in the physical bit array Q', if there is a physical bit q 2 ' adjacent to the physical bit q 1 ' and q 2 ' is idle, it is called a SWAP operation between q 1 ' and q 2 ' For candidate SWAP, the set composed of all candidate SWAPs is called a SWAP candidate set.

利用最优路由的启发式算法,获取SWAP操作序列S的步骤包括:Using the heuristic algorithm of optimal routing, the steps of obtaining the SWAP operation sequence S include:

步骤D1、令SWAP操作序列S={};Step D1, make the SWAP operation sequence S={};

步骤D2、求出当前SWAP候选集Sc;假设逻辑门g为远程门,将逻辑门g作用的逻辑比特数组Q通过映射π转换为物理比特数组Q’(Q’=π(Q)),则逻辑门g变为物理门g’,此处称为远程门g’,对于物理比特数组Q’中的空闲比特q1’,如果存在与物理比特q1’相邻的物理比特q2’且q2’空闲,则称物理比特q1’与q2’之间的SWAP操作为候选SWAP;Step D2, obtain the current SWAP candidate set S c ; Suppose that the logic gate g is a remote gate, the logical bit array Q that the logic gate g acts is converted into a physical bit array Q'(Q'=π(Q)) by mapping π, Then the logic gate g becomes the physical gate g', which is called the remote gate g' here. For the idle bit q 1 ' in the physical bit array Q', if there is a physical bit q 2 ' adjacent to the physical bit q 1 ' And q 2 ' is idle, then the SWAP operation between the physical bits q 1 ' and q 2 ' is called a candidate SWAP;

步骤D3、对每个候选SWAP操作sk∈Sc,进行优先级的计算(具体方式将在后文进行介绍);Step D3: Calculate the priority of each candidate SWAP operation sk ∈ S c (the specific method will be introduced later);

步骤D4、选出优先级最高的SWAP操作s,如果SWAP操作s优先级小于1;或者,如果物理比特之间的相邻关系能够建模为矩形网格,SWAP操作s的优先级小于<1,0>,终止算法,输出当前得到的SWAP操作序列S;Step D4, select the SWAP operation s with the highest priority, if the priority of the SWAP operation s is less than 1; or, if the adjacent relationship between the physical bits can be modeled as a rectangular grid, the priority of the SWAP operation s is less than <1 ,0>, terminate the algorithm, and output the currently obtained SWAP operation sequence S;

步骤D5、更新SWAP操作序列:S=S∪{s};Step D5, update the SWAP operation sequence: S=S∪{s};

步骤D6、从SWAP候选集Sc中去掉SWAP操作s以及与SWAP操作s有共同物理比特的SWAP操作;Step D6, remove the SWAP operation s and the SWAP operation having a common physical bit with the SWAP operation s from the SWAP candidate set S c ;

步骤D7、更新映射,π=π|s,即,在映射π时执行SWAP操作s后映射π变更新为π|sStep D7, update the mapping, π=π| s , that is, after performing the SWAP operation s when mapping π, the mapping π is changed and updated to π| s ;

步骤D8、返回步骤D3,直到SWAP候选集为空。Step D8, return to step D3 until the SWAP candidate set is empty.

上述算法执行过程中每次选出SWAP都会从候选SWAP中排除掉和选出的SWAP不可并行的SWAP,因此产生的所有SWAP操作S互相并行且可以立即执行。算法的返回值为S,也即SWAP操作序列。During the execution of the above algorithm, each time a SWAP is selected, a SWAP that is not parallel to the selected SWAP will be excluded from the candidate SWAPs, so all the generated SWAP operations S are parallel to each other and can be executed immediately. The return value of the algorithm is S, which is the sequence of SWAP operations.

然而,上述执行过程中可能所有候选SWAP操作sk∈S的优先级都小于1或者小于<1,0>,此时可能有如下两种情况:However, in the above execution process, the priority of all candidate SWAP operations sk ∈ S may be less than 1 or less than <1,0>, and there may be the following two situations:

第一种情况,某些候选门需要路由,但是这些候选门作用的某个物理比特处于忙碌状态,或者路由会干扰其他正在执行的门(已经处在指令调度序列中,且正在执行的量子门,此处的执行是指模拟执行);In the first case, some candidate gates need to be routed, but a certain physical bit of these candidate gates is busy, or the routing will interfere with other executing gates (the quantum gates that are already in the instruction scheduling sequence and are being executed) , the execution here refers to the simulated execution);

第二种情况,存在需要路由的候选门,这些路由不干扰正在执行的门;In the second case, there are candidate gates that need routing, and these routes do not interfere with the gate being executed;

对于第二种情况出现的原因是,算法认为,对于任何一个路由,它虽然使有些远程门的距离减小,但可能会使同样或更多数目的远程门距离增加。这时路由调度系统就被锁住了——这和操作系统中的死锁很相似,故称之为死锁。对于发生死锁的情形,有如下的解除策略:The reason for the second case is that the algorithm believes that, for any one route, although it reduces the distance of some remote doors, it may increase the distance of the same or more number of remote doors. At this time, the routing and scheduling system is locked - this is very similar to the deadlock in the operating system, so it is called deadlock. For deadlock situations, there are the following release strategies:

1)从SWAP候选集Sc中选择优先级最高的SWAP操作s;1) Select the SWAP operation s with the highest priority from the SWAP candidate set S c ;

2)从SWAP候选集Sc中去掉SWAP操作s和与SWAP操作s有共同比特的SWAP操作,执行s并更新映射π=π|s2) Remove the SWAP operation s and the SWAP operation that has a common bit with the SWAP operation s from the SWAP candidate set S c , execute s and update the mapping π=π| s ;

3)重新执行正常的路由算法(也即,前文的步骤D1~D8),直到没有优先级不小于1或<1,0>(针对物理比特矩形网格)的候选SWAP。3) Re-execute the normal routing algorithm (ie, steps D1 to D8 above) until there is no candidate SWAP with a priority of not less than 1 or <1,0> (for a rectangular grid of physical bits).

理论分析和实践都表明,即使所有比特都空闲并且候选SWAP集Sc非空,仍然有可能找不到优先级大于等于1的SWAP。这是因为有些SWAP牵扯的比特可能涉及不同的远程门,任何一种路由都不会减少远程门的总距离。如图6所示的情况,在矩形网格设备上有4个候选门等待执行,相同填充物的比特之间有一个候选CX门(受控非门,一种双量子门)。每个CX的距离都是1,但是交换任意相邻比特不会减少总距离(最多从1+1+1+1变为2+1+1+0)Both theoretical analysis and practice show that even if all bits are free and the candidate SWAP set S c is not empty, it is still possible to find no SWAP with a priority greater than or equal to 1. This is because some of the bits involved in SWAP may involve different remote gates, and neither route will reduce the total distance of the remote gates. In the situation shown in Figure 6, there are 4 candidate gates waiting to be executed on a rectangular grid device, and a candidate CX gate (controlled NOT gate, a kind of two-quantum gate) between bits of the same padding. Each CX has a distance of 1, but swapping any adjacent bits does not reduce the total distance (at most from 1+1+1+1 to 2+1+1+0)

针对这种情况,可以选择一个优先级最高(尽管仍小于1)的候选SWAP来执行,打破这个局面。可以证明这样的最高优先级至少为0,意味着执行它不会使局势更糟,并一定对某个候选门的距离缩短有利。In response to this situation, a candidate SWAP with the highest priority (although still less than 1) can be selected for execution to break this situation. It can be shown that such a highest priority is at least 0, meaning that executing it will not make the situation worse, and must be beneficial to some candidate gate's distance reduction.

下面介绍候选SWAP操作sk优先级的计算方式:The following describes how the priority of candidate SWAP operations sk is calculated:

定义远程门g的距离(distance)为实现该远程门g所需的最少SWAP操作数,记为g.d;两个不相邻的比特上的双量子门是远程门;另外,若某个单比特量子门在当前位置无法执行、需要将比特重映射至另一位置才能执行,这种门也是远程门。The distance (distance) of the remote gate g is defined as the minimum number of SWAP operations required to realize the remote gate g, denoted as g.d; a double quantum gate on two non-adjacent bits is a remote gate; in addition, if a single bit Quantum gates that cannot be executed at the current location and require remapping of bits to another location to execute are also remote gates.

定义总候选距离

Figure BDA0002201261370000141
对于每一个候选SWAP操作sk=SWAP(q1’,q2’),执行候选SWAP操作sk,更新逻辑-物理比特映射
Figure BDA0002201261370000142
定义启发式函数:Define the total candidate distance
Figure BDA0002201261370000141
For each candidate SWAP operation sk =SWAP(q 1 ',q 2 '), perform the candidate SWAP operation sk , update the logical-physical bitmap
Figure BDA0002201261370000142
Define the heuristic function:

Figure BDA0002201261370000143
Figure BDA0002201261370000143

Hbasic(π,s)越高,SWAP操作sk产生的正面影响就越大,则优先级H(π,sk)=Hbasic(π,s);一般情况下,可以直接用H(π,sk)=Hbasic(π,sk)衡量每一个候选SWAP操作sk的积极效果,从中选出使H(π,s)最高的s。The higher the H basic (π,s), the greater the positive impact of the SWAP operation sk , then the priority H(π, sk )=H basic (π,s); in general, you can directly use H( π, sk )=H basic (π, sk ) measures the positive effect of each candidate SWAP operation sk , and selects the s that maximizes H(π,s).

如果物理比特之间的相邻关系能够建模为矩形网格;则可以针对每个候选双量子远程门g,考察其候选SWAP操作在矩形网格上的特征来进一步进行启发式优选。在矩形网格中,每个物理比特有位置属性x和y,如果逻辑门g为双量子远程门,则g=g(q1,q2),其作用的两个逻辑比特q1与q2之间的水平距离和垂直距离分别定义为:If the adjacent relationship between physical bits can be modeled as a rectangular grid; for each candidate dual quantum remote gate g, we can further perform heuristic optimization by examining the characteristics of its candidate SWAP operations on the rectangular grid. In a rectangular grid, each physical bit has location attributes x and y. If the logic gate g is a double quantum remote gate, then g=g(q 1 , q 2 ), and the two logic bits q 1 and q act on it The horizontal and vertical distances between 2 are defined as:

HD(π,g)=|q1’.x-q2’.x|HD(π,g)=|q 1 '.xq 2 '.x|

VD(π,g)=|q1’.y-q2’.y|VD(π,g)=|q 1 '.yq 2 '.y|

其中,q1’.x、q1’.y代表逻辑比特q1对应的物理比特q1’在矩形网格中的行、列坐标;q2’.x、q2’.y代表逻辑比特q2对应的物理比特q2’在矩形网格中的行、列坐标;Wherein, q 1 '.x, q 1 '.y represent the row and column coordinates of the physical bit q 1 ' corresponding to the logical bit q 1 in the rectangular grid; q 2 '.x, q 2 '.y represent the logical bit The row and column coordinates of the physical bit q 2 ' corresponding to q 2 in the rectangular grid;

则距离d(π,g)=HD(π,g)+VD(π,g)-1;对于g,需要引入SWAP操作将比特信息路由到该量子门可以执行的物理比特上,其最短路由路径可以有

Figure BDA0002201261370000144
种。Then the distance d(π,g)=HD(π,g)+VD(π,g)-1; for g, the SWAP operation needs to be introduced to route the bit information to the physical bits that the quantum gate can execute, and its shortest route path can have
Figure BDA0002201261370000144
kind.

在矩形网格中,对于任意距离为d(π,g)的比特对,当比特对的|VD(π,g)-HD(π,g)|越小,则比特对之间可能的最短路由路径数就越多;利用这个性质,针对每个候选SWAP操作sk,引入如下启发式函数进行辅助选择:In a rectangular grid, for any bit pair with a distance of d(π,g), when the |VD(π,g)-HD(π,g)| of the bit pair is smaller, the shortest possible distance between the bit pair The larger the number of routing paths; using this property, for each candidate SWAP operation sk , the following heuristic function is introduced to assist in the selection:

Figure BDA0002201261370000145
Figure BDA0002201261370000145

其中,G2为双量子远程门集合,对于能够建模为矩形网格情况,令优先级为H(π,sk)=<Hbasic(π,sk),Hfine(π,sk)>。Among them, G 2 is a set of double quantum remote gates. For the case that can be modeled as a rectangular grid, let the priority be H(π,s k )=<H basic (π,s k ),H fine (π,s k ) )>.

规定H(π,s1)>H(π,s2)当且仅当Hbasic(π,s1)>Hbasic(π,s2)或者Hbasic(π,s1)=Hbasic(π,s2)∧Hfine(π,s1)>Hfine(π,s2)。如果H(π,s1)>H(π,s2)或记为H(π,s2)<H(π,s1),则称s1的优先级比s2高。It is stipulated that H(π,s 1 )>H(π,s 2 ) if and only if H basic (π,s 1 )>H basic (π,s 2 ) or H basic (π,s 1 )=H basic ( π,s 2 )∧H fine (π,s 1 )>H fine (π,s 2 ). If H(π,s 1 )>H(π,s 2 ) or denoted as H(π,s 2 )<H(π,s 1 ), then the priority of s 1 is higher than that of s 2 .

本领域技术人员可以理解,上述优先级用二元组表示,“>、<”表示二元组优先级的偏序关系。Those skilled in the art can understand that the above priorities are represented by two-tuple groups, and “> and <” represent the partial order relationship of the priorities of the two-tuple groups.

对于足够理想的量子计算机,任意支持的门操作可以在任意的量子比特上执行。但通常的量子计算机上需要进行重映射才能保证程序执行。在重映射过程中会引入SWAP操作,导致重映射后的指令总数和总执行时间一定不少于进行重映射变换前。我们可以用两个简单的指标来衡量重映射算法的优劣:额外引入的SWAP操作数,和引入SWAP后导致(比在理想硬件上执行)增加的执行时间。For a sufficiently ideal quantum computer, any supported gate operation can be performed on any qubit. However, remapping is usually required on quantum computers to ensure program execution. A SWAP operation will be introduced during the remapping process, so that the total number of instructions and the total execution time after remapping must be no less than before the remapping transformation. We can measure the pros and cons of a remapping algorithm by two simple metrics: the number of additional SWAP operations introduced, and the increased execution time (compared to execution on ideal hardware) resulting from the introduction of SWAP.

将把本发明提供的面向嘈杂中型量子设备的逻辑-物理比特重映射方法称为COntext-and Duration-Aware Remapping algorithm(CODAR)。对标评估的算法是目前已知效果最好的SABRE算法。分别在IBM Q16,IBM Q20 Tokyo和Enfield 6*6三个模型上进行测试。测试样例包括量子傅里叶变换(QFT)、舒尔算法(shors)等典型量子算法。测试结果如表2~表3所示。其中,Qubits是量子程序所用逻辑比特数,gt为程序的总门数,TS、TC为SABRE变换后、CODAR变换后的最短执行时间,其中取单量子门执行时间为1,CX为2,SWAP为6。以上测试中CODAR与SABRE都经过12轮正反双向迭代来寻找初始映射。The logical-physical bit remapping method for noisy medium-sized quantum devices provided by the present invention will be referred to as COntext-and Duration-Aware Remapping algorithm (CODAR). The algorithm for benchmark evaluation is the best known SABRE algorithm. Tested on IBM Q16, IBM Q20 Tokyo and Enfield 6*6 models respectively. The test samples include typical quantum algorithms such as quantum Fourier transform (QFT) and Shors algorithm. The test results are shown in Tables 2 to 3. Among them, Qubits is the number of logical bits used by the quantum program, g t is the total number of gates in the program, T S and T C are the shortest execution time after SABRE transformation and after CODAR transformation, where the execution time of a single quantum gate is 1, and CX is 2, SWAP is 6. In the above tests, both CODAR and SABRE go through 12 rounds of forward and reverse bidirectional iterations to find the initial mapping.

Figure BDA0002201261370000161
Figure BDA0002201261370000161

表2测试结果(前半部分)Table 2 Test results (the first half)

volume_n5_d2volume_n5_d2 55 4040 2020 2020 2020 100.0%100.0% 2020 2020 100.0%100.0% 2020 2020 100.0%100.0% 4mod5-v1_224mod5-v1_22 55 21twenty one 22twenty two 4242 5353 79.2%79.2% 22twenty two 22twenty two 100.0%100.0% 4242 4747 89.4%89.4% 9symml_1959symml_195 1111 3488134881 3208432084 7435274352 8171181711 91.0%91.0% 5975559755 6088460884 98.2%98.2% 7181671816 7815378153 91.9%91.9% adr4_197adr4_197 1313 34393439 30883088 69776977 77377737 90.2%90.2% 53455345 54445444 98.2%98.2% 67476747 74797479 90.2%90.2% alu-v0_27alu-v0_27 55 3636 3535 6161 7171 85.9%85.9% 4949 3939 125.6%125.6% 6868 7171 95.8%95.8% cvcle10_2_110cvcle10_2_110 1212 60506050 56625662 1287112871 1411314113 91.2%91.2% 1007710077 1062610626 94.8%94.8% 1249212492 1368213682 91.3%91.3% ising_model_10ising_model_10 1010 480480 9090 8989 9090 98.9%98.9% 8989 9090 98.9%98.9% 8989 9090 98.9%98.9% ising_model_13ising_model_13 1313 633633 9191 9191 9191 100.0%100.0% 9191 9191 100.0%100.0% 9191 178178 51.1%51.1% ising_model_16ising_model_16 1616 786786 9191 9191 9191 100.0%100.0% 9191 180180 50.6%50.6% 9191 130130 70.0%70.0% misex1_241misex1_241 1515 48134813 44734473 98169816 1077510775 91.1%91.1% 71967196 69406940 103.7%103.7% 92969296 1066310663 87.2%87.2% mod5mils_65mod5mils_65 55 3535 3737 7676 8080 95.0%95.0% 6363 5959 106.8%106.8% 7676 8080 95.0%95.0% radd_250radd_250 1313 32133213 29902990 67276727 74047404 90.9%90.9% 50615061 53755375 94.2%94.2% 64946494 71597159 90.7%90.7% rd73_252rd73_252 1010 53215321 48294829 1097010970 1228712287 89.3%89.3% 88348834 89338933 98.9%98.9% 1069410694 1178011780 90.8%90.8% rd84_142rd84_142 1515 343343 191191 452452 493493 91.7%91.7% 378378 412412 91.8%91.8% 459459 463463 99.1%99.1% rd84_253rd84_253 1212 1365813658 1217612176 2825628256 3136531365 90.1%90.1% 2205422054 2318323183 95.1%95.1% 2723727237 3013330133 90.4%90.4% sqn_258sqn_258 1010 1022310223 91769176 2091620916 2317023170 90.3%90.3% 1674116741 1669416694 100.3%100.3% 2058120581 2226322263 92.4%92.4% square_root_7square_root_7 1515 76307630 63676367 1239912399 1626916269 76.2%76.2% 1024710247 1071010710 95.7%95.7% 1205812058 1574415744 76.6%76.6% sym6_145sym6_145 77 38883888 36863686 81298129 90119011 90.2%90.2% 58855885 62216221 94.6%94.6% 80668066 88478847 91.2%91.2% sym9_193sym9_193 1111 3488134881 3208432084 7435274352 8171181711 91.0%91.0% 5980559805 6077760777 98.4%98.4% 7192071920 7815378153 92.0%92.0% z4_268z4_268 1111 30733073 27562756 62486248 68926892 90.7%90.7% 50105010 51405140 97.5%97.5% 60826082 68276827 89.1%89.1%

表3测试结果(后半部分)Table 3 Test results (the second half)

在IBM Q16、IBM Q20Tokyo和Enfield 6*6三个模型中,CODAR变换的程序的运行时间与SABRE变换的程序的时间相比,分别为82.5%、82.4%、80.6%。CODAR在不同平台上成功减少了17.5%~19.4%的程序运行时间。In IBM Q16, IBM Q20Tokyo and Enfield 6*6 three models, the running time of CODAR-transformed program is 82.5%, 82.4%, and 80.6%, respectively, compared with that of SABRE-transformed program. CODAR successfully reduces the program running time by 17.5% to 19.4% on different platforms.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例可以通过软件实现,也可以借助软件加必要的通用硬件平台的方式来实现。基于这样的理解,上述实施例的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the above embodiments can be implemented by software or by means of software plus a necessary general hardware platform. Based on this understanding, the technical solutions of the above embodiments may be embodied in the form of software products, and the software products may be stored in a non-volatile storage medium (which may be CD-ROM, U disk, mobile hard disk, etc.), including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present invention.

以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明披露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求书的保护范围为准。The above description is only a preferred embodiment of the present invention, but the protection scope of the present invention is not limited to this. Substitutions should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims (8)

1. A logical-physical bit remapping method for a noisy medium-sized quantum device is characterized by comprising the following steps:
acquiring a logic gate sequence of a quantum program and initial mapping of logic-physical bits;
combining constraint information of quantum equipment for running the quantum program with initial mapping of logic-physical bits, completing remapping by changing the order of logic gates and inserting SWAP operation, obtaining an instruction scheduling sequence meeting the constraint information of the quantum equipment, and ensuring the minimum execution cost; each element in the instruction scheduling sequence is a binary group consisting of a physical gate to be executed and the initial execution time of the physical gate;
wherein a t is defined for each physical bit end Attribute to indicate the busy moment of the end of the corresponding bit, for the physical bit q, its t end The attribute is noted as q.t end T of the totality of physical bits end The attribute set is denoted T end (ii) a Initially, t of each bit end The attribute is 0, if the current time t is more than or equal to q.t end If so, bit q is idle;
the step of remapping comprises:
step a1, setting the current time t to be 0, and initializing an output instruction scheduling sequence I to be { };
step A2, initialize t end Attribute, t of each physical bit end Setting the attribute as 0;
step A3, calculating a current candidate gate set C by using an approximate solution algorithm of the candidate gate set and combining a logic gate sequence G and a mapping pi of logic-physical bits; the candidate gate is that, for one logic gate g, if the logic gate g and all the logic gates which are not executed before the logic gate g are all easy, the logic gate g is executed first next without changing the execution result of the sequence, and then the logic gate g is the candidate gate;
step A4, set of immediate gates C in set C for current candidate gates I Sequentially traverse C I Performs: step A41, if the physical bits mapped by the logic bits acted by the logic gate g are all idle, then using quantum instruction simulation execution and maximum parallelization algorithm, combining the instruction scheduling sequence I and the attribute set T end Transmitting a physical instruction corresponding to the logic gate G, wherein the physical instruction consists of a physical gate corresponding to the logic gate G and an acting physical bit, and removing the logic gate G from the logic gate sequence G; step A42, get immediate gate set C I Continues to perform step a41 until the immediate set of gates C I Is empty; otherwise, executing step A5;
step A5, for remote set of doors C in current set of candidate doors C R And executing: step A51, utilizing heuristic algorithm of optimal route, combining logic-physical bit mapping pi and attribute set T end And remote door set C R Obtaining a SWAP operation sequence S; step A52, for each SWAP operation in the SWAP operation sequence S, firstly updating the corresponding bit mapping in the logic-physical bit mapping pi according to two physical bits exchanged by the corresponding SWAP operation, and then combining the instruction scheduling sequence I and the attribute set T by utilizing the quantum instruction simulation execution and maximum parallelization algorithm end Transmitting a corresponding physical instruction; the remote gate is a logic gate needing routing operation, and the immediate gate is a logic gate which can be executed without routing;
step a6, setting the current time t to t + 1;
step A7, return to step A3 until logic gate sequence G is empty.
2. The method of claim 1, wherein the remapping by changing the order of logic gates and inserting SWAP operations comprises:
during remapping, the process of quantum program execution is simulated, the context environment of the quantum program and the parallelization characteristics of the logic gates are combined, the order of part of the logic gates is changed and SWAP operation is inserted on the premise of not changing the semantics of the quantum program, so that the instruction scheduling sequence obtained after remapping can be directly executed in corresponding quantum equipment.
3. The method of claim 1, wherein the step of computing the current candidate set of gates C comprises:
introducing a flag word with fixed length for each physical bit, and setting a flag bit for each parameter position g.i of each physical gate g in the flag word; sequentially reading in the logic gates in the logic gate sequence G, wherein the flag bit is true to indicate that the corresponding parameter positions of the logic gates and all the read logic gates are easy;
step B1, initially, the current candidate gate set C is a null set, and each flag bit of each physical bit is true;
step B2, all the logic gates which are not executed are traversed forward in sequence, and the following steps are executed:
step B21, setting the current logic gate as g ═ g (Q), where g is the quantum gate operation including parameter information, g is a quantum gate name, and Q represents the logic bit array acted by the logic gate g; if each logic bit Q belongs to Q, Q is the ith parameter of g, and the g.i flag bit of the corresponding physical bit Q' ═ pi (Q) is true, the logic gate g is put into a candidate gate set C;
step B22, for all logic bits Q belonging to Q, setting Q as the ith parameter of g, searching the column where the g.i flag bit of the physical bit Q ' corresponding to the logic bit Q is located, if the corresponding column has a unit with a value of 0, the row name of the corresponding unit is g '. j, and if the g '. j and the g.i are not easy to match, the flag bit corresponding to g '. j of the physical bit Q ' is false;
and step B23, taking down a logic gate, and continuing to loop until the traversal is finished or all the flag bits are false.
4. The method of claim 1, wherein the step of computing the current candidate set of gates C comprises:
introducing a flag word with fixed length for each physical bit, and setting a flag bit for each parameter position g.i of each physical gate g in the flag word; sequentially reading in the logic gates in the logic gate sequence G, wherein the flag bit is true to indicate that the corresponding parameter positions of the logic gates and all the read logic gates are easy;
step C1, in each remapping iteration process, a candidate gate set needs to be solved, and when the candidate gate set is solved for the first time, the candidate gate set C is an empty set;
step C2, when solving the candidate gate set in the remapping iterative process, recording the candidate gate set solved last as C last Is provided with C last Subset C emitted Having been launched and removed in the last remapping, set C is marked 0 =C last -C emitted
C3, recording each flag bit of each physical bit is true;
step C4, traversing the set C 0 The logic gate g ═ g (Q), where g is a quantum gate operation containing parameter information, g is a quantum gate name, and Q represents a bit array acted on by the logic gate g; for each logic bit Q belongs to Q, setting Q to be the ith parameter of g, searching a column where a g.i flag bit of a physical bit Q ' corresponding to the logic bit Q is located, if a unit with a value of 0 exists in the corresponding column, the row name of the corresponding unit is named as g '. j, and if the g '. j and the g.i are not easy, setting the flag bit corresponding to the g '. j of the physical bit Q '. pi (Q) as false;
step C5, sequentially traversing all unexecuted logic gates in the forward direction, and executing:
step C51, if the logic g is already in the candidate gate set C, continuing to take the next logic gate; otherwise, go to step C52;
step C52, if each logic bit Q belongs to Q, Q is the ith parameter of g, and g.i flag bit of the corresponding physical bit Q' is true, putting g into the candidate gate set C; otherwise, go to step C53;
step C53, for all logic bits Q belonging to Q, setting Q as the ith parameter of g, searching the column where the g.i flag bit of the physical bit Q ' corresponding to the logic bit Q is located, if the corresponding column has a unit with a value of 0, the row name of the corresponding unit is g '. j, and if the g '. j and the g.i are not easy to match, the flag bit corresponding to g '. j of the physical bit Q ' is false;
and step C54, taking down a logic gate, and continuing to loop until the traversal is finished or the total number of traversed logic gates exceeds a set value N.
5. The method for remapping the logical-physical bits of the noisy medium-sized quantum device according to claim 1, wherein before the quantum instruction simulation execution and the maximum parallelization algorithm are performed, the logical bit array Q acted by the logical gate g is transformed into a physical bit array Q '═ pi (Q) by using a mapping pi, so that the logical gate g becomes the physical gate g', actual operation contents of the logical gate and the physical gate are not changed, and only the operation object is changed from the logical bit to the physical bit; the quantum instruction simulation execution and maximum parallelization algorithm is responsible for transmitting a physical instruction corresponding to a physical gate g' or SWAP operation acting on a physical bit, and comprises the following steps:
for each physical bit Q ' ∈ Q ' acted on by physical gate g ', its latest ending busy time t is found m =max{q.t end },t m T is less than or equal to t; let the execution time of the physical gate g 'be tau, then for each physical bit Q'. epsilon.Q ', set Q'. t end =t m +τ;
And for the SWAP operation, transmitting a physical implementation instruction corresponding to the SWAP operation.
6. The logical-physical bit remapping method for the noisy medium-sized quantum device according to claim 1, wherein the step of obtaining the SWAP operation sequence S by using the heuristic algorithm of the optimal route comprises:
step D1, let SWAP operation sequence S { };
step D2, finding the current SWAP candidate set S c (ii) a Assuming that the logic gate g is a remote gate, the logic bit array Q acted on by the logic gate g is converted into a physical bit array Q 'by mapping pi to pi (Q), and the logic gate g becomes a physical gate g', here called remote gate g ', for the free bits Q' in the bit array Q 1 ', if any, associated with the physical bit q 1 ' Adjacent bits q 2 ' and physical bit q 2 'Idle', physical bit q is called 1 ' and q 2 SWAP operations between' are candidate SWAP;
step D3, for each candidate SWAP operation s k ∈S c Calculating the priority;
d4, selecting the SWAP operation s with the highest priority, if the priority of the SWAP operation s is less than 1; or if the adjacent relation between the physical bits can be modeled as a rectangular grid, the priority of the SWAP operation S is less than <1,0>, the algorithm is terminated, and the SWAP operation sequence S obtained at the current stage is output;
step D5, update SWAP operation sequence: s ═ es { S };
step D6, from SWAP candidate set S c Removing SWAP operation s and SWAP operation with common physical bit with the SWAP operation s;
step D7, updating mapping, pi ═ pi- s That is, the SWAP operation s is performed at the initial mapping of π, and the mapping becomes π! memory cells s
And D8, returning to the step D3 until the SWAP candidate set is empty.
7. The method of claim 6, wherein the candidate SWAP operations s are selected from a group consisting of a global operation, a motion, a global operation, a motion, a global operation, a motion, a, and a k The priority calculation method comprises the following steps:
defining the distance of the logic gate g as the minimum SWAP operand required for realizing the logic gate g, noted as g.d;
defining a total candidate distance
Figure FDA0003695220840000041
For each candidate SWAP operation s k =SWAP(q 1 ’,q 2 ') perform a candidate SWAP operation s k Updating the initial mapping pi ═ pi _ non conducting phosphor s Defining a heuristic function:
Figure FDA0003695220840000042
H basic the higher (π, s), the SWAP operation s k The greater the positive impact, the higher the priority H (π, s) k )=H basic (π,s);
If the neighborhood between physical bits can be modeled as a rectangular grid; each physical bit has location attributes x and y, g ═ g (q) if logic gate g is a dual-quantum remote gate 1 ,q 2 ) Two bits q of its effect 1 And q is 2 The horizontal and vertical distances therebetween are defined as:
HD(π,g)=|q 1 ’.x-q 2 ’.x|
VD(π,g)=|q 1 ’.y-q 2 ’.y|
wherein q is 1 ’.x、q 1 '. y represents a logical bit q 1 Corresponding physical bit q 1 ' row, column coordinates in a rectangular grid; q. q.s 2 ’.x、q 2 '. y represents a logical bit q 2 Corresponding physical bit q 2 ' row, column coordinates in a rectangular grid;
then the distance d (pi, g) ═ HD (pi, g) + VD (pi, g) -1;
in the rectangular grid, for a bit pair with an arbitrary distance d (pi, g), when | VD (pi, g) -HD (pi, g) | of the bit pair is smaller, the number of shortest routing paths possible between the bit pair is larger; using this property, for each candidate SWAP operation s k The following heuristic function is introduced for auxiliary selection:
Figure FDA0003695220840000051
wherein G is 2 For a set of dual-quantum remote gates, for the case that can be modeled as a rectangular grid, let the priority be H (π, s) k )=<H basic (π,s k ),H fine (π,s k )>。
8. The method of claim 7, wherein if all candidate SWAP operations s are performed, the method comprises k Are all less than 1 or less than<1,0>At this time, there may be two cases: in the first case, some candidate gates need routing, but some physical bit corresponding to these candidate gates is in busy state, or the routing will interfere with other executing gates; in the second case, there are candidate gates that need routes that do not interfere with existing gates;
for the second case, the following processing is adopted:
from SWAP candidate set S c Selecting the SWAP operation s with the highest priority;
from SWAP candidate set S c Removing SWAP operation s and SWAP operation having common bit with SWAP operation s, executing s and updating mapping pi ═ pi- s
The normal routing algorithm is re-executed until there are no candidate SWAP with a priority of no less than 1 or <1,0 >.
CN201910865893.9A 2019-09-09 2019-09-09 Logical-physical bit remapping method for noisy medium-sized quantum equipment Active CN110569979B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910865893.9A CN110569979B (en) 2019-09-09 2019-09-09 Logical-physical bit remapping method for noisy medium-sized quantum equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910865893.9A CN110569979B (en) 2019-09-09 2019-09-09 Logical-physical bit remapping method for noisy medium-sized quantum equipment

Publications (2)

Publication Number Publication Date
CN110569979A CN110569979A (en) 2019-12-13
CN110569979B true CN110569979B (en) 2022-09-06

Family

ID=68779818

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910865893.9A Active CN110569979B (en) 2019-09-09 2019-09-09 Logical-physical bit remapping method for noisy medium-sized quantum equipment

Country Status (1)

Country Link
CN (1) CN110569979B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11194573B1 (en) 2018-02-09 2021-12-07 Rigetti & Co, Llc Streaming execution for a quantum processing system
CN111638688B (en) * 2020-05-13 2023-02-03 宿迁学院 A Quantum Scheduling Method for Solving the Scheduling Problem of Flexible Flow Shop
CN111753990B (en) * 2020-05-27 2024-02-02 山东浪潮科学研究院有限公司 Quantum computer environment simulation method, device and medium
CN112099774B (en) * 2020-09-15 2025-01-28 山东浪潮科学研究院有限公司 A quantum cloud platform front-end development method
CN112085204B (en) * 2020-09-18 2022-10-28 东南大学 A Circuit Transformation Method for Quantum Compilation
CN115146782B (en) * 2021-03-31 2024-11-15 本源量子计算科技(合肥)股份有限公司 Quantum circuit compiling method and device, compiling frame and quantum operating system
CN115271080B (en) * 2021-04-30 2024-07-16 本源量子计算科技(合肥)股份有限公司 Quantum computing task execution method and device and quantum computer operating system
WO2023020487A1 (en) * 2021-08-17 2023-02-23 合肥本源量子计算科技有限责任公司 Method for mapping quantum program and quantum chip, quantum operating system and computer
WO2023051577A1 (en) * 2021-09-28 2023-04-06 合肥本源量子计算科技有限责任公司 Quantum program and quantum chip mapping method, and quantum operating system and computer
CN114157369B (en) * 2021-11-29 2023-03-14 北京印刷学院 Quantum state remote preparation model, method and device based on quantum network coding
CN115238899B (en) * 2022-04-29 2024-10-29 北京航空航天大学 Quantum program parallel processing method and operating system for superconducting quantum computer
CN115392469A (en) * 2022-08-16 2022-11-25 北京中科弧光量子软件技术有限公司 Quantum line mapping method and system based on dynamic deep search and electronic equipment
CN115062786B (en) * 2022-08-19 2022-12-30 中国科学技术大学 Quantum bit mapping and quantum gate scheduling method for quantum computer
CN115688931B (en) * 2022-10-31 2024-07-30 南通大学 Quantum circuit mapping and routing method based on segmented parallel processing
CN115860128B (en) * 2022-12-21 2023-08-15 北京百度网讯科技有限公司 Quantum circuit operation method and device and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1672171A (en) * 2002-07-31 2005-09-21 雅马哈发动机株式会社 Intelligent electromechanical control suspension system based on quantum soft computing
CN109858628A (en) * 2019-02-28 2019-06-07 北京百度网讯科技有限公司 Compile method, apparatus, equipment and the computer readable storage medium of quantum circuit
CN109961150A (en) * 2019-03-27 2019-07-02 中国科学技术大学 A quantum program transformation method and system for dealing with decoherence
CN110083440A (en) * 2013-05-17 2019-08-02 相干逻辑公司 The dynamic applied on multi-processor Embedded System reconfigures

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10255555B2 (en) * 2016-11-10 2019-04-09 Rigetti & Co, Inc. Generating quantum logic control sequences for quantum information processing hardware
US10496563B2 (en) * 2017-04-07 2019-12-03 Intel Corporation Apparatus and method for dynamic provisioning, quality of service, and scheduling in a graphics processor

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1672171A (en) * 2002-07-31 2005-09-21 雅马哈发动机株式会社 Intelligent electromechanical control suspension system based on quantum soft computing
CN110083440A (en) * 2013-05-17 2019-08-02 相干逻辑公司 The dynamic applied on multi-processor Embedded System reconfigures
CN109858628A (en) * 2019-02-28 2019-06-07 北京百度网讯科技有限公司 Compile method, apparatus, equipment and the computer readable storage medium of quantum circuit
CN109961150A (en) * 2019-03-27 2019-07-02 中国科学技术大学 A quantum program transformation method and system for dealing with decoherence

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Optimizing Quantum Programs against Decoherence Delaying Qubits into Quantum Superposition;Yu Zhang 等;《arXiv》;20190729;第1-8页 *
Tackling the Qubit Mapping Problem for NISQ-Era Quantum Devices;Gushu Li 等;《arXiv》;20190509;第1-13页 *
基于MCT可逆线路的量子线路近邻化排布;程学云等;《电子学报》;20180815(第08期);第101-107页 *

Also Published As

Publication number Publication date
CN110569979A (en) 2019-12-13

Similar Documents

Publication Publication Date Title
CN110569979B (en) Logical-physical bit remapping method for noisy medium-sized quantum equipment
US20230251861A1 (en) Accelerating linear algebra kernels for any processor architecture
CN110188885B (en) A quantum computing simulation method, device, storage medium and electronic device
US10423887B2 (en) Compilation, memory management, and fault localization with ancillas in an unknown state
CN114072817B (en) Quantum circuit optimization method and system
WO2020150156A1 (en) Systems and methods for hybrid algorithms using cluster contraction
CN112836787B (en) Reducing deep neural network training times through efficient hybrid parallelization
CN110516810B (en) A quantum program processing method, device, storage medium and electronic device
CN114175060A (en) Measurement sequence determination for quantum computing devices
US12093811B2 (en) Fractal calculating device and method, integrated circuit and board card
EP4242936A1 (en) Reducing resources in quantum circuits
Resch et al. Accelerating variational quantum algorithms using circuit concurrency
CN118913297A (en) Mobile robot path planning method, device, equipment and medium
CN103955443A (en) Ant colony algorithm optimization method based on GPU (Graphic Processing Unit) acceleration
CN111832144B (en) Full-amplitude quantum computing simulation method
US20230186131A1 (en) Simulator for quantum computing systems
Huang et al. Qubit mapping: the adaptive divide-and-conquer approach
CN113419990B (en) Method and device for accelerating imperfect nested circulation on coarse-granularity reconfigurable array
US11983606B2 (en) Method and device for constructing quantum circuit of QRAM architecture, and method and device for parsing quantum address data
CN108845795A (en) GPDSP-based dense matrix multiplication vectorization assembly code generation method
Sand et al. HMMlib: A C++ library for general hidden Markov models exploiting modern CPUs
Mokhov et al. Language and hardware acceleration backend for graph processing
US20230081944A1 (en) Data processing apparatus, data processing method, and storage medium
US20240232588A9 (en) Data processing device, data processing method, and computer-readable recording medium storing data processing program
US20240411977A1 (en) Dynamic standard cell external pin methodology for routability-driven standard cell design automation

Legal Events

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