SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2606.27783 · 2026

CANNs: A Toolkit for Research on Continuous Attractor Neural Networks

Si Wu, Sichao He, Yuling Wu, Aiersi Tuerhong, Shangjun She, Tianhao Chu, Junfeng Zuo

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 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; 3 failures of our instrument; 0 no recorded run), measured 2026-11-23; 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/2606.27783.json · badge: /api/ran/2606.27783.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
Routhleck/canns-lib canonical (classifier label)
classifier basis: census
6 ran · 0 no recorded run
FunctionStatusWhere it lives
aggregate Ran
ran; our contract draft was wrong, not the code
Routhleck/canns-lib/benchmarks/ripser/analysis_results.py
code served (permissive licence) · get_code("419b2fa83115ff7a")
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 DataFrame. 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 pandas as pd
import numpy as np

# Create a sample DataFrame that matches the expected structure
data = {
    'dataset': ['data1', 'data1', 'data2', 'data2'],
    'description': ['desc_a', 'desc_a', 'desc_b', 'desc_b'],
    'category': ['cat1', 'cat1', 'cat2', 'cat2'],
    'n_points': [100, 100, 200, 200],
    'dimension': [10, 10, 20, 20],
    'maxdim': [5, 5, 10, 10],
    'threshold': [0.5, 0.5, 0.6, 0.6],
    'canns_time': [1.2, 1.3, 2.1, 2.2],
    'canns_rss_peak': [512, 520, 1024, 1030],
    'orig_time': [5.0, 5.1, 10.2, 10.3],
    'orig_rss_peak': [2048, 2050, 4096, 4100],
    'speedup': [4.1, 3.9, 4.8, 4.7],
    'memory_ratio_rss': [0.25, 0.254, 0.25, 0.251],
    'acc_h0_count_match': [95, 94, 98, 97],
    'acc_h0_match': [0.95, 0.94, 0.98, 0.97],
    'acc_h0_bn_distance': [0.05, 0.06, 0.02, 0.03],
    'acc_h0_tp_diff': [0.01, 0.02, 0.005, 0.015],
    'acc_h1_count_match': [90, 89, 96, 95],
    'acc_h1_match': [0.90, 0.89, 0.96, 0.95],
    'acc_h1_bn_distance': [0.10, 0.11, 0.04, 0.05],
    'acc_h1_tp_diff': [0.05, 0.06, 0.02, 0.03],
    'acc_h2_count_match': [85, 84, 92, 91],
    'acc_h2_match': [0.85, 0.84, 0.92, 0.91],
    'acc_h2_bn_distance': [0.15, 0.16, 0.08, 0.09],
    'acc_h2_tp_diff': [0.10, 0.11, 0.05, 0.06],
}

df = pd.DataFrame(data)

