A CMF is flat (path-independent) if matrix products are path-independent: any two admissible paths between the same endpoints yield the same product. This page runs the exact 2D residual test. For 3D entries, only the path-independence heuristic applies.
A 2D CMF has matrix fields \(K_1(k,m)\) and \(K_2(k,m)\). The flatness condition states:
When this holds for all \((k,m)\), products along any lattice path from \((0,0)\) to \((K,M)\) agree.
This test checks the condition numerically at each grid point using 20-digit mpmath arithmetic.
The residual at each point \((k,m)\) is the Frobenius norm of \(K_1(k,m)\cdot K_2(k{+}1,m) - K_2(k,m)\cdot K_1(k,m{+}1)\).