Distributed tensor network reduction method using dynamic ordering-based partitioning

By determining a contraction order and distributing sub-networks across computing nodes, the method optimizes tensor network computations, reducing resource consumption and time by up to 100 times.

JP7756642B2Active Publication Date: 2025-10-20ジー アクシス プライベート リミテッド
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2022538712
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-01-06
Filing Date
2020-12-31
Publication Date
2025-10-20
Estimated Expiration
2040-12-31

AI Technical Summary

Technical Problem

The efficiency of tensor network computations is bottlenecked by high computational power and time requirements, exacerbated by the complex nature of tensor networks, necessitating a reduction in computational resources and time.

Method used

A method involving determining a contraction order for a tensor network, generating sub-networks, and distributing them to computing nodes for parallel contraction, utilizing tree decomposition and virtual tensors to optimize resource usage.

Benefits of technology

Significantly reduces computational time and resources required for tensor network contraction by up to 100 times, enabling efficient processing in distributed systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007756642000005
    Figure 0007756642000005
  • Figure 0007756642000006
    Figure 0007756642000006
  • Figure 0007756642000007
    Figure 0007756642000007
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a method for contracting a tensor network, the method including the steps of: receiving a tensor network in a system, the tensor network including a plurality of tensors and a plurality of edges between the plurality of tensors, each edge being associated with a plurality of index elements; determining a contraction order for the tensor network; determining one or more edges from the plurality of edges for generating a plurality of subnetworks based on the tensor network; and distributing the plurality of subnetworks to a plurality of computing nodes in the system, and contracting the plurality of subnetworks by the plurality of computing nodes based on the contraction order.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0001] This disclosure claims priority to, and the benefit of, U.S. Provisional Patent Application No. 62 / 957,442, filed January 6, 2020, which is incorporated herein by reference in its entirety. [Background technology]

[0002]

[0002] A tensor is a mathematical concept that abstracts and generalizes the idea of ​​multilinear maps. A tensor network can be a countable collection of tensors connected by contractions. Tensor networks have a wide range of applications in modern science and engineering, including machine learning, many-body theory, gradient computation, quantum computing, and more. As the use of tensor networks continues to expand, the efficiency of computations using tensor networks becomes a bottleneck in many applications. This efficiency issue for tensor networks is further exacerbated by the complex nature of tensor networks, which often require significant computational power and time to implement. To continue expanding the use of tensor networks, there is a strong desire to reduce the time and computational resources required to compute tensor networks. Summary of the Invention [Means for solving the problem]

[0003]

[0003] Embodiments of the present disclosure provide a method for contracting a tensor network, the method including the steps of: receiving, in a system, a tensor network including a plurality of tensors and a plurality of edges between the plurality of tensors, where each edge is associated with a plurality of index elements; determining a contraction order for the tensor network; determining one or more edges from the plurality of edges for generating a plurality of sub-networks based on the tensor network; and distributing the plurality of sub-networks to a plurality of computing nodes of the system, and contracting the plurality of sub-networks by the plurality of computing nodes based on the contraction order.

[0004]

[0004] Embodiments of the present disclosure further provide a non-transitory computer-readable medium storing an instruction set, the instruction set being executable by at least one processor of the system to cause the system to perform contraction of a tensor network, the method including the steps of receiving a tensor network including a plurality of tensors and a plurality of edges between the plurality of tensors, each edge being associated with a plurality of index elements; determining a contraction order of the tensor network; determining one or more edges from among the plurality of edges for generating a plurality of subnetworks based on the tensor network; and distributing the plurality of subnetworks to a plurality of computational nodes of the system and contracting the plurality of subnetworks by the plurality of computational nodes based on the contraction order.

[0005]

[0005] Embodiments of the present disclosure further provide a system comprising: a plurality of computer nodes; one or more memories storing an instruction set; and one or more processors; the one or more processors are configured to execute the instruction set to cause the system to receive a tensor network including a plurality of tensors and a plurality of edges between the plurality of tensors, each edge associated with a plurality of index elements; determine a contraction order for the tensor network; determine one or more edges from among the plurality of edges for generating a plurality of subnetworks based on the tensor network; and distribute the plurality of subnetworks to a plurality of computing nodes of the system, and cause the plurality of computing nodes to contract the plurality of subnetworks based on the contraction order.

[0006]

[0006] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosed embodiments, as claimed.

[0007]

[0007] Embodiments and various aspects of the present disclosure are illustrated in the following detailed description and the accompanying drawings, in which various features are not drawn to scale. [Brief explanation of the drawings]

[0008] [Figure 1]

[0008] FIG. 1 illustrates an example tensor, according to some embodiments of the present disclosure. [Figure 2]

[0009] FIG. 1 illustrates an exemplary tensor contraction, in accordance with some embodiments of the present disclosure. [Figure 3]

[0010] FIG. 1 illustrates an exemplary cloud services system, consistent with some embodiments of the present disclosure. [Figure 4]

[0011] 1 is a flowchart illustrating an exemplary method for performing tensor network contraction, according to some embodiments of the present disclosure. [Figure 5]

[0012] FIG. 1 illustrates an exemplary tensor network, in accordance with some embodiments of the present disclosure. [Figure 6]

[0013] FIG. 1 illustrates an exemplary intermediate tensor network, in accordance with some embodiments of the present disclosure. [Figure 7]

[0014] FIG. 1 is an exemplary tree diagram according to some embodiments of the present disclosure. [Figure 8]

