SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2010.01921 · 2020

$ξ$-torch: differentiable scientific computing library

arXiv · PDF · Open in the Atlas

Code that ran

6 of 8 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 6 have no contract verdict; 0 failures of our instrument; 2 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/2010.01921.json · badge: /api/ran/2010.01921.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
xitorch/xitorch canonical (classifier label)
classifier basis: census
6 ran · 2 no recorded run
FunctionStatusWhere it lives
deprecated Ran
ran on a synthesized input
xitorch/xitorch/xitorch/_utils/decorators.py
code served (permissive licence) · get_code("37d7d9e3c5432824")
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 inspect
import warnings
import functools

def _deprecated(obj, date_str):
    if inspect.isfunction(obj):
        name = 'Function %s' % obj.__str__()
    elif inspect.isclass(obj):
        name = 'Class %s' % obj.__name__
    if inspect.ismethod(obj) or inspect.isfunction(obj):

        @functools.wraps(obj)
        def fcn(*args, **kwargs):
            warnings.warn('%s is deprecated since %s' % (name, date_str), stacklevel=2)
            return obj(*args, **kwargs)
        return fcn
    elif inspect.isclass(obj):
        old_init = obj.__init__

        @functools.wraps(old_init)
        def newinit(*args, **kwargs):
            warnings.warn('%s is deprecated since %s' % (name, date_str), stacklevel=2)
            return old_init(*args, **kwargs)
        obj.__init__ = newinit
        return obj

def deprecated(date_str):
    return lambda obj: _deprecated(obj, date_str)


# Test function to be deprecated
def sample_function(x, y):
    return x + y


# Test class to be deprecated
class SampleClass:
    def __init__(self, value):
        self.value = value


ARGS = {
    'date_str': '2024-01-15'
}
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 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
get_and_pop_keys Ran
ran on a synthesized input
xitorch/xitorch/xitorch/_utils/misc.py
code served (permissive licence) · get_code("e813c46cc94f89a3")
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 dict. 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 numpy as np
from typing import Dict, List

torch.manual_seed(0)

# The function get_and_pop_keys takes a dict and a list of keys
# It pops each key from the dict and returns a new dict with those key-value pairs
# So we need:
# - dct: a Dict with some key-value pairs
# - keys: a List of keys that exist in dct

dct = {
    'key1': 'value1',
    'key2': 42,
    'key3': [1, 2, 3],
    'key4': {'nested': 'dict'},
    'key5': torch.randn(2, 4)
}

keys = ['key1', 'key3', 'key5']

