SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.18716 · 2023

Laplacian Canonization: A Minimalist Approach to Sign and Basis Invariant Spectral Embedding

arXiv · PDF · Open in the Atlas

Code that ran

11 of 12 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; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 8 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2310.18716.json · badge: /api/ran/2310.18716.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
GeorgeMLP/basis-invariance-synthetic-experiment canonical (classifier label)
classifier basis: census
6 ran · 0 no recorded run
georgemlp/laplacian-canonization canonical (classifier label)
classifier basis: plan_row
5 ran · 1 no recorded run
FunctionStatusWhere it lives
aggregate_max Ran
ran; our contract draft was wrong, not the code
georgemlp/laplacian-canonization/layers/pna_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from changminwu/expandergnn, is pointer only (licence: NONE) · get_code("0cb93154c335108f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from changminwu/expandergnn, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

aggregate_mean Ran
ran; our contract draft was wrong, not the code
georgemlp/laplacian-canonization/layers/pna_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from changminwu/expandergnn, is pointer only (licence: NONE) · get_code("b19d1fdc25bad3bd")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from changminwu/expandergnn, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

aggregate_min Ran
ran; our contract draft was wrong, not the code
georgemlp/laplacian-canonization/layers/pna_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from changminwu/expandergnn, is pointer only (licence: NONE) · get_code("ff879af48e34176e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from changminwu/expandergnn, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

eval Ran
ran, honoured the contract we drafted
GeorgeMLP/basis-invariance-synthetic-experiment/synthetic.py
code served (permissive licence) · get_code("a8de1fa7bc9aaab6")
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 float, ndim 0, dtype family float, 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Build a minimal model that the function uses
class SimpleClassifier(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)  # 4 input dims, 3 output classes
    
    def forward(self, x):
        return self.linear(x)

# Create model
model = SimpleClassifier()

# Device (CPU only)
device = torch.device('cpu')

# Create a simple data loader - list of (x, y) tuples
# Each batch: x is (batch_size=2, features=4), y is (batch_size=2,) with class indices
loader = [
    (torch.randn(2, 4), torch.randint(0, 3, (2,))),
    (torch.randn(2, 4), torch.randint(0, 3, (2,))),
]

ARGS = {
    'model': model,
    'device': device,
    'loader': loader,
}
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 float, ndim 0, dtype family float, 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
find_complementary_space Ran
ran; our contract draft was wrong, not the code
GeorgeMLP/basis-invariance-synthetic-experiment/utils.py
code served (permissive licence) · get_code("2a7ec17e69572d30")
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 Tensor, ndim 2, dtype family float, shape (5, 2) 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 torch
from torch import Tensor

torch.manual_seed(0)

# Create U: a tensor of shape [n, d] where n=5, d=3
# This should be a full-rank matrix with linearly independent columns
U = torch.tensor([
    [1.0, 0.0, 0.0],
    [0.0, 1.0, 0.0],
    [0.0, 0.0, 1.0],
    [0.0, 0.0, 0.0],
    [0.0, 0.0, 0.0]
], dtype=torch.float32)

# Create u_span: a tensor of shape [n, s] where n=5, s=1
# This should be a subset of the column space of U
u_span = torch.tensor([
    [1.0],
    [0.0],
    [0.0],
    [0.0],
    [0.0]
], dtype=torch.float32)

ARGS = {
    "U": U,
    "u_span": u_span
}
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 Tensor, ndim 2, dtype family float, shape (5, 2) — shape (5, 2) 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
imp_exp_attn Ran
ran; our contract draft was wrong, not the code
georgemlp/laplacian-canonization/layers/graphit_gt_layer.py
code served (permissive licence) · get_code("700de849477f93ce")
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
import torch.nn as nn

torch.manual_seed(0)

# The function creates a closure that accesses edges.data[implicit_attn] and edges.data[explicit_edge]
# These are string keys used to access edge data in a DGL-like edge batch object
# We need to construct a mock edge batch object that has a .data dict

class MockEdgeBatch:
    def __init__(self):
        # Create mock data with tensors
        self.data = {
            'attn': torch.randn(2, 4),
            'edge_feat': torch.randn(2, 4)
        }

# Create the arguments
implicit_attn = 'attn'
explicit_edge = 'edge_feat'

ARGS = {
    'implicit_attn': implicit_attn,
    'explicit_edge': explicit_edge
}
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
orthogonalize Ran
ran; our contract draft was wrong, not the code
GeorgeMLP/basis-invariance-synthetic-experiment/utils.py
code served (permissive licence) · get_code("f8220a5b40f8d459")
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 Tensor, ndim 2, dtype family float, shape (5, 3) 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 torch

torch.manual_seed(0)

# Create a tensor of shape [n, d] where n > d
# Using shape [5, 3] as shown in the docstring example
# n=5 vectors, d=3 dimensions
U = torch.randn(5, 3)

# Normalize the columns to make them approximately orthogonal initially
U = torch.nn.functional.normalize(U, dim=0)

ARGS = {
    "U": U
}
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 Tensor, ndim 2, dtype family float, shape (5, 3) — shape (5, 3) 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
scaling Ran
ran; our contract draft was wrong, not the code
georgemlp/laplacian-canonization/layers/graphit_gt_layer.py
code served (permissive licence) · get_code("a3fb87a259b15eae")
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
import torch.nn as nn

torch.manual_seed(0)

# The function `scaling` returns a function that expects an object with a `data` attribute
# The `data` attribute should be a dict-like object with the field specified
# We need to create an object that mimics what DGL uses (an edge batch object)

class MockEdges:
    def __init__(self):
        self.data = {
            'features': torch.tensor([[1.0, 2.0, 3.0, 4.0],
                                      [5.0, 6.0, 7.0, 8.0]])
        }

ARGS = {
    'field': 'features',
    'scale_constant': 2.0
}
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
train Ran
ran, honoured the contract we drafted
GeorgeMLP/basis-invariance-synthetic-experiment/synthetic.py
code served (permissive licence) · get_code("6b32104b7d171641")
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 float, ndim 0, dtype family float, 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Define a minimal model
class TinyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create the model
model = TinyModel()

# Define device (CPU only)
device = torch.device('cpu')

# Create a data loader as a list of (x, y) tuples
# Batch size 2, input dim 4, output dim 3
loader = [
    (torch.randn(2, 4), torch.randn(2, 3)),
    (torch.randn(2, 4), torch.randn(2, 3))
]

# Create optimizer
optimizer = torch.optim.SGD(model.parameters(), lr=0.01)

# Create criterion
criterion = nn.MSELoss()

ARGS = {
    'model': model,
    'device': device,
    'loader': loader,
    'optimizer': optimizer,
    'criterion': criterion
}
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 float, ndim 0, dtype family float, 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
unique_basis Ran
ran; our contract draft was wrong, not the code
GeorgeMLP/basis-invariance-synthetic-experiment/utils.py
code served (permissive licence) · get_code("2e17b5f232883936")
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 Tensor, ndim 2, dtype family float, shape (5, 3) 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 torch
import numpy as np

torch.manual_seed(0)

# Create a small tensor of shape [n, d] where n > d
# U_i should be a tensor of eigenvectors (each column is an eigenvector)
# The function expects U_i to have linearly independent columns
n = 5
d = 3

# Create a random matrix and use QR decomposition to get orthonormal columns
U_random = torch.randn(n, d)
U_i, _ = torch.linalg.qr(U_random)

ARGS = {
    "U_i": U_i
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (5, 3) — shape (5, 3) 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
validate Ran
ran, honoured the contract we drafted
GeorgeMLP/basis-invariance-synthetic-experiment/synthetic.py
code served (permissive licence) · get_code("2f90ede6b1995413")
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 float, ndim 0, dtype family float, 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Define a minimal model that works with the function
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Define a minimal criterion
criterion = nn.MSELoss()

# Define device
device = 'cpu'

# Define model
model = SimpleModel()
model.to(device)

# Create a minimal data loader: list of (x, y) batches
# Each batch contains input tensor of shape (2, 4) and target tensor of shape (2, 3)
loader = [
    (torch.randn(2, 4), torch.randn(2, 3)),
    (torch.randn(2, 4), torch.randn(2, 3)),
]

ARGS = {
    'model': model,
    'device': device,
    'loader': loader,
    'criterion': criterion,
}
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 float, ndim 0, dtype family float, 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
src_dot_dst Not yet run
unverified (harvested, no recorded run)
georgemlp/laplacian-canonization/layers/graphit_gt_layer.py
code served (permissive licence) · get_code("9408c2ca6e799410")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 3 later) and 6 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
scaling 6 other papers
4 dated earlier, 2 later
2110.07875 (2021-10)
Graph Neural Networks with Learnable Structural and Positional Representations
2201.09332 (2022-01)
How Expressive are Transformers in Spectral Domain for Graphs?
2308.08173 (2023-08)
Expressivity of Graph Neural Networks Through the Lens of Adversarial Robustness
and 3 more not named here
src_dot_dst 6 other papers
4 dated earlier, 2 later
2110.07875 (2021-10)
Graph Neural Networks with Learnable Structural and Positional Representations
2201.09332 (2022-01)
How Expressive are Transformers in Spectral Domain for Graphs?
2308.08173 (2023-08)
Expressivity of Graph Neural Networks Through the Lens of Adversarial Robustness
and 3 more not named here
imp_exp_attn 5 other papers
4 dated earlier, 1 later
2110.07875 (2021-10)
Graph Neural Networks with Learnable Structural and Positional Representations
2201.09332 (2022-01)
How Expressive are Transformers in Spectral Domain for Graphs?
2308.08173 (2023-08)
Expressivity of Graph Neural Networks Through the Lens of Adversarial Robustness
and 2 more not named here
aggregate_max 2 other papers
2 dated earlier
2004.05718 (2020-04)
Principal Neighbourhood Aggregation for Graph Nets
2110.07875 (2021-10)
Graph Neural Networks with Learnable Structural and Positional Representations
aggregate_mean 2 other papers
2 dated earlier
2004.05718 (2020-04)
Principal Neighbourhood Aggregation for Graph Nets
2110.07875 (2021-10)
Graph Neural Networks with Learnable Structural and Positional Representations
aggregate_min 2 other papers
2 dated earlier
2004.05718 (2020-04)
Principal Neighbourhood Aggregation for Graph Nets
2110.07875 (2021-10)
Graph Neural Networks with Learnable Structural and Positional Representations

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-23.

Repositories linked to this paper

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

Abstract

Spectral embedding is a powerful graph embedding technique that has received a lot of attention recently due to its effectiveness on Graph Transformers. However, from a theoretical perspective, the universal expressive power of spectral embedding comes at the price of losing two important invariance properties of graphs, sign and basis invariance, which also limits its effectiveness on graph data. To remedy this issue, many previous methods developed costly approaches to learn new invariants and suffer from high computation complexity. In this work, we explore a minimal approach that resolves the ambiguity issues by directly finding canonical directions for the eigenvectors, named Laplacian Canonization (LC). As a pure pre-processing method, LC is light-weighted and can be applied to any existing GNNs. We provide a thorough investigation, from theory to algorithm, on this approach, and discover an efficient algorithm named Maximal Axis Projection (MAP) that works for both sign and basis invariance and successfully canonizes more than 90% of all eigenvectors. Experiments on real-world benchmark datasets like ZINC, MOLTOX21, and MOLPCBA show that MAP consistently outperforms existing methods while bringing minimal computation overhead. Code is available at https://github.com/PKU-ML/LaplacianCanonization.

For agents

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

get_harvested_code_for_paper("2310.18716")
get_code_for_paper("2310.18716")
have("2310.18716")

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

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

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

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

Connect an agent — have() is free.