You can easily detect an unknot using Snappy by computing the fundamental group of the knot via:
python
B.exterior().fundamental_group()
Snappy takes about 5 seconds to process a braid with 50,000 crossings and 10 strands on a mid-range laptop.
If you're looking to identify knots, you can also use invariants like the Jones polynomial. Back in the 1990s, I developed software that computes the Jones polynomial at a point x modulo p, i.e., V(x) mod p, where p is a prime number. For a braid with 100,000 crossings and 10 strands, this takes roughly 1.2 seconds.
This method serves as a powerful filter:
Negative test: To check whether your structure is a trefoil, compute V(11) mod 46337. For the trefoil (braid: 111), the result is: JONES(s = t^(1/2) = 11) mod 46337 = 6957 → If your structure does not yield 6957, it’s not a trefoil. → If it does, it might be a trefoil.
If you're working with a limited set of possible knots, you can precompute a table of V(x) mod p values to identify many knots quickly. Example: If only the trefoil yields 6957 for x = 11 and p = 46337, then your structure is the trefoil.
Of course, some knots share the same Jones polynomial. If two such knots appear in your table, further steps are needed after the initial V(x) mod p test.
Unknot test: If your structure yields V(x) mod p = 1 at multiple points, it’s very likely an unknot (Jones conjecture: V = 1 ⇔ unknot).
Alternatively, you can use the fundamental group test mentioned above or attempt to algorithmically untangle the structure. I also wrote a program for that in the 1990s. For braids with 50,000 crossings and 10 strands, it takes about 5 seconds to fully untangle the knot – optionally with step-by-step logging. To date, I haven’t encountered a braid that took longer.
Best of luck with your project!
(Translated from German with a little help from Copilot)