Path integration in complex number space.
One block of code here has a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 1 match
- [1] § paragraph 7 ↔ generate_figure2.py, lines 1 to 11 · score 0.71 · cross species, PI model, angular errors, Computational cost, Bracket, simulation · block
oscr:b:Y6Q1BR63TZ55F-G· Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 170 lines · 7.2 KB · no license · 1 match
- #!/usr/bin/env python3
- """
- Figure 2 — PNAS Brief Report. Craddock, Miossec & Bouchekioua.
- Panel A: Placeholder for Müller & Wehner 1988 Fig. 1
- Panel B: PI Model simulation (seed=9798, 100 steps, raw waypoints)
- Panel C: Angular error histogram with verified cross-species bracket
- Panel D: Computational cost comparison
- """
- import numpy as np
- import matplotlib.pyplot as plt
- from matplotlib.lines import Line2D
- def complex_mult(a_re, a_im, b_re, b_im):
- return (a_re * b_re - a_im * b_im, a_re * b_im + a_im * b_re)
- def run_outward(num_steps, rng):
- traj = [{"x": 0.0, "y": 0.0, "I_re": 1.0, "I_im": 0.0}]
- z1_re, z1_im = 1.0, 1.0
- for _ in range(num_steps):
- prev = traj[-1]
- if rng.random() < 0.5: i_n_re, i_n_im = 0.0, 1.0
- else: i_n_re, i_n_im = 0.0, -1.0
- newI_re, newI_im = complex_mult(prev["I_re"], prev["I_im"], i_n_re, i_n_im)
- if i_n_im == 1.0:
- zd_re = 0.5 + rng.random() * 0.5; zd_im = rng.random() * 0.5
- else:
- zd_re = rng.random() * 0.5; zd_im = 0.5 + rng.random() * 0.5
- Iz1_re, Iz1_im = complex_mult(newI_re, newI_im, z1_re, z1_im)
- traj.append({"x": prev["x"] + Iz1_im + zd_im, "y": prev["y"] + Iz1_re + zd_re,
- "I_re": newI_re, "I_im": newI_im})
- return traj
- def run_return(traj, rng):
- last = traj[-1]
- X_n, Y_n = last["x"], last["y"]
- path = []
- for _ in range(10000):
- if X_n + Y_n < 1.0: break
- prevX, prevY = X_n, Y_n
- epsilon = -0.5 + rng.random()
- denom = prevX + prevY
- if abs(denom) > 0.001:
- X_n = prevX - (prevX / denom) + epsilon
- Y_n = prevY - (prevY / denom) + epsilon
- else: break
- path.append((X_n, Y_n))
- path.append((0.0, 0.0))
- return path
- def compute_ae(traj, ret):
- xs = np.array([p["x"] for p in traj])
- ys = np.array([p["y"] for p in traj])
- ideal = np.arctan2(-ys[-1], -xs[-1])
- if len(ret) > 1:
- dx, dy = ret[0][0] - xs[-1], ret[0][1] - ys[-1]
- ae = np.degrees(np.arctan2(dy, dx) - ideal)
- ae = ((ae + 180) % 360) - 180
- return abs(ae)
- return np.nan
- # ═══ Panel B: seed=9798, 100 steps, tort=3.10 ═══
- rng = np.random.default_rng(9798)
- traj = run_outward(100, rng)
- ret = run_return(traj, rng)
- xs_out = np.array([p["x"] for p in traj])
- ys_out = np.array([p["y"] for p in traj])
- ret_xs = [xs_out[-1]] + [p[0] for p in ret]
- ret_ys = [ys_out[-1]] + [p[1] for p in ret]
- pl = np.sum(np.sqrt(np.diff(xs_out)**2 + np.diff(ys_out)**2))
- d = np.sqrt(xs_out[-1]**2 + ys_out[-1]**2)
- print(f"Panel B: seed=9798, steps=100, tort={pl/d:.2f}, disp={d:.1f}")
- # ═══ Panel C: n=1000 ═══
- rng_c = np.random.default_rng(42)
- all_ae = []
- for _ in range(1000):
- t = run_outward(20, rng_c); r = run_return(t, rng_c)
- ae = compute_ae(t, r)
- if not np.isnan(ae): all_ae.append(ae)
- med_ae = np.median(all_ae); mean_ae = np.mean(all_ae)
- print(f"Panel C: n={len(all_ae)}, median={med_ae:.1f}, mean={mean_ae:.1f}")
- # ═══ FIGURE: 2x2 layout ═══
- fig = plt.figure(figsize=(7.5, 9))
- gs = fig.add_gridspec(2, 2, height_ratios=[1.2, 1], hspace=0.35, wspace=0.35)
- # ── Panel A: Placeholder ──
- ax_a = fig.add_subplot(gs[0, 0])
- ax_a.text(0.5, 0.5, 'Müller & Wehner\n(1988) Fig. 1\n\n[To be inserted\nwith permission]',
- ha='center', va='center', fontsize=9, fontstyle='italic',
- color='#666666', transform=ax_a.transAxes)
- ax_a.set_xlim(0, 1); ax_a.set_ylim(0, 1)
- for spine in ax_a.spines.values(): spine.set_linestyle('--'); spine.set_color('#aaa')
- ax_a.set_xticks([]); ax_a.set_yticks([])
- ax_a.set_title('(A) C. fortis', fontsize=9, fontweight='bold',
- loc='left', fontstyle='italic', pad=6)
- # ── Panel B: Raw trajectory ──
- ax_b = fig.add_subplot(gs[0, 1])
- ax_b.plot(xs_out, ys_out, color='black', linewidth=0.4, solid_capstyle='round', zorder=2)
- ax_b.plot(ret_xs, ret_ys, color='black', linewidth=0.6,
- linestyle=(0, (2, 2)), zorder=3)
- ax_b.plot(0, 0, 'ks', markersize=4, zorder=5)
- ax_b.annotate('N', (0, 0), textcoords="offset points", xytext=(-12, -8),
- fontsize=11, fontweight='bold', fontstyle='italic')
- ax_b.plot(xs_out[-1], ys_out[-1], 'ko', markersize=4, zorder=5)
- ax_b.annotate('F', (xs_out[-1], ys_out[-1]), textcoords="offset points",
- xytext=(6, 4), fontsize=11, fontweight='bold', fontstyle='italic')
- ax_b.set_aspect('equal'); ax_b.axis('off')
- ax_b.set_title('(B) PI Model simulation', fontsize=9,
- fontweight='bold', loc='left', pad=6)
- leg_b = [Line2D([0],[0], color='k', lw=0.4, label='Outbound'),
- Line2D([0],[0], color='k', lw=0.6, ls='--', label='Homeward')]
- ax_b.legend(handles=leg_b, loc='upper left', fontsize=6.5, frameon=False)
- # ── Panel C: Angular error histogram ──
- ax_c = fig.add_subplot(gs[1, 0])
- ax_c.hist(all_ae, bins=40, color='#888888', edgecolor='white',
- linewidth=0.3, alpha=0.85, zorder=2)
- ax_c.axvline(med_ae, color='black', linewidth=1.2, linestyle='-', zorder=4)
- ax_c.axvline(mean_ae, color='black', linewidth=1.2, linestyle='--', zorder=4)
- # Single verified cross-species bracket
- y_pos = 310 * 0.68
- ax_c.plot([10, 25], [y_pos, y_pos], 'k-', linewidth=1.2, zorder=5)
- ax_c.plot([10, 10], [y_pos - 7, y_pos + 7], 'k-', linewidth=0.9, zorder=5)
- ax_c.plot([25, 25], [y_pos - 7, y_pos + 7], 'k-', linewidth=0.9, zorder=5)
- ax_c.text(26.5, y_pos, 'Cross-species PI error\n(Etienne & Jeffery 2004, Fig. 3)',
- fontsize=6, fontstyle='italic', va='center', ha='left')
- leg_c = [
- plt.Rectangle((0,0), 1, 1, fc='#888888', alpha=0.85, label='Model (n = 1,000)'),
- Line2D([0],[0], color='black', lw=1.2, ls='-', label=f'Median ({med_ae:.1f}\u00b0)'),
- Line2D([0],[0], color='black', lw=1.2, ls='--', label=f'Mean ({mean_ae:.1f}\u00b0)'),
- ]
- ax_c.legend(handles=leg_c, loc='upper right', fontsize=5.5, frameon=True,
- framealpha=0.95, edgecolor='#ccc')
- ax_c.set_xlabel('Absolute angular error (\u00b0)', fontsize=8)
- ax_c.set_ylabel('Count', fontsize=8)
- ax_c.set_xlim(0, 75)
- ax_c.set_ylim(0, 320)
- ax_c.tick_params(labelsize=7)
- ax_c.spines['top'].set_visible(False); ax_c.spines['right'].set_visible(False)
- ax_c.set_title('(C) Homing angular error', fontsize=9,
- fontweight='bold', loc='left', pad=6)
- # ── Panel D: Computational cost ──
- ax_d = fig.add_subplot(gs[1, 1])
- models = ['Complex\nnumber\n(this study)', 'Cartesian\nvector', 'Polar\ncoord.']
- arith_ops = [10, 5, 5]
- trig_cost = [0, 24, 48]
- x = np.arange(len(models))
- width = 0.30
- ax_d.bar(x - width/2, arith_ops, width, color='black', label='Arithmetic', zorder=2)
- ax_d.bar(x + width/2, trig_cost, width, color='#aaaaaa', label='Trigonometric', zorder=2)
- ax_d.set_xticks(x)
- ax_d.set_xticklabels(models, fontsize=6.5)
- ax_d.set_ylabel('Operations per step', fontsize=8)
- ax_d.tick_params(labelsize=7)
- ax_d.spines['top'].set_visible(False); ax_d.spines['right'].set_visible(False)
- ax_d.legend(fontsize=6, loc='upper left', framealpha=0.9, edgecolor='#ccc')
- ax_d.set_ylim(0, 55)
- ax_d.set_title('(D) Computational cost', fontsize=9,
- fontweight='bold', loc='left', pad=6)
- plt.savefig('figure2_pnas.png', dpi=600, bbox_inches='tight', facecolor='white')
- plt.savefig('figure2_pnas.tiff', dpi=600, bbox_inches='tight', facecolor='white')
- print("\nSaved: figure2_pnas.png / .tiff")
generate_figure2.py at commit a561537, no license · at the source
Overview
- Department of Psychology, University of Lille, Villeneuve d’Ascq 59653, France
- Division of Engineering in Medicine, Department of Medicine, Brigham and Women’s Hospital, Harvard Medical School, Boston, MA 02115
Abstract
The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.
Repositories
Its files are read in the Code ↔ Paper reader above, with 1 match between paragraphs and lines of code.
YuYuB/Path_Integration_Simulation_Dr.Craddock_2026
a56153753ad9b662b8f786e410d3f63d98f37499, 25 March 2026Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
2 files
- generate_figure2.py, Python, 170 lines, 1 match
- generate_figure2_notext.
py , Python, 132 lines
Zenodo 19262464
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
- 28 September 2026: the link answers (HTTP 200)
2 files
- generate_figure2.py, Python, 170 lines
- generate_figure2_notext.
py , Python, 132 lines
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 4 scripts, each with its path and the digest of its content;
- 1 match between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Code and data availability statement
The paper has a code and data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to the authors' code: YuYuB/
Path_Integration_Simulat , Zenodo 19262464ion_Dr.Craddock_2026
Read it in the paper: doi.org/10.1073/pnas.2603690123.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 28 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 3 authors, 4 keywords, 7 MeSH terms, 12 references.
Cite
This paper
Craddock, P., Miossec, Y., & Bouchekioua, Y. (2026). Path integration in complex number space. Proceedings of the National Academy of Sciences of the United States of America, 123(22), e2603690123. https://
BibTeX
@article{craddock2026pat
author = {Craddock, Paul and Miossec, Yannick and Bouchekioua, Youcef},
title = {{Path integration in complex number space}},
journal = {Proceedings of the National Academy of Sciences of the United States of America},
year = {2026},
month = may,
volume = {123},
number = {22},
pages = {e2603690123},
publisher = {National Academy of Sciences},
issn = {0027-8424},
doi = {10.1073/
url = {https://
pmid = {42213748},
pmcid = {PMC13229285}
}
RIS
TY - JOUR
AU - Craddock, Paul
AU - Miossec, Yannick
AU - Bouchekioua, Youcef
TI - Path integration in complex number space
T2 - Proceedings of the National Academy of Sciences of the United States of America
J2 - Proc Natl Acad Sci U S A
PY - 2026
DA - 2026/
VL - 123
IS - 22
SP - e2603690123
SN - 0027-8424
PB - National Academy of Sciences
DO - 10.1073/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1073/
"type": "article-journal",
"title": "Path integration in complex number space",
"container-title": "Proceedings of the National Academy of Sciences of the United States of America",
"author": [
{
"family": "Craddock",
"given": "Paul"
},
{
"family": "Miossec",
"given": "Yannick"
},
{
"family": "Bouchekioua",
"given": "Youcef"
}
],
"container-title-short":
"volume": "123",
"issue": "22",
"page": "e2603690123",
"DOI": "10.1073/
"PMID": "42213748",
"PMCID": "PMC13229285",
"ISSN": "0027-8424",
"publisher": "National Academy of Sciences",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
29
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.7554/elife.95764 [code]
- Shortcutting from self-motion signals reveals a cognitive map in mice.Journal: eLifeIn common: Matplotlib, NumPy, 5 references
- [2] doi:10.1038/s41467-023-42642-3 [code]
- Hippocampal firing fields anchored to a moving object predict homing direction during path-integration-based behavior.Journal: Nature communicationsIn common: Matplotlib, NumPy, 4 references
- [3] doi:10.1038/s41467-022-35346-7 [code]
- Median raphe serotonergic neurons projecting to the interpeduncular nucleus control preference and aversion.Journal: Nature communicationsIn common: Matplotlib, NumPy, author Youcef Bouchekioua
- [4] doi:10.1371/journal.pcbi.1011913 [code]
- Estimating orientation in natural scenes: A spiking neural network model of the insect central complex.Journal: PLoS computational biologyIn common: Matplotlib, NumPy, other, 3 references
- [5] doi:10.7554/elife.66039 [code]
- A connectome of the &
lt;i& gt;Drosophila& lt;/ i& gt; central complex reveals network motifs suitable for flexible navigation and context-dependent action selection. Journal: eLifeIn common: Matplotlib, NumPy, 3 references - [6] doi:10.3389/fncom.2023.1136985 [code]
- Empirically validated theoretical analysis of visual-spatial perception under change of nervous system arousal.Journal: Frontiers in computational neuroscienceIn common: Matplotlib, NumPy, 3 references
- [7] doi:10.1038/s41593-025-02054-6 [code]
- Grid cells accurately track movement during path integration-based navigation despite switching reference frames.Journal: Nature neuroscienceIn common: Matplotlib, NumPy, 3 references
- [8] doi:10.1016/j.celrep.2023.112375
- Circadian protein TIMELESS regulates synaptic function and memory by modulating cAMP signaling.Journal: Cell reportsIn common: author Youcef Bouchekioua
- [9] doi:10.1371/journal.pcbi.1010547 [code]
- Multiple bumps can enhance robustness to noise in continuous attractor networks.Journal: PLoS computational biologyIn common: Matplotlib, NumPy, 3 references
- [10] doi:10.1093/cercor/bhab195 [code]
- Local Microcircuitry of PaS Shows Distinct and Common Features of Excitatory and Inhibitory Connectivity.Journal: Cerebral cortex (New York, N.Y. : 1991)In common: Matplotlib, NumPy, 3 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 2 repositories of the authors' code, each at its verified commit and with its license, 4 scripts, and 1 match between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:cf29249acc1c22e8…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1073/pnas.2603690123)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1073/pnas.2603690123.svg
:target: https://openscicode.org/badge/doi/10.1073/pnas.2603690123
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1073/pnas.2603690123"><img src="https://openscicode.org/badge/doi/10.1073/pnas.2603690123.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