[0015] FIG. 10 is an exemplary diagram of generating a sub-network according to some embodiments of the present disclosure. [Figure 9]

[0016] FIG. 1 illustrates an exemplary reduction of a tensor network, according to some embodiments of the present disclosure. [Figure 10]

[0017] FIG. 1 illustrates an exemplary representation of a quantum circuit using a tensor network, according to some embodiments of the present disclosure. DETAILED DESCRIPTION OF THE INVENTION

[0009]

[0018] Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. In the following description, reference will be made to the accompanying drawings, in which like numerals in different drawings represent the same or similar elements unless otherwise specified. The implementations set forth in the following description of exemplary embodiments do not represent all implementations consistent with the present invention. Rather, these implementations are merely examples of apparatus and methods consistent with aspects related to the present invention as recited in the appended claims. Certain aspects of the present disclosure are described in more detail below. The terms and definitions presented herein shall control in the event of conflict with terms and / or definitions incorporated by reference.

[0010]

[0019] A tensor network can contain multiple tensors. Tensors can represent multidimensional arrays that can contain complex numbers. Tensor networks can also contain multiple indices associated with tensors. Each tensor can contain some or all of the multiple indices. Because tensor networks provide a visual language along with a set of mathematical tools, they can be very useful tools that simplify extremely difficult calculations.

[0011]

[0020] FIG. 1 illustrates an example tensor diagram, according to some embodiments of the present disclosure. As shown in FIG. 1, tensors are represented in the form of solid lines, and tensor indices are represented by one or more lines emanating from the tensor. A tensor indices associated with a tensor can be represented as a subscript or superscript of the tensor. For example, FIG. 1 illustrates three different tensors, namely, the vector tensor V j , matrix tensor M i,j , and a 3-index tensor T i,j,k Contains the vector tensor V j can be a one-dimensional array of scalar values. i,j can be a two-dimensional array of scalar values. i,j,k can be a 3-dimensional array of scalar values. It should be recognized that a tensor can have more than three indices.

[0012]

[0021] In a tensor network, tensors can be combined by tensor indices. Contraction of a tensor network can include merging indices of the same type from different tensors and summing indices that do not appear in the final result. Figure 2 shows an example tensor contraction diagram in accordance with some embodiments of the present disclosure. As shown in Figure 2, a tensor V i and the tensor M i,j The tensor network contraction of Σ i V i M i,jAfter contraction, the tensor V i and the tensor M i,j can merge indices. It should be recognized that one tensor index can be connected to more than two tensors. These indices that can be connected to more than two tensors can be referred to as hyperedges. In this disclosure, edges and hyperedges are referred to interchangeably. For example, one edge can be connected to more than two tensors.

[0013]

[0022] Tensor indices can be open or closed. An open index is an index that has an open end. For example, as shown in Figure 2, the index j is an open index because it has an open end. A closed index is an index that has no open ends. For example, as shown in Figure 2, index i is a closed index because it has no open ends.

[0014]

[0023] In general, contracting a tensor network may require contracting open and closed edges. The contractions of open and closed edges may be intertwined. For example, contracting a tensor network may require sequentially merging and summing closed edges and merging open edges.

[0015]

[0024] In some cases, reducing a tensor network may involve two stages. In the first stage, closed indices can be merged and summed one by one. In the second stage, open indices are merged one by one. In many scenarios, the first stage may consume a large portion of computational resources and time compared to the second stage. Furthermore, the order in which closed indices are merged and summed one by one does not change the final result, but it significantly affects the time and resource consumption of the reduction process. Therefore, the reduction order should be chosen wisely to avoid unnecessary resource consumption.

[0016]

[0025] Traditional tensor network designs have flaws. For example, some tensor networks are based on matrix multiplication, which incurs communication and memory costs. Some tensor networks are designed based on the reduction of tensor networks in a fixed order. However, the fixed order may not be optimal.

[0017]

[0026] To address the above problems, embodiments of the present disclosure provide a method and system for reducing a tensor network. For example, one way to reduce a tensor network is to postpone summing some closed indices until the end of the calculation. At the end of the calculation, each term in the final sum corresponds to a subtensor network that is simpler than the original tensor network. In a scenario where a distributed cluster is used, the reduction of a tensor network can be performed by distributing multiple subtensor networks to cluster nodes and summing the reduction results sent back from these cluster nodes.

[0018]

[0027] 3 shows a diagram of an exemplary cloud service system 100 according to some embodiments of the present disclosure. The cloud service system 100 may include multiple computing devices for providing cloud services to users. As shown in FIG. 1, the cloud service system 100 may include computing devices 100a, 100b, 100c, ..., 100n. Each computing device (e.g., computing device 100a) may include at least one processor 102 (e.g., processor 102a, processor 102b, and processor 102c), a memory 104 communicatively coupled to the at least one processor 102 via a bus 106, and an interface 108 communicatively coupled to the bus 106.

[0019]

[0028] The at least one processor 102 may be any suitable processor capable of executing instructions. For example, processor 102a may be an X86 processor or an ARM processor. In some embodiments, the at least one processor 102 may also include an accelerator (e.g., a neural processing unit) for providing computational functions related to neural networks, such as neural network training and inference.

[0020]

