SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2211.09958 · 2022

pmwd: A Differentiable Cosmological Particle-Mesh $N$-body Library

arXiv · PDF · Open in the Atlas

Code that ran

8 of 16 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 8 have no contract verdict; 0 failures of our instrument; 8 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/2211.09958.json · badge: /api/ran/2211.09958.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
eelregit/pmwd canonical (classifier label)
classifier basis not recorded on the link
8 ran · 8 no recorded run
FunctionStatusWhere it lives
E2 Ran
ran on a synthesized input
eelregit/pmwd/pmwd/cosmology.py
code served (permissive licence) · get_code("06d44ba997224d0a")
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 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.numpy as jnp


class Config:
    def __init__(self):
        self.cosmo_dtype = jnp.float64


class Cosmology:
    def __init__(self):
        self.conf = Config()
        self.Omega_m = 0.3
        self.Omega_k = 0.0
        self.Omega_de = 0.7
        self.w_0 = -1.0
        self.w_a = 0.0


# Create test arguments
a = jnp.array([0.5, 0.8, 1.0, 1.2], dtype=jnp.float64)
cosmo = Cosmology()

ARGS = {
    "a": a,
    "cosmo": cosmo,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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
Omega_m_a Ran
ran on a synthesized input
eelregit/pmwd/pmwd/cosmology.py
code served (permissive licence) · get_code("15c76c3399b7016a")
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 ArrayImpl, ndim 1, dtype family float, shape (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 jax.numpy as jnp

class Config:
    def __init__(self):
        self.cosmo_dtype = jnp.float32

class Cosmology:
    def __init__(self):
        self.conf = Config()
        self.Omega_m = 0.3
        self.Omega_k = 0.0
        self.Omega_de = 0.7
        self.w_0 = -1.0
        self.w_a = 0.0

a_values = jnp.array([0.5, 0.8, 1.0], dtype=jnp.float32)
cosmo = Cosmology()

ARGS = {
    "a": a_values,
    "cosmo": cosmo
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 (3,) — shape (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
enmesh Ran
ran on a synthesized input
eelregit/pmwd/pmwd/pm_util.py
code served (permissive licence) · get_code("4e3ecccc48afd1d0")
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 jax.numpy as jnp
import numpy as np

# Set seed for reproducibility
np.random.seed(0)

# Define small test data
num = 2  # number of points
dim = 3  # dimensionality

# i1: (num, dim) integer coordinates on grid 1
i1 = np.array([[1, 2, 3], [4, 5, 6]], dtype=np.int32)

# d1: (num, dim) float displacements from grid 1 points
d1 = np.array([[0.1, 0.2, 0.3], [0.4, 0.5, 0.6]], dtype=np.float64)

# a1: cell size of grid 1
a1 = 1.0

# s1: periodic boundary shape of grid 1, or None for non-periodic
s1 = (10, 10, 10)

# b12: offset of origin of grid 2 to that of grid 1
b12 = np.array([0.5, 0.5, 0.5], dtype=np.float64)

# a2: cell size of grid 2 (or None to use a1)
a2 = 1.0

# s2: shape of grid 2 (or None)
s2 = (20, 20, 20)

# grad: whether to compute gradients
grad = True

ARGS = {
    'i1': i1,
    'd1': d1,
    'a1': a1,
    's1': s1,
    'b12': b12,
    'a2': a2,
    's2': s2,
    'grad': grad,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, 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
fftfreq Ran
ran on a synthesized input
eelregit/pmwd/pmwd/pm_util.py
code served (permissive licence) · get_code("21ccfeec2cae0aa7")
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. 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.numpy as jnp

ARGS = {
    "shape": (4, 5, 6),
    "spacing": 0.5,
    "dtype": jnp.float64,
    "sparse": True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list 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
levi_civita Ran
ran on a synthesized input
eelregit/pmwd/pmwd/lpt.py
code served (permissive licence) · get_code("3a832a9c3a79cb14")
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 jax.numpy as jnp
import numpy as np

# The function takes indices as input and computes the Levi-Civita symbol
# indices should be an array-like object that can be converted to a jax array
# The function uses len(indices) to get the dimension, and indexes into it with indices[hi] and indices[lo]

# For a valid Levi-Civita symbol computation, indices should be a permutation of range(dim)
# Let's create a simple case with dimension 3

# Example 1: indices as a list representing a permutation of [0, 1, 2]
indices_list = [0, 2, 1]  # A permutation of 3 elements

# Example 2: indices as a numpy array
indices_array = np.array([1, 0, 2])  # Another permutation

# Example 3: indices as a jax array
indices_jax = jnp.array([2, 1, 0])  # Another permutation

# The function will work with any of these. Let's use a simple list
ARGS = {
    "indices": [0, 2, 1]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — 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
rfftnfreq Ran
ran on a synthesized input
eelregit/pmwd/pmwd/pm_util.py
code served (permissive licence) · get_code("d4bf76e2ba592993")
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. 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.numpy as jnp

# The function rfftnfreq takes: shape, spacing, dtype
# shape should be a tuple of ints representing the shape of a real field
# spacing should be a float or None
# dtype should be a JAX dtype (default jnp.float64)

ARGS = {
    'shape': (4, 5, 6),
    'spacing': 1.0,
    'dtype': jnp.float64,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list 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
transfer Ran
ran on a synthesized input
eelregit/pmwd/pmwd/boltzmann.py
code served (permissive licence) · get_code("0c1b2530da71719d")
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 ArrayImpl, ndim 1, dtype family float, shape (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 jax.numpy as jnp
import numpy as np

class Cosmology:
    def __init__(self, transfer_array):
        self.transfer = transfer_array

class Configuration:
    def __init__(self, transfer_fit, transfer_k_array):
        self.transfer_fit = transfer_fit
        self.transfer_k = transfer_k_array

# Create small test data
k_values = jnp.array([0.01, 0.1, 1.0, 10.0])
transfer_values = jnp.array([0.99, 0.85, 0.5, 0.1])

cosmo = Cosmology(transfer_array=transfer_values)
conf = Configuration(transfer_fit=True, transfer_k_array=k_values)

k = jnp.array([0.05, 0.5, 5.0])

ARGS = {
    'k': k,
    'cosmo': cosmo,
    'conf': conf
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — 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 (3,) — shape (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
transfer_fit Ran
ran on a synthesized input
eelregit/pmwd/pmwd/boltzmann.py
code served (permissive licence) · get_code("882c55607004378b")
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 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.numpy as jnp

class Cosmology:
    def __init__(self):
        self.h = 0.678
        self.Omega_m = 0.31
        self.Omega_b = 0.049
        self.Omega_c = 0.261

class Configuration:
    def __init__(self):
        self.L = 1000.0
        self.Mpc_SI = 3.086e22
        self.T_cmb = 2.7255
        self.transfer_fit_nowiggle = False

k = jnp.array([0.1, 0.5, 1.0, 2.0])
cosmo = Cosmology()
conf = Configuration()

ARGS = {
    "k": k,
    "cosmo": cosmo,
    "conf": conf,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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
H_deriv Not yet run
unverified (harvested, no recorded run)
eelregit/pmwd/pmwd/cosmology.py
code served (permissive licence) · get_code("c87c940b4ea493e3")
How it ran

no invocation recorded.

interp_fit_dopri Not yet run
unverified (harvested, no recorded run)
eelregit/pmwd/pmwd/ode_util.py
code served (permissive licence) · get_code("52caf6b0e7f33f92")
How it ran

no invocation recorded.

laplace Not yet run
unverified (harvested, no recorded run)
eelregit/pmwd/pmwd/gravity.py
code served (permissive licence) · get_code("0d1fcfe2dec1367c")
How it ran

no invocation recorded.

laplace_bwd Not yet run
unverified (harvested, no recorded run)
eelregit/pmwd/pmwd/gravity.py
code served (permissive licence) · get_code("69c17c4e7524e5c6")
How it ran

no invocation recorded.

laplace_fwd Not yet run
unverified (harvested, no recorded run)
eelregit/pmwd/pmwd/gravity.py
code served (permissive licence) · get_code("64f13b6b0df4a7e7")
How it ran

no invocation recorded.

ravel_first_arg Not yet run
unverified (harvested, no recorded run)
eelregit/pmwd/pmwd/ode_util.py
code served (permissive licence) · get_code("7087607fb22695f3")
How it ran

no invocation recorded.

ravel_first_arg_ Not yet run
unverified (harvested, no recorded run)
eelregit/pmwd/pmwd/ode_util.py
code served (permissive licence) · get_code("55bf5813189f1bcc")
How it ran

no invocation recorded.

transfer_integ Not yet run
unverified (harvested, no recorded run)
eelregit/pmwd/pmwd/boltzmann.py
code served (permissive licence) · get_code("b3ba2c1312101ef7")
How it ran

no invocation recorded.

Also present in other papers' code

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

The formation of the large-scale structure, the evolution and distribution of galaxies, quasars, and dark matter on cosmological scales, requires numerical simulations. Differentiable simulations provide gradients of the cosmological parameters, that can accelerate the extraction of physical information from statistical analyses of observational data. The deep learning revolution has brought not only myriad powerful neural networks, but also breakthroughs including automatic differentiation (AD) tools and computational accelerators like GPUs, facilitating forward modeling of the Universe with differentiable simulations. Because AD needs to save the whole forward evolution history to backpropagate gradients, current differentiable cosmological simulations are limited by memory. Using the adjoint method, with reverse time integration to reconstruct the evolution history, we develop a differentiable cosmological particle-mesh (PM) simulation library pmwd (particle-mesh with derivatives) with a low memory cost. Based on the powerful AD library JAX, pmwd is fully differentiable, and is highly performant on GPUs.

For agents

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

get_harvested_code_for_paper("2211.09958")
get_code_for_paper("2211.09958")
have("2211.09958")

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

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

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

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

Connect an agent — have() is free.