ARGS = {
    'df': df
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
bar_counts Ran
ran, honoured the contract we drafted
Routhleck/canns-lib/benchmarks/ripser/phase_baseline.py
code served (permissive licence) · get_code("cc22b59083869002")
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
import numpy as np

torch.manual_seed(0)

# The function expects res to be a dict with a 'dgms' key
# 'dgms' should be an iterable of iterables (lists, arrays, etc.)
# The function computes the length of each inner iterable

res = {
    'dgms': [
        [1, 2, 3],           # length 3
        [4, 5],              # length 2
        np.array([1, 2, 3, 4]),  # length 4
        torch.tensor([1, 2])     # length 2
    ]
}

ARGS = {
    'res': res
}
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 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
generate_steps Ran
ran, honoured the contract we drafted
Routhleck/canns-lib/benchmarks/spatial/step_scaling_benchmark.py
code served (permissive licence) · get_code("cf0efcb4f8e607c5")
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
import numpy as np

torch.manual_seed(0)

ARGS = {
    "min_power": 1,
    "max_power": 4,
}
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 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
load_results Ran
ran; our contract draft was wrong, not the code
Routhleck/canns-lib/benchmarks/ripser/analysis_results.py
code served (permissive licence) · get_code("75a623042d612374")
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 DataFrame. 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
from pathlib import Path
import pandas as pd
import json

# Create a temporary directory for test files
temp_dir = Path(tempfile.gettempdir())

# Create a test CSV file
csv_path = temp_dir / "test_results.csv"
csv_df = pd.DataFrame({
    'col1': [1, 2, 3],
    'col2': ['a', 'b', 'c']
})
csv_df.to_csv(csv_path, index=False)

# Create a test JSON file
json_path = temp_dir / "test_results.json"
json_data = [
    {'col1': 1, 'col2': 'a'},
    {'col1': 2, 'col2': 'b'},
    {'col1': 3, 'col2': 'c'}
]
with open(json_path, 'w', encoding='utf-8') as f:
    json.dump(json_data, f)

# Define ARGS with a CSV path (function expects a Path object)
ARGS = {
    'path': csv_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
total_persistence Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Routhleck/canns-lib/benchmarks/ripser/comprehensive_benchmark.py
code served (permissive licence) · get_code("a1e428c2b11e0e1c")
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 numpy as np

# The function takes a persistence diagram (array-like of birth-death pairs)
# and optionally a finite_only flag.

# Create a valid persistence diagram as a list of [birth, death] pairs
# A persistence diagram typically has birth <= death for each feature
diagram = [
    [0.0, 1.5],      # birth at 0.0, death at 1.5, lifetime = 1.5
    [0.5, 2.0],      # birth at 0.5, death at 2.0, lifetime = 1.5
    [1.0, np.inf],   # infinite lifetime (should be filtered if finite_only=True)
    [0.2, 0.8],      # birth at 0.2, death at 0.8, lifetime = 0.6
]

ARGS = {
    "diagram": diagram,
    "finite_only": True,
}
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 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
total_persistence Ran
ran, honoured the contract we drafted
Routhleck/canns-lib/benchmarks/ripser/phase_baseline.py
code served (permissive licence) · get_code("cd763a7885860028")
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 numpy as np

# Construct a persistence diagram as a 2D numpy array
# Each row is [birth, death] where death > birth
# The function computes the sum of lifetimes (death - birth)

dgm = np.array([
    [0.0, 1.0],
    [0.5, 2.5],
    [1.0, 1.5]
], dtype=np.float64)

ARGS = {
    "dgm": dgm
}
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 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

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 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 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.

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

Continuous attractor neural networks (CANNs) are the canonical computational framework for how the brain encodes continuous variables such as spatial position, head direction, and movement direction, and explain the activity of hippocampal place cells, entorhinal grid cells, and head-direction cells. CANN research, however, is fragmented: most results rest on lab-specific implementations, generalpurpose simulators lack CANN-specific abstractions, and the path from spike trains to attractor geometry in real recordings lacks a standardized toolkit. Here, we present a comprehensive open-source toolkit that unifies the full CANN research workflow. It combines three tightly integrated components: 1) canns, a Python library on BrainPy/JAX that provides standardized 1D/2D CANNs, spikefrequency-adaptation variants, grid cell networks, hierarchical path-integration models, and brain-inspired attractor architectures, together with curated datasets, task generators, an analyzer module and trainer modules for biologically plausible plasticity; 2) canns-lib, a Rust acceleration backend delivering hundreds-of-times speedups for spatial-navigation workloads and modest gains for Ripser-based persistent homology; 3) ASA (Attractor Structure Analyzer), a PySide6 pipeline applying persistent homology and cohomology to experimental neural recordings to detect ring-like and toroidal attractor signatures in real data. The toolkit ships with full-detail reproducible pipelines that recover recent CANN results including SFA-driven anticipative tracking, theta sweeps in head-direction/place/grid systems, and hierarchical path integration.

For agents

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

get_harvested_code_for_paper("2606.27783")
get_code_for_paper("2606.27783")
have("2606.27783")

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

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

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

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

Connect an agent — have() is free.