[0029] The memory 104 may be configured to store instructions and data accessible to the at least one processor 102. For example, instructions may be executed by the at least one processor 102 to cause the computing device 100a to perform various functions. In some embodiments, the memory 104 may be implemented with any suitable technology, such as static random access memory ("SRAM"), synchronous dynamic RAM ("SDRAM"), non-volatile memory, etc.

[0021]

[0030] The bus 106 may be configured to provide connections between components of the computing device 100a. For example, at least one processor 102, memory 104, and network interface 106 may be connected to each other via the bus 106.

[0022]

[0031] The interface 108 may include a network interface that enables wired or wireless network connectivity and an input / output ("I / O") interface that is communicatively coupled to peripheral devices (e.g., cursor control devices, keyboards, displays, etc.). The network interface may be configured to enable communication between the system 100 and the client terminal 120 over a network 110. The network 110 may be the Internet, a private network, etc. In some embodiments, the client terminal 120 may be a personal computer, a server, a smartphone, a tablet, or any computing device. The I / O interface may include at least one of a universal serial bus (USB) port, a peripheral component interconnect express (PCI-E) port, etc. for connecting to peripheral devices.

[0023]

[0032] 4 shows a flowchart of an example method 200 for performing tensor network reduction according to some embodiments of the present disclosure. Method 200 can be performed by a computer device (e.g., cloud service system 100 or computer device 100a of FIG. 3). Method 200 can include the following steps.

[0024]

[0033] In step 202, a tensor network is received. The tensor network may include multiple tensors. The tensor network may further include edges between multiple tensors. The edges, which may also be referred to as indices, are associated with the dimensions of the tensors. The dimensions of the tensors may also be referred to as ranks. For example, if a tensor A i,j , B j,k,l , C i,l a tensor network T containing i,j,k is a rank-3 tensor network with edges i, j, k, and l. A tensor B j,k,l is a tensor of rank 3 because it has three edges attached to it. i,j and B j,k,l Since both have edge j, edge j is i,j and B j,k,l The edge l is connected between the tensor network T i,j,k It can be seen that edges are merged within a tensor network and can therefore be referred to as closed edges. It should be recognized that the edges of a tensor network can include zero or more closed edges and zero or more open edges.

[0025]

[0034] FIG. 5 illustrates an exemplary tensor network according to some embodiments of the present disclosure. As shown in FIG. 5, tensor network 300 can include tensors A, B, C, D, F, G, and H. Each of the tensors can include zero or more closed edges and zero or more open edges. For example, edge 302 connecting tensors A and B is a closed edge. Edge i, which has one end connected to tensor D and the other end open, is an open edge. Similarly, edges j, k, l, and m are also open edges. Thus, tensor network 300 can also be described as tensor network T(i, j, k, l, m), where edges i, j, k, l, and m are the open edges of the tensor network.

[0026]

[0035] Returning to Figure 4, in step 204, a contraction order of the tensor network is determined. For example, the contraction order can be determined by tree decomposition. As discussed above, a tensor network is associated with multiple edges of tensors, and each tensor can be associated with some or all of the multiple edges. Contracting a tensor network involves merging edges of the same type in different tensors. The contraction order is the order in which the edges are merged.

[0027]

[0036] To determine the contraction order, a virtual tensor can be created to connect one or more open edges. A virtual tensor can be created to connect some or all of the open edges of a tensor network. The virtual tensor may not contain data. The rank of the virtual tensor can be associated with the number of open edges. For example, as shown in FIG. 5, the tensor network 300 includes five open edges (i, j, k, l, m), and therefore the virtual tensor V of the tensor network 300 can have a rank of 5. In other words, the virtual tensor V has five edges corresponding to the open edges (i, j, k, l, m) and can be represented as, for example, V(i, j, k, l, m).

[0028]

[0037] In some embodiments, tree decomposition can be used to determine the contraction order of a tensor network. Tree decomposition is the mapping of a graph into a tree, which can be used to speed up the solution of computational tasks on the graph. A tensor network can be mapped as a tree by tree decomposition. For example, each node of the tree can contain one or more indices from the tensor network. Furthermore, tree nodes containing particular indices can form subtrees. In some embodiments, every tensor in a tensor network can correspond to one or more nodes of the tree, such that a node contains all indices adjacent to the tensor.

[0029]

[0038] In some embodiments, to perform tree decomposition, a tree node can be selected as a root node. A reduced order can be generated from the root tree in an iterative process, starting with an empty reduced order. In the iterative process, if there is a leaf node of the tree, the leaf node can be removed from the tree. For closed indexes that are present in the leaf node but no longer exist in the new tree, the closed index can be added to the end of the reduced order. The iterative process can be repeated until the tree is empty.

[0030]

[0039] If a virtual tensor exists, a tree node can be selected as the root node if it contains all the indices adjacent to the virtual tensor.

[0031]

[0040] A reduced order can be generated from the root tree in an iterative process. The iterative process can start with an empty reduced order. While there are leaf nodes in the tree, the leaf nodes can be removed from the tree. For all closed indices that are present in the leaf nodes but no longer exist in the new tree, these closed indices can be added to the end of the reduced order. The iterative process can be repeated until the tree is empty.

[0032]

[0041] Next, a computing device (e.g., cloud service system 100 or computing device 100a of FIG. 3) can generate an intermediate tensor network. FIG. 6 shows an exemplary intermediate tensor network according to some embodiments of the present disclosure. It should be appreciated that intermediate tensor network 310 shown in FIG. 6 can be an intermediate tensor network to tensor network 300 shown in FIG. 5. As shown in FIG. 6, the open edges of a tensor network (e.g., tensor network 300 of FIG. 3A) can be closed by a virtual tensor V(i, j, k, l, m) that includes all open edges. After the addition of the virtual tensor (e.g., V(i, j, k, l, m)), the open edges of the tensor network (e.g., tensor network 300 of FIG. 3A) can become closed tensors.

