The 3-cell rule
The simulator turns each spin into a magnetic phase by looking at it together with its two immediate neighbors. The rule is embarrassingly simple:
- All three spins identical → FM.
- Strict ↑↓↑ or ↓↑↓ → AFM.
- Anything else → Mixed.
That's exactly what the original Python helper spin_array_manual_v2 does — and what the JS port in lib/phases.ts mirrors so the editor can colour itself instantly without a backend round-trip.
See the window slide
Hover any cell below and the orange highlight shows the 3-layer window the classifier used to label it:
AFM 19Mixed 2FM 0Hover a cell to see the 3-layer classification window.
Key takeaways
- 3-cell window decides the local phase.
- Phase decides which Lorentz oscillator goes into the layer.