A visual quantum computing programming system

By combining quantum circuits, states, and evolution visualization units, the problem of high complexity in quantum computing programming in existing technologies has been solved, an intuitive display of the quantum computing process has been achieved, and development and learning efficiency has been improved.

CN116911396BActive Publication Date: 2025-09-26ZHEJIANG UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310857434.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-13
Publication Date
2025-09-26
Estimated Expiration
2043-07-13

AI Technical Summary

Technical Problem

Existing quantum computing programming visualization methods are difficult to help users intuitively understand the quantum computing process, and the operations are complex, making development and debugging difficult.

Method used

A visual quantum computing programming system is provided, including a quantum circuit visualization unit, a quantum state visualization unit and an evolution visualization unit. It intuitively displays the amplitude, phase and entanglement relationship of quantum bits through bar graphs, double concentric circles and concentric double-layer squares, and visualizes the evolution process of the quantum state.

Benefits of technology

It simplifies the quantum computing programming process, improves development efficiency, helps users intuitively understand the quantum computing process, and improves the learning efficiency of beginners.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116911396B_ABST
    Figure CN116911396B_ABST
Patent Text Reader

Abstract

The present invention discloses a visualized quantum computing programming system, comprising a quantum circuit visualization unit for visualizing each qubit based on a received user code and visualizing the quantum gate processing of each qubit according to a time sequence; a qubit visualization unit for visualizing the amplitude and phase of a qubit in its initial state, as well as the amplitude and phase of each qubit in its intermediate or final state, and displaying the entanglement relationship between different bases; and an evolution visualization unit for visualizing the corresponding phase and amplitude changes when each qubit in different quantum algorithms or different variants of the same quantum algorithm evolves from its initial state to its final state. This visualized quantum computing programming system can effectively help users understand the quantum computing process and improve the efficiency of quantum computing development.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of quantum computers, and in particular relates to a visual quantum computing programming system. Background Art

[0002] The visualization of a quantum program typically consists of two parts: visualization of the quantum state and visualization of the quantum evolution. Quantum state visualization involves encoding the distribution of the properties of the basis, which in turn include information such as phase, amplitude, and entanglement. Visualization requires processing information from different channels to intuitively present a quantum state.

[0003] The document F. Bloch. Nuclear induction. Physical review, 70(7-8): 460, 1946. discloses that the representation of a single-bit quantum state can be described using the geometry of the Bloch sphere, that is, the amplitude and phase of the quantum state are determined by the position on the sphere and the angle with the coordinate axis. The state of an unentangled quantum bit can be represented at a point on the sphere.

[0004] C. Gidney. Visualizing 2-qubit entanglement. https: / / algassert.com / post / 1716, 2017. This paper proposes a better visualization method based on the Bloch sphere, using animation and two Bloch spheres to demonstrate the entanglement of a two-qubit quantum system. H. Rabinowitz. Helloquantum: The making of a seriously fun quantum game. https: / / www.ibm.com / blogs / research / 2018 / 07 / hello-quantum / , July 2018. This paper uses matrices to describe a two-qubit quantum state and encodes the probability and entanglement in color, but this work ignores the phase information of the bits.

[0005] In the paper E.R. Johnston, N. Harrigan, and M. Gimeno-Segovia. Programming Quantum Computers: Essential Algorithms and Code Samples. O'Reilly Media, 2019, Johnston et al. used a circular notation to describe quantum states, using a circle and a rotating line to encode the amplitude and phase of each basis in the quantum state. This geometric representation accurately matches the exponential representation of amplitude in quantum states, but the visual channels it uses, including area and angle, have high spatial requirements and make it difficult for users to accurately and quantitatively identify the information in the quantum state. To address this issue, the paper Ibm qexperience. https: / / quantumexperience.ng.bluemix.net uses a two-dimensional bar chart to encode probability and encodes phase in the other-dimensional bar chart.

[0006] The document F. Bloch. Nuclear induction. Physical review, 70(7-8): 460, 1946. mentions that the representation of a single-bit quantum state can be described using the geometry of the Bloch sphere, that is, the amplitude and phase of the quantum state are determined by the position on the sphere and the angle with the coordinate axis. The state of a non-entangled quantum bit can be represented at a point on the sphere.

[0007] C. Gidney (2017). Visualizing 2-qubit entanglement (https: / / algassert.com / post / 1716). Based on the Bloch sphere, a better visualization method is proposed, using animation and two Bloch spheres to demonstrate the entanglement of a two-qubit quantum system. H. Rabinowitz (2018). Hello quantum: The making of a seriously fun quantum game (https: / / www.ibm.com / blogs / research / 2018 / 07 / hello-quantum / ). This paper uses matrices to describe a two-qubit quantum state and encodes the probability and entanglement in the colors, but this work ignores the phase information of the bits.