[0033]

[0042] In some embodiments, a computing device can perform tree decomposition of the intermediate tensor network. Intuitively, tree decomposition is a method of drawing a graph that looks like a tree. To do so, a set of vertices, or a bag, can be viewed as a single vertex. The less a graph looks like a tree, the larger the bag. In some embodiments, tree decomposition can be performed using a tree decomposition algorithm or a computational program (e.g., a subroutine). The contraction order of a tensor network can also be determined based on the tree. FIG. 7 illustrates an exemplary tree diagram in accordance with some embodiments of the present disclosure. As shown in FIG. 7, the tree diagram 320 is generated by performing tree decomposition of the intermediate tensor network 310 shown in FIG. 6. The tensors in the intermediate tree 320 can be grouped into one or more tree nodes or bags. For example, as shown in FIG. 7, tensors A, B, and C can be grouped into one tree node. After tree decomposition, the intermediate tensor network 310 can have a tree-like structure.

[0034]

[0043] Returning to FIG. 4 , at step 206, the computing device can determine one or more edges from among the multiple edges based on the tensor network to generate multiple subnetworks. In some embodiments, each edge can include one or more elements. As an example, edge i of T(i,j,k,l,m) shown in FIG. 5 can include elements i[0], i[1], i[2], . . . , i[7], which can be selected to generate multiple subnetworks. Thus, a first subnetwork corresponding to i[0], a second subnetwork corresponding to i[1], a third subnetwork corresponding to i[2], . . . , an eighth subnetwork corresponding to i[7], and so on can be generated.

[0035]

[0044] In some embodiments, to determine one or more edges for generating the plurality of subnetworks, a computing device can generate a plurality of evaluation subnetworks for each of the plurality of edges. FIG. 8 shows an example diagram of generating a subnetwork according to some embodiments of the present disclosure. As shown in FIG. 8, a tensor network 402 can include tensors (A, B, C, D, and E) and edges (a, b, c, d, e, and f). Subnetworks 404 and 406 can be generated by dividing an edge (e.g., edge d). In some embodiments, edge d can be in the range {0, 1}. It should be appreciated that the generation of the subnetworks shown in FIG. 8 can be performed by a computing device (e.g., cloud service system 100 or computing device 100a of FIG. 3).

[0036]

[0045] 8, by splitting edge d, tensor network 402 can be replaced by the sum of two sub-networks 404 and 406. In some embodiments, sub-networks 404 and 406 have the same shape, but the tensors associated with corresponding nodes of the sub-networks may be different. More specifically, sub-network 404 can be generated based on edge d being "0," and sub-network 406 is generated based on edge d being "1."

[0037]

[0046] Therefore, the tensor A' of the subnetwork 404 b and C' e and the tensor of subnetwork 406

[0038]

number

[0039]

number

[0040]

number

[0041]

number

[0042]

[0047] In some embodiments, only the shape of the subnetwork is needed for resource estimation purposes. The shape of the subnetwork is the same as the shape of the original tensor network (e.g., tensor network 402) except that an edge (e.g., edge d) has been removed from the graph. For example, as shown in FIG. 8, the shape of subnetwork 404 is the same as the shape of tensor network 402 except that edge d has been removed from the graph.

[0043]

[0048] It should be appreciated that in some embodiments, the multiple evaluation subnetworks do not need to be real subnetworks. Instead, the multiple evaluation subnetworks can be virtual subnetworks for evaluation. As discussed above, the multiple evaluation subnetworks can be generated by traversing multiple index elements of each edge and generating multiple evaluation subnetworks corresponding to the multiple index elements. In this case, the computer device can estimate the resource consumption required to perform the contraction of the tensor network based on each of the multiple evaluation subnetworks. For example, in T(i,j,k,l,m) shown in FIG. 5, the resource consumption based on edges i, j, k, l, and m can be estimated. Among the estimated resource consumptions, the computer device can determine one or more edges that require less resource consumption based on the estimation. For example, the computer device can determine one or more edges that require the least resource consumption based on the estimation.

[0044]

[0049] 9 shows a diagram of an example reduction of a tensor network according to some embodiments of the present disclosure. It should be appreciated that the reduction of the tensor network 500 shown in FIG. 9 can be performed by a computing device (e.g., the cloud service system 100 or the computing device 100a of FIG. 3).

[0045]

[0050] As shown in Figure 9, tensor network 500 includes tensors (A, B, C, D, and E) and edges (a, b, c, d, e, and f). As an example, edge b can be merged and summed. As a result, tensor network 502 is created with a new tensor F that replaces the tensors connected by edge b (e.g., tensors A, B, and D). In some embodiments, tensor F can be represented by the following equation: F acd =ΣAbd B ab D bc

[0046]

[0051] To perform the contraction, the value of tensor F can be calculated using the above formula. Generating tensor F requires additional space of dimension (a) x dimension (c) x dimension (d). Therefore, computing tensor F takes time of dimension (a) x dimension (c) x dimension (d). After computing tensor F, tensors A, B, and D can be merged and removed from tensor network 500 to generate tensor network 502.

[0047]

