Simulation¶
Vectorized Euler-Maruyama simulators. Each advances N independent particles
for T time steps at once and returns the full trajectory, indexed
[time, particle, coordinate].
All three are re-exported at the top level, so under the conventional alias
they are ww.sphere_simulator, ww.torus_simulator, and
ww.hyperbolic_simulator.
Vectorized Euler-Maruyama simulators for Brownian motion on each manifold.
Each simulator advances N independent particles for T time steps at once, returning the full trajectory rather than only the final positions, so that both the time evolution and the terminal distribution can be inspected.
Reproducibility: these simulators draw from NumPy's global random state via
np.random. Call np.random.seed(...) before a simulator to obtain a
repeatable trajectory.
All three are re-exported at the top level, so under the conventional alias
they are reached as ww.sphere_simulator, ww.torus_simulator, and
ww.hyperbolic_simulator.
sphere_simulator ¶
Simulates Brownian motion for N particles on the unit sphere S^2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
T
|
Number of time steps to advance. |
required | |
N
|
Number of independent particles to simulate. |
required | |
dt
|
Size of each time step. |
required | |
noise_type
|
Either "isotropic" (motion in all tangent directions) or "anisotropic" (motion constrained to a single tangent direction). |
required | |
starting_point
|
Optional point in R^3 for every particle to start from. It is projected onto the sphere first, so it need not be normalized. Defaults to (1, 0, 0). |
None
|
Returns:
| Type | Description |
|---|---|
|
A (T, N, 3) array of particle positions, where entry [t] holds the |
|
|
positions of all N particles after time step t. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If noise_type is not one of the two supported values. |
Source code in src/wanderwalk/simulation/simulator.py
torus_simulator ¶
Simulates Brownian motion for N particles on the torus T^2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
T
|
Number of time steps to advance. |
required | |
N
|
Number of independent particles to simulate. |
required | |
dt
|
Size of each time step. |
required | |
R
|
Major radius, from the center of the hole to the center of the tube. |
required | |
r
|
Minor radius, the radius of the tube. |
required | |
noise_type
|
Either "isotropic" (motion in all tangent directions) or "anisotropic" (motion constrained to e_u, the direction around the central axis). Defaults to "isotropic". |
'isotropic'
|
|
starting_point
|
Optional point in R^3 on the torus for every particle to start from. Defaults to the point at toroidal and poloidal angles (0, 0). |
None
|
Returns:
| Type | Description |
|---|---|
|
A (T, N, 3) array of particle positions. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If noise_type is not one of the two supported values. |
Source code in src/wanderwalk/simulation/simulator.py
hyperbolic_simulator ¶
Simulates Brownian motion for N particles on the hyperbolic plane H^2.
Unlike the sphere and torus simulators, trajectories here have shape
(T, N, 2), not (T, N, 3): H^2 has no isometric embedding into R^3
(Hilbert's theorem), so points are genuine 2D vectors in the Poincare
disk rather than 3D ambient points constrained to a surface. See
:class:wanderwalk.manifolds.PoincareDisk and
docs/writeups/2-poincare-disk-derivation.md.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
T
|
Number of time steps to advance. |
required | |
N
|
Number of independent particles to simulate. |
required | |
dt
|
Size of each time step. |
required | |
starting_point
|
Optional point in the open unit disk for every particle to start from. It is clamped inside the disk first. Defaults to the origin. |
None
|
Returns:
| Type | Description |
|---|---|
|
A (T, N, 2) array of particle positions in the Poincare disk. |