[0008] However, the visualizations in the above literature cannot easily help users understand the quantum computing programming process. Summary of the Invention

[0009] The present invention provides a visual quantum computing programming system, which can effectively help users understand the process of quantum computing and improve the development efficiency of quantum computing.

[0010] The present invention provides a visual quantum computing programming system, comprising:

[0011] a quantum circuit visualization unit for visualizing each qubit based on a received user code and visualizing a quantum gate processing each qubit according to a time sequence process;

[0012] A quantum state visualization unit is used to visualize the quantum state of each variable or the entire system at a specified time. The system is the sum of all qubits used in the quantum circuit. The quantum state is the amplitude and phase angle of each basis, and the bases with entangled relationships are marked;

[0013] And the evolution visualization unit is used to visualize the phase change and amplitude change corresponding to the evolution of the quantum state of each variable in different modules of the entire quantum computing process from the initial state to the final state.

[0014] Furthermore, the quantum circuit visualization unit includes multiple quantum circuit rows, each quantum circuit row is used to visualize the corresponding quantum bit and the quantum gates that process the quantum bit in time sequence, wherein a multi-bit quantum gate can be visualized by spanning multiple quantum circuit rows.

[0015] Furthermore, the quantum circuit visualization unit is further configured to select at least one quantum gate corresponding to each quantum algorithm module to obtain different frames, and label each frame with the corresponding algorithm or variable name.

[0016] Furthermore, the quantum state visualization unit is used to visualize the amplitude value and phase value of each basis in different variables through a bar graph, and mark the corresponding amplitude value on the bar graph;

[0017] Alternatively, visualize the amplitude and phase values ​​of each basis in the entire system through a bar graph, and mark the corresponding amplitude on the bar graph;

[0018] The quantum bits of the entire system are composed of quantum bits for each variable.

[0019] Furthermore, the quantum bit visualization unit is also used to use mutual information to characterize the entanglement relationship between different quantum bits, and bases with mutual information values ​​exceeding 0.3 will be connected in the quantum state visualization of the variable.

[0020] Furthermore, the evolution visualization unit includes an initial quantum state subunit, a final quantum state subunit and an evolution matrix subunit;

[0021] The initial quantum state subunit is used to visualize each basis in which the quantum state of different modules is the initial state;

[0022] The final state quantum state subunit is used to visualize the quantum state obtained by evolution as the corresponding basis of the final state;

[0023] The evolution matrix subunit is used to visualize the modulus and amplitude of the corresponding complex number in polar coordinates when each basis with the quantum state as the initial state evolves into the corresponding basis with the quantum state as the final state, thereby showing the phase change and amplitude change.

[0024] Furthermore, the modulus and argument of the corresponding complex number in polar coordinates are visualized by using double concentric circles, where the inner radius of the double concentric circles represents the modulus of the corresponding complex number in polar coordinates, and the outer radius of the double concentric circles is the maximum modulus of all complex numbers in polar coordinates.

[0025] The degree of the arc of the double concentric circles represents the argument of the complex number in polar coordinates, that is, the corresponding quantum state is the phase increment of the corresponding basis of the initial state.

[0026] Furthermore, the quantum state of the initial state or the quantum state of the final state is visualized through concentric double-layer squares;

[0027] The concentric double-layer squares include an inner square, an outer square, and a line segment pointing from the center to the border;

[0028] Wherein, the side length of the inner square is the amplitude of the corresponding basis of the initial state or final state of the corresponding quantum state;

[0029] The side length of the outer square is the amplitude of the maximum basis in the initial state and the final state of the quantum state;

[0030] The angle between the line segment from the center to the frame and the twelve o'clock direction in a clockwise direction is the phase value when the corresponding quantum state is the initial state or the final state.

[0031] Compared with the prior art, the present invention has the following beneficial effects:

[0032] (1) The present invention provides a complete and easy-to-use application programming interface (API) for quantum computing programming, which can conveniently describe and define operations on quantum bits, quantum gates, etc. in the quantum computing process.

[0033] (2) The quantum computing process is more complex and counterintuitive than classical computing, which makes the development process difficult. The description of intermediate states in this invention can be compared to the monitoring of variables in classical computing debugging, which facilitates the development and debugging of quantum computing.