[0052] In some embodiments, merging tensors may require matrix multiplication. During resource estimation, the cost of the matrix multiplication may be estimated first instead of immediately performing the actual matrix multiplication. The cost estimate of the matrix operation may depend on the shape of the intermediate tensors rather than the actual values. As a result, the actual matrix calculation may be omitted when estimating resource consumption. In some embodiments, resource consumption may include time consumption and space consumption. In some embodiments, the total time consumption is the sum of the time consumption of each step. The space consumption may be the maximum of the sum of the sizes of the tensors in the tensor network.

[0048]

[0053] Returning to FIG. 4 , in step 208, the contraction of the multiple subnetworks can be performed based on a contraction order. In some embodiments, a computing device can perform the contraction of the multiple subnetworks based on a contraction order. In some embodiments, the multiple subnetworks can be distributed across multiple computing nodes (e.g., multiple cloud service apparatuses 100 in FIG. 1 ) of a cloud system to perform the contraction of each of the multiple subnetworks. As a result, the contraction of some or all of the multiple subnetworks can be performed in parallel.

[0049]

[0054] In some embodiments, the contraction of a tensor network can be performed iteratively. In some embodiments, at each iteration of the iterative method, an edge at the front of the contraction order can be selected and removed from the contraction order. All tensors adjacent to the selected edge can be merged into a single new intermediate tensor. This new intermediate tensor can include all edges that were adjacent to one or more tensors adjacent to the selected edge. In this case, the selected edge and its neighbors in the tensor network can be replaced with the new intermediate tensor. In some embodiments, the above iterative process can be repeated until the contraction order is empty.

[0050]

[0055] In some embodiments, more than one tensor may be left in the tensor network, in which case the more than one tensor may be merged to form a final tensor, which in some embodiments is adjacent to all open edges.

[0051]

[0056] As discussed above, resource consumption estimation can be performed by estimating the time and space consumption of the reduction process, respectively. At each step, intermediate tensors can be generated and one or more tensors can be removed from the tensor network. The time consumption of reduction can be estimated as the sum of the sizes of all intermediate tensors. The space consumption can be estimated as the maximum sum of the sizes of tensors in the tensor network. Depending on this scenario, the time and space consumption can be merged into a single quantity that serves as a resource estimator for reduction. For the same amount of computational resources consumed, using subnetworks can improve the computation time of tensor network reduction by more than 100 times.

[0052]

[0057] In some embodiments, the multiple subnetworks may be distributed across multiple computer nodes (e.g., multiple cloud service devices 100 in FIG. 1 ) of the cloud system, respectively, to perform the contraction of each of the multiple subnetworks. In some embodiments, during the contraction of each of the multiple subnetworks, the computer node may further determine a final contraction order for each of the multiple subnetworks, and then perform the contraction of each of the multiple subnetworks based on the final contraction order.

[0053]

[0058] In some embodiments, the reduction process illustrated above (e.g., method 200 of FIG. 4) can be used to simulate quantum circuits or quantum circuits. A quantum circuit is a computational routine in which a computation is performed by a sequence of quantum gates. A quantum circuit can be an ordered sequence of quantum gates, measurements, and resets. A quantum gate can perform an operation that changes the state of a qubit. A qubit is a fundamental variable, or a variant of a bit, in quantum computing.

[0054]

[0059] For purposes of simulating quantum circuits, the quantum circuit C can naturally be viewed as a tensor network. The tensor network of the quantum circuit C can be represented as N(C). In some embodiments, each gate in the quantum circuit C can be viewed as a tensor in the tensor network N(C). Qubit lines can be wires, closed edges connecting tensors, or open edges corresponding to input and output qubits. When contraction is performed on the tensor network N(C), each edge can be contracted one by one, and the corresponding tensor can be convolved until a single vertex remains. With degree 0, this vertex can be labeled with a single number, which provides the final measurement probability for the tensor network N(C) we are simulating. For tensor networks that include open edges, the final measurement after contraction can be a vector. One advantage of using tensor contraction to simulate quantum circuits is that the individual quantum gates in the circuit do not necessarily need to be simulated in their original order. In fact, a given gate may be only partially simulated at some stages of the simulation.

[0055]

[0060] 10 is a diagram illustrating an example representation of a quantum circuit using a tensor network, according to some embodiments of the present disclosure. As shown in FIG. 10, quantum circuit C is presented, with four input qubits (e.g., the upper four qubit lines of quantum circuit C) and four output qubits (e.g., the lower four qubit lines of quantum circuit C). Quantum circuit C may include one or more quantum gates.

[0056]

[0061] Quantum circuit C can be represented as a tensor network N(C), as shown in Figure 10. In some embodiments, tensor network N(C) includes eight open edges, as shown in Figure 10. Four of the open edges (e.g., the four edges above the tensor) can correspond to inputs of quantum circuit C, and the other four of the open edges (e.g., the four edges below the tensor) can correspond to outputs of quantum circuit C. In some embodiments, the tensors shown in tensor network N(C) can correspond to gates of quantum circuit C. In some embodiments, contracting tensor network N(C) provides tensors for operators implemented by quantum circuit C.

[0057]

[0062] Embodiments of the present disclosure provide methods and systems for using subnetworks to make estimates about the computational cost of contraction orders. These methods and systems can be used for tensor networks with open edges, and the tensor networks discussed above can be used to simulate quantum circuits. By using subnetworks,

[0058]