ARGS = {
    'dct': dct,
    'keys': keys
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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_attr Ran
ran on a synthesized input
xitorch/xitorch/xitorch/_utils/attr.py
code served (permissive licence) · get_code("b246fc2a681ab3d7")
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 str. 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 re
import ast

torch.manual_seed(0)

# Create test objects for different access patterns
class SimpleObj:
    def __init__(self):
        self.attr1 = "value1"
        self.nested = NestedObj()

class NestedObj:
    def __init__(self):
        self.attr2 = "value2"

# Test case 1: Simple attribute access
obj1 = SimpleObj()

# Test case 2: Dictionary access
dict_obj = {
    "key1": "dict_value1",
    "nested_dict": {"key2": "dict_value2"}
}

# Test case 3: List access
list_obj = ["item0", "item1", "item2"]

# Test case 4: Mixed access - object with dict attribute
class MixedObj:
    def __init__(self):
        self.data = {"key": "nested_value"}
        self.items = ["a", "b", "c"]

mixed_obj = MixedObj()

# Test simple attribute name
name1 = "attr1"

# Test dictionary key access
name2 = "[\"key1\"]"

# Test list index access
name3 = "[0]"

# Test nested attribute
name4 = "nested.attr2"

ARGS = {
    "obj": obj1,
    "name": name1
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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_method Ran
ran on a synthesized input
xitorch/xitorch/xitorch/_utils/misc.py
code served (permissive licence) · get_code("fcb60d08e1154e12")
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
from typing import Mapping, Callable, Union, Dict, List

torch.manual_seed(0)

# Define a simple callable function to use as a method
def custom_method():
    return "custom"

# Define methods mapping
methods_dict = {
    "method_a": lambda: "result_a",
    "method_b": lambda: "result_b",
    "default_method": custom_method
}

# Construct valid arguments for get_method
ARGS = {
    "algname": "test_algorithm",
    "methods": methods_dict,
    "method": "method_a"  # Can be a string key that exists in methods
}
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
get_methods_docstr Ran
ran on a synthesized input
xitorch/xitorch/xitorch/_docstr/api_docstr.py
code served (permissive licence) · get_code("cb49fe1783f0fd2d")
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 str. 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 inspect
from typing import Union, Any, Mapping, Sequence, Optional, Callable, List

# Create a simple callable (function) to use as cls_or_func
def sample_function(x: int = 5, y: str = "default") -> None:
    """Main function docstring."""
    pass

# Create some methods to document
def method_one(param1: int = 10, param2: float = 2.5) -> None:
    """Documentation for method one."""
    pass

def method_two(alpha: str = "test", beta: int = 7) -> None:
    """Documentation for method two."""
    pass

# Test with methods as a list
methods_list = [method_one, method_two]

# Test with methods as a dict
methods_dict = {
    "first_method": method_one,
    "second_method": method_two
}

# Test with ignore_kwargs
ignore_kwargs_list = ["x", "y"]

ARGS = {
    "cls_or_func": sample_function,
    "methods": methods_dict,
    "ignore_kwargs": ignore_kwargs_list
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
set_default_option Ran
ran on a synthesized input
xitorch/xitorch/xitorch/_utils/misc.py
code served (permissive licence) · get_code("6ddc23f1ca22268f")
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 dict. 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 copy
from typing import Dict

torch_imported = False
try:
    import torch
    torch_imported = True
except ImportError:
    pass

# Construct arguments for set_default_option
# The function takes two dicts: defopt (default options) and opt (options to update with)
# It creates a copy of defopt and updates it with opt

defopt = {
    "learning_rate": 0.001,
    "batch_size": 32,
    "epochs": 10,
    "optimizer": "adam"
}

opt = {
    "learning_rate": 0.01,
    "epochs": 20
}

ARGS = {
    "defopt": defopt,
    "opt": opt
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
del_attr Not yet run
unverified (harvested, no recorded run)
xitorch/xitorch/xitorch/_utils/attr.py
code served (permissive licence) · get_code("5f076fef39127444")
How it ran

no invocation recorded.

set_attr Not yet run
unverified (harvested, no recorded run)
xitorch/xitorch/xitorch/_utils/attr.py
code served (permissive licence) · get_code("fad83659b28a7806")
How it ran

no invocation recorded.

Also present in other papers' code

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

Physics-informed learning has shown to have a better generalization than learning without physical priors. However, training physics-informed deep neural networks requires some aspect of physical simulations to be written in a differentiable manner. Unfortunately, some operations and functionals commonly used in physical simulations are scattered, hard to integrate, and lack higher order derivatives which are needed in physical simulations. In this work, we present $ξ$-torch, a library of differentiable functionals for scientific simulations. Example functionals are a root finder and an initial value problem solver, among others. The gradient of functionals in $ξ$-torch are written based on their analytical expression to improve numerical stability and reduce memory requirements. $ξ$-torch also provides second and higher order derivatives of the functionals which are rarely available in existing packages. We show two applications of this library in optimizing parameters in physics simulations. The library and all test cases in this work can be found at https://github.com/xitorch/xitorch/ and the documentation at https://xitorch.readthedocs.io.

For agents

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

get_harvested_code_for_paper("2010.01921")
get_code_for_paper("2010.01921")
have("2010.01921")

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

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

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

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

Connect an agent — have() is free.