[0034] (3) The present invention can form a detailed visual view of the evolution process of quantum computing, which can help users intuitively understand the impact of each quantum gate on the quantum state.

[0035] (4) The visual quantum computing programming framework provided by the present invention can more efficiently develop programs for problems that can be solved by quantum computing in the intersection of computer science and different disciplines, and can improve the learning efficiency of quantum computing for beginners. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 A structural diagram of the visual programming framework provided for a specific embodiment of the present invention;

[0037] Figure 2 A block diagram of the structure of a quantum circuit visualization unit provided in a specific embodiment of the present invention;

[0038] Figure 3 A block diagram of the structure of a quantum bit visualization unit provided in a specific embodiment of the present invention;

[0039] Figure 4 A visualization graph of an initial state qubit or a final state qubit and a visualization graph of a complex number in an evolution visualization unit provided in a specific embodiment of the present invention;

[0040] Figure 5 A structural diagram of an evolution visualization unit provided in a specific embodiment of the present invention;

[0041] Figure 6 A schematic diagram of the Markov process and the corresponding quantum circuit visualization unit provided in Example 1;

[0042] Figure 7 A schematic diagram of the intermediate state of the Markov process provided in Example 1;

[0043] Figure 8 Schematic diagram of the quantum evolution of the Markov process provided in Example 1. DETAILED DESCRIPTION

[0044] In order to make the purpose, content, and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below with reference to the accompanying drawings and examples.

[0045] To achieve the goal of visualizing the quantum computing process, a specific embodiment of the present invention provides a set of APIs for describing and defining quantum bits and quantum gates, which can be used to describe the operations of different quantum gates on specified quantum bits in the quantum computing process. The present invention is based on computer programming to process multiple quantum gates of visualized quantum bits, visualize the relationship between amplitude, phase and mutual entanglement under different quantum states, and the evolution process of different bases of quantum states from the initial state to the final state.

[0046] The specific embodiment of the present invention provides a visual quantum computing programming system, such as Figure 1 As shown, it includes quantum computing programming visualization unit, quantum circuit visualization unit, quantum bit visualization unit and evolution visualization unit:

[0047] The quantum computing programming visualization unit provided by the specific embodiment of the present invention is as follows: Figure 1 As shown in A-1 in the figure, the coding of quantum computing programming is shown as Figure 1 As shown in A-2 in Figure 1, a user-defined quantum gate is shown, such as Figure 1 Figure A-3 shows the console output of the user program.

[0048] The quantum circuit visualization unit provided by the specific embodiment of the present invention is as follows: Figure 1 FIG. 1B is a diagram showing a quantum gate for visualizing each qubit based on a received user code and processing each qubit in a time-series manner.

[0049] In a specific embodiment, if Figure 1 As shown in B in FIG, the quantum circuit visualization unit includes multiple quantum circuit rows, each of which is used to visualize a corresponding quantum bit and a quantum gate that processes the quantum bit in a time-sequential manner. A multi-bit quantum gate can be visualized by spanning multiple quantum circuit rows.

[0050] In one embodiment, each quantum circuit uses rows to represent each qubit. Quantum gates are added to each row in chronological order. For multi-bit quantum gates, such as control gates, their operations on the corresponding qubits are represented across multiple rows.

[0051] like Figure 2 As shown, Figure 2 The quantum circuit contains 7 quantum bits, of which Q0-Q2, Q3-Q5, and Q6 each form a subsystem, that is, variables S, R, A,

[0052] The quantum bit Q0 passes through the SWAP gate, and Q0 and Q2 exchange quantum states. Then, through the HADAMARD gate, the coefficients a and b corresponding to the original 0 and 1 bases are changed to a+b / √(2), ab / √(2). After passing through the CPHASE gate, the phase of the (1, 1) basis in the subsystem composed of Q0 and Q1 is flipped 90°. After passing through the CPHASE gate, the phase of the (1, 1) basis in the subsystem composed of Q0 and Q2 is flipped 45°. Then, through the SWAP gate, Q0 and Q3 exchange quantum states.

[0053] The qubit Q1 is rotated 135° (ry) around the y-axis, undergoes a 90° phase flip of the (1,1) basis in the subsystem consisting of Q0 and Q1 through a CPHASE gate, and then passes through a HADAMARD gate. The phase of the (1,1) basis in the subsystem consisting of Q1 and Q2 is flipped 90° through a CPHASE gate. The quantum states of Q1 and Q4 are then swapped through a SWAP gate.