[0063] The flowcharts and diagrams in each figure illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of the present specification. In this regard, the blocks in the flowcharts or diagrams may represent software programs, segments, or code portions that contain one or more executable instructions for implementing a particular function. It should be noted that in some alternative implementations, the functions shown in the blocks may occur out of the order shown in the figures. For example, two blocks shown in succession may in fact be executed substantially simultaneously, or the blocks may sometimes be executed in the reverse order, depending on the functionality required. It should also be noted that each block of the diagrams or flowcharts, and combinations of each block in the diagrams and flowcharts, may be implemented by a dedicated hardware-based system that performs the specified function or operation, or by a combination of dedicated hardware and computer instructions.

[0059]

[0064] As used herein, the terms "comprise," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, composition, article, or apparatus that includes a list of elements does not include only those elements, but may also include other elements not expressly listed or elements inherent in such process, method, composition, article, or apparatus. The term "exemplary" is used in the sense of "example," not "ideal."

[0060]

[0065] As used herein, unless otherwise stated, the term "or" encompasses all possible combinations unless impracticable. For example, if it is stated that a database can include A or B, then the database can include either A, B, or A and B, unless otherwise stated or impracticable. As a second example, if it is stated that a database can include A, B, or C, then the database can include either A, B, C, A and B, A and C, B and C, or A, B, and C, unless otherwise stated or impracticable.

[0061]

[0066] It should be appreciated that the above-described embodiments can be realized by hardware, software (program code), or a combination of hardware and software. If realized by software, the software can be stored in the computer-readable medium described above. When executed by a processor, the software can perform the disclosed methods. The data storage system, secondary storage unit, and other functional units described in this disclosure can be realized by hardware, software, or a combination of hardware and software. Those skilled in the art will also understand that two or more of the above-described functional units can be combined into one functional unit, and that each of the above-described functional units can be further divided into multiple functional sub-units.

[0062]

[0067] In the foregoing specification, embodiments have been described with reference to numerous specific details that may vary from implementation to implementation. Certain adaptations and modifications of the described embodiments may be made. Other embodiments will become apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. It is to be understood that the specification and examples are intended to be exemplary only, with the true scope and spirit of the invention being indicated by the appended claims. Additionally, the order of steps depicted in the figures is for illustrative purposes only and is not intended to be limited to any particular order of steps. Thus, one skilled in the art will recognize that steps can be performed in different orders while still performing the same method.

[0063]

