SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.01552 · ICLR · 2024

Tensor learning with orthogonal, Lorentz, and symplectic symmetries

Soledad Villar, Wilson Gregory, Josué Tonelli-Cueto, Nicholas Marshall, Andrew Lee

arXiv · PDF · Open in the Atlas

Code that ran

8 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 1 violated it and 1 has no contract verdict; 3 failures of our instrument; 3 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/2406.01552.json · badge: /api/ran/2406.01552.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
wilsongregory/tensorpolynomials canonical (classifier label)
classifier basis: classifier_2025
8 ran · 3 no recorded run
FunctionStatusWhere it lives
GeneralLinear Ran
ran on a synthesized input · constructed an object; no result was computed
wilsongregory/tensorpolynomials/src/tensorpolynomials/ml.py
code served (permissive licence) · get_code("a2b25394881d78d2")
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 an instance of its own class, GeneralLinear: the run constructed the object and did not call it, so no result was computed. 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 jax
import jax.numpy as jnp
import jax.random as random
import equinox as eqx
import math

# Create a random key for JAX
key = random.PRNGKey(0)

# Create a simple basis array
# basis shape: (basis_size, feature_dim1, feature_dim2, ...)
# For simplicity, let's use a 2D basis: (basis_size, in_dim)
basis = jnp.ones((3, 4))  # 3 basis vectors, each of dimension 4

# Create a bias_basis array
# bias_basis shape: (bias_basis_size, out_dim1, out_dim2, ...)
bias_basis = jnp.ones((2, 5))  # 2 basis vectors for bias, each of dimension 5

# Parameters for GeneralLinear
in_features = 4
out_features = 5
use_bias = True

# Split key for initialization
key1, key2 = random.split(key)

