SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2209.12332 · 2022

On the Optimal Linear Contraction Order of Tree Tensor Networks, and Beyond

arXiv · PDF · Open in the Atlas

Code that ran

12 of 14 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 9 have no contract verdict; 3 failures of our instrument; 2 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2209.12332.json · badge: /api/ran/2209.12332.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
stoianmihail/netzwerk canonical (classifier label)
classifier basis not recorded on the link
12 ran · 2 no recorded run
FunctionStatusWhere it lives
fetch_abs_path Ran
ran on a synthesized input
stoianmihail/netzwerk/src/netzwerk/wrapper.py
code served (permissive licence) · get_code("891555ff681d4053")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile

# Create a temporary directory to simulate the netzwerk module location
temp_dir = tempfile.mkdtemp()

# Create a simple relative path for testing
rel_path = "subdir/model.pt"

# The function takes a relative path string
ARGS = {
    "rel_path": rel_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
general_st Ran
ran on a synthesized input
stoianmihail/netzwerk/src/netzwerk/spanning_tree.py
code served (permissive licence) · get_code("448d0f07e218295b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# PYTHON SETUP CODE for general_st function

ARGS = {
    "n": 4,
    "m": 5,
    "edges": [
        (0, 1, 10),
        (1, 2, 20),
        (2, 3, 30),
        (0, 3, 40),
        (1, 3, 50),
    ]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_files Ran
ran on a synthesized input
stoianmihail/netzwerk/src/util.py
code served (permissive licence) · get_code("655afd2b175f5391")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import os

# Create a temporary directory with some test files
temp_dir = tempfile.mkdtemp()
test_file_1 = os.path.join(temp_dir, "file1.txt")
test_file_2 = os.path.join(temp_dir, "file2.py")
test_file_3 = os.path.join(temp_dir, "file3.dat")

# Create the test files
open(test_file_1, 'w').close()
open(test_file_2, 'w').close()
open(test_file_3, 'w').close()

# Also create a subdirectory to ensure it's not included
os.makedirs(os.path.join(temp_dir, "subdir"))

ARGS = {
    "path": temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
min_degree_spanning_tree Ran
ran on a synthesized input
stoianmihail/netzwerk/src/netzwerk/spanning_tree.py
code served (permissive licence) · get_code("1c5eef2d84b8d817")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# Analyze the function to understand what it needs
# min_degree_spanning_tree(n, m, edges)
# n: number of nodes (int)
# m: number of edges (int)
# edges: list of m tuples, each (u, v, c) where u, v are node indices < n

# The function finds a minimum degree spanning tree
# Let's create a simple example with 4 nodes and 5 edges

n = 4
m = 5

# Create edges: each edge is (u, v, cost)
# We need enough edges to form a spanning tree and explore alternatives
edges = [
    (0, 1, 1),  # edge 0
    (1, 2, 2),  # edge 1
    (2, 3, 3),  # edge 2
    (0, 2, 4),  # edge 3
    (1, 3, 5),  # edge 4
]

ARGS = {
    "n": n,
    "m": m,
    "edges": edges,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_line Ran
ran on a synthesized input
stoianmihail/netzwerk/src/util.py
code served (permissive licence) · get_code("b77562811e12351b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

# Analyze parse_line function:
# - Takes 'line' parameter
# - Calls line.strip() -> returns string
# - Calls .split(' ') on stripped string -> returns list of strings
# - Iterates over the list and converts each element to int
# - Returns list of ints

# Construct a valid string argument with space-separated integers
line = "1 2 3 4 5"

ARGS = {
    "line": line
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
random_int Ran
ran on a synthesized input
stoianmihail/netzwerk/gen.py
code served (permissive licence) · get_code("2c7f89a171977b2c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import random

ARGS = {
    "lower": 1,
    "upper": 10
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
random_leg_dim Ran
ran on a synthesized input
stoianmihail/netzwerk/gen.py
code served (permissive licence) · get_code("32719c8f68566aa3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import random

def random_int(lower, upper):
    return random.randint(lower, upper)

def random_leg_dim(f):
    c = random_int(1, 100)
    if c <= 50:
        return random_int(f, f ** 2)
    elif c <= 90:
        return random_int(f ** 2, f ** 3)
    return random_int(f ** 3, f ** 4)

ARGS = {
    "f": 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
read_file Ran
ran on a synthesized input
stoianmihail/netzwerk/src/netzwerk/spanning_tree.py
code served (permissive licence) · get_code("0e877c22a3d08770")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import os

# Create a temporary file with test data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_filename = temp_file.name

# Write test data: first line has n=3, m=2 (3 nodes, 2 edges)
# Then 2 edges with format: u v cost
temp_file.write("3 2\n")
temp_file.write("0 1 5\n")
temp_file.write("1 2 10\n")
temp_file.close()

ARGS = {
    'filename': temp_filename
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
register_vcs_handler Ran
ran; our contract draft was wrong, not the code
stoianmihail/netzwerk/src/netzwerk/_version.py
code served (permissive licence) · get_code("c55cafde08716f01")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# Global HANDLERS dict that the function uses
HANDLERS = {}

# Define arguments for register_vcs_handler
ARGS = {
    "vcs": "git",
    "method": "commit"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
register_vcs_handler Ran
ran on a synthesized input
stoianmihail/netzwerk/src/netzwerk/versioneer.py
code served (permissive licence) · get_code("9dc618d67058e3e6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

# Global HANDLERS dict that the function uses
HANDLERS = {}

# Build arguments for register_vcs_handler(vcs, method)
# The function takes a vcs identifier and a method name
# It returns a decorator that stores functions in HANDLERS[vcs][method]

ARGS = {
    "vcs": "git",
    "method": "clone"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
run_command Ran
ran; our contract draft was wrong, not the code
stoianmihail/netzwerk/src/netzwerk/_version.py
code served (permissive licence) · get_code("dbb37355631dabcf")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import subprocess
import sys

ARGS = {
    "commands": ["echo"],
    "args": ["hello", "world"],
    "cwd": None,
    "verbose": False,
    "hide_stderr": False,
    "env": None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
versions_from_parentdir Ran
ran; our contract draft was wrong, not the code
stoianmihail/netzwerk/src/netzwerk/_version.py
code served (permissive licence) · get_code("5032e3b81c0fffb3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile

ARGS = {
    'parentdir_prefix': 'myproject-',
    'root': '/tmp/myproject-1.2.3/src',
    'verbose': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_config_from_root Not yet run
unverified (harvested, no recorded run)
stoianmihail/netzwerk/src/netzwerk/versioneer.py
code served (permissive licence) · get_code("d4c10b96da92e57d")
How it ran

no invocation recorded.

parse_filename Not yet run
unverified (harvested, no recorded run)
stoianmihail/netzwerk/src/util.py
code served (permissive licence) · get_code("43bbe34d2353f122")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 3 later) and 10 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
register_vcs_handler 26 other papers
18 dated earlier, 8 later
1806.00550 (2018-06)
A Swiss Army Infinitesimal Jackknife
1806.03146 (2018-06)
Neural Message Passing with Edge Updates for Predicting Properties of Molecules and Materials
1806.03720 (2018-06)
Stochastic seismic waveform inversion using generative adversarial networks as a geological prior
and 23 more not named here
versions_from_parentdir 9 other papers
5 dated earlier, 4 later
1806.03146 (2018-06)
Neural Message Passing with Edge Updates for Predicting Properties of Molecules and Materials
2104.08691 (2021-04)
The Power of Scale for Parameter-Efficient Prompt Tuning
2204.04516 (2022-04)
Uncertainty-Informed Deep Learning Models Enable High-Confidence Predictions for Digital Histopathology
and 6 more not named here
run_command 7 other papers
5 dated earlier, 2 later
1806.03146 (2018-06)
Neural Message Passing with Edge Updates for Predicting Properties of Molecules and Materials
2104.08691 (2021-04)
The Power of Scale for Parameter-Efficient Prompt Tuning
2204.04516 (2022-04)
Uncertainty-Informed Deep Learning Models Enable High-Confidence Predictions for Digital Histopathology
and 4 more not named here
register_vcs_handler 2 other papers
2 dated earlier
2104.08691 (2021-04)
The Power of Scale for Parameter-Efficient Prompt Tuning
2205.10242 (2022-05)
EXODUS: Stable and Efficient Training of Spiking Neural Networks

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

The contraction cost of a tensor network depends on the contraction order. However, the optimal contraction ordering problem is known to be NP-hard. We show that the linear contraction ordering problem for tree tensor networks admits a polynomial-time algorithm, by drawing connections to database join ordering. The result relies on the adjacent sequence interchange property of the contraction cost, which enables a global decision of the contraction order based on local comparisons. Based on that, we specify a modified version of the IKKBZ database join ordering algorithm to find the optimal tree tensor network linear contraction order. Finally, we extend our algorithm as a heuristic to general contraction orders and arbitrary tensor network topologies.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2209.12332")
get_code_for_paper("2209.12332")
have("2209.12332")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2209.12332.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2209.12332.svg)](https://syntology.ai/paper/2209.12332)

Connect an agent — have() is free.