[0068] The embodiments may be further described using the following clauses. 1. A method for performing tensor network reduction, comprising: receiving, at a system, a tensor network including a plurality of tensors and a plurality of edges between the plurality of tensors, each edge being associated with a plurality of index elements; determining a reduction order for the tensor network; determining one or more edges from the plurality of edges based on the tensor network for generating a plurality of sub-networks; distributing the plurality of subnetworks to a plurality of computation nodes of the system, and performing contraction of the plurality of subnetworks by the plurality of computation nodes based on a contraction order; A method comprising: 2. The edges include one or more open edges and one or more closed edges; The step of determining a reduction order of the tensor network further comprises: creating a virtual tensor for connecting one or more open edges; generating an intermediate tensor network having one or more open edges closed by a virtual tensor; performing a tree decomposition of the intermediate tensor network to construct a tree; and Tree-based determination of the reduction order of tensor networks 2. The method according to clause 1, comprising: 3. The step of determining one or more edges for generating a plurality of sub-networks from among the plurality of edges based on the tensor network further includes: generating a plurality of evaluation sub-networks for each of the plurality of edges; Estimating resource consumption required to perform the reduction of the tensor network based on each of the plurality of evaluation sub-networks; and Determining one or more edges that require lower consumption based on an estimation 3. The method according to clause 1 or 2, comprising: 4. Generating multiple evaluation subnetworks for each of multiple edges further traversing multiple index elements of each edge; and generating a plurality of evaluation sub-networks corresponding to the plurality of index elements, respectively; 3. The method of claim 3, comprising: 5. The method of any one of clauses 1 to 4, further comprising the step of performing the contraction of multiple sub-networks in parallel by multiple computational nodes. 6. Determining a final reduction order for each of the plurality of sub-networks; and contracting each of the plurality of sub-networks based on a final contraction order. 7. The tensor network is used to simulate a quantum circuit including one or more quantum gates and one or more qubit lines; Multiple tensors correspond to one or more quantum gates, 7. The method of any one of clauses 1 to 6, wherein the multiple edges correspond to one or more qubit lines. 8. The method of any one of clauses 1 to 7, wherein the system is a cloud system. 9. A non-transitory computer-readable medium storing a set of instructions, the set of instructions executable by at least one processor of a system such that the system performs a reduction of a tensor network, the method comprising: receiving a tensor network including a plurality of tensors and a plurality of edges between the plurality of tensors, each edge being associated with a plurality of index elements; determining a reduction order for the tensor network; determining one or more edges from the plurality of edges based on the tensor network for generating a plurality of sub-networks; distributing the plurality of subnetworks to a plurality of computation nodes of the system, and performing contraction of the plurality of subnetworks by the plurality of computation nodes based on a contraction order; 1. A non-transitory computer-readable medium comprising: 10. The edges include one or more open edges and one or more closed edges; The instruction set further comprises: creating a virtual tensor for connecting one or more open edges; generating an intermediate tensor network having one or more open edges closed by a virtual tensor; performing a tree decomposition of the intermediate tensor network to construct a tree; and Tree-based determination of the reduction order of tensor networks 10. The non-transitory computer-readable medium of claim 9, executable to cause 11. The instruction set further comprises: generating a plurality of evaluation sub-networks for each of the plurality of edges; Estimating resource consumption required to perform the reduction of the tensor network based on each of the plurality of evaluation sub-networks; and Determining one or more edges that require lower consumption based on an estimation 11. The non-transitory computer-readable medium of clause 9 or 10, executable to cause 12. The instruction set further comprises: traversing multiple index elements of each edge; and generating a plurality of evaluation sub-networks corresponding to the plurality of index elements, respectively; 12. The non-transitory computer-readable medium of claim 11, executable to cause 13. The instruction set further comprises: traversing multiple index elements of each edge; and generating a plurality of evaluation sub-networks corresponding to the plurality of index elements, respectively; 12. The non-transitory computer-readable medium of claim 11, executable to cause 14. The instruction set further comprises: 14. The non-transitory computer-readable medium of any one of clauses 10 to 13, executable to cause a plurality of computing nodes to perform the contraction of a plurality of sub-networks in parallel. 15. The instruction set further comprises: determining a final reduction order for each of the plurality of subnetworks; and Contracting each of the multiple subnetworks based on the final contraction order 15. The non-transitory computer-readable medium of any one of clauses 10 to 14, executable to cause 16. The instruction set further comprises: the tensor network is used to simulate a quantum circuit including one or more quantum gates and one or more qubit lines; a plurality of tensors corresponding to one or more quantum gates; and Multiple edges correspond to one or more qubit lines 16. The non-transitory computer-readable medium of any one of clauses 10 to 15, configured to cause 17. The non-transitory computer-readable medium of any one of clauses 10 to 16, wherein the system is a cloud system. 18. A plurality of computer nodes; one or more memories storing an instruction set; and one or more processors, the one or more processors executing an instruction set to provide the system with: receiving a tensor network including a plurality of tensors and a plurality of edges between the plurality of tensors, each edge being associated with a plurality of index elements; Determining the reduction order of a tensor network; determining one or more edges from the plurality of edges based on the tensor network for generating a plurality of sub-networks; and Distributing a plurality of subnetworks to a plurality of computation nodes of the system and performing contraction of the plurality of subnetworks by the plurality of computation nodes based on the contraction order. A system configured to: 19. The edges include one or more open edges and one or more closed edges; The one or more processors further execute the instruction set to cause the system to: creating a virtual tensor for connecting one or more open edges; generating an intermediate tensor network having one or more open edges closed by a virtual tensor; performing a tree decomposition of the intermediate tensor network to construct a tree; and Tree-based determination of the reduction order of tensor networks 19. The system of claim 18, configured to: 20. The one or more processors further execute the instruction set to provide the system with: generating a plurality of evaluation sub-networks for each of the plurality of edges; Estimating resource consumption required to perform the reduction of the tensor network based on each of the plurality of evaluation sub-networks; and Determining one or more edges that require lower consumption based on an estimation 20. The system of clause 18 or 19, configured to cause 21. The one or more processors further execute an instruction set to provide the system with: traversing multiple index elements of each edge; and generating a plurality of evaluation sub-networks corresponding to the plurality of index elements, respectively; 21. The system of claim 20, configured to: 22. The one or more processors further execute the instruction set to provide the system with: 22. The system of any one of clauses 18 to 21, configured to cause a plurality of computational nodes to perform the contraction of a plurality of sub-networks in parallel. 23. The one or more processors further execute an instruction set to provide the system with: determining a final reduction order for each of the plurality of subnetworks; and Contracting each of the multiple subnetworks based on the final contraction order 23. The system of any one of clauses 18 to 22, configured to: 24. The one or more processors further execute an instruction set to provide the system with: the tensor network is used to simulate a quantum circuit including one or more quantum gates and one or more qubit lines; a plurality of tensors corresponding to one or more quantum gates; and Multiple edges correspond to one or more qubit lines 24. The system of any one of clauses 18 to 23, configured to: 25. A system according to any one of clauses 18 to 24, wherein the system is a cloud system.

[0064]

[0069] It should be appreciated that certain features of this specification, which are, for clarity, described in the context of separate embodiments, may also be provided in combination in a single embodiment. Conversely, various features of this specification, which are, for clarity, described in the context of a single embodiment, may also be provided separately or in any suitable subcombination, or as appropriate, with any other described embodiment of this specification. Certain features described in the context of various embodiments are not considered essential features of that embodiment, unless the embodiment is inoperable without that element.

Claims

1. 1. A method for performing tensor network reduction, comprising: receiving, at a system, a tensor network including a plurality of tensors and a plurality of edges between the plurality of tensors, the edges including one or more open edges and one or more closed edges, each edge associated with a plurality of index elements; The contraction order of the tensor network is creating a virtual tensor for connecting the one or more open edges; generating an intermediate tensor network having the one or more open edges closed by the virtual tensor; performing a tree decomposition of the intermediate tensor network to construct a tree; and determining the contraction order of the tensor network based on the tree; determining the determining one or more edges from the plurality of edges based on the tensor network for generating a plurality of sub-networks; distributing the plurality of subnetworks to a plurality of computing nodes of the system, and performing contraction of the plurality of subnetworks by the plurality of computing nodes based on the contraction order; Including, The method, wherein the reduced order is generated in an iterative process by removing leaf nodes from the tree and adding closed indices to the end of the reduced order until the tree is empty.