ARGS = {
    'basis': basis,
    'in_features': in_features,
    'out_features': out_features,
    'use_bias': use_bias,
    'bias_basis': bias_basis,
    'key': key1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
equinox, jax, jaxtyping, typing_extensions — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type GeneralLinear — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a GeneralLinear 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_patterns Ran
ran, honoured the contract we drafted
wilsongregory/tensorpolynomials/src/tensorpolynomials/ml.py
code served (permissive licence) · get_code("2dc0602051429b2b")
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 2, 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 numpy as np
import itertools as it

def partitions(n, k, min_elem=0):
    """
    From: https://stackoverflow.com/questions/28965734/general-bars-and-stars
    args:
        n (int): number of items to partition
        k (int): number of partitions
        min_elem (int): minimum number of elements per partition
    """
    n = n - min_elem * k
    assert n > -1
    for c in it.combinations(range(n + k - 1), k - 1):
        yield [b - a - 1 + min_elem for a, b in zip((-1,) + c, c + (n + k - 1,))]

def reorder_pattern(pattern):
    """
    Reorder a pattern so that the numbers are in order, e.g. (1,0,0,1) -> (0,1,1,0).
    However, (1,0,0,2) is a valid order because only the singletons can be swapped.
    args:
        partition (tuple of ints): the size of the parititions
        pattern (np.array): the elements of the pattern, as a numpy array
    """
    k = len(pattern)
    _, partition = np.unique(pattern, return_counts=True)
    new_pattern = np.copy(pattern)
    for j in range(1, k // 2 + 1):
        if np.sum(partition == j) > 1:
            idxs = np.arange(len(partition))[partition == j]
            ord = {}
            i = 0
            for char in pattern:
                if char in idxs and char not in ord:
                    ord[char] = idxs[i]
                    i += 1
            for k, v in ord.items():
                new_pattern[pattern == k] = v
    return new_pattern

def get_patterns(k, n):
    """
    Get the possible patterns. Returns list of tuples of patterns.
    args:
        k (int): tensor order
        n (int):
    """
    patterns = []
    for i in range(1, min(k, n) + 1):
        for p in partitions(k, i, 1):
            if sorted(p, reverse=True) != p:
                continue
            chars = it.chain.from_iterable([(char,) * char_count for char, char_count in enumerate(p)])
            arr = np.unique(np.array(list(it.permutations(chars))), axis=0)
            valid_rows = list((True,) * len(arr))
            for row_i in range(len(arr)):
                if np.any(reorder_pattern(arr[row_i]) != arr[row_i]):
                    valid_rows[row_i] = False
            patterns.append([tuple(row) for row in arr[valid_rows]])
    return list(it.chain.from_iterable(patterns))

ARGS = {
    "k": 4,
    "n": 3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, 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
get_symmetric_patterns Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
wilsongregory/tensorpolynomials/src/tensorpolynomials/ml.py
code served (permissive licence) · get_code("c4521f9abe35a923")
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 numpy as np

# The function get_symmetric_patterns takes:
# 1. patterns: list of tuples - possible patterns
# 2. symmetric_axes: tuple of tuples of ints - symmetric axes that must be pairs

# Looking at the function body:
# - patterns is iterated over, each element is a pattern (tuple)
# - pattern is indexed with integers (pattern[a], pattern[b])
# - symmetric_axes is iterated to get pairs (a, b)
# - patterns are converted to tuples and used as dict keys

# Constructing minimal valid arguments:
patterns = [
    (0, 1, 0, 1),  # symmetric pattern
    (0, 1, 2, 1),  # pattern with axes 1 and 3 that could be symmetric
    (0, 0, 1, 1),  # another symmetric pattern
    (1, 0, 1, 0),  # pattern with axes that need checking
]

symmetric_axes = (
    (0, 3),  # axis 0 and 3 should be symmetric
    (1, 2),  # axis 1 and 2 should be symmetric
)

ARGS = {
    "patterns": patterns,
    "symmetric_axes": symmetric_axes,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
map_and_loss Ran
ran; our contract draft was wrong, not the code
wilsongregory/tensorpolynomials/scripts/sos_spectral.py
code served (permissive licence) · get_code("2dad7d3e9ac96f86")
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) 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 jax
import jax.numpy as jnp

# Define a simple functional model that takes a single input and returns predictions
def simple_model(x):
    """
    A simple functional model that processes a single input.
    x has shape (n, d) where n=3, d=4
    Returns output of shape (n,) for the sparse vector prediction
    """
    # Simple linear transformation: sum across features
    return jnp.sum(x, axis=1)

# Create input data
batch_size = 2
n = 3  # sequence/feature dimension
d = 4  # feature dimension

x = jnp.ones((batch_size, n, d))
y = jnp.array([[1.0, 0.0, 0.0],
               [0.0, 1.0, 0.0]])  # sparse vectors, shape (batch, n)

# aux_data can be any auxiliary information
aux_data = {"metadata": "test", "version": 1}

ARGS = {
    "model": simple_model,
    "x": x,
    "y": y,
    "aux_data": aux_data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
jax — 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
partitions Ran
ran; our contract draft was wrong, not the code
wilsongregory/tensorpolynomials/src/tensorpolynomials/ml.py
code served (permissive licence) · get_code("abe32879e73b871a")
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 generator. 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 itertools as it

ARGS = {
    "n": 10,
    "k": 3,
    "min_elem": 1,
}
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 generator — a generator output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a generator 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
reorder_pattern Ran
ran, violated the contract we drafted
wilsongregory/tensorpolynomials/src/tensorpolynomials/ml.py
code served (permissive licence) · get_code("c07cf93b55480f2d")
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 ndarray, ndim 1, dtype family int, shape (4,) 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 numpy as np

# Create a simple test pattern as a numpy array
# The function takes a pattern (tuple or array of ints) and reorders it
# based on partition counts

# Example: (1, 0, 0, 1) - has two elements with count 2, and two with count 1
# The function reorders so singleton partitions are swapped appropriately
pattern = np.array([1, 0, 0, 1], dtype=np.int32)

ARGS = {
    "pattern": pattern
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family int, shape (4,) — shape (4,) 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
sos_method Ran
ran, honoured the contract we drafted
wilsongregory/tensorpolynomials/src/tensorpolynomials/models.py
code served (permissive licence) · get_code("c64048d649037766")
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) and returned ArrayImpl, ndim 1, dtype family float, shape (4,) 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 jax
import jax.numpy as jnp

# Create a small test array
# S should be shape (n, d) where n is ambient dimension, d is number of vectors
n = 4  # ambient dimension
d = 3  # number of vectors

# Create a random array with shape (n, d)
key = jax.random.PRNGKey(0)
S = jax.random.normal(key, shape=(n, d))

ARGS = {
    "S": S
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 1, dtype family float, shape (4,) — shape (4,) 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
sos_methodII Ran
ran, honoured the contract we drafted
wilsongregory/tensorpolynomials/src/tensorpolynomials/models.py
code served (permissive licence) · get_code("b14d386d5c18e44c")
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) and returned ArrayImpl, ndim 1, dtype family float, shape (4,) 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 jax
import jax.numpy as jnp

# Set seed for reproducibility
jax.config.update('jax_platform_name', 'cpu')

# Create a small test array with shape (N, n)
# N = 4 (ambient dimension), n = 3 (number of vectors)
S = jnp.array([
    [1.0, 2.0, 3.0],
    [4.0, 5.0, 6.0],
    [7.0, 8.0, 9.0],
    [10.0, 11.0, 12.0]
], dtype=jnp.float32)

ARGS = {
    "S": S
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 1, dtype family float, shape (4,) — shape (4,) 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
PermEquivariantLayer Not yet run
unverified (harvested, no recorded run)
wilsongregory/tensorpolynomials/src/tensorpolynomials/ml.py
code served (permissive licence) · get_code("9573c20df0f9b5e0")
How it ran

no invocation recorded.

PermInvariantTensor Not yet run
unverified (harvested, no recorded run)
wilsongregory/tensorpolynomials/src/tensorpolynomials/ml.py
code served (permissive licence) · get_code("1bad12d82c05605f")
How it ran

no invocation recorded.

tensor_from_pattern Not yet run
unverified (harvested, no recorded run)
wilsongregory/tensorpolynomials/src/tensorpolynomials/ml.py
code served (permissive licence) · get_code("5acafa1378b5dea8")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 11 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.

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

Tensors are a fundamental data structure for many scientific contexts, such as time series analysis, materials science, and physics, among many others. Improving our ability to produce and handle tensors is essential to efficiently address problems in these domains. In this paper, we show how to exploit the underlying symmetries of functions that map tensors to tensors. More concretely, we develop universally expressive equivariant machine learning architectures on tensors that exploit that, in many cases, these tensor functions are equivariant with respect to the diagonal action of the orthogonal, Lorentz, and/or symplectic groups. We showcase our results on three problems coming from material science, theoretical computer science, and time series analysis. For time series, we combine our method with the increasingly popular path signatures approach, which is also invariant with respect to reparameterizations. Our numerical experiments show that our equivariant models perform better than corresponding non-equivariant baselines.

For agents

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

get_harvested_code_for_paper("2406.01552")
get_code_for_paper("2406.01552")
have("2406.01552")

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

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

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

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

Connect an agent — have() is free.