Implement computation of Reshetikhin--Turaev knot polynomials along with miscellaneous features for Tangle - #72
Conversation
Co-authored-by: Copilot <copilot@github.com>
More tests pending Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
_rebuild() bug fixed simplify() bug fixed. All three Reidemeister moves work for Tangles but not the pickup moves TODO: 1. decide whether to fix describe() or replace it entirely with PD_code() 2. fix isosig() for Tangles 3. implement rot_num()
describe and isosig kept using old_tangles TODO: 1. rot_num 2. flip 3. computation of RT invariants 4. is_planar
…creating pull request
…ynomial and sage's LaurentPolynomial
…'s behaviour. Update doctests
|
Hi @Shakugannotorch: This looks like a very nice contribution to Spherogram. Thanks! |
|
I think you should modify |
Done. I only added |
Thanks. Unrelated question: Does the invariant of Bar-Natan and van der Veen fit naturally into this framework? |
Short answer: No. Longer answer: I'm not sure if there is a definition of their theta polynomial in this framework, but even if there is, it would not be optimal to compute the theta polynomial using this framework. The time complexity with this framework is always sub-exponential, but the theta polynomial is computable in polynomial time following their definition. |
|
I think I've fixed all the style issues pointed out previously. Please let me know if there is any other changes needed. |
This is to implement the computation of Reshetikhin--Turaev knot polynomials following the algorithm described in Fixed-parameter tractable computation of Reshetikhin--Turaev knot polynomials via tensor networks.
The algorithm converts the knot diagram into a tensor network and performs tensor contractions, which allows computation of any Reshetikhin--Turaev knot polynomial provided its R-matrix and ribbon element. The current implementation comes with the R-matrices and ribbon elements of the n-colored Jones polynomial for any n>=0 and of the n-colored Links--Gould polynomial (defined as the V_n polynomial in Multivariable knot polynomials from braided Hopf algebras with automorphisms) for n = 1, 2, 3, 4.
Feature additions
DictLaurentPolynomialfor representing Laurent polynomials (over Z) without dependence on Sage. It is more RAM-efficient for multi-variable polynomials and supports building from strings (from_str) and conversion to and from Sage's PuiseuxSeries and LaurentPolynomial (to_sage,from_sage). It also supports arbitrary monomial changes of variables with the rules specified by strings (change_vars) and automatically matches variables when doing binary operations.SparseTensorwhich represents tensors of arbitrary shapes and provides methods for doing tensor contractions. Entries of tensors can be of any class supporting addition and multiplication.RMatrixfor holding the R-matrix and ribbon element (asSparseTensor's) defining a Reshetikhin--Turaev functor. Supports reading from CSV files (from_directory).Tangle.rot_numwhich computes the rotation numbers for an arbitrary upward-oriented tangle. Used in creatingRTNetworkbelow.RTNetworkrepresenting tensor networks obtained by applying the Reshetikhin--Turaev functor to upward-orientedTangle's. It uses the package opt_einsum for finding efficient contraction sequences (optimal_contraction_sequence) and computing the contraction width of the tensor network (contraction_width). Supports faithful contraction which collapse the tensor network into a single tensor which is an invariant of the oriented tangle (contract_all);__eq__has been written to support direct comparison of this invariant. Also supports contraction with fixated open arcs which is more efficient for computing oriented link invariants (evaluate).reshetikhin_turaev_network,contraction_widthandcontraction_sequenceforTangleto interact withRTNetwork.Link.long_diagramwhich returns the (1,1)-tangle obtained by cutting a link open at an arc specified by indices.Link.colored_jones_polynomialandLink.colored_links_gould_polynomialrespectively.Tangle.flipwhich flips the tangle over in 3D along the vertical axis, inheriting the orientation from the original tangle (modified from code provided by @NathanDunfield).digraph,split_tangle_diagramandis_planarforTanglesimilar to those forLink; the constructor ofTanglenow checks the planarity of the tangle by default.Bug fixes
Tangle.facesresults in an infinite loop in some corner cases.Strandin closed component is not removed fromTangle.componentsafter build even though it is fused afterwards.