2. determining, based on the tensor network, one or more edges from among the plurality of edges for generating the plurality of sub-networks, further comprising: generating a plurality of evaluation sub-networks for each of the plurality of edges; estimating resource consumption required to perform the reduction of the tensor network based on each of the plurality of evaluation sub-networks; and determining the one or more edges requiring lower consumption based on the estimation; The method of claim 1 , comprising:

3. generating the plurality of evaluation sub-networks for each of the plurality of edges further comprises: traversing the plurality of index elements of each edge; and generating the plurality of evaluation sub-networks corresponding to the plurality of index elements, respectively; The method of claim 2 , comprising:

4. The method of claim 1 , further comprising: performing, by the plurality of computing nodes, the contraction of the plurality of sub-networks in parallel.

5. determining a final contraction order for each of the plurality of subnetworks; and contracting each of the plurality of subnetworks based on the final contraction order.

6. the tensor network is used to simulate a quantum circuit including one or more quantum gates and one or more qubit lines; the plurality of tensors correspond to the one or more quantum gates; 10. The method of claim 1, wherein the plurality of edges correspond to the one or more quantum bit lines.

7. The method of claim 1 , wherein the system is a cloud system.

8. 1. A non-transitory computer-readable medium storing a set of instructions executable by at least one processor of a system to cause the system to perform tensor network reduction, the method comprising: receiving a tensor network including a plurality of tensors and a plurality of edges between the plurality of tensors, the edges including one or more open edges and one or more closed edges, each edge associated with a plurality of index elements; The contraction order of the tensor network is creating a virtual tensor for connecting the one or more open edges; generating an intermediate tensor network having the one or more open edges closed by the virtual tensor; performing a tree decomposition of the intermediate tensor network to construct a tree; and determining the contraction order of the tensor network based on the tree; determining the determining one or more edges from the plurality of edges based on the tensor network for generating a plurality of sub-networks; distributing the plurality of subnetworks to a plurality of computing nodes of the system, and performing contraction of the plurality of subnetworks by the plurality of computing nodes based on the contraction order; Including, A non-transitory computer-readable medium, wherein the reduced order is generated in an iterative process by removing leaf nodes from the tree and adding closed indices to the end of the reduced order until the tree is empty.

9. The instruction set is further configured to provide to the system by the at least one processor of the system: generating a plurality of evaluation sub-networks for each of the plurality of edges; estimating resource consumption required to perform the reduction of the tensor network based on each of the plurality of evaluation sub-networks; and determining the one or more edges requiring lower consumption based on the estimation; 10. The non-transitory computer-readable medium of claim 8, executable to cause:

10. The instruction set is further configured to provide to the system by the at least one processor of the system: traversing the plurality of index elements of each edge; and generating the plurality of evaluation sub-networks corresponding to the plurality of index elements, respectively; 10. The non-transitory computer-readable medium of claim 9, executable to cause:

11. a plurality of computing nodes; one or more memories that store an instruction set; and one or more processors, wherein the one or more processors execute the instruction set to cause the system to: receiving a tensor network including a plurality of tensors and a plurality of edges between the plurality of tensors, the edges including one or more open edges and one or more closed edges, each edge associated with a plurality of index elements; The contraction order of the tensor network is creating a virtual tensor for connecting the one or more open edges; generating an intermediate tensor network having the one or more open edges closed by the virtual tensor; performing a tree decomposition of the intermediate tensor network to construct a tree; and determining the contraction order of the tensor network based on the tree; To determine by, determining one or more edges from among the plurality of edges based on the tensor network for generating a plurality of sub-networks; and Distributing the plurality of subnetworks to the plurality of computing nodes of the system, and contracting the plurality of subnetworks by the plurality of computing nodes based on the contraction order. The method is configured to: The system wherein the reduced order is generated in an iterative process by removing leaf nodes from the tree and adding closed indices to the end of the reduced order until the tree is empty.

12. The one or more processors further execute the instruction set to cause the system to: generating a plurality of evaluation sub-networks for each of the plurality of edges; estimating resource consumption required to perform the reduction of the tensor network based on each of the plurality of evaluation sub-networks; and determining the one or more edges requiring lower consumption based on the estimation; The system of claim 11 configured to:

13. The one or more processors further execute the instruction set to cause the system to: traversing the plurality of index elements of each edge; and generating the plurality of evaluation sub-networks corresponding to the plurality of index elements, respectively; The system of claim 12 configured to:

14. The one or more processors further execute the instruction set to cause the system to: The system of claim 11 , configured to cause the plurality of computing nodes to perform the contraction of the plurality of sub-networks in parallel.

15. The one or more processors further execute the instruction set to cause the system to: determining a final reduction order for each of the plurality of subnetworks; and The system of claim 11 , configured to cause the contraction of each of the plurality of sub-networks to be performed based on the final contraction order.

16. The one or more processors further execute the instruction set to cause the system to: the tensor network is used to simulate a quantum circuit including one or more quantum gates and one or more quantum bit lines; the plurality of tensors corresponding to the one or more quantum gates; and the plurality of edges corresponding to the one or more quantum bit lines; The system of claim 11 configured to:

17. The system of claim 11 , wherein the system is a cloud system.

Citation Information

Patent Citations

  • Simulating quantum circuits

    US20190095561A1

  • Method and system for quantum computing

    US20190332731A1