Free monoid generated by prime knots available via the¶
KnotInfoBase
class.
A generator of this free abelian monoid is a prime knot according to
the list at KnotInfo. A fully
amphicheiral prime knot is represented by exactly one generator with
the corresponding name. For non-chiral prime knots, there are
additionally one or three generators with the suffixes m
, r
and c
which specify the mirror and reverse images according to
their symmetry type.
AUTHORS:
Sebastian Oehms June 2024: initial version
- class sage.knots.free_knotinfo_monoid.FreeKnotInfoMonoid(max_crossing_number, category=None, prefix=None, **kwds)[source]¶
Bases:
IndexedFreeAbelianMonoid
Initialize
self
with generators belonging to prime knots with at mostmax_crossing_number
crossings.- Element[source]¶
alias of
FreeKnotInfoMonoidElement
- from_knot(knot, unique=True)[source]¶
Create an element of this abelian monoid from
knot
.INPUT:
knot
– an instance ofKnot
unique
– boolean (default isTrue
). This only affects the case where a unique identification is not possible. If set toFalse
you can obtain a matching list (see explanation of the output below)
OUTPUT:
An instance of the element class of
self
per default. If the keyword argumentunique
then a list of such instances is returned.EXAMPLES:
sage: from sage.knots.free_knotinfo_monoid import FreeKnotInfoMonoid sage: FKIM = FreeKnotInfoMonoid() sage: K = KnotInfo.K5_1.link().mirror_image() sage: FKIM.from_knot(K) KnotInfo['K5_1m'] sage: # optional - database_knotinfo sage: K = Knot(KnotInfo.K9_12.braid()) sage: FKIM.from_knot(K) # long time Traceback (most recent call last): ... NotImplementedError: this (possibly non prime) knot cannot be identified uniquely by KnotInfo use keyword argument `unique` to obtain more details sage: FKIM.from_knot(K, unique=False) # long time [KnotInfo['K4_1']*KnotInfo['K5_2'], KnotInfo['K9_12']]
>>> from sage.all import * >>> from sage.knots.free_knotinfo_monoid import FreeKnotInfoMonoid >>> FKIM = FreeKnotInfoMonoid() >>> K = KnotInfo.K5_1.link().mirror_image() >>> FKIM.from_knot(K) KnotInfo['K5_1m'] >>> # optional - database_knotinfo >>> K = Knot(KnotInfo.K9_12.braid()) >>> FKIM.from_knot(K) # long time Traceback (most recent call last): ... NotImplementedError: this (possibly non prime) knot cannot be identified uniquely by KnotInfo use keyword argument `unique` to obtain more details >>> FKIM.from_knot(K, unique=False) # long time [KnotInfo['K4_1']*KnotInfo['K5_2'], KnotInfo['K9_12']]
from sage.knots.free_knotinfo_monoid import FreeKnotInfoMonoid FKIM = FreeKnotInfoMonoid() K = KnotInfo.K5_1.link().mirror_image() FKIM.from_knot(K) # optional - database_knotinfo K = Knot(KnotInfo.K9_12.braid()) FKIM.from_knot(K) # long time FKIM.from_knot(K, unique=False) # long time
- inject_variables(select=None, verbose=True)[source]¶
Inject
self
with its name into the namespace of the Python code from which this function is called.INPUT:
select
– instance ofKnotInfoBase
,KnotInfoSeries
or an integer. In all cases the input is used to restrict the injected generators to the according subset (number of crossings in the case of integer)verbose
– boolean (optional, defaultTrue
) to suppress the message printed on the invocation
EXAMPLES:
sage: from sage.knots.free_knotinfo_monoid import FreeKnotInfoMonoid sage: FKIM = FreeKnotInfoMonoid(5) sage: FKIM.inject_variables(select=3) Defining K3_1 Defining K3_1m sage: FKIM.inject_variables(select=KnotInfo.K5_2) Defining K5_2 Defining K5_2m sage: FKIM.inject_variables(select=KnotInfo.K5_2.series()) Defining K5_1 Defining K5_1m sage: FKIM.inject_variables() Defining K0_1 Defining K4_1
>>> from sage.all import * >>> from sage.knots.free_knotinfo_monoid import FreeKnotInfoMonoid >>> FKIM = FreeKnotInfoMonoid(Integer(5)) >>> FKIM.inject_variables(select=Integer(3)) Defining K3_1 Defining K3_1m >>> FKIM.inject_variables(select=KnotInfo.K5_2) Defining K5_2 Defining K5_2m >>> FKIM.inject_variables(select=KnotInfo.K5_2.series()) Defining K5_1 Defining K5_1m >>> FKIM.inject_variables() Defining K0_1 Defining K4_1
from sage.knots.free_knotinfo_monoid import FreeKnotInfoMonoid FKIM = FreeKnotInfoMonoid(5) FKIM.inject_variables(select=3) FKIM.inject_variables(select=KnotInfo.K5_2) FKIM.inject_variables(select=KnotInfo.K5_2.series()) FKIM.inject_variables()
- class sage.knots.free_knotinfo_monoid.FreeKnotInfoMonoidElement(F, x)[source]¶
Bases:
IndexedFreeAbelianMonoidElement
An element of an indexed free abelian monoid.
- as_knot()[source]¶
Return the knot represented by
self
.EXAMPLES:
sage: from sage.knots.free_knotinfo_monoid import FreeKnotInfoMonoid sage: FKIM = FreeKnotInfoMonoid() sage: FKIM.inject_variables(select=3) Defining K3_1 Defining K3_1m sage: K = K3_1^2 * K3_1m sage: K.as_knot() Knot represented by 9 crossings
>>> from sage.all import * >>> from sage.knots.free_knotinfo_monoid import FreeKnotInfoMonoid >>> FKIM = FreeKnotInfoMonoid() >>> FKIM.inject_variables(select=Integer(3)) Defining K3_1 Defining K3_1m >>> K = K3_1**Integer(2) * K3_1m >>> K.as_knot() Knot represented by 9 crossings
from sage.knots.free_knotinfo_monoid import FreeKnotInfoMonoid FKIM = FreeKnotInfoMonoid() FKIM.inject_variables(select=3) K = K3_1^2 * K3_1m K.as_knot()
- to_knotinfo()[source]¶
Return a word representing
self
as a list of pairs.Each pair
(ki, sym)
consists of aKnotInfoBase
instanceki
andSymmetryMutant
instancesym
.EXAMPLES:
sage: from sage.knots.free_knotinfo_monoid import FreeKnotInfoMonoid sage: FKIM = FreeKnotInfoMonoid() sage: FKIM.inject_variables(select=3) Defining K3_1 Defining K3_1m sage: K = K3_1^2 * K3_1m sage: K.to_knotinfo() [(<KnotInfo.K3_1: '3_1'>, <SymmetryMutant.itself: 's'>), (<KnotInfo.K3_1: '3_1'>, <SymmetryMutant.itself: 's'>), (<KnotInfo.K3_1: '3_1'>, <SymmetryMutant.mirror_image: 'm'>)]
>>> from sage.all import * >>> from sage.knots.free_knotinfo_monoid import FreeKnotInfoMonoid >>> FKIM = FreeKnotInfoMonoid() >>> FKIM.inject_variables(select=Integer(3)) Defining K3_1 Defining K3_1m >>> K = K3_1**Integer(2) * K3_1m >>> K.to_knotinfo() [(<KnotInfo.K3_1: '3_1'>, <SymmetryMutant.itself: 's'>), (<KnotInfo.K3_1: '3_1'>, <SymmetryMutant.itself: 's'>), (<KnotInfo.K3_1: '3_1'>, <SymmetryMutant.mirror_image: 'm'>)]
from sage.knots.free_knotinfo_monoid import FreeKnotInfoMonoid FKIM = FreeKnotInfoMonoid() FKIM.inject_variables(select=3) K = K3_1^2 * K3_1m K.to_knotinfo()