Repository navigation
Various improvements for the computation of Reshetikhin--Turaev knot polynomials - #75
Merged
Merged
Conversation
Slicing cuts an edge of the network and sums the contraction over its values, which shrinks every intermediate at the cost of repeating the contraction. It is a large win on memory-bound contractions (2.6GB -> 184MB on a 5-strand braid at V3) and a large loss on cheap ones (28MB/3s -> 208MB/108s for 11n34 at V4), and no cheap way to tell the two apart in advance held up: dense intermediate size, sparse entry counts and monomial-product counts each misclassified a case the others got right. Moved to the rt-slicing branch until that is resolved. What remains is the part that helps unconditionally: interned exponent tuples, streaming contraction that consumes its larger operand, and in-place accumulation. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…with the same set but differently ordered variables
…DictLaurentPolynomial
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.
This is mainly to update the code for the computation of Reshetikhin--Turaev knot polynomials to optimize the RAM consumption, along with some improvements to other related code. The RAM cost is currently the main bottleneck of the computation, and this update in general cut down the RAM cost by ~50% compared to the previous version.
Feature additions
coefficientsandlatexforDictLaurentPolynomial, where the former returns a dictionary representing the coefficients of a given variable, and the latter returns a string of the polynomial inLaTeXformat.DictLaurentPolynomialnow automatically drops redundant variables stored in its attribute after each binary operation.FastDictLaurentPolynomialintoDictLaurentPolynomial.Link.RT_polynomialwhich takes R-matrices as input and computes the corresponding knot polynomial. The computation of various RT polynomials now passes through this method to avoid redundant code.methodfor some methods along the line of computing the RT polynomials, which controls the behavior ofopt_einsum. The flag has not been added toLink.RT_polynomialyet.Bug fixes
DictLaurentPolynomialwhere the computation is not handled correctly if two polynomials have the same set of variables but are stored as differently ordered lists within the two polynomials.Others
invariants.py