[0054] Quantum bit Q2 passes through a ry gate that rotates 135° around the y-axis, then passes through a SWAP gate to exchange its quantum state with Q0, then passes through two CPHASE gates to flip the phase by 45° and 90° respectively in the subsystem composed of Q0 and Q1, then passes through a HADAMARD gate, and finally exchanges its quantum state with Q5 through a SWAP gate.

[0055] After swapping its quantum state with Q0 via a SWAP gate, qubit Q3 undergoes two CPHASE gates, flipping its phase with the subsystem consisting of Q4 and Q5 by 45 and 90 degrees, respectively. It then swaps its quantum state with Q5 via a SWAP gate. Finally, it undergoes three CCNOT gates with Q4, Q5, and Q6. These are multi-bit control gates that invert the states of the controlled bits when all control bits are 1. Q3 serves as the control bit in the first two CCNOT gates and as the controlled bit in the final CCNOT gate.

[0056] After qubit Q4 exchanges its quantum state with Q0 via a SWAP gate, it performs a (1,1)-basis phase flip with the subsystem consisting of Q5 and Q4 via a HADAMARD gate and two CPHASE gates. Finally, two CCNOT gates are performed with Q3, Q5, and Q6, respectively, to perform a multi-bit controlled NOT operation, acting as the control bit and controlled bit.

[0057] Quantum bit Q5 first exchanges its quantum state with Q2 through a SWAP gate, then uses a HADAMARD gate and two CPHASE gates to flip the phase of the (1,1) basis in the subsystem composed of Q3 and Q4. It then exchanges its quantum state with Q3 through a SWAP gate, and then uses a CNOT gate to flip the quantum state of Q6 as a control bit. Finally, it performs a CCNOT gate with Q3, Q4, and Q6 as a controlled gate to flip its state.

[0058] Quantum bit Q6 flips the quantum state when Q5 is 1 through the CNOT gate (controlled NOT gate) formed with Q5, and then flips the target bit through the three CCNOT gates formed with Q3, Q4, and Q5 as control gates.

[0059] In the quantum circuit provided by the specific embodiment of the present invention, users can label each part to represent different modules, that is, different modules of the entire quantum computing process. Each module is composed of at least one quantum gate, and the quantum gates of multiple modules constitute all the quantum gates of the entire quantum computing process. GenInfo indicates that this part of the quantum gate is used to generate the quantum state, because the initial quantum state is all 0. InvQFT indicates that the frequency domain information of this part is converted into time domain information. Send indicates that these quantum states are exchanged and transferred from Q0-Q2 to Q3-Q5. Then QFT indicates the conversion from time domain to frequency. A=R>=4 indicates that this part is used to determine whether the R variable is greater than or equal to 4. Finally, High freq++ indicates that the basis of high-frequency signals, that is, R>=4, will be increased by one.

[0060] A specific embodiment of the present invention provides a quantum state visualization unit, such as Figure 1 As shown in C, it is used to visualize the quantum state of each variable or the entire system at a specified time. The quantum state is the amplitude and phase angle of each basis, and shows the entanglement relationship between each basis, that is, the connection between the ︱4> in the variable R and the ︱0> in the variable A, where the specified time is Figure 1 Select the vertical line BB in the red dotted box in B.

[0061] Figure 1 C-1 in the figure shows the quantum state of the variables, that is, the amplitude and phase of each basis with variables S, R, and A, and the basis with entangled relationship. Figure 1 Figure C-2 shows the amplitude and phase of each basis of the entire system, which visualizes the amplitude and phase of all bases of the overall state of the entire system formed by all quantum bits in the form of a bar graph.

[0062] like Figure 3 As shown, in the above descriptions of the overall state and variable state, the quantum state is visualized in the form of a bar graph. The bar graph will be arranged from small to large according to the size of the basis, and each basis will be divided into two parts of the bar graph, the upper half is the amplitude of the basis, and the lower half is the phase of the basis.

[0063] Furthermore, in the overall state of the system, if a system has N quantum bits, the state contains 2 N There are bases, each of which contains its own amplitude and phase. The amplitudes and phases of different bases can be different, but the sum of the squares of the amplitudes of different bases is 1.

[0064] Furthermore, if a specified variable in the entire system consists of M bits, it can be considered as a subsystem composed of some M quantum bits in the system, and its state contains 2 MEach basis is in the overall system. After selecting the M quantum bits in this part, traverse the NM remaining quantum bits from 0 to 2 N-M For each combination of bases, the sum of the squares of the amplitudes of different bases for the subsystem also satisfies the requirement that the sum of the squares of the amplitudes of different bases is 1.

[0065] In the specific implementation of the present invention, a quantum evolution process refers to the process by which the combination of partially consecutive quantum gates in a quantum circuit affects the quantum state of the system. Each quantum evolution process includes the initial state, final state, and evolution matrix of the quantum state. The initial state refers to the quantum state of the system at the time of entering the quantum evolution process but before passing through any quantum gates. The final state refers to the quantum state of the system after all quantum gate operations have been completed. The evolution matrix refers to the matrix formed by the combination of quantum gates during the evolution process.

[0066] The present invention specifically implements an evolution visualization unit for visualizing the phase change and amplitude change corresponding to the evolution of the quantum state of each basis in different modules of the entire quantum computing process from the initial state to the final state.

[0067] In a specific embodiment, the evolution visualization unit includes an initial state quantum state sub-unit, a final state quantum state sub-unit and an evolution matrix sub-unit; the initial state quantum state sub-unit is used to visualize each basis whose quantum state is the initial state in different modules; the final state quantum state sub-unit is used to visualize the corresponding basis whose quantum state is the final state obtained by evolution; the evolution matrix sub-unit is used to visualize the modulus and amplitude of the corresponding complex number in polar coordinates when each basis whose quantum state is the initial state evolves into the corresponding basis whose quantum state is the final state, thereby showing the phase change and amplitude change.

[0068] like Figure 1 As shown in D-1 to D-4 in the figure, the visualization of the evolution process of the InVQFT quantum algorithm, the visualization of the evolution process of the QFT quantum algorithm, the visualization of the evolution process corresponding to A=R>8, and the visualization of the evolution process of High freq++ are displayed. The overall layout is shown in the figure. Figure 1 As shown in E.

[0069] The visualization of the quantum evolution process is as follows: Figure 5 As shown in A, for the evolution process of an N quantum bit, the quantum evolution matrix will use 2 N *2 N Each element in the matrix is ​​divided into two inner and outer circles and arcs. Figure 4This is shown in part B of the figure, where the outer circle is transparent and the inner arc is yellow. The ratio of the radii of the inner circle to the outer circle represents the effect of that element in the evolution matrix on the amplitude of the corresponding initial and final states, while the degree of the inner arc represents the effect of that element in the evolution matrix on the phase of the corresponding initial and final states. Specifically, if we assume that a position in the evolution matrix is ​​(x, y), that is, row x and column y, and its corresponding basis is the yth basis from the left to the right in the initial state and the xth basis from the top to the bottom in the final state, then the amplitude of that basis in the initial state is multiplied by the ratio of the inner circle to the outer circle at that position, and then multiplied by the value of the outer circle itself (marked in the upper right corner). The resulting value is the contribution of the amplitude of the basis corresponding to the initial state at that position to the basis of the final state. For the final state, we calculate the contribution of each position in the row x corresponding to the basis and sum them, which is equal to the amplitude of the basis in the final state. For the phase, the operation is similar. We need to add the phase of the basis in the initial state to the phase of the corresponding position in the evolution matrix as its phase contribution to the basis corresponding to that row in the final state. We take the average of all the phase contributions in that row as the phase of the corresponding basis in the final state.

[0070] like Figure 4 As shown in Part A of the diagram, the initial and final states of the quantum state are described using a combination of squares, one for each basis in the quantum state. The squares are divided into two layers: the outer layer is transparent, and the inner layer is green. The ratio of the side lengths of the inner and outer squares represents the ratio of the amplitude of the basis to the amplitude of the largest basis in the quantum state. Furthermore, a line segment running from the center of the square to the outer border represents the phase of the basis. The angle between this line segment and the 12 o'clock direction, measured clockwise, represents the phase of the basis.

[0071] In the process of quantum evolution, Figure 5 As shown in Figure 1, if the nonzero elements in the evolution matrix are less than 10%, the evolution process is automatically converted to a Sankey diagram. The Sankey diagram is divided into three structures: left, center, and right. Each structure contains the same basic elements as the matrix representation. The left and right parts respectively describe the initial and final states of the quantum state. The center part is the combination of the nonzero elements in the original matrix, connected to the basis on which these elements act in the quantum state.

[0072] Example 1

[0073] Take, for example, a Markov process described in the form of a quantum circuit. This quantum circuit is a first-order Markov process, and its workflow is commonly used in weather forecasting and natural language segmentation. This process can be represented as a directed acyclic graph. Consider a three-step process consisting of three random bidirectional subprocesses, s1, s2, and s3. For example, starting with the current weather, the weather in the next time interval is either sunny or rainy. This Markov process can be used to infer the probability of rainy days in the future.

