Repository navigation
Conversation
BrownianMotionOnCircle solves dX = -sigma^2/2 X dt + sigma J X dW in the
plane with scalar noise. Its exact solution rotates x0 by the angle
sigma (W(t) - W(t0)), so the radius is invariant; Euler-Maruyama leaves the
circle, with |X^{n+1}|^2 = |X^n|^2 ((1 - sigma^2 h/2)^2 + sigma^2 dW^2) on
every path and E|X_h^N|^2 = |x0|^2 (1 + sigma^4 h^2/4)^N.
Tests: coefficients and rotation by hand, the commuting matrix formula,
the per-step radius identity (property test), PyTorch against NumPy, the
strong order 1/2 and the exact second moment (slow). Theory page,
registry entry, API reference, changelog and decision log.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018KaTyMUfivRVAGYQR6kGnp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Third test problem of milestone M1 (roadmap: "Brownian motion on the circle as third test problem"). Independent of #16; based on
main.Problem
with$d = 2$ , $m = 1$ (scalar, multiplicative noise). The exact solution is $X(t) = R(\sigma(W(t) - W(t_0))),x_0$ , a rotation of $x_0$ , so $|X(t)| = |x_0|$ . Defaults: $\sigma = 1$ , $x_0 = (1, 0)$ , $t_0 = 0$ . Registry name
brownian_motion_on_circle.Euler–Maruyama leaves the circle: on every path$|X_h^{n+1}|^2 = |X_h^n|^2\big((1 - \sigma^2 h_n/2)^2 + \sigma^2 \Delta W_n^2\big)$ , and on a uniform grid $\mathbb{E}|X_h^N|^2 = |x_0|^2 (1 + \sigma^4 h^2/4)^N$ . Both identities were checked numerically before they went onto the theory page, and both are tested.
There is no legacy script for this problem in the archive; the scripts
unitcirc*.pysample the uniform distribution on the circle.Tests
Coverage 100 % with and without PyTorch and matplotlib; Ruff, mypy, codespell and Sphinx
-Wpass.Please check
Generated by Claude Code