Simulation device and simulation method
Patent Information
- Application Number
- JP2025509325
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Priority Date
- 2023-03-28
- Filing Date
- 2023-03-28
- Publication Date
- 2025-12-04
Abstract
Description
Simulation device, simulation method, and program
[0001] The present invention relates to a simulation device, a simulation method, and a program.
[0002] Unlike conventional computers, quantum computers operate based on the properties of quantum mechanics. Recent social challenges require high-speed processing, such as handling huge amounts of data and performing complex calculations, and quantum computers are expected to be a means to potentially meet these demands. In fact, with regard to quantum computers classified as gate-type quantum computers, active development is underway to increase the number of qubits so that they can solve real-world problems. Gate-type quantum computers are quantum computers that perform quantum calculations using quantum circuits with quantum gates. In this case, quantum circuits are hardware that directly utilize quantum mechanical phenomena.
[0003] While the development of quantum computers continues, research and development is also underway to speed up simulations on conventional computers, inspired by calculations using quantum computers. One such effort involves simulating calculations performed by quantum computers (quantum circuit simulation) using conventional computers. This is being done to understand the operation of quantum computers and develop quantum algorithms.
[0004] Tensor networks are one of the methods used to simulate quantum computers. A tensor network is a network connected by a calculation called "contraction" involving multidimensional arrays called tensors. Tensors include vectors, which are one-dimensional arrays, and matrices, which are two-dimensional arrays. Vectors can be considered one-dimensional tensors. Matrices can be considered two-dimensional tensors. Tensors are a more generalized version of matrices in the sense that they are arrays with a larger dimension. Also, ordinary numbers are called scalars and can be considered zero-dimensional tensors.
[0005] FIG. 1 shows an example of a tensor contraction calculation and a tensor network graph. An example of a contraction calculation is shown in the upper part of FIG. 1, and an example of a tensor network graph is shown in the lower part of FIG. 1. Contraction is the sum of the indices of a tensor. For example, for a tensor network graph such as the one shown in the lower part of FIG. 1, the node T 1 , T 2 , T 3 , T 4 Each represents a tensor. An edge i extending from a node 1 , i 2 , ..., i 8 represents the index of each tensor. The number of edges represents the dimension of each tensor. The tensor network graph shown in the lower part of Figure 1 corresponds to the contraction calculation formula shown in the upper part of Figure 1. This graph is i 1 , i 2 , i 3 , i 4 , i 5 In the graph of a tensor network, tensor contractions are represented by edges connecting nodes.
[0006] In quantum computer simulations using tensor networks, the quantum circuit representing the calculations on a quantum computer is regarded as a tensor network of states and gate operators, and simulations are performed by taking contractions on the indices connected on the network.
[0007] FIG. 2 is a diagram showing an example of how to assign tensor subscripts when a quantum circuit is considered as a tensor network. In the example of the quantum circuit shown in FIG. 2, quantum computation starts from the initial state on the far left, quantum gate operations are performed on the qubits in order from the left, and the state is observed at the stage on the far right when the quantum gate operations are completed. When this series of operations is calculated based on a tensor network, the quantum states and gates are each considered as nodes in the graph of the tensor network, and the lines connecting the quantum states and gates and the lines connecting gates are each considered as edges. In FIG. 2, the i shown above these lines 1 Symbols such as are considered to be tensor indices.
[0008] While exact calculations can be performed in quantum circuit simulations using tensor networks, approximate calculations can be performed by combining matrix product states and low-rank approximations, which are well known in the field of tensor networks (e.g., Non-Patent Document 1). As the number of quantum bits increases, the number of quantum states to be handled increases exponentially, and the amount of calculation also increases. Therefore, approximate calculations are particularly useful when performing calculations on a general personal computer (PC) or when high accuracy is not required. In this invention, we deal with approximate quantum circuit calculations using matrix product states and low-rank approximations.
[0009] On the other hand, known techniques for simulations that do not use tensor networks to approximate quantum circuits include, for example, the techniques described in Patent Document 1 and Patent Document 2. The technique described in Patent Document 1 includes a method for reducing the amount of computation required for matrix multiplications corresponding to contraction calculations when k (<n) qubit gates are applied in a simulation of an n-qubit quantum circuit by appropriately rearranging the indices of n qubits representing the state to consolidate the variables included in the qubit gates. The technique described in Patent Document 2 includes a method for reducing the amount of computation required for tensor network contraction calculations when an operation using a single qubit gate or an operation using a combination of multiple qubit gates is expressed as a matrix that has only diagonal elements, since calculations for the off-diagonal elements are not required.
[0010] Japanese Patent Application Laid-Open No. 2022-3501 Special Publication No. 2021-520546
[0011] "Quantum Software Pilot Lecture: Information Compression in Computational Science and Quantum Computing," [online], [Retrieved November 17, 2022], Internet <URL: https: / / github.com / utokyo-qsw / data-compression>
[0012] However, when simulating quantum circuits by combining tensor contraction, matrix product states, and low-rank approximation, low-rank approximation is performed for each multi-qubit gate operation, which reduces the accuracy of the simulation when a large number of quantum gate operations are performed.
[0013] According to a first aspect of the invention, a simulation device includes a tensor contraction calculation unit that performs a contraction calculation in a tensor network corresponding to a quantum gate operation based on the state of a quantum bit included in a quantum circuit and information indicating a quantum gate operation to be applied to the quantum bit; a matrix product state construction unit that constructs a matrix product state from the state of the quantum bit obtained by the contraction calculation by the tensor contraction calculation unit; and a low-rank approximation calculation unit that performs a low-rank approximation for each of a plurality of quantum gate operations grouped together when the matrix product state construction unit constructs the matrix product state.
[0014] According to a first aspect of the invention, a simulation device includes a simulation result comparison unit that, in a simulation of an approximate quantum circuit with a pure state as an initial state, compares multiple simulation results obtained using different approximation methods based on their proximity to the pure state, and a simulation result output unit that outputs the result of the multiple simulation results that is closest to the pure state based on the result of the comparison by the simulation result comparison unit.
[0015] According to a first aspect of the invention, a simulation method includes a tensor contraction calculation step that performs a contraction calculation in a tensor network corresponding to a quantum gate operation based on the state of a quantum bit included in a quantum circuit and information indicating a quantum gate operation to be applied to the quantum bit; a matrix product state construction step that constructs a matrix product state from the state of the quantum bit obtained by the contraction calculation in the tensor contraction calculation step; and a low-rank approximation calculation step that performs a low-rank approximation for each of a plurality of quantum gate operations grouped together when constructing the matrix product state in the matrix product state construction step.
[0016] According to a first aspect of the invention, a simulation method includes a simulation result comparison step of comparing multiple simulation results obtained using different approximation methods based on their proximity to the pure state in a simulation of an approximate quantum circuit whose initial state is a pure state, and a simulation result output step of outputting the result of the multiple simulation results that is closest to the pure state based on the result of the comparison made in the simulation result comparison step.
[0017] According to a first aspect of the invention, the program causes a computer to execute a tensor contraction calculation step of performing a contraction calculation in a tensor network corresponding to a quantum gate operation based on the state of a quantum bit included in a quantum circuit and information indicating a quantum gate operation to be applied to the quantum bit; a matrix product state construction step of constructing a matrix product state from the state of the quantum bit obtained by the contraction calculation in the tensor contraction calculation step; and a low-rank approximation calculation step of performing a low-rank approximation for each of a plurality of quantum gate operations grouped together when constructing the matrix product state in the matrix product state construction step.
[0018] According to a first aspect of the invention, a program causes a computer to execute a simulation result comparison step of comparing multiple simulation results obtained using different approximation methods based on their proximity to the pure state in a simulation of an approximate quantum circuit with a pure state as the initial state, and a simulation result output step of outputting the result of the multiple simulation results that is closest to the pure state based on the result of the comparison made in the simulation result comparison step.
[0019] According to the present invention, when performing an approximate simulation of a quantum circuit based on a tensor network, it is possible to mitigate the influence of a decrease in simulation accuracy due to approximation.
[0020] 1 shows an example of a graph of a tensor contraction calculation and a tensor network. FIG. 2 shows an example of how to assign subscripts to tensors when a quantum circuit is considered as a tensor network. FIG. 3 shows an example of a graph of a tensor network corresponding to performing singular value decomposition to construct a matrix product state. FIG. 4 shows an example of a graph of a tensor network corresponding to performing a one-qubit gate operation on a matrix product state. FIG. 5 shows an example of a graph of a tensor network corresponding to performing a two-qubit gate operation on a matrix product state. FIG. 6 is a diagram for explaining a decrease in simulation accuracy when low-rank approximation is performed every time a multi-qubit gate operation is performed. FIG. 7 shows an overview of a first calculation method according to an embodiment of the present invention. FIG. 8 shows an overview of a method of performing low-rank approximation from a matrix product state without performing a quantum gate operation from an embodiment of the present invention. FIG. 9 shows an overview of a second calculation method according to an embodiment of the present invention. FIG. 10 shows an example of a configuration of a quantum circuit simulation device 100 according to an embodiment of the present invention. FIG. 11 shows an example of a process flow based on a simulation method according to an embodiment of the present invention. FIG. 12 shows an example of a process flow based on a calculation method in which low-rank approximation is performed for each quantum gate operation according to an embodiment of the present invention. FIG. 13 shows an example of a process flow based on the first calculation method according to an embodiment of the present invention. FIG. 14 shows an example of a process flow based on the second calculation method according to an embodiment of the present invention.
[0021] (Embodiments) Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. In a simulation of a quantum circuit using tensor network approximation, there is a method in which the quantum state is represented in a state called a matrix product state and approximated using a method called low-rank approximation. In this embodiment, a quantum circuit is a model that represents calculations performed by a quantum computer. A quantum circuit is described by the states of quantum bits and quantum gate operations that act on the quantum bits.
[0022] [Matrix product state] A matrix product state is a state in which coefficients representing the superposition of quantum states are expressed as a product of matrices. A general quantum state Ψ of N qubits is expressed using bracket notation as shown in Equation (1).
[0023]
[0024] Based on this representation, the quantum state when there are three quantum bits, for example, is expressed as in equation (2).
[0025]
[0026] Here, the state of each quantum bit is represented by the subscript shown in the ket |·〉. For example, in the state |011〉, the states of the first, second, and third quantum bits are 0, 1, and 1, respectively. The matrix product state is expressed by the coefficient Ψ of the quantum state. i1i2・・・iN (i1 etc. is i 1 This matrix product is shown in equation (3).
[0027]
[0028] In equation (3), the subscript i on the left side 1 , i 2 , ・・・ , i N are the arguments i on the right side, respectively. 1 , i 2 , ・・・ , i N Corresponds to the right side of A 1 , A 2 , ・・・ , A N are matrices.
[0029] Singular value decomposition is used to rewrite a quantum state into a matrix product state. Singular value decomposition rewrites a complex matrix as the product of two unitary matrices and a singular value matrix. A singular value matrix is a matrix with positive real numbers arranged on the diagonal elements. When a complex matrix A with M rows and N columns is subjected to singular value decomposition, it is expressed as shown in equation (4).
[0030]
[0031] where U is an M-row, M-column unitary matrix, and V is an N-row, N-column unitary matrix. The † (dagger) next to a matrix indicates that it is Hermitian conjugate. Σ is an M-row, N-column matrix with positive real numbers on the diagonal elements, and is a singular value matrix. The singular value matrix can be expressed mathematically as in equation (5).
[0032]
[0033] These positive real numbers σ 1 , σ 2 , ..., σ r are called singular values. Here, r denotes the rank of matrix A. Σ r×r represents a submatrix of Σ with r rows and r columns, in which non-zero singular values are sorted in descending order. r×(N-r) etc. represents a matrix of r rows and (Nr) columns whose elements are all zero.
[0034] [Data reduction by singular value decomposition and low-rank approximation] If the rank of the original matrix A is smaller than M and N, then the singular values are arranged in a matrix Σ r×r Using this, the original matrix A can be reproduced while reducing the number of elements of the matrix resulting from the singular value decomposition, as shown in equation (6).
[0035]
[0036] However, U M×r is a submatrix using up to r columns of U, V † r×N is V † The effect of reducing the matrix components by singular value decomposition is particularly significant when the rank of the original matrix A is much smaller than the number of rows, M, and the number of columns, N, respectively.
[0037] Furthermore, the singular value matrix Σ r×r The singular values are arranged in descending order of magnitude, but by ignoring small singular values, the matrix components can be reduced. This operation corresponds to an approximation that lowers the rank of the original matrix by reducing the number of singular values. Therefore, this operation is called low-rank approximation.
[0038] For example, it is decided to retain singular values of the original matrix A until the sum of the singular values of the original matrix A becomes a predetermined percentage (e.g., 95%) of the sum of the singular values of the original matrix. As a result, when k (<r) singular values are adopted, the result of low-rank approximation is expressed as in Equation (7).
[0039]
[0040] As a result, the inequality shown by equation (8) holds.
[0041]
[0042] [Approximate Simulation of Quantum Computers Using Matrix Product States and Low-Rank Approximation] Using matrix product states and low-rank approximation, it is possible to approximate the simulation of quantum circuits using tensor networks.
[0043] The quantum state handled in the simulation of quantum circuits is a superposition of multiple states. For example, in the case of three qubits, as shown in equation (9), 3 ) is a superposition of individual states.
[0044]
[0045] This quantum state can be expressed as a row vector by equation (10).
[0046]
[0047] To rewrite the quantum state represented by equation (10) into a matrix product state, first rewrite it into a two-row matrix, each row corresponding to the states 0 and 1 of the first quantum bit, as shown in equation (11).
[0048]
[0049] First, to express the first quantum bit in a matrix product state, the matrix rewritten into two rows shown in equation (11) is set as matrix A as shown in equation (12).
[0050]
[0051] The matrix A is subjected to the above-mentioned singular value decomposition as shown in equation (13).
[0052]
[0053] In this case, the matrix U corresponds to the matrix product state of the first quantum bit, and the matrix ΣV † corresponds to the state of the second and subsequent quantum bits. The resulting matrix ΣV † Further singular value decomposition can be performed on the matrix product state of the second and third qubits.
[0054] These operations can be represented by a tensor network graph as shown in Figure 3. Figure 3 is a diagram showing an example of a tensor network graph corresponding to performing singular value decomposition to construct a matrix product state. A state in which all of the coefficients of the states of three qubits are held as matrices is shown as graph 11 in Figure 3. Graph 12 is the graph obtained when graph 11 is represented as a matrix product state using singular value decomposition for the first qubit. Furthermore, when singular value decomposition is performed on the matrix representing the states of the second and third qubits, the result is shown as graph 13.
[0055] A circled in Graph 13 1 , A 2 , A 3 The symbols represent matrix product states. 1 , A 2 , A 3 The lines extending downward from each represent the arguments of the matrix product state (A 1 [i 1 ] etc. 1 When simulating a quantum circuit using a tensor network, the state of each quantum bit is represented by a matrix product state.
[0056] In quantum circuits, quantum gate operations are performed on quantum bits, and quantum gate operations are classified according to the number of quantum bits they operate on. For example, quantum gate operations include one-qubit gate operations that operate on only one quantum bit, and two-qubit gate operations that operate on two quantum bits.
[0057] When a one-qubit gate operation is calculated by a tensor network simulation, the graph shown in Fig. 4 is obtained. Fig. 4 is a diagram showing an example of a tensor network graph corresponding to performing a one-qubit gate operation on a matrix product state. Graph 21 shows the matrix product state A of the qubit represented by a circle. n [i n ] corresponding to the tensor (A n ) injn-1jn (In etc. is i n) and the quantum gate operation G 1 The tensor (G 1 ) ini’n (In etc. is i n Graph 22 shows the matrix product state A' resulting from this contraction. n [i' n ] corresponding to the tensor (A n ') i’njn-1jn (i'n etc. are i ’ n In other words, as shown in equation (14), in FIG. 4, as a result of this contraction, the matrix product state A n [i n ] corresponding to the tensor (A n ) injn-1jn is the matrix product state A' n [i' n ] corresponding to the tensor (A n ') i’njn-1jn (i'n etc. are i ’ n This indicates that the file has been updated to the latest version.
[0058]
[0059] Next, a method of tensor contraction calculation corresponding to performing two-qubit gate operations will be described. FIG. 5 is a diagram showing an example of a graph of a tensor network corresponding to performing two-qubit gate operations on a matrix product state. Graph 31 shows two qubits represented by circles (i.e., matrix product state A n [i n ] corresponding to the tensor (A n ) injn-1jn (In etc. is i n ) and the matrix product state A n+1 [ in+1 ] corresponding to the tensor (A n+1 ) in+1jnjn+1 (in+1 etc. is i n+1 ) and the two-qubit gate operation G 2 The tensor (G 2 ) in in + 1 in ' in + 1 ' (in etc. is i nGraph 32 shows the tensor (A n 'A n+1 ') i'ni'n+1jn-1jn+1 (i'n etc. is i ’ n ) is shown in the upper part of FIG. 5. As a result of this contraction, as shown in equation (15), the matrix product state A n [i n ] corresponding to the tensor (A n ) injn-1jn (In etc. is i n ) and the matrix product state A n+1 [ in+1 ] corresponding to the tensor (A n+1 ) in+1 jn jn+1) (in+1 etc. is i n+1 ) is a tensor (A n 'A n+1 ') i'ni'n+1jn-1jn+1 (i'n etc. is i ’ n This indicates that the file has been updated to the latest version.
[0060]
[0061] In the case of two-qubit gate operation, a tensor (A n 'A n+1 ') i'ni'n+1jn-1jn+1' (i'n etc. is i ’ n (meaning that the matrix product is a matrix of the same size) needs to be rewritten into a matrix product state one by one by singular value decomposition. When rewritten into a matrix product state, it becomes as shown in Graph 33.
[0062] [Effects of Approximate Simulation of Quantum Computers] Here, if low-rank approximation is not used when performing singular value decomposition, quantum circuit simulations can be performed accurately. However, the states handled in quantum circuit simulations can involve a superposition of exponentially many states. Therefore, when performing simulations on a typical personal computer (PC), memory may be insufficient. Therefore, by using low-rank approximation when rewriting the states of two quantum bits into matrix product states of each quantum bit, simulations can be performed while reducing the memory required to represent the quantum bit states. For quantum gate operations to operate three or more quantum bits, as in the case of two quantum bits, tensor contraction can be performed, and then rewriting the state into a matrix product state, followed by low-rank approximation. In this way, by combining tensor contraction in a tensor network graph, matrix product states, and low-rank approximation, the amount of computation required to perform quantum circuit simulations in the order in which quantum gate operations are performed can be reduced.
[0063] [Problems with Approximate Simulation of Quantum Computers] However, when simulating quantum circuits by combining tensor contraction, matrix multiplication, and low-rank approximation, low-rank approximation is performed for each multi-qubit gate operation, which results in a decrease in simulation accuracy when performing a large number of quantum gate operations.
[0064] Here, referring to FIG. 6 , a description will be given of the degradation in simulation accuracy when low-rank approximation is performed each time a multi-qubit gate operation is performed. In FIG. 6 , a simulation of a five-qubit quantum computer is shown by a tensor network graph 41. In graph 41, quantum gate operations that perform low-rank approximation are represented by shaded rectangles (rectangle 42, rectangle 43, rectangle 44, rectangle 45, rectangle 46, and rectangle 47). In the example shown in FIG. 6 , low-rank approximation is performed each time a gate that operates multiple qubits, such as a two-qubit gate operation, is performed. Therefore, the accuracy of the quantum computer simulation decreases each time low-rank approximation is performed.
[0065] [Pure states] States in quantum mechanics are classified into either pure states, which are single states in the context of quantum mechanics, or mixed states, which are combinations of multiple pure states. In actual quantum computers that are not simulations, it is difficult to create strictly pure states, so mixed states are realized. On the other hand, the states handled in quantum circuit simulations are almost always pure states.
[0066] [Probability of Observing a State] In quantum mechanics, the probability that a state |Ψ〉 is observed as |Ψ〉 is expressed by equation (16).
[0067]
[0068] where 〈·|〉 is called a bra, which is the Hermitian conjugate of the ket. When a state is a pure state, the probability of observing that state is 1. Correspondingly, for a pure state, the inner product of states 〈Ψ|Ψ〉 is 1. Also, for a pure state, the norm of the state expressed by equation (17) is 1.
[0069]
[0070] [Von Neumann Entropy] The von Neumann entropy S(ρ) is expressed by equation (18) using the density operator ρ.
[0071]
[0072] Here, the base of the logarithm is the base e of the natural logarithm or 2. The density operator ρ of a pure state that is usually handled in a quantum computer is expressed by equation (19) when the quantum state is |Ψ〉.
[0073]
[0074] When a quantum state is a pure state in quantum mechanics, the von Neumann entropy is 0. In a simulation of a quantum circuit without approximation, if the initial state is a pure state, the state obtained as a simulation result is also a pure state. Therefore, in a simulation of a quantum circuit without approximation, the von Neumann entropy of the simulation result is also 0. However, when an approximation such as low-rank approximation is performed and the simulation of the quantum circuit becomes less rigorous, the von Neumann entropy of the quantum state obtained by quantum gate operations becomes greater than 0.
[0075] In this embodiment, a state closest to a pure state is selected from the calculation results obtained by performing low-rank approximation under multiple rules in quantum circuit calculations. Specific methods for selecting the state closest to a pure state include, for example, the following four methods. The first method is to calculate the observed probability of the state obtained from multiple calculation results and select a solution whose probability is closest to 1. The second method is to select a solution whose inner product of the states is closest to 1. The third method is to select a solution whose norm of the state is closest to 1. The fourth method is to compare multiple calculation results using von Neumann entropy and select a solution whose von Neumann entropy is closest to 0.
[0076] There are two types of low-rank approximation: one in which low-rank approximation is performed for each quantum gate operation, and one in which low-rank approximation is performed for each group of quantum gate operations. The reason why calculations are also performed for the low-rank approximation for each quantum gate operation, which was treated as a problem in approximate calculations, is that performing low-rank approximation for each quantum gate operation may sometimes be closer to the calculation result without approximation than performing low-rank approximation for each group of quantum gate operations.
[0077] A calculation method for performing low-rank approximation for each quantum gate operation is shown in Figure 6. Low-rank approximation is performed each time a gate that operates on multiple quantum bits, such as a two-qubit gate operation. There are, for example, the following two methods for performing low-rank approximation each time a group of quantum gate operations is performed. Each of these two methods has the effect of mitigating the impact of reduced accuracy due to low-rank approximation each time a quantum gate operation involving multiple quantum bits is performed.
[0078] [First Calculation Method] In the first calculation method, low-rank approximation is performed after a group of quantum gate operations that combines multiple quantum gate operations. As described above, this is to mitigate the impact of the decrease in accuracy due to low-rank approximation that occurs each time a quantum gate operation involving multiple quantum bits is performed. If the first calculation method is represented by a tensor network graph, similar to that of FIG. 6, it will look like graph 51 shown in FIG. 7. FIG. 7 is a diagram showing an overview of the first calculation method in which low-rank approximation is not performed for each quantum gate operation, but rather a group of quantum gate operations are performed before low-rank approximation is performed.
[0079] In graph 51, low-rank approximation is not performed on multiple intermediate quantum gate operations. In Figure 7, low-rank approximation is not performed on the quantum gate operations represented by unshaded rectangles 52, 53, 54, 55, 56, and 57. After completing a group of quantum gate operations, an operation that performs low-rank approximation on the state of each quantum bit is added. The operation that performs low-rank approximation on the state of all quantum bits at once is indicated by a shaded rounded rectangle 58 in Figure 7.
[0080] Here, to perform only the low-rank approximation corresponding to the rounded rectangle 58 in FIG. 7 , the process can be performed as shown in FIG. 8 . FIG. 8 is a diagram showing an overview of a method for performing low-rank approximation from a matrix product state without performing quantum gate operations. In graph 61, multiple matrix product states are connected by edges. First, as in graph 62, contractions are made for the subscripts corresponding to the edges connecting the multiple matrix product states. Then, as in the low-rank approximation in quantum gate operations, as in graph 63, low-rank approximation involving singular value decomposition can be performed.
[0081] [Second Calculation Method] In the second calculation method, in order to mitigate the influence of the decrease in accuracy due to the low-rank approximation each time a quantum gate operation relating to multiple quantum bits is performed, the low-rank approximation is performed after a set of quantum gate operations that combines multiple quantum gate operations. However, unlike the first calculation method, in the second calculation method, the number of quantum bits to be subjected to the low-rank approximation may be some, not all.
[0082] In the second calculation method, when quantum gate operations are performed in sequence, if the number of qubits involved in the quantum gate operation is less than a specified number, low-rank approximation is not performed. On the other hand, low-rank approximation is performed just before a certain quantum gate operation causes the number of qubits to exceed the specified number for the first time. This corresponds to performing low-rank approximation when a quantum circuit is represented as a tensor network, at a stage where the number of qubits involved in a group of quantum gates connected by edges does not exceed the specified number.
[0083] The second calculation method will be described in more detail with reference to Fig. 9. Fig. 9 is a diagram showing an overview of the second calculation method. Fig. 9 shows a method in which low-rank approximation is not performed for each quantum gate operation, but is performed at a stage where the number of quantum bits related to a group of parts connected by edges connecting quantum gates does not exceed a specified number (for example, three).
[0084] Graph 71 represents a quantum circuit with five quantum bits and including multiple two-qubit gate operations. In graph 71, the shaded rectangles (711 to 720) indicate that low-rank approximation is performed for each two-qubit gate operation. Looking at the quantum circuit shown in graph 71 from left to right, it can be seen that the number of quantum bits involved in the quantum gate operation is three for each of the regions surrounded by dashed lines (regions R1, R2, R3, and R4). However, between regions where a group of quantum gates exists, there are no quantum gates included in other groups. In the second calculation method, low-rank approximation is not performed for the quantum gate operations included in the region surrounded by dashed lines, and low-rank approximation is performed immediately after all quantum gate operations included in the region surrounded by dashed lines are completed.
[0085] Reflecting these facts, in the second calculation method, as shown in graph 75, low-rank approximation is not performed for quantum gate operations included in the regions surrounded by dashed lines (regions R1, R2, R3, and R4), and immediately after all quantum gate operations in those regions are completed, low-rank approximation operations represented by the shaded rounded rectangles (rounded rectangle 751, 752, 753, and 754) are performed. Here, for each quantum bit, the quantum gate operations are performed in the order of a group of quantum gates.
[0086] [Configuration of the quantum circuit simulation device 100] A method of using pure states in an approximate quantum circuit simulation using matrix product states and low-rank approximation will be described. FIG. 10 is a diagram showing an example of the configuration of the quantum circuit simulation device 100 according to this embodiment. The quantum circuit simulation device 100 is a device that performs an approximate quantum circuit simulation using matrix product states and low-rank approximation. The quantum circuit simulation device 100 includes a simulation setting input unit 110, a simulation unit 120, a simulation result comparison unit 130, and a simulation result output unit 140.
[0087] The simulation setting input unit 110 includes an initial condition input unit 111, a gate operation input unit 112, and an approximation setting input unit 113. The simulation setting input unit 110 acquires various pieces of information for performing a simulation of an input quantum circuit. This information is input, for example, from an external information processing device or by user operation.
[0088] Quantum bit initial state information is input to the initial condition input unit 111. The quantum bit initial state information is information indicating the state of the quantum bits before a quantum gate operation is performed. This quantum bit state may be a state in which all quantum bits are in the state of 0 or 1, or may be a state obtained by simulating another quantum circuit or by calculation using another quantum computer.
[0089] Quantum gate information is input to the gate operation input unit 112. The quantum gate information is information indicating the quantum gates that constitute the quantum circuit. The gate operation input unit 112 acquires the quantum gate information in the order in which the quantum gates are operated in the quantum circuit. Here, depending on the purpose of the simulation, quantum gate information indicating all quantum gates may be input before simulating the quantum circuit, or quantum gate information indicating quantum gates to be operated sequentially may be input.
[0090] Approximation setting information is input to the approximation setting input unit 113. The approximation setting information is information indicating settings related to low-rank approximation performed during a simulation. The approximation setting information includes, for example, information indicating settings related to a calculation method other than a calculation method that performs low-rank approximation for each quantum gate operation. The approximation setting information includes, for example, information indicating, in the low-rank approximation of the first calculation method, every time a quantum gate operation related to multiple quantum bits is performed, low-rank approximation is performed.
[0091] The approximation setting information also includes information that specifies the stage at which the low-rank approximation of the second calculation method is performed, at which the number of quantum bits involved in a group of parts connected by edges connecting quantum gates does not exceed a certain number.
[0092] The approximation setting information also includes information indicating what percentage (e.g., 95% or more, 99% or more) of the sum of the diagonal components of the singular value matrix should be extracted in the low-rank approximation. Note that the approximation setting information is not limited to this.
[0093] The simulation unit 120 includes a tensor contraction calculation unit 121, a matrix product state construction unit 122, a low-rank approximation calculation unit 123, and a gate group determination unit 124. The simulation unit 120 performs a simulation of a quantum circuit.
[0094] The tensor contraction calculation unit 121 performs a contraction calculation in a tensor network based on the state of a quantum bit and information (quantum gate information) indicating a quantum gate operation to be applied to the quantum bit. This contraction calculation corresponds to a quantum gate operation. The matrix product state construction unit 122 constructs a matrix product state from the state of a quantum bit that is not represented in a matrix product state. The low-rank approximation calculation unit 123 performs a low-rank approximation when constructing a matrix product state involving a low-rank approximation. The gate group determination unit 124 determines a group of quantum gates in the second calculation method.
[0095] The simulation result comparison unit 130 compares the results of the quantum circuit simulation obtained by a plurality of calculation methods. Here, the simulation result comparison unit 130 calculates any one of the observed probability, the inner product of the state, the norm of the state, and the von Neumann entropy for use in the comparison.
[0096] The simulation result output unit 140 outputs the result closest to the pure state among the obtained results as the result of the simulation of the quantum circuit. The result closest to the pure state can be obtained by any of the following methods: selecting a solution whose observation probability is closest to 1, selecting a solution whose inner product of the state is closest to 1, selecting a solution whose norm of the state is closest to 1, or selecting a solution whose von Neumann entropy is closest to 0.
[0097] The quantum circuit simulation device 100 is, for example, a personal computer (PC). Each functional unit of the quantum circuit simulation device 100 is realized by, for example, a central processing unit (CPU) loading a program read from a read-only memory (ROM) into a random access memory (RAM) and executing processing in accordance with the program. The quantum circuit simulation device 100 may be realized as a virtual server. Each functional unit of the quantum circuit simulation device 100 may be distributed across multiple servers. The quantum circuit simulation device 100 may be realized as a cloud server.
[0098] 11 is a diagram showing an example of a processing flow based on a simulation method according to this embodiment. The simulation method shown in FIG. 11 is performed by a quantum circuit simulation device 100.
[0099] First, quantum bit initial state information indicating the initial state of a quantum bit is input to the initial condition input unit 111 (step S101). Quantum gate information (which gates are to be operated and in what order) of quantum gate operations included in the quantum circuit to be simulated is input to the gate operation input unit 112 (step S102).
[0100] Thereafter, approximation setting information indicating settings and conditions for performing low-rank approximation is input to the approximation setting input unit 113 (step S103). In step S103, settings are made for multiple calculation methods based on the input approximation setting information. Settings for multiple calculation methods include settings for a calculation method that performs low-rank approximation for each quantum gate operation, or settings for a calculation method that performs low-rank approximation for each group of quantum gate operations. With this, the information for performing the simulation has been input.
[0101] The simulation unit 120 performs a simulation of the quantum circuit (step S104). In step S104, the simulation unit 120 performs a simulation based on each of a plurality of calculation methods. As described above, the plurality of calculation methods include a calculation method that performs low-rank approximation for each quantum gate operation and a calculation method that performs low-rank approximation for each group of quantum gate operations.
[0102] After the simulation in step S104 is completed, the simulation result comparison unit 130 compares the results of the quantum circuit simulation obtained by the multiple calculation methods (step S105). The simulation result comparison unit 130 calculates any one of the observed probability, the inner product of the state, the state norm, and the von Neumann entropy obtained from the simulation results obtained by the multiple calculation methods.
[0103] The simulation result comparison unit 130 selects a solution that is closest to a pure state from among the results obtained by the multiple calculation methods based on the calculated quantity. The simulation result comparison unit 130 selects, according to the calculated quantity, a solution with an observation probability closest to 1, a solution with a state inner product closest to 1, a solution with a state norm closest to 1, or a solution with a von Neumann entropy closest to 0.
[0104] Therefore, in a simulation of an approximate quantum circuit in which a pure state is the initial state, the simulation result comparison unit 130 compares a plurality of simulation results obtained by different approximation methods based on their proximity to the pure state.
[0105] The simulation result output unit 140 outputs the simulation result that is closest to the pure state among the simulation results based on the comparison result by the simulation result comparison unit 130 (step S106). With this, the quantum circuit simulation device 100 ends the simulation method.
[0106] A specific calculation method for simulating a quantum circuit will be described below. First, a calculation method for performing low-rank approximation for each quantum gate operation will be described with reference to Fig. 12. Fig. 12 is a diagram showing an example of a processing flow based on the calculation method for performing low-rank approximation for each quantum gate operation according to this embodiment.
[0107] First, the simulation unit 120 acquires the quantum bit initial state information input to the initial condition input unit 111 (step S201). Next, the simulation unit 120 determines whether to perform low-rank approximation on the quantum bit initial state based on the approximation setting information input to the approximation setting input unit 113 (step S202). If it is determined that low-rank approximation is to be performed, the matrix product state construction unit 122 performs singular value decomposition on the initial state, and the low-rank approximation calculation unit 123 performs low-rank approximation during the singular value decomposition (step S203). If it is determined that low-rank approximation is not to be performed, the matrix product state construction unit 122 performs singular value decomposition on the initial state without performing low-rank approximation (step S204).
[0108] The matrix product state of the initial state of the quantum bit is configured in step S203 or step S204. The simulation unit 120 acquires the configured matrix product state (step S205). At this stage, setting of the initial conditions for the quantum circuit simulation is complete.
[0109] Next, the simulation unit 120 starts quantum gate operations in the quantum circuit simulation and operates the gates in order (step S206). When performing low-rank approximation for each quantum gate operation, low-rank approximation is performed for each quantum gate operation involving multiple quantum bits. On the other hand, for one-qubit gates, low-rank approximation is not performed because the number of elements in the matrix representing the state does not increase even if contraction is performed using quantum gate operations. Therefore, for each quantum gate operation, the simulation unit 120 determines whether the gate is a multiple-qubit gate (step S207).
[0110] If it is determined to be a multi-qubit gate, the tensor contraction calculation unit 121 performs a contraction calculation on the edges between qubits in the matrix product state representing the state of the qubits at that time (step S208), and the tensor contraction calculation unit 121 performs a contraction calculation on the quantum gate operation (step S209). Thereafter, the matrix product state construction unit 122 and the low-rank approximation calculation unit 123 perform singular value decomposition involving low-rank approximation (step S210), and the matrix product state construction unit 122 constructs a matrix product state (step S211). On the other hand, if it is determined to be a one-qubit gate rather than a multi-qubit gate, the tensor contraction calculation unit 121 performs a contraction calculation on the quantum gate operation (step S212).
[0111] As the final step in performing quantum gate operations, the simulation unit 120 determines whether all quantum gate operations or low-rank approximation operations in the quantum circuit have been completed (step S213). If the simulation unit 120 determines that all quantum gate operations or low-rank approximation operations have been completed, it terminates the simulation of the quantum circuit. On the other hand, if the simulation unit 120 determines that all quantum gate operations or low-rank approximation operations in the quantum circuit have not been completed, it executes the processing of step S207 again and repeats the processing from step S207 onwards until all quantum gate operations or low-rank approximation operations in the quantum circuit are completed. With this, the simulation unit 120 terminates the calculation method for performing low-rank approximation for each quantum gate operation.
[0112] Next, with reference to FIGS. 13 and 14, two examples of calculation methods for performing low-rank approximation for each group of quantum gate operations will be described.
[0113] 13 is a diagram showing an example of a processing flow based on the first calculation method according to this embodiment. The first calculation method is a calculation method in which low-rank approximation is performed every time a group of quantum gate operations is performed.
[0114] First, the simulation unit 120 acquires quantum bit initial state information input by the initial condition input unit 111 (step S301). Next, the simulation unit 120 determines whether to perform low-rank approximation on the quantum bit initial state based on the approximation setting information input by the approximation setting input unit 113 (step S302). If it is determined that low-rank approximation is to be performed, the matrix product state construction unit 122 performs singular value decomposition on the initial state, and the low-rank approximation calculation unit 123 performs low-rank approximation during the singular value decomposition (step S303). If it is determined that low-rank approximation is not to be performed, the matrix product state construction unit 122 performs singular value decomposition on the initial state without performing low-rank approximation (step S304).
[0115] The matrix product state of the initial state of the quantum bit is configured by step S303 or S304. The simulation unit 120 acquires the configured matrix product state (step S305). At this stage, setting of the initial conditions for the quantum circuit simulation is complete.
[0116] Next, the simulation unit 120 starts the quantum gate operation in the simulation of the quantum circuit and activates the gates in order (step S306). When activating a gate, it determines whether or not it is a stage of performing low-rank approximation immediately before activating the gate based on the information input by the approximation setting input unit 113 (step S307).
[0117] If it is determined that low-rank approximation is to be performed, the tensor contraction calculation unit 121 performs contraction calculation on the edges between quantum bits in the matrix product state representing the state of the quantum bits at that time (step S308), and the matrix product state construction unit 122 and the low-rank approximation calculation unit 123 perform singular value decomposition involving low-rank approximation (step S309). Thereafter, the matrix product state construction unit 122 constructs a matrix product state (step S310).
[0118] In the next step, whether a matrix product state is obtained after performing low-rank approximation or not, the tensor contraction calculation unit 121 performs a contraction calculation corresponding to the quantum gate operation (step S311). After that, the matrix product state construction unit 122 constructs a matrix product state of the quantum bits after the quantum gate operation (step S312).
[0119] As the final step in performing quantum gate operations, the simulation unit 120 determines whether all quantum gate operations or low-rank approximation operations in the quantum circuit have been completed (step S313). If the simulation unit 120 determines that all operations have been completed, it terminates the simulation of the quantum circuit. On the other hand, if the simulation unit 120 determines that all operations have not been completed, it executes the process of step S307 again, and repeats the processes from step S307 onwards until all quantum gate operations or low-rank approximation operations in the quantum circuit have been completed. With this, the simulation unit 120 terminates the first calculation method.
[0120] As described above, in the first calculation method, a matrix product state with low-rank approximation is constructed for all quantum bits included in the quantum circuit each time a predetermined number of contraction calculations are performed.
[0121] 14 is a diagram showing an example of a processing flow based on the second calculation method according to this embodiment. The second calculation method is a calculation method in which low-rank approximation is performed every time a group of quantum gate operations is performed.
[0122] First, the simulation unit 120 acquires quantum bit initial state information input by the initial condition input unit 111 (step S401). Next, the simulation unit 120 determines whether to perform low-rank approximation on the quantum bit initial state based on the approximation setting information input by the approximation setting input unit 113 (step S402). If it is determined that low-rank approximation is to be performed, the matrix product state construction unit 122 performs singular value decomposition on the initial state, and the low-rank approximation calculation unit 123 performs low-rank approximation during the singular value decomposition (step S403). If it is determined that low-rank approximation is not to be performed, the matrix product state construction unit 122 performs singular value decomposition on the initial state without performing low-rank approximation (step S404).
[0123] The matrix product state of the initial state of the quantum bit is configured by step S403 or S404. The simulation unit 120 acquires the configured matrix product state (step S405). At this stage, setting of the initial conditions for the quantum circuit simulation is complete.
[0124] Next, the simulation unit 120 starts quantum gate operations in the quantum circuit simulation (step S406). The gate group determination unit 124 determines a group of quantum gates such that the number of qubits related to a group connected by edges connecting quantum gates does not exceed a specified number (step S407).
[0125] The simulation unit 120 then operates the gates in order for each group of quantum gates to perform quantum gate operations (step S408). The tensor contraction calculation unit 121 performs contraction calculations for the quantum bits included in the quantum gate group (step S409). After the contraction calculations for the quantum gate group are performed, the matrix product state construction unit 122 and the low-rank approximation calculation unit 123 perform singular value decomposition with low-rank approximation (step S410). The matrix product state construction unit 122 then constructs a matrix product state (step S411).
[0126] As the final step in performing quantum gate operations, the simulation unit 120 determines whether all quantum gate operations in the quantum circuit have been completed (step S412). If the simulation unit 120 determines that all quantum gate operations have been completed, it terminates the simulation of the quantum circuit. On the other hand, if the simulation unit 120 determines that all quantum gate operations have not been completed, it executes the process of step S408 again, and repeats the processes from step S408 onwards until the quantum gate operations in the quantum circuit are completed. With this, the simulation unit 120 terminates the second calculation method.
[0127] As described above, in the second calculation method, when the number of quantum bits connected by contraction calculation in a tensor network representing a quantum circuit exceeds a predetermined number, a matrix product state involving low-rank approximation is constructed for the quantum bits connected up to that point.
[0128] As described above, the tensor contraction calculation unit 121 performs a contraction calculation in a tensor network corresponding to a quantum gate operation based on the states of quantum bits included in the quantum circuit and information indicating quantum gate operations to be applied to the quantum bits. The matrix product state construction unit 122 constructs a matrix product state from at least the states of the quantum bits obtained by the contraction calculation by the tensor contraction calculation unit 121. When the matrix product state construction unit 122 constructs the matrix product state, the low-rank approximation calculation unit 123 not only performs low-rank approximation on the quantum gate operations of each of the multiple quantum bits, but also performs low-rank approximation on at least each of the multiple quantum gate operations grouped together.
[0129] In this embodiment, an example has been described in which the calculation method for performing low-rank approximation for each quantum gate operation, the first calculation method, and the second calculation method are used as calculation methods for performing low-rank approximation under multiple rules in quantum circuit calculations. However, this is not limited to this. Two or more of the calculation method for performing low-rank approximation for each quantum gate operation, the first calculation method, and the second calculation method may be used as calculation methods to select a state closest to a pure state from the calculation results. Furthermore, the calculation method for performing low-rank approximation may include calculation methods other than the calculation method for performing low-rank approximation for each quantum gate operation, the first calculation method, and the second calculation method. If the second calculation method is not used, the gate group determination unit 124 may be omitted from the configuration of the quantum circuit simulation device 100.
[0130] In addition, in this embodiment, an example of selecting a state closest to a pure state from among the calculation results obtained by performing low-rank approximation under multiple rules in quantum circuit calculations has been described, but this is not limited to this. Only one type of calculation method may be used as the calculation method for low-rank approximation. In this case, the process of selecting the state closest to a pure state from among the calculation results is omitted. In this case, the simulation result comparison unit 130 and the simulation result output unit 140 may be omitted from the configuration of the quantum circuit simulation device 100.
[0131] As described above, the simulation device according to this embodiment (in this embodiment, the quantum circuit simulation device 100) includes a tensor contraction calculation unit 121, a matrix product state construction unit 122, and a low-rank approximation calculation unit 123. The tensor contraction calculation unit 121 performs a contraction calculation in a tensor network corresponding to a quantum gate operation based on the states of quantum bits included in the quantum circuit and information indicating quantum gate operations to be applied to the quantum bits. The matrix product state construction unit 122 constructs a matrix product state from the states of the quantum bits obtained by the contraction calculation by the tensor contraction calculation unit 121. When the matrix product state construction unit 122 constructs the matrix product state, the low-rank approximation calculation unit 123 performs a low-rank approximation for each of a plurality of quantum gate operations grouped together.
[0132] With this configuration, the simulation device according to this embodiment (the quantum circuit simulation device 100 in this embodiment) can perform low-rank approximation for each group of multiple quantum gate operations, and can therefore mitigate the impact of reduced simulation accuracy due to approximation when performing approximate quantum circuit simulation based on a tensor network.
[0133] Furthermore, the simulation device according to this embodiment (in this embodiment, the quantum circuit simulation device 100) includes a simulation result comparison unit 130 and a simulation result output unit 140. In an approximate quantum circuit simulation in which a pure state is used as the initial state, the simulation result comparison unit 130 compares multiple simulation results obtained by different approximation methods based on their proximity to the pure state. Based on the result of the comparison by the simulation result comparison unit 130, the simulation result output unit 140 outputs the result closest to the pure state among the multiple simulation results.
[0134] With this configuration, the simulation device according to this embodiment (in this embodiment, the quantum circuit simulation device 100) can output the result that is closest to the pure state among multiple simulation results, and therefore, when performing an approximate quantum circuit simulation based on a tensor network, the impact of reduced simulation accuracy due to approximation can be mitigated.
[0135] Each unit included in each device in the above-described embodiments may be realized by dedicated hardware, or may be realized by a memory and a microprocessor.
[0136] In addition, each part of each device may be composed of a memory and a CPU (central processing unit), and the functions of each part of each device may be realized by loading a program into memory and executing it.
[0137] In addition, a program for realizing the functions of each unit of each device may be recorded on a computer-readable recording medium, and the program recorded on the recording medium may be read into a computer system and executed to perform processing by each unit of the control unit. Note that the term "computer system" here includes hardware such as the OS and peripheral devices.
[0138] Furthermore, if a WWW system is used, the term "computer system" also includes the homepage provision environment (or display environment). Furthermore, "computer-readable recording medium" refers to portable media such as flexible disks, optical magnetic disks, ROMs, and CD-ROMs, as well as storage devices such as hard disks built into computer systems. Furthermore, "computer-readable recording medium" also includes devices that dynamically store programs for a short period of time, such as communication lines used when transmitting programs over networks like the Internet or over communication lines like telephone lines, and devices that store programs for a fixed period of time, such as volatile memory within the computer systems that serve as servers or clients in such cases. Furthermore, the above-mentioned programs may be those that implement some of the aforementioned functions, or may be those that can realize the aforementioned functions in combination with programs already stored in the computer system.
[0139] REFERENCE SIGNS LIST 100 Quantum circuit simulation device 110 Simulation setting input unit 111 Initial condition input unit 112 Gate operation input unit 113 Approximation setting input unit 120 Simulation unit 121 Tensor contraction calculation unit 122 Matrix product state construction unit 123 Low-rank approximation calculation unit 124 Gate group determination unit 130 Simulation result comparison unit 140 Simulation result output unit
Claims
1. a tensor contraction calculation unit that performs a contraction calculation in a tensor network corresponding to a quantum gate operation based on the state of a quantum bit included in the quantum circuit and information indicating a quantum gate operation to be applied to the quantum bit; a matrix product state constructing unit that constructs a matrix product state from the state of the quantum bit obtained by the contraction calculation by the tensor contraction calculation unit; a low-rank approximation calculation unit that performs low-rank approximation for each of a plurality of quantum gate operations grouped together when the matrix product state construction unit constructs the matrix product state; A simulation device comprising:
2. Each time a predetermined number of contraction calculations are performed, a matrix product state with low-rank approximation is constructed for all quantum bits included in the quantum circuit. The simulation device according to claim 1 .
3. For a tensor network representing the quantum circuit, when the number of quantum bits connected by contraction calculation exceeds a predetermined number, a matrix product state with low-rank approximation is formed for the quantum bits connected immediately before that. The simulation device according to claim 1 .
4. a simulation result comparison unit that compares a plurality of simulation results obtained by different approximation methods based on their proximity to the pure state in a simulation of an approximate quantum circuit with a pure state as an initial state; a simulation result output unit that outputs a result that is closest to a pure state among the plurality of simulation results based on a result of the comparison by the simulation result comparison unit; A simulation device comprising:
5. The term "close to a pure state" means that the probability of observation is close to 1. The simulation device according to claim 4.
6. The state being close to a pure state means that the inner product of the state is close to 1. The simulation device according to claim 4.
7. The state being close to a pure state means that the norm of the state is close to 1. The simulation device according to claim 4.
8. The term "close to a pure state" means that the von Neumann entropy is close to 0. The simulation device according to claim 4.
9. a tensor contraction calculation step of performing a contraction calculation in a tensor network corresponding to the quantum gate operation based on the state of a quantum bit included in the quantum circuit and information indicating a quantum gate operation to be applied to the quantum bit; a matrix product state construction step of constructing a matrix product state from the state of the quantum bit obtained by the contraction calculation in the tensor contraction calculation step; a low-rank approximation calculation step of performing a low-rank approximation for each of a plurality of quantum gate operations grouped together when the matrix product state configuration step configures the matrix product state; A simulation method comprising:
10. a simulation result comparison step of comparing a plurality of simulation results obtained by different approximation methods based on their proximity to the pure state in a simulation of an approximate quantum circuit with a pure state as an initial state; a simulation result output step of outputting a result that is closest to a pure state among the plurality of simulation results based on a result of the comparison in the simulation result comparison step; A simulation method comprising: