From a4f52767aaef9e1db077864b99f7dfc52471e3ae Mon Sep 17 00:00:00 2001 From: Henry Wallace Date: Tue, 3 Nov 2026 22:02:12 -0500 Subject: [PATCH 1/2] examples: state what ode_comparison measures about Heun The closing text said Heun's radius "stays near 1.0 (symplectic-like behavior)". The example's own output contradicts it: Heun's radius is 1.2106 at 10 steps and 1.0246 at 20, and it grows every step. Heun is not symplectic; on dx/dt = -y, dy/dt = x its per-step radius factor is sqrt(1 + h^4/4) against Euler's sqrt(1 + h^2), so it gains radius about h^2/4 times slower. The text now says both methods gain radius and gives the two rates. Run with `cargo run --release --example ode_comparison`; clippy -D warnings and fmt pass. Claude-Session: https://claude.ai/code/session_01UJZpXYJLkeY3RtMaiJnqSR --- examples/ode_comparison.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/ode_comparison.rs b/examples/ode_comparison.rs index a544bd9..7aadad0 100644 --- a/examples/ode_comparison.rs +++ b/examples/ode_comparison.rs @@ -96,6 +96,7 @@ fn main() { } println!(); - println!("Observation: Euler's radius grows each step (energy gain),"); - println!("while Heun's radius stays near 1.0 (symplectic-like behavior)."); + println!("Observation: both methods gain radius on this flow. Per step the radius"); + println!("grows by about h^2/2 for Euler and h^4/8 for Heun (h = step size), so"); + println!("Heun's error falls much faster as the step count rises."); } From 8909f9224df1f1453e2c40bb36b4589c06737ca7 Mon Sep 17 00:00:00 2001 From: Henry Wallace Date: Tue, 3 Nov 2026 22:02:13 -0500 Subject: [PATCH 2/2] examples: list rfm_fisher_simplex and print fynch_bregman_energy inputs as lists rfm_fisher_simplex is registered with the `riemannian` feature and run by CI, but the examples README did not list it. Add it to the feature table and the run block. fynch_bregman_energy printed its inputs with `{:?}` on an ndarray, which emits `shape=[3], strides=[1], layout=CFcf (0xf), const ndim=1`. Print the values as a plain list instead. Claude-Session: https://claude.ai/code/session_01UJZpXYJLkeY3RtMaiJnqSR --- examples/README.md | 3 ++- examples/fynch_bregman_energy.rs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/README.md b/examples/README.md index 5d899c9..2cf4d31 100644 --- a/examples/README.md +++ b/examples/README.md @@ -69,7 +69,7 @@ cargo run --release --example profile_breakdown_torsions | Feature | Examples | |---|---| | `burn` | `burn_sd_fm_semidiscrete_linear`, `burn_rfm_minibatch_ot_linear` | -| `riemannian` | `rfm_poincare_geodesic_ode`, `riemannian_fm_poincare` | +| `riemannian` | `rfm_poincare_geodesic_ode`, `riemannian_fm_poincare`, `rfm_fisher_simplex` | | `sheaf-evals` | `rfm_usgs_earthquakes_cluster_mass`, `rfm_usgs_knn_leiden`, `rfm_usgs_full_pipeline_report` | ```sh @@ -77,6 +77,7 @@ cargo run --release --features burn --example burn_sd_fm_semidiscrete_linear cargo run --release --features burn --example burn_rfm_minibatch_ot_linear cargo run --release --features riemannian --example rfm_poincare_geodesic_ode cargo run --release --features riemannian --example riemannian_fm_poincare +cargo run --release --features riemannian --example rfm_fisher_simplex cargo run --release --features sheaf-evals --example rfm_usgs_earthquakes_cluster_mass cargo run --release --features sheaf-evals --example rfm_usgs_knn_leiden cargo run --release --features sheaf-evals --example rfm_usgs_full_pipeline_report diff --git a/examples/fynch_bregman_energy.rs b/examples/fynch_bregman_energy.rs index 5a9cbe8..13a3057 100644 --- a/examples/fynch_bregman_energy.rs +++ b/examples/fynch_bregman_energy.rs @@ -29,8 +29,8 @@ fn main() { let shannon_grad = bregman_energy_gradient(&fynch::Shannon, &x.view(), ¢er.view(), sigma) .expect("Shannon gradient"); - println!("x: {x:?}"); - println!("center: {center:?}"); + println!("x: {:?}", x.to_vec()); + println!("center: {:?}", center.to_vec()); println!("squared-L2 energy via fynch: {l2_energy:.6}"); println!("squared-L2 energy via logp: {logp_l2_energy:.6}"); println!("Shannon energy via fynch: {shannon_energy:.6}");