SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1701.02434 · 2017

A Conceptual Introduction to Hamiltonian Monte Carlo

arXiv · PDF · Open in the Atlas

Code that ran

3 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 3 have no contract verdict; 0 failures of our instrument; 5 no recorded run), measured 2026-11-22; 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/1701.02434.json · badge: /api/ran/1701.02434.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
Matematija/continuous-vmc community (classifier label)
classifier basis not recorded on the link
3 ran · 2 no recorded run
copy not recorded community
not in the paper's declared repositories
0 ran · 3 no recorded run
FunctionStatusWhere it lives
canonicalize_kernel_size Ran
ran on a synthesized input
Matematija/continuous-vmc/cvmc/ansatz.py
code served (permissive licence) · get_code("27b463750b1dabc7")
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, 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)

# Analyze the function:
# - kernel_size: can be None, int, or tuple/sequence
# - dims: used with len(dims) to determine repetition count
# The function checks isinstance(kernel_size, int) and returns tuples

# Test case 1: kernel_size is an int, dims is a sequence
kernel_size_int = 3
dims_seq = (4, 5, 6)  # 3 dimensions, distinct sizes for probing

ARGS = {
    "kernel_size": kernel_size_int,
    "dims": dims_seq,
}
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 tuple, ndim 1, dtype family int — a tuple 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
canonicalize_padding Ran
ran on a synthesized input
Matematija/continuous-vmc/cvmc/ansatz.py
code served (permissive licence) · get_code("7a99750281b4b88e")
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, 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 torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "padding": "FULL",
    "kernel_size": (3, 5, 7)
}
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 tuple, ndim 1, dtype family int — a tuple 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
canonicalize_rhs_fun Ran
ran on a synthesized input
Matematija/continuous-vmc/cvmc/integrate/solver.py
code served (permissive licence) · get_code("a8be8f07c1151082")
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)

# Define test functions with different signatures

# Function 1: non-autonomous, no aux, no key
def f_basic(t, y):
    return y * 2

# Function 2: autonomous, no aux, no key
def f_autonomous(y):
    return y * 3

# Function 3: non-autonomous, has aux, no key
def f_with_aux(t, y):
    return y * 2, {"loss": 0.5}

# Function 4: autonomous, has aux, no key
def f_autonomous_aux(y):
    return y * 3, {"loss": 0.5}

# Function 5: non-autonomous, no aux, needs key
def f_needs_key(t, y, key):
    return y * 2

# Function 6: autonomous, no aux, needs key
def f_autonomous_key(y, key):
    return y * 3

# Function 7: non-autonomous, has aux, needs key
def f_aux_key(t, y, key):
    return y * 2, {"loss": 0.5}

# Function 8: autonomous, has aux, needs key
def f_autonomous_aux_key(y, key):
    return y * 3, {"loss": 0.5}

ARGS = {
    "f": f_basic,
    "autonomous": False,
    "has_aux": False,
    "needs_key": False,
}
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
build_tree Not yet run
unverified (harvested, no recorded run)
this paper's copy was not recorded; identical code first harvested from JohannesBuchner/PinNUTS
pointer only · get_code("4d864798cca4b23b")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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. No invocation recorded.

eval_callback Not yet run
unverified (harvested, no recorded run)
Matematija/continuous-vmc/cvmc/integrate/solver.py
code served (permissive licence) · get_code("fd5e7b83c2727f0e")
How it ran

no invocation recorded.

make_qgt_norm Not yet run
unverified (harvested, no recorded run)
Matematija/continuous-vmc/cvmc/propagator.py
code served (permissive licence) · get_code("f11822470adef70d")
How it ran

no invocation recorded.

pinnuts Not yet run
unverified (harvested, no recorded run)
this paper's copy was not recorded; identical code first harvested from JohannesBuchner/PinNUTS
pointer only · get_code("4f8a7d049558a7a8")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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. No invocation recorded.

tree_sample Not yet run
unverified (harvested, no recorded run)
this paper's copy was not recorded; identical code first harvested from JohannesBuchner/PinNUTS
pointer only · get_code("86a695959d00fddb")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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. 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, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 0 later) and 5 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
build_tree 1 other paper
1 dated earlier
1111.4246 (2011-11)
The No-U-Turn Sampler: Adaptively Setting Path Lengths in Hamiltonian Monte Carlo
pinnuts 1 other paper
1 dated earlier
1111.4246 (2011-11)
The No-U-Turn Sampler: Adaptively Setting Path Lengths in Hamiltonian Monte Carlo
tree_sample 1 other paper
1 dated earlier
1111.4246 (2011-11)
The No-U-Turn Sampler: Adaptively Setting Path Lengths in Hamiltonian Monte Carlo

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

Repositories linked to this paper

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

Abstract

Hamiltonian Monte Carlo has proven a remarkable empirical success, but only recently have we begun to develop a rigorous understanding of why it performs so well on difficult problems and how it is best applied in practice. Unfortunately, that understanding is confined within the mathematics of differential geometry which has limited its dissemination, especially to the applied communities for which it is particularly important. In this review I provide a comprehensive conceptual account of these theoretical foundations, focusing on developing a principled intuition behind the method and its optimal implementations rather of any exhaustive rigor. Whether a practitioner or a statistician, the dedicated reader will acquire a solid grasp of how Hamiltonian Monte Carlo works, when it succeeds, and, perhaps most importantly, when it fails.

For agents

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

get_harvested_code_for_paper("1701.02434")
get_code_for_paper("1701.02434")
have("1701.02434")

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

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

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

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

Connect an agent — have() is free.