Arithmetic setup and tensor update procedure
By representing tensors as products of small tensors and performing contraction directly on these tensors, the device reduces processing time and maintains accuracy by focusing on relevant factor information.
Patent Information
- Application Number
- DE112024005678
- Authority / Receiving Office
- DE · DE
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-04-03
- Filing Date
- 2024-04-03
- Publication Date
- 2026-11-26
AI Technical Summary
Existing arithmetic devices require significant processing time to move factor information located outside the positions between two small tensors to those positions before contraction processing, leading to inefficiencies.
An arithmetic device that represents a tensor of order L by a product of small tensors and performs contraction processing directly on these small tensors, incorporating factor information between them, thereby reducing the need for moving factor information.
This approach significantly reduces arithmetic processing time and maintains or enhances arithmetic accuracy by selectively including factor information based on its impact on the tensors.
Smart Images

Figure 00000013_0000 
Figure 00000013_0001 
Figure 00000014_0000
Abstract
Description
TECHNICAL AREA The present disclosure relates to an arithmetic device and a tensor update procedure. STATE OF THE ART There exists an arithmetic apparatus that represents a tensor of order L (where L is an integer equal to or greater than 2) by a product of a plurality of small tensors (hereinafter referred to as "small tensors"), each of which has a smaller number of elements than the number of elements of the tensor of order L, and performs a contraction processing of incorporating factor information on a tensor group that has a plurality of small tensors. As such an arithmetic device, for example, non-patent literature 1 discloses an arithmetic device that moves all factor information that is present at positions other than between two small tensors of a tensor group to a position between the two small tensors and then performs a contraction processing of incorporating the factor information that is present between the two small tensors into the two small tensors. REFERENCE LIST NON-PATENT LITERATURE Non-patent literature 1: U. Schollwock, “The density-matrix renormalization group in the age of matrix product states”, published on arXiv under number arXiv:1008.3477v2 on August 20, 2010 SUMMARY OF THE INVENTION TECHNICAL PROBLEM The arithmetic setup described in non-patent literature 1 has the problem that it requires a lot of arithmetic processing time to move all factor information that is located at positions other than between two small tensors of the tensor group to a position between the two small tensors before the contraction processing is performed. The present disclosure was prepared to solve the problems mentioned above, and its aim is to obtain an arithmetic device which can reduce the arithmetic processing time more than the arithmetic device disclosed in non-patent literature 1. SOLUTION TO THE PROBLEM An arithmetic device according to the present disclosure comprises: a contraction unit for representing a tensor of order L (where L is an integer equal to or greater than 2) by a product of a plurality of small tensors, wherein the plurality of small tensors are each having a smaller number of elements than the number of elements of the tensor of order L, and performing, on the plurality of small tensors, a contraction processing of incorporating factor information that exists between the plurality of small tensors. ADVANTAGEOUS EFFECTS OF THE INVENTION According to the present disclosure, the arithmetic processing time can be reduced more than with the arithmetic device disclosed in non-patent literature 1. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a configuration diagram showing an arithmetic device according to a first embodiment. Fig. 2 is a hardware configuration diagram illustrating hardware of the arithmetic device according to the first embodiment. Fig. 3 is a hardware configuration diagram of a computer in a case where the arithmetic device is implemented by software, firmware, or the like. Fig. 4 is a flowchart illustrating a tensor update procedure, which is a processing flow of the arithmetic device. Fig. 5A is an explanatory diagram illustrating a matrix aj,k and a matrix ai,as a second-order tensor. Fig. 5B is an explanatory diagram illustrating a tensor ai,j,as a third-order tensor. Fig. 5C is an explanatory diagram illustrating a tensor Mi,jσi,σi+1 as a fourth-order tensor.Figure 6 is an explanatory diagram illustrating an L-th order tensor represented by a product of a plurality of small tensors. Figure 7 is an explanatory diagram illustrating an example where the number of elements of a tensor is reduced by increasing the order of the tensor. Figure 8 is an explanatory diagram illustrating a conventional contraction processing disclosed in non-patent literature 1. Figure 9 is an explanatory diagram illustrating a contraction processing, a decomposition processing, and an approximation processing in the arithmetic setup shown in Figure 1. Figure 10 is a configuration diagram representing the interior of a contraction unit 1. Figure 11 is a flowchart illustrating a processing sequence of the contraction unit 1.Figure 12 is a configuration diagram showing an arithmetic device according to a second embodiment. Figure 13 is a hardware configuration diagram illustrating the hardware of the arithmetic device according to the second embodiment. Figure 14 is a flowchart illustrating a tensor update procedure, which is a processing flow of the arithmetic device according to the second embodiment. Figure 15 is an explanatory diagram illustrating contraction processing, decomposition processing, approximation processing, and reordering processing in the arithmetic device shown in Figure 12. Figure 16 is an explanatory diagram illustrating a specific example of reordering processing by a reordering unit 4.Figure 17 is an explanatory diagram illustrating an example where a plurality of parts of factor information exist between a plurality of small tensors. Figure 18 is an explanatory diagram illustrating factor information after a movement. Figure 19 is a flowchart illustrating contraction processing of contraction unit 1 in an arithmetic device according to a fourth embodiment. Figure 20A is an explanatory diagram illustrating a configuration example of a switching target, and Figure 20B is an explanatory diagram illustrating an example of a user interface for setting. Figures 21A and 21B are explanatory diagrams illustrating an example of a plurality of contraction target tensors for which contraction processing is performed in parallel.Figure 22A is an explanatory illustration showing an example where the form of the product of the small tensors is a one-dimensional form; Figure 22B is an explanatory illustration showing an example where the form of the product of the small tensors is a two-dimensional two-row form; Figure 22C is an explanatory illustration showing an example where the form of the product of the small tensors is a two-dimensional two-column form; and Figure 22D is an explanatory illustration showing an example where two-dimensional rows or two-dimensional columns are large. DESCRIPTION OF THE EXECUTION FORMS In order to explain the present disclosure in more detail below, modes for carrying out the present disclosure are described with reference to the accompanying drawings. First embodiment Fig. 1 is a configuration diagram showing an arithmetic device according to a first embodiment. Fig. 2 is a hardware configuration diagram illustrating a hardware arithmetic device according to the first embodiment. The arithmetic device shown in Fig. 1 comprises a contraction unit 1, a decomposition unit 2 and an approximation unit 3. The contraction unit 1 is implemented, for example, by a contraction circuit 11 shown in Fig. 2. The contraction unit 1 represents a tensor of order L (where L is an integer equal to or greater than 2) by a product of a plurality of small tensors, which are a plurality of tensors, each of which has a smaller number of elements than the number of elements of the tensor of order L. Contraction unit 1 performs a contraction processing of the inclusion of factor information that exists between the multitude of small tensors on the multitude of small tensors. Factor information can be, for example, a factor matrix in matrix form, a numerical value, or a sequence of numbers where a component of the matrix close to 0 is omitted. Factor information is information obtained when each L-th order tensor is transformed into a basis transformation matrix, and can include, for example, information specifying a quantum state. In many cases, factor information located closer to a tensor of an operator has a greater impact on arithmetic accuracy. The contraction unit 1 outputs the contraction result from the contraction processing to the decomposition unit 2. Here, the contraction unit 1 performs the contraction processing on the multitude of small tensors, incorporating factor information present between the multitude of small tensors. However, this is only an example, and the contraction unit 1 can perform the contraction processing on the multitude of small tensors, incorporating factor information present between the multitude of small tensors, and an operator for the multitude of small tensors. The following description assumes that contraction unit 1 performs the contraction processing of including the factor information and the operator. The decomposition unit 2 is implemented, for example, by a decomposition circuit 12 shown in Fig. 2. The decomposition unit 2 obtains a contraction result through contraction processing from the contraction unit 1. The decomposition unit 2 performs a decomposition processing of the contraction result and outputs a tensor group, which has a large number of small tensors and factor information, to the approximation unit 3. The approximation unit 3 is implemented, for example, by an approximation circuit 13 shown in Fig. 2. The approximation unit 3 procures a tensor group, which has a large number of small tensors and factor information, from the decomposition unit 2. Approximation unit 3 performs approximation processing of the factor information contained in the tensor group. In Fig. 1, it is assumed that each of the contraction unit 1, the decomposition unit 2, and the approximation unit 3, which are components of the arithmetic device, is implemented by dedicated hardware, as shown in Fig. 2. That is, it is assumed that the arithmetic device is implemented by the contraction circuit 11, the decomposition circuit 12, and the approximation circuit 13. The contraction circuit 11, the decomposition circuit 12 and the approximation circuit 13 each correspond, for example, to a single circuit, a composite circuit, a programmed processor, a parallel programmed processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or a combination thereof. The components of arithmetic devices are not limited to those implemented by special hardware, and the arithmetic device can be implemented by software, firmware, or a combination of software and firmware. The software or firmware is stored as a program in a computer's main memory. The computer refers to the hardware that executes a program and corresponds, for example, to a central processing unit (CPU), a graphics processing unit (GPU), a central processing unit, a processing unit, an arithmetic unit, a microprocessor, a microcomputer, a processor, or a digital signal processor (DSP). Fig. 3 is a hardware configuration diagram of a computer in a case where the arithmetic setup is implemented by software, firmware or the like. In a case where the arithmetic setup is implemented by software, firmware, or the like, a program that causes a computer to execute each processing step in the contraction unit 1, the decomposition unit 2, and the approximation unit 3 is stored in a working memory 21. Then, a processor 22 of the computer executes the program stored in the working memory 21. Furthermore, Fig. 2 shows an example where each component of the arithmetic device is implemented by dedicated hardware, and Fig. 3 shows an example where the arithmetic device is implemented by software, firmware, or similar means. However, these are merely examples, and some components of the arithmetic device may be implemented by dedicated hardware, while the remaining components may be implemented by software, firmware, or similar means. The operation of the arithmetic device shown in Fig. 1 is described below. Fig. 4 is a flowchart illustrating a tensor update procedure, which is a processing flow of the arithmetic setup. Fig. 5A illustrates a matrix aj,k and a matrix ai,kals the second-order tensor, where the L-th order tensor is the second-order tensor. The number of elements of matrix aj,k is DjDk, and the number of elements of matrix ai,k is DiDk. Fig. 5B illustrates a tensor ai,j,kals, the third-order tensor, where the L-th-order tensor is the third-order tensor. The number of elements of the tensor ai,j,kist is DiDjDk. Fig. 5C illustrates a tensor Mi,jσi,σi+1 as the tensor of fourth order, where the tensor L-th order is the tensor of fourth order. Fig. 10 is a configuration diagram showing the interior of the contraction unit 1. As shown in Fig. 10, the contraction unit 1 comprises a tensor procurement unit 31, a tensor representation unit 32 and a contraction processing unit 33. Fig. 11 is a flowchart illustrating a processing sequence of the contraction unit 1. The tensor procurement unit 31 of the contraction unit 1 procures a tensor Φ of order L, which has M indices σm(m = 1, ..., M), as shown in the upper diagram in Fig. 6 (step ST11 in Fig. 11). M is an integer equal to or greater than 2. For example, if the degrees of freedom of the index σm are equal to 2, the tensor Φ has 2M elements, and the number of elements increases exponentially. As shown in the lower part of Fig. 6, the tensor representation unit 32 of the contraction unit 1 represents the L-th order tensor Φ by a product of a plurality of small tensors Tidar, each of which has a smaller number of elements than the number of elements of the tensor Φ (step ST12 in Fig. 11). i = 1, ..., I. I is an integer greater than or equal to 2. The small tensor Ti, shown in the lower part of Fig. 6, has a constant number of elements. The number of elements is less than 2M. Fig. 6 is an explanatory representation illustrating the L-th order tensor, which is represented by a product of a plurality of small tensors. The technique described here can be applied by transforming the first-order tensor into a second-order or higher-order tensor. Fig. 7 is an explanatory illustration that shows an example where the number of elements of a tensor is reduced by increasing the order of the tensor. In the example from Fig. 7, if Di, i.e., the number of elements, is 10,000, Da and Db, i.e., the number of elements, are 100, and Dc, i.e., the number of elements, is 5, then the number of elements of the tensor on the far right in the figure, where the tensor on the far right is represented by a product of two small tensors, is 1,000, which is reduced to be smaller than the number of elements of the tensor on the far left. In Fig. 7, the number of elements of the tensor has been reduced by increasing the tensor's order. However, this is just one example, and the number of elements can be reduced by decreasing the tensor's order. Reducing the number of elements of the tensor by decreasing its order is a well-known technique, so a detailed description is omitted here. The example in Fig. 7 illustrates that an L-th order tensor is represented by a product of two smaller tensors. However, this is only one example, and the L-th order tensor can be represented by a product of three or more smaller tensors. The contraction processing unit 33 of the contraction unit 1 performs contraction processing on the plurality of small tensors by incorporating factor information that exists between the plurality of small tensors and an operator for the plurality of small tensors (step ST1 in Fig. 4 and step ST13 in Fig. 11). The contraction processing unit 33 outputs a contraction result from the contraction processing to the decomposition unit 2. Fig. 8 is an explanatory illustration depicting a conventional contraction processing disclosed in non-patent literature 1. In conventional contraction processing, the factor information on the far left is moved to a position between two small tensors by moving the factor information on the far left one position to the right. Furthermore, in conventional contraction processing, all factor information to the right of the position between the two small tensors is moved to the position between the two small tensors by moving all factor information to the right of the position between the two small tensors. For example, the factor information on the far right is moved to the position between the two small tensors by moving the factor information on the far right five positions to the left. Since the process of moving factor information is a known technique in itself, a detailed description is omitted. Traditional contraction processing requires an arithmetic processing time associated with the movement of these pieces of factor information. In the example from Fig. 8, after the factor information has been moved, a contraction processing is performed to include all factor information and operators on the two small tensors. Fig. 9 is an explanatory illustration demonstrating contraction processing, decomposition processing, and approximation processing in the arithmetic setup shown in Fig. 1. In the arithmetic setup shown in Fig. 1, the contraction processing unit 33 of the contraction unit 1 does not move any factor information, unlike in conventional contraction processing. The further away these factor pieces are from the original factor pieces between the two small tensors, the less influence they have on the arithmetic accuracy. This means that computations can be performed efficiently by selectively including factor pieces from between the two small tensors in those tensors. Thus, during contraction processing, the factor information present between the multitude of small tensors is selectively included in the two small tensors by the contraction processing unit 33. Assuming that the left small tensor contained in the tensor group to be contracted, as shown in Fig. 9, is a'i,k,σ'list, the right small tensor contained in the tensor group to be contracted is b'k',jσ'I+1, the factor information between the two small tensors is s'k', and the operator is Mσ'l,σ'l+1σl,σl+1, the contraction result Mi,jσl,σl+1 is represented by the following formula (1). I is a variable that specifies the number of dimensions. Here, an example is illustrated where an operator—that is, an operation to be performed on a tensor—is represented by a fourth-order tensor, and the operation of applying the operator is represented by a product-sum operation. This is only an example, however, and the order of the operator could, for instance, differ from fourth order. Furthermore, the operation of applying the operator can be represented in the form of a linear equation. The decomposition unit 2 obtains the contraction result Mi,j,σl,σl+1 through contraction processing from the contraction unit 1. Here, the contraction processing is represented by a product-sum operation. However, this is only an example, and it is preferable, for instance, to use an example that satisfies the axiom of the commutative semiring, where the operation is not limited to the product-sum operation. The decomposition unit 2 performs a decomposition processing of the contraction result Mi,jσl,σl+1 (step ST2 in Fig. 4 ). Examples of decomposition processing of the contraction result Mi,jσl,σl+1 include singular value decomposition, QR decomposition, and QLP decomposition. The decomposition process yields a tensor group that includes two small tensors and factor information. The tensor group comprising the two small tensors and the factor information is represented by the following formula (2). The decomposition unit 2 outputs the tensor group, which contains the two small tensors and the factor information, to the approximation unit 3. In formula (2) ai,kσ is a left small tensor, bk,jσl+1 is a right small tensor and sk represents factor information that exists between the two small tensors. The approximation unit 3 obtains a tensor group containing two small tensors and factor information from the decomposition unit 2. The approximation unit 3 performs an approximation processing of the factor information contained in the tensor group (step ST3 in Fig. 4). Approximation processing of factor information includes, for example, the processing of deleting a singular value close to 0 from the singular values of the factor matrix that specifies the factor information. If the number of singular values of the factor matrix that specifies the factor information contained in the tensor group is D', then in a case where the number of singular values of the factor matrix is D (D < D'), by deleting a singular value close to 0, the tensor group after approximation processing is represented by the following formula (3). In the first embodiment described above, the arithmetic device is configured to comprise the contraction unit 1 for representing an L-th order tensor (where L is an integer equal to or greater than 2) by a product of a plurality of small tensors, each having a smaller number of elements than the L-th order tensor, and performing, on the plurality of small tensors, a contraction processing operation of incorporating factor information present between the plurality of small tensors. Thus, the arithmetic device is able to reduce arithmetic processing time more significantly than the arithmetic device disclosed in non-patent literature 1. Furthermore, in the first embodiment, the arithmetic unit is configured to include the approximation unit 3, which performs the approximation processing of the factor information contained in the tensor group output by the decomposition unit 2. Therefore, the arithmetic unit can reduce the size of the factor information contained in the tensor group. Second embodiment In a second embodiment, an arithmetic device is described which has a rearrangement unit 4 for rearranging, for the tensor group after the approximation processing by the approximation unit 3, neighboring factor information, which is factor information adjacent to each of the small tensors, among the factor information that differs from the factor information present between the plurality of small tensors. Fig. 12 is a configuration diagram showing an arithmetic device according to the second embodiment. In Fig. 12, the same reference numerals as in Fig. 1 denote the same or corresponding units, so their description is omitted. Fig. 13 is a hardware configuration diagram illustrating the hardware of the arithmetic device according to the second embodiment. In Fig. 13, the same reference numerals as in Fig. 2 denote the same or corresponding units, so their detailed description is omitted. The arithmetic device shown in Fig. 12 comprises the contraction unit 1, the decomposition unit 2, the approximation unit 3 and the rearrangement unit 4. The rearrangement unit 4 is implemented, for example, by a rearrangement circuit 14 shown in Fig. 13. After approximation processing, the rearrangement unit 4 obtains a tensor group from the approximation unit 3. The reordering unit 4 reorders adjacent factor information for the tensor group, which is factor information adjacent to each of the small tensors, among the factor information that differs from the factor information present between the multitude of small tensors. In Fig. 12, it is assumed that each of the contraction unit 1, the decomposition unit 2, the approximation unit 3, and the rearrangement unit 4, which are components of the arithmetic device, is implemented by dedicated hardware, as shown in Fig. 13. That is, it is assumed that the arithmetic device is implemented by the contraction circuit 11, the decomposition circuit 12, the approximation circuit 13, and the rearrangement circuit 14. The contraction circuit 11, the decomposition circuit 12, the approximation circuit 13 and the rearrangement circuit 14 each correspond, for example, to a single circuit, a composite circuit, a programmed processor, a parallel programmed processor, an ASIC, an FPGA or a combination thereof. The components of arithmetic devices are not limited to those implemented by special hardware, and the arithmetic device can be implemented by software, firmware, or a combination of software and firmware. In a case where the arithmetic device is implemented by software, firmware, or the like, a program that instructs a computer to execute each processing step in the contraction unit 1, the decomposition unit 2, the approximation unit 3, and the rearrangement unit 4 is stored in the main memory 21 shown in Fig. 3. The processor 22 shown in Fig. 3 then executes the program stored in the main memory 21. Furthermore, Fig. 13 shows an example where each component of the arithmetic device is implemented by dedicated hardware, and Fig. 3 shows an example where the arithmetic device is implemented by software, firmware, or the like. However, these are merely examples, and some components of the arithmetic device may be implemented by dedicated hardware, while the remaining components may be implemented by software, firmware, or the like. The operation of the arithmetic unit shown in Fig. 12 is described below. It should be noted that, with the exception of the rearrangement unit 4, the arithmetic unit is similar to the arithmetic unit shown in Fig. 1; therefore, only the operation of rearrangement unit 4 is described here. Fig. 14 is a flowchart illustrating a tensor update procedure, which is a processing flow of the arithmetic device according to the second embodiment. Fig. 15 is an explanatory representation illustrating contraction processing, decomposition processing, approximation processing and rearrangement processing in the arithmetic setup shown in Fig. 12. For example, the rearrangement unit 4 stores neighboring factor information before the contraction unit 1 performs the contraction processing. As shown in Fig. 15, the neighboring factor information is the factor information adjacent to each of the small tensors, among which the factor information differs from the factor information present between the multitude of small tensors. After approximation processing, the rearrangement unit 4 obtains a tensor group from the approximation unit 3. As shown in Fig. 15, the rearrangement unit 4 rearranges the adjacent factor information for the tensor group (step ST4 in Fig. 14). The following section describes in more detail the reordering process of reordering unit 4. Fig. 16 is an explanatory illustration that shows a specific example of the reordering processing by the reordering unit 4. Fig. 16 shows an example where the neighboring factor information S1 is rearranged for the tensor group. The rearrangement unit 4 performs a contraction process, incorporating the neighboring factor information S1 and the factor information S2 of the tensor T2, which lies to the right of the tensor group. It should be noted that S1, T2, and S2 are continuously stored in memory even after the contraction. Subsequently, the rearrangement unit 4 obtains the factor information S'1 by performing a decomposition processing, such as a QR decomposition, on the contraction result. Subsequently, the rearrangement unit 4 multiplies a small tensor T1 on the right side of the figure consisting of the two small tensors contained in the tensor group after approximation processing with an inverse matrix S'1-1 of a matrix that gives the factor information S'1. By performing the above-mentioned processing, the rearrangement unit 4 can rearrange the neighboring factor information S1 for the tensor group after the approximation processing. In the second embodiment described above, the arithmetic device shown in Fig. 12 is configured to include the rearrangement unit 4 for rearranging, for the tensor group after approximation processing by the approximation unit 3, adjacent factor information—that is, factor information adjacent to each of the small tensors—among the factor information that differs from the factor information present between the multitude of small tensors. Thus, the arithmetic device shown in Fig. 12 is able to reduce arithmetic processing time more significantly than the arithmetic device disclosed in non-patent literature 1 and can increase arithmetic accuracy more than the arithmetic device shown in Fig. 1. In the arithmetic setup shown in Fig. 12, the reordering unit 4 rearranges the adjacent factor information with respect to the tensor group. The reordering unit 4 can adjust the value of the adjacent factor information when the adjacent factor information is rearranged. In a case where a component with a small singular value is contained in the matrix which has the neighboring factor information S1, the operation may be numerically unstable, so that deleting the binding dimension of the tensor or approximating the singular value contained in the inverse matrix S'1-1 of the matrix which specifies the neighboring factor information S1 to 0 enables a numerically stable operation. Third embodiment In a third embodiment, an arithmetic device is described in which the contraction unit 1 performs contraction processing on a plurality of small tensors by including a plurality of parts of factor information that are present between the plurality of small tensors. The configuration of the arithmetic device according to the third embodiment corresponds to the configuration of the arithmetic device according to the first embodiment or the configuration of the arithmetic device according to the second embodiment. Thus, a configuration diagram showing the arithmetic device according to the third embodiment is shown in Fig. 1 or Fig. 12. Fig. 17 is an explanatory representation illustrating an example where a multitude of pieces of factor information exist between a multitude of small tensors. In the example from Fig. 17, there are four pieces of factor information between two small tensors. In the example from Fig. 17, the contraction unit 1 moves the first factor information from the right by three positions to the left, the second factor information from the right by two positions to the left, and the third factor information from the right by one position to the left. Since the process of moving the factor information is a well-known technique, a detailed description is omitted. Consequently, the four pieces of factor information are present between two adjacent small tensors, as shown in Fig. 18. Fig. 18 is an explanatory illustration showing the factor information after the movement. Contraction unit 1 performs a contraction processing on the two small tensors, incorporating four pieces of factor information that are present between the two small tensors. In the third embodiment described above, the arithmetic device is configured such that the contraction unit 1 performs contraction processing on the plurality of small tensors, incorporating a plurality of parts of factor information that exist between the plurality of small tensors. Therefore, the arithmetic device can perform contraction processing on a plurality of small tensors even in a case where a plurality of parts of factor information exist between the plurality of small tensors. Fourth embodiment In a fourth embodiment, exclusively when arithmetic processing time is prioritized over arithmetic accuracy, an arithmetic device is described in which the contraction unit 1 performs contraction processing on a plurality of small tensors, including factor information that exists between the plurality of small tensors. The configuration of the arithmetic device according to the fourth embodiment corresponds to the configuration of the arithmetic device according to the first embodiment or the configuration of the arithmetic device according to the second embodiment. Thus, a configuration diagram showing the arithmetic device according to the fourth embodiment is shown in Fig. 1 or Fig. 12. Fig. 19 is a flowchart illustrating a contraction processing of the contraction unit 1 in the arithmetic device according to the fourth embodiment. Next, the operation of the arithmetic device according to the fourth embodiment will be described. It should be noted that, with the exception of contraction unit 1, the operation is similar to that of the arithmetic device according to the first embodiment; therefore, only the operation of contraction unit 1 will be described here. The user can make a setting that prioritizes arithmetic processing time over arithmetic accuracy, or a setting that prioritizes arithmetic accuracy over arithmetic processing time. Fig. 20A is an explanatory illustration showing a configuration example of a switching target. Fig. 20B is an explanatory illustration showing an example of a user interface for settings. Calculations using a tensor can be implemented as a library, and arithmetic operations can be switched depending on the user's settings. Examples of the parameter for switching between the configuration on the left side of the figure (focusing on arithmetic accuracy) and the configuration on the right side of the figure (focusing on acceleration: prioritizing arithmetic processing time), as shown in Fig. 20A, include whether or not to prioritize accelerating the arithmetic operation, whether or not to use all operators, and whether or not to perform all switches. A switch involves exchanging a physical index σi. Switching is usually continuous, and it can be advantageous to perform all switches to maintain high accuracy. In the user interface shown in Fig. 20B, it is possible, for example, to set an update range of a tensor, a range of a small tensor representing an L-th order tensor, or a number of small tensors representing an L-th order tensor, the number of factor information pieces used for the update, and the like. In the example of Fig. 20B, the number of factor information pieces to be used for the update can be set from among those on the left side of the second small tensor from the left in the figure, and the number of factor information pieces to be used for the update can be set from among those on the right side of the third small tensor from the left in the figure. A variable value can be set by changing the number of required pieces of factor information depending on the number of the small tensor representing the L-th order tensor. Although not shown in Fig. 20, the number of switches used for the update can be adjusted. The user can configure the arithmetic settings in cases where an acceleration of arithmetic operations is expected. For example, artificial intelligence (AI)-based predictions can be used to forecast an expected acceleration of arithmetic operations. When the setting is made which prioritizes arithmetic processing time over arithmetic accuracy (step ST21 in Fig. 19: YES), the contraction unit 1 performs contraction processing on a plurality of small tensors by incorporating factor information present between the plurality of small tensors (step ST22 in Fig. 19), similar to the arithmetic setup of the first to third embodiments. If the setting that prioritizes arithmetic accuracy over arithmetic processing time has been made (step ST21 in Fig. 19: NO), the contraction unit 1 performs contraction processing on the multitude of small tensors by including all factor information that has a connection relationship with each of the small tensors, similar to the arithmetic setup of non-patent literature 1 (step ST23 in Fig. 19). In the fourth embodiment described above, the arithmetic device is configured such that, when arithmetic processing time is prioritized over arithmetic accuracy, the contraction unit 1 performs contraction processing on the plurality of small tensors, incorporating factor information present between the plurality of small tensors. Conversely, when arithmetic accuracy is prioritized over arithmetic processing time, the contraction processing on the plurality of small tensors includes all factor information that has a linking relationship to each of the small tensors. Therefore, the arithmetic device can perform contraction processing that prioritizes either arithmetic accuracy or arithmetic processing time. If, in the arithmetic setup according to the fourth embodiment, the setting is implemented that prioritizes arithmetic processing time over accuracy, the contraction unit 1 performs contraction processing on the plurality of small tensors, incorporating factor information present between the plurality of small tensors. However, this is only an example, and even in a case where the setting is implemented that prioritizes arithmetic processing time over arithmetic accuracy, the contraction unit 1 can only perform contraction processing on a plurality of small tensors, incorporating factor information present between the plurality of small tensors, in a case where a reduction in arithmetic processing time is expected. As an example of a case where a reduction in arithmetic processing time can be expected, there is a case where the number of movements of factor information is equal to or greater than a threshold. Fifth embodiment In a fifth embodiment, an arithmetic device is described in which, if a plurality of contraction target tensors are present, comprising the plurality of small tensors, the contraction unit 1 performs the contraction processing on the plurality of contraction target tensors in parallel. The configuration of the arithmetic device according to the fifth embodiment corresponds to the configuration of the arithmetic device according to the first embodiment or the configuration of the arithmetic device according to the second embodiment. Thus, a configuration diagram showing the arithmetic device according to the fifth embodiment is shown in Fig. 1 or Fig. 12. Fig. 21 is an explanatory illustration showing an example of a variety of contraction target tensors on which contraction processing is performed in parallel. Fig. 21A shows four contraction target tensors, and Fig. 21B shows two contraction target tensors. In the example of Fig. 21A, the contraction unit 1 performs the contraction processing on the four contraction target tensors in parallel. In the example of Fig. 21B, the contraction unit 1 performs the contraction processing on the two contraction target tensors in parallel. The contraction processing on each contraction target tensor by the arithmetic device according to the fifth embodiment is similar to the contraction processing by the arithmetic device according to the first to fourth embodiments. The arithmetic device according to the fifth embodiment performs a multitude of contraction processing operations in parallel when carrying out the contraction processing on the multitude of contraction target tensors. In the fifth embodiment described above, the arithmetic device according to the third embodiment is configured such that a plurality of contraction target tensors are present, comprising the plurality of small tensors, and the contraction unit 1 performs the contraction processing on the plurality of contraction target tensors in parallel. Therefore, the arithmetic device according to the third embodiment can achieve a greater reduction in arithmetic processing time than the arithmetic device according to the first embodiment. The first through fifth embodiments illustrate an example where the shape of the product of the small tensors is one-dimensional, as shown in Fig. 22A. However, this is merely an example, and for the shape of the product of the small tensors, as shown in Fig. 22B, even a two-dimensional two-row form is applicable. Furthermore, for the shape of the product of the small tensors, as shown in Fig. 22C, even a two-dimensional two-column form is applicable. Moreover, for the shape of the product of the small tensors, as shown in Fig. 22D, even a form with a large number of two-dimensional rows or two-dimensional columns is applicable. If the form of the product of the small tensors is a one-dimensional form, a two-dimensional two-row form, or the like, the same path can be repeatedly taken at the time of switching, so that the factor information can be updated efficiently. For example, if an update path can be selected when updating successive sections by switching between a variety of remote operators, it is particularly advantageous to choose an update path directed toward the longer section. If the longer section consists of two rows, an update path in the direction of the rows is selected, and if the longer section consists of two columns, an update path in the direction of the columns is selected. As a result, the update information of the factor information from the previous operator can be reflected in the next operator, and a calculation with higher accuracy can be performed. Fig. 22A is an explanatory illustration showing an example where the shape of the product of the small tensors is a one-dimensional shape. Fig. 22B is an explanatory illustration showing an example where the form of the product of the small tensors is a two-dimensional two-row form. Fig. 22C is an explanatory illustration showing an example where the shape of the product of the small tensors is a two-dimensional two-column shape. Fig. 22D is an explanatory illustration showing an example where two-dimensional rows or two-dimensional columns are large. It should be noted that the form may be a small tensor product, in which forms of one series and two series are partially combined, or a small tensor product that partially has forms of three or more series. If the shape of the product of the small tensors is a two-dimensional shape, the shape of the product of the small tensors is not restricted to a two-dimensional quadrilateral, but can be, for example, a polygon, a crossing of connections, or an N-dimensional solid shape. It should be noted that free combinations of the embodiments, modifications to any components of the embodiments or omissions of any components in the embodiments are possible within the scope of the disclosure. INDUSTRIAL APPLICABILITY The present disclosure is suitable for an arithmetic apparatus and a tensor update procedure. REFERENCE MARK LIST 1: Contraction unit, 2: Decomposition unit, 3: Approximation unit, 4: Rearrangement unit, 11: Contraction circuit, 12: Decomposition circuit, 13: Approximation circuit, 14: Rearrangement circuit, 21: Main memory, 22: Processor, 31: Tensor acquisition unit, 32: Tensor representation unit, 33: Contraction processing unit
Claims
An arithmetic setup comprising: a contraction unit for representing a tensor of order L (where L is an integer equal to or greater than 2) by a product of a plurality of small tensors, wherein the plurality of tensors is a plurality of tensors, each having a smaller number of elements than a number of elements of the tensor of order L, and performing, on the plurality of small tensors, a contraction processing of incorporating factor information that exists between the plurality of small tensors. Arithmetic device according to claim 1, wherein the contraction unit performs a contraction processing on the plurality of small tensors of incorporating the factor information that exists between the plurality of small tensors and an operator for the plurality of small tensors. Arithmetic device according to claim 2, further comprising: a decomposition unit for performing decomposition processing on a contraction result by means of the contraction processing of the contraction unit, and outputting a tensor group comprising a plurality of small tensors and factor information. Arithmetic device according to claim 3, further comprising: an approximation unit for performing approximation processing of the factor information contained in the tensor group output by the decomposition unit. Arithmetic device according to claim 4, further comprising: a rearrangement unit for rearranging, for the tensor group after approximation processing by the approximation unit, neighboring factor information, which is factor information adjacent to each of the small tensors, among the factor information that differs from the factor information present between the plurality of small tensors. Arithmetic device according to claim 1, wherein the contraction unit performs a contraction processing on the plurality of small tensors of incorporating a plurality of parts of factor information that are present between the plurality of small tensors. Arithmetic device according to claim 1, wherein the contraction unit, when arithmetic processing time is prioritized over arithmetic accuracy, performs contraction processing on the plurality of small tensors by including factor information that exists between the plurality of small tensors, and when arithmetic accuracy is prioritized over arithmetic processing time, performs contraction processing on the plurality of small tensors by including all factor information that has a linking relationship with each of the small tensors. Arithmetic device according to claim 1, wherein there is a plurality of contraction target tensors which have the plurality of small tensors, and the contraction unit performs the contraction processing on the plurality of contraction target tensors in parallel. Arithmetic device according to claim 1, wherein one form of a product of the small tensors is a one-dimensional form, a two-dimensional two-row form or a two-dimensional two-column form. Tensor update procedure, comprising: by a contraction unit, representing a tensor of order L (where L is an integer equal to or greater than 2) by a product of a plurality of small tensors, wherein the plurality of tensors are each having a smaller number of elements than the number of elements of the tensor of order L, and performing, on the plurality of small tensors, a contraction processing of incorporating factor information that exists between the plurality of small tensors.
