Repository navigation
Fix quadrature noise in linking number diagnostic - #63
rogeriojorge wants to merge 13 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
|
|
Added SIMSOPT-compatible |
0fd8379 to
e6d8005
Compare
eduardolneto
left a comment
There was a problem hiding this comment.
The changes to add restructure and add extra compatibility with simsopt equivalent calculations are good. However, should we find a way to get an alternative loss function that is differentiable?
a32d831 to
da43b57
Compare
Round each coil pair’s absolute Gauss integral to its integer linking number, matching SIMSOPT. Stop gradients through this topological diagnostic and mask padded quadrature entries without changing the physical denominator. Optional downsampling reduces pairwise work.
Tests cover Hopf links, unlinked circles, orientation, symmetry copies, uneven quadrature blocks, and zero gradients. Mandatory NumPy reference tests and optional SIMSOPT parity tests verify each pair and the aggregate. Linking number remains undefined for intersecting curves.
Recorded validation: reference/SIMSOPT parity and the 99-test suite passed (one expected failure). Python 3.10–3.12 CI passes. No production dependency is added.