# US 2021/0334313 A1 · Methods and systems for tensor network contraction based on local optimization of contraction tree

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0334313 A1
- Document ID: US20210334313A1
- Status: Published application
- Kind: A1
- Application number: 17/239,071
- Filed: 2021-04-23
- Published: 2021-10-28
- Earliest claimed: 2020-04-24
- Assignees: Alibaba Group Holding Limited
- Applicants: Alibaba Group Holding Limited
- Inventors: Jiachen Huang; Jianxin Chen
- Web page: https://patentgrep.com/patent/US20210334313A1

## CPC

- G06F 16/9024: {Graphs; Linked lists (G06F16/9027 takes precedence)}
- G06F 17/16: Matrix or vector computation {, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization (matrix transposition G06F7/78)}
- G06N 5/01: Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
- G06N 10/20: Models of quantum computing, e.g. quantum circuits or universal quantum computers
- G06N 10/80: Quantum programming, e.g. interfaces, languages or software-development kits for creating or handling programs capable of running on quantum computers; Platforms for simulating or accessing quantum computers, e.g. cloud-based quantum computing
- G06T 1/20: Processor architectures; Processor configuration, e.g. pipelining
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

Methods and systems for tensor network contraction are provided. A method implemented by a computing host comprises obtaining a contraction tree associated with a tensor network, wherein a plurality of vertices and edges of the contraction tree correspond to a set of tensor nodes and indices of the tensor network, respectively; iteratively performing operations until a termination condition is satisfied, the operations including selecting a sub-graph of the contraction tree; replacing the sub-graph with a local optimal sub-graph; and obtaining an optimized contraction tree including the local optimal sub-graph; and outputting the optimized contraction tree.

## Claims

### Claim 1

A method implemented by a computing host, the method comprising:
obtaining a contraction tree associated with a tensor network, wherein a plurality of vertices and edges of the contraction tree correspond to a set of tensor nodes and indices of the tensor network, respectively;
iteratively performing operations until a termination condition is satisfied, the operations including:
selecting a sub-graph of the contraction tree;
replacing the sub-graph with a local optimal sub-graph; and
obtaining an optimized contraction tree including the local optimal sub-graph; and
outputting the optimized contraction tree.

### Claim 2 (depends on 1)

The method of claim 1, wherein replacing the sub-graph with a local optimal sub-graph further comprises:
reconstructing the sub-graph;
computing a contraction cost of the reconstructed sub-graph;
determining that the contraction cost of the reconstructed sub-graph is less than a preset threshold; and
setting the reconstructed sub-graph as the local optimal sub-graph.

### Claim 3 (depends on 2)

The method of claim 2, wherein the contraction cost of the reconstructed sub-graph is determined based at least in part on a number of nodes in the reconstructed sub-graph and the indices associated with the number of nodes.

### Claim 4 (depends on 2)

The method of claim 2, wherein the contraction cost of the reconstructed sub-graph includes at least one of a computation cost or a storage cost.

### Claim 5 (depends on 1)

The method of claim 1, wherein the termination condition includes at least one of a number of reconstruction iterations, an individual contraction cost of the sub-graph, or a total contraction cost of the contraction tree.

### Claim 6 (depends on 5)

The method of claim 5, wherein the total contraction cost of the contraction tree is determined based on the individual contraction cost associated with the sub-graph, the individual contraction cost indicating a complexity degree of a contraction computation.

### Claim 7 (depends on 6)

The method of claim 6, wherein the complexity degree of the contraction computation includes at least one of a temporal complexity degree or a spatial complexity degree.

### Claim 8 (depends on 5)

The method of claim 5, the termination condition being met indicates at least one of the number of reconstruction iterations satisfies a preset threshold, or
the total contraction cost of the contraction tree is less than a preset bound.

### Claim 9 (depends on 1)

The method of claim 1, wherein the sub-graph is a randomly selected connected sub-graph.

### Claim 10

A system comprising:
one or more processors, and
memory communicatively coupled to the one or more processors, the memory storing computer-executable modules executable by the one or more processors that, when executed by the one or more processors, perform actions including:
obtaining a contraction tree associated with a tensor network, wherein a plurality of vertices and edges of the contraction tree correspond to a set of tensor nodes and indices of the tensor network, respectively;
iteratively performing operations until a termination condition is satisfied, the operations including:
selecting a sub-graph of the contraction tree;
replacing the sub-graph with a local optimal sub-graph; and
obtaining an optimized contraction tree including the local optimal sub-graph; and
outputting the optimized contraction tree.

### Claim 11 (depends on 10)

The system of claim 10, wherein replacing the sub-graph with a local optimal sub-graph further comprises:
reconstructing the sub-graph;
computing a contraction cost of the reconstructed sub-graph;
determining that the contraction cost of the reconstructed sub-graph is less than a preset threshold; and
setting the reconstructed sub-graph as the local optimal sub-graph.

### Claim 12 (depends on 11)

The system of claim 11, wherein the contraction cost of the reconstructed sub-graph includes at least one of a computation cost or a storage cost.

### Claim 13 (depends on 10)

The system of claim 10, wherein the termination condition includes at least one of a number of reconstruction iterations, an individual contraction cost of the sub-graph, or a total contraction cost of the contraction tree.

### Claim 14 (depends on 13)

The system of claim 13, wherein the total contraction cost of the contraction tree is determined based on the individual contraction cost associated with the sub-graph, the individual contraction cost indicating a complexity degree of a contraction computation.

### Claim 15 (depends on 13)

The system of claim 13, the termination condition being met indicates at least one of the number of reconstruction iterations satisfies a preset threshold, or
the total contraction cost of the contraction tree is less than a preset bound.

### Claim 16 (depends on 10)

The system of claim 10, wherein the sub-graph is a randomly selected connected sub-graph.

### Claim 17

A computer-readable storage medium storing computer-readable instructions executable by one or more processors of a video compression system, that when executed by the one or more processors, cause the one or more processors to perform actions comprising:
obtaining a contraction tree associated with a tensor network, wherein a plurality of vertices and edges of the contraction tree correspond to a set of tensor nodes and indices of the tensor network, respectively;
iteratively performing operations until a termination condition is satisfied, the operations including:
selecting a sub-graph of the contraction tree;
replacing the sub-graph with a local optimal sub-graph; and
obtaining an optimized contraction tree including the local optimal sub-graph; and
outputting the optimized contraction tree.

### Claim 18 (depends on 17)

The computer-readable storage medium of claim 17, wherein the actions further comprise:
reconstructing the sub-graph;
computing a contraction cost of the reconstructed sub-graph;
determining that the contraction cost of the reconstructed sub-graph is less than a preset threshold; and
setting the reconstructed sub-graph as the local optimal sub-graph.

### Claim 19 (depends on 18)

The computer-readable storage medium of claim 18, wherein the contraction cost of the reconstructed sub-graph includes at least one of a computation cost or a storage cost.

### Claim 20 (depends on 17)

The computer-readable storage medium of claim 17, wherein the termination condition includes at least one of a number of reconstruction iterations, an individual contraction cost of the sub-graph, or a total contraction cost of the contraction tree.