[0074] Simulate the Markov process, such as Figure 6 As shown in the figure, this quantum circuit is used to describe the Markov process. It contains five single-qubit variables, of which three qubits qs1, qs2, and qs3 are used to store three states, and nqs1 and nqs2 are used to record the opposite states of qs1 and qs2. In this circuit, three types of gates are used, namely Rotate Y gate (hereinafter referred to as RY), Controlled Not gate (hereinafter referred to as CNOT), and Controlled Rotate Y gate (hereinafter referred to as CRY). These three gates have different effects on the changes in the current state of the quantum system, such as Figure 6 Figure B-1 shows the effect of the RY gate on state evolution. By rotating Q0 101° about the y-axis, qubit Q0 evolves from a pure 0 state to a superposition of 0 and 1. At this point, the probability of measuring 0 is equal to P(S1=0), or 0.4, while the probability of measuring 1 is equal to P(S1=1), or 0.6. (P(S1=0) refers to the probability of S1=0.)

[0075] exist Figure 6 In the example, in chronological order, the RY gate will first operate on the single quantum bit variable qs1 with a parameter of 101 degrees. After the gate operation, the probability distribution of qs1 is the same as P(s1). Therefore, the parameters used by the RY gate in this operation conform to the process of the Markov chain in this example. Subsequently, a controlled NOT gate is added between qs1 and nqs1, where qs1 is the control bit and nqs1 is the controlled bit. The control gate will make the quantum state of nqs1 opposite to that of qs1. Subsequently, a CRY gate is connected between qs1 and qs2, that is Figure 6 The quantum gate in B-3 changes the amplitude and phase of qs2, simulating the conduction process from S1 = 1 to S2 = 1 in the Markov chain, and is used to construct P(S1 = 1) and P(S2 = 1). The subsequent process is similar, constructing the conduction process in different directions of the Markov process.

[0076] B-4, Transformation Figure 6 The line of 0.4 of S1 in A (the probability of transmission to S2 being 1 is 16%) converts 82% (0) into 66% (0) and 18% (1) into 34% (1))

[0077] (2) By selecting a certain execution state in the quantum circuit, the corresponding description and visualization operations of the quantum intermediate state can be performed. Each adjacent quantum process contains the intermediate state of the quantum system at the current time. Each intermediate state includes the overall state of the system and the current state of the subsystem composed of different variables containing its quantum bits.

[0078] For the state of the quantum system, the quantum state is visualized in the form of a histogram. The histogram will be arranged from small to large according to the size of the basis. Each basis will be divided into two parts of the histogram, the upper part is the amplitude of the basis, and the lower part is the phase of the basis. For example, in this example, the Markov chain process is Figure 7 As shown, it describes the state of 5 single-qubit variables in the system. A-1 is the initial state, and all bits are initialized to state 0 or state 1. At this time, there is no quantum superposition and entanglement, and the phase of the bit is also 0, so in the bar chart, each bit has a basis with an amplitude of 1 and another basis with an amplitude of 0. In A-2, the state after evolution, due to the quantum superposition and entanglement brought by the multi-bit gates CRY and CNOT, different variables are in different states. For example, in qs1, the amplitude of the basis corresponding to 1 is 0.77. Since the square of the amplitude of the basis in quantum computing is the probability of obtaining the value corresponding to the basis during measurement, its square is 0.6 (rounded off), which is equal to the probability of P(S1=1). For example, the amplitudes of the two bases qs1 and nqs1 are opposite to each other, which also confirms that nqs1 is the opposite state of qs1 in the previous article. The red line above describes the entanglement relationship between the corresponding bases in qs1 and nqs1. As shown Figure 2 As shown, the white line above each basis represents the probability, the height of the green column is the amplitude, and the height of the gray column below the basis is the phase.

[0079] (3) Visualization of the quantum evolution process. The quantum evolution process refers to the process of changes in the influence of the combination of some continuous quantum gates in the quantum circuit on the quantum state of the system. Each quantum evolution process will contain the initial state, final state and evolution matrix of the quantum state. Among them, the initial state refers to the quantum state of the system when entering the quantum evolution process but before passing through any quantum gates. The final state refers to the quantum state of the system after all quantum gate operations are completed. The evolution matrix refers to the matrix formed by the combination of quantum gates in the evolution process.

