Repository navigation
Fix the sign of getLinkingNumber - #79
Merged
Merged
Conversation
_getLinkingNumberCpp returned -L/2, but intersectValue already uses the standard crossing sign, so L = 2 * lk and the result was the negative of the Gauss linking number. Return L/2 and pin the Hopf link's sign in test_hopf_link_sign. Release the new[] buffers in intersectValue and _getLinkingNumberCpp with delete[] instead of free(), and release data, which leaked. Fixes open2c#78
mimakaev
approved these changes
Oct 4, 2026
teerthsharma
pushed a commit
to teerthsharma/teerthsharma
that referenced
this pull request
Oct 11, 2026
The profile linked its website to teerthsharma.github.io and its 3D portfolio to teerthfolio.vercel.app. teerthsharma.github.io now serves from teerth.dev, which GitHub redirects to with a 301 for the user site and every project site; teerthfolio.vercel.app 308-redirects to www.evilseal.si. The Website, 3D portfolio and Caustic results links point at the new addresses directly, so none of the three passes through a redirect. open2c/polychrom#79, merged 2026-10-04, joins the landings table, the link row under the ticker and commits.svg as a twelfth slide. getLinkingNumber returned the negated Gauss linking number on every linked pair; the fix brings agreement with a Gauss-Legendre double integral from 1/11 pairs to 11/11. The ticker's alt text and footer now say twelve, eleven of them in production ML infrastructure, since polychrom is a chromosome-simulation library. gen.py reproduces the previously committed commits.svg and systems.svg byte-for-byte before this change, and the new slide passes its width guard. The resume carries the same link changes and an open2c block in the Experience section's existing per-org shape. The added block overflowed A4 by two lines; the Caustic and OpenCLAW-P2P entries each lose one clause and Education fits on one line, so the render stays one page (125,023 bytes, against 121,354 before). The Experience entries above open2c are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #78.
_getLinkingNumberCppsums signed projected crossings intoLand returns-L/2.intersectValuealready uses the standard crossing sign, so the negation makesgetLinkingNumberreturn the opposite of the Gauss linking number, and of its own docstring, on every linked pair.This change returns
L/2. It also releases thenew[]buffers inintersectValueand_getLinkingNumberCppwithdelete[]instead offree(), and releasesdata, which leaked.test_hopf_link_signpins the sign: -1 for the test's Hopf link, +1 with one ring reversed. The existingtest_hopf_linkonly checkedabs(L) == 1.mutualSimplify,simplifyPolymerand the Python signatures are unchanged.Validation
From this branch on
masterat1e9ac0f, in-place build on Ubuntu (WSL2), g++ 15.2.0, Python 3.14.4, openmm 8.6.1:getLinkingNumbervs a Gauss–Legendre double integral, 11 pairs (Hopf link in four orientations, T(2,2), T(2,4), T(2,6) in both chiralities, unlinked rings): 1/11 agree onmaster, 11/11 with this change.pytest tests: 64/64 passed onmaster, 65/65 with this change.test_hopf_link_signwithmaster's__polymer_math.cpp: fails, 1 failed and 1 passed of the two Hopf tests.valgrindon a 30-point Hopf link: 16Mismatched free() / delete / delete []contexts onmaster, 0 with this change. Definitely lost: 3,192 bytes onmaster, 2,712 with this change.black -l 120 --check .: 40 files unchanged.isort --check-only .: clean.flake8 tests/test_polymer_math.py: clean.Limits
Every non-zero result changes sign, so analyses run against
mastersince #75 that kept the sign will invert. Results from v0.1.0 keep their sign and halve.PR Checklist
black .)isort .)flake8and try to resolve all the issues (work in progress!)