Wikipedia

Search results

Monday, December 29, 2025

RKMK: A second look

 In my trademark style, I jumped into an advanced topic without much background when I wrote this code. I implemented it directly from the paper, following the pseudocode and equations without really understanding them. Recently, I went back to it to see if it would make more sense now. With some help from ChatGPT, I finally slowed down and tried to understand what problem this method is actually meant to solve.

    


RKMK methods exist because not every system evolves in a space where you can safely add things together. Standard Runge–Kutta methods assume that states live in a vector space. You take weighted sums of intermediate steps and move forward. That works when your state is a vector. It breaks when your state is something like a matrix that is supposed to stay on a group.

In this code, the state is updated by multiplication, not addition. Each step looks like

yyexp().y \rightarrow y \exp(\cdot).

This is a clue that the natural space here is a Lie group. If you ignore that and apply a standard integrator, small errors accumulate and the state slowly drifts away from where it is supposed to live.

The idea behind RKMK is simple. Do all the bookkeeping in a linear space where addition makes sense, and only at the end move back to the group using the exponential map. The intermediate quantities live in the Lie algebra. The final update lives on the group.

The commutator terms appear because matrix multiplication does not commute. They are not optional corrections. They are there to account for the fact that the order of operations matters. If the underlying space were flat, these terms would disappear.

The final step multiplies the current state by an exponential. This guarantees that the updated state stays on the group by construction. The normalization check afterward is just a sanity check that the geometry is being respected.

No comments:

Post a Comment

RKMK: A second look

 In my trademark style, I jumped into an advanced topic without much background when I wrote this code. I implemented it directly from the p...