[0080] like Figure 8In B-3, for the evolution of a qubit, the quantum evolution matrix will take the form of a 4x4 square matrix. Each element in the matrix is ​​a complex number, expressed in polar coordinates as a*exp(i*theta). This complex number can be determined based on its amplitude and modulus. We represent this graphically, dividing each element into an outer circle and an inner arc, with the outer circle being semi-transparent and the inner arc yellow. The ratio of the radii of the inner circle to the outer circle represents the effect of that position in the evolution matrix on the amplitude of the corresponding initial and final states. That is, the amplitude in the final state is equal to the amplitude in the initial state multiplied by the ratio of the inner circle to the outer circle, multiplied by the value of the outer circle itself (marked in the upper right corner). The degree of the inner arc represents the effect of that element in the evolution matrix on the phase of the corresponding initial and final states. That is, the phase in the final state is equal to the phase in the initial state plus the degree of the arc, which is the theta value of the complex number at that position in the polar coordinates a*exp(e,i*theta). During the quantum evolution of this Markov chain, it represents the conditional probability of the transmission process in the chain. For example, in the second column, the evolution matrix transmits the amplitude and phase of the second basis qs1=1 and qs2=0 in the initial state to the amplitude and phase of the second basis qs1=1 and qs2=0 and the fourth basis qs1=1 and qs2=1 in the modal state. (The inner circle radius is, the initial state of the quantum bits qs1 and qs2 is transformed into the final state, and there is an evolution matrix 4*4. The evolution matrix is ​​normalized, and the value corresponding to each element of the matrix obtained after normalization is used as the radius of the corresponding inner circle. The radius of the outer circle is 1. The maximum value in the evolution matrix is ​​1, and the coefficient of the quantum state basis is the largest after normalization, 0.77.)

[0081] The initial and final states of a quantum state will be described using a combination of squares, one for each basis in the quantum state. The squares will be divided into two layers: the outer layer is transparent, and the inner layer is green. The ratio of the side lengths of the inner and outer squares represents the ratio of the amplitude of the basis to the amplitude of the largest basis among all bases. Furthermore, a line segment running from the center to the outer edge of the square will be drawn through the square. The angle between this line segment and the twelve o'clock direction, measured clockwise, represents the phase of the basis. In this Markov process, the final state is obtained by linearly combining the initial states in the evolution matrix. For example, in the final state, the second basis qs1 = 1 and qs2 = 0 has two nonzero elements in its evolution matrix. However, the nonzero element on the right has a basis amplitude of 0 in the column corresponding to the input state, so it is gray and does not contribute to the actual amplitude of the result. The element on the left, as shown in the upper right corner, has an amplitude of 0.77 in the input basis. Since the ratio of its inner circle to its outer circle is 1, and the value of the outer circle is marked as 0.77 in the upper right corner, the final amplitude of this basis in the final state is 1*0.77+0=0.77. The green squares represent the basis of the variables, and the cyan squares indicate that the green squares are composed of the basis of the system state. Taking a simple example, if we have two qubits, there are four possible bases: 00, 01, 10, and 11. In this case, if we require P(Q0=1), then Then, we need to add the squared amplitudes of the bases corresponding to bases 10 and 11. In this example, the cyan square lists every possibility: when we determine the value in the green square, the remaining bits can range from all 0 to all 1. Since there are 5 qubits in this example, when the value of the green square is determined to be 1, the cyan square will have 16 bases, from 0000 to 1111. We only select bases with non-zero amplitudes and add the squared amplitudes of the cyan squares to obtain the probability. Since the squared amplitude is a probability, we take the square root to obtain the amplitude of the basis of the green square. We then average the phases of the cyan squares to obtain the phase of the green square.

[0082] During the quantum evolution process, if the non-zero elements of the evolution matrix are less than 10%, the evolution process will be automatically converted into a Sankey diagram. Figure 8 As shown in B-2, the Sankey diagram is divided into three structures: left, center, and right. The left and right parts describe the initial and final states of the quantum state, respectively. The center part is the combination of nonzero elements in the original matrix, connected to the basis on which these elements act in the quantum state. In this Markov process, since the amplitude of the initial state qs1 = 0 and nqs1 = 0 is 0, these elements are gray, indicating that they do not contribute to the final state.

[0083] Figure 8B1 in the matrix represents the process of changing the variable qs1 from a zero state to a superposition state of 0 and 1. Since the initial state only has the amplitude of the basis corresponding to 0, only the left column in the matrix is ​​valid and is marked in yellow. Multiply the amplitude of the basis corresponding to 0 by the radius of the yellow circle and then by the maximum value in the upper right corner to obtain the amplitude of the basis in the final state. The phase is processed similarly. Add the phase of the initial state to the phase of the yellow circle. Figure 8 B2 in the figure represents the process of obtaining the opposite state of the variable qs1. Focus on the lines to the left and right of the yellow circle. These lines connect to the basis in the initial and final states, respectively. These lines indicate that the basis in the initial state, through the yellow circle, forms the basis in the final state. For example, in the initial state 01, the radius of the green square divided by the radius of the outer square (1), multiplied by the value of the largest square in the upper right corner (0.77), is the amplitude of the basis in the initial state. This is multiplied by the radius of the inner courtyard of the yellow circle (1), divided by the radius of the outer circle (1), and then multiplied by the maximum value of the yellow circle in the upper right corner, which corresponds to the amplitude of the basis in the final state. The calculation of the phase is similar: the phase in the initial state is added to the phase increment in the yellow circle to obtain the phase of the final state.

Claims

1. A visual quantum computing programming system, characterized by: include: a quantum circuit visualization unit for visualizing each qubit based on a received user code and visualizing a quantum gate processing each qubit according to a time sequence process; A quantum state visualization unit is used to visualize the quantum state of each variable or the entire system at a specified time. The system is the sum of all qubits used in the quantum circuit. The quantum state is the amplitude and phase angle of each basis, and the bases with entangled relationships are marked; and evolution visualization unit, which is used to visualize the phase change and amplitude change corresponding to the evolution of the quantum state of each variable in different modules of the entire quantum computing process from the initial state to the final state; The evolution visualization unit includes an initial quantum state subunit, a final quantum state subunit and an evolution matrix subunit; The initial quantum state subunit is used to visualize each basis in which the quantum state of different modules is the initial state; The final state quantum state subunit is used to visualize the quantum state obtained by evolution as the corresponding basis of the final state; The evolution matrix subunit is used to visualize the modulus and argument of the corresponding complex number in polar coordinates when each basis with the quantum state as the initial state evolves to the corresponding basis with the quantum state as the final state, thereby showing the phase change and amplitude change; The modulus and argument of the corresponding complex number in polar coordinates are visualized through double concentric circles, where the inner radius of the double concentric circles represents the modulus of the corresponding complex number in polar coordinates, and the outer radius of the double concentric circles is the maximum modulus of all complex numbers in polar coordinates; The degree of the arc of the double concentric circles represents the argument of the complex number in polar coordinates, that is, the corresponding quantum state is the phase increment of the corresponding basis of the initial state.

2. The visual quantum computing programming system according to claim 1, characterized in that: The quantum circuit visualization unit includes multiple quantum circuit rows, each quantum circuit row is used to visualize a corresponding quantum bit and a quantum gate that processes the quantum bit in a time sequence, wherein a multi-bit quantum gate can be visualized by spanning multiple quantum circuit rows.

3. The visual quantum computing programming system according to claim 1, characterized in that: The quantum circuit visualization unit is further configured to frame at least one quantum gate corresponding to each quantum algorithm module to obtain different labeled frames, and label each labeled frame with a corresponding algorithm or variable name.

4. The visual quantum computing programming system according to claim 1, characterized in that The quantum state visualization unit is used to visualize the amplitude value and phase value of each basis in different variables through a bar graph, and mark the corresponding amplitude value on the bar graph; Alternatively, visualize the amplitude and phase values ​​of each basis in the entire system through a bar graph, and mark the corresponding amplitude on the bar graph; The quantum bits of the entire system are composed of quantum bits for each variable.

5. The visual quantum computing programming system according to claim 1, characterized in that: The quantum bit visualization unit is further configured to use mutual information to characterize the entanglement relationship between different quantum bits, and bases with mutual information values ​​exceeding 0.3 will be connected in the quantum state visualization of the variable.

6. The visual quantum computing programming system according to claim 1, characterized in that: Visualize the quantum state of the initial state or the quantum state of the final state through concentric double layers of squares; The concentric double-layer squares include an inner square, an outer square, and a line segment pointing from the center to the border; Wherein, the side length of the inner square is the amplitude of the corresponding basis of the initial state or final state of the corresponding quantum state; The side length of the outer square is the amplitude of the maximum basis in the initial state and the final state of the quantum state; The angle between the line segment from the center to the frame and the twelve o'clock direction in a clockwise direction is the phase value when the corresponding quantum state is the initial state or the final state.

Citation Information

Patent Citations

  • Visualizing or interacting with a quantum processor

    US10592626B1