BraidWord
class braidgenerator.BraidWord(**kwargs)
A BraidWord represents a mathematical braid. A mathematical braid is a word expressed as a finite list of Artin generators or their inverses. Generators are represented here as positive or negative integers. An object of BraidWord (i.e. a braid) is the main component acted upon by the MarkovChain class.
-
braidword
list
- List containing integers (representing Artin generators) to be used as initial word.
Parameters
-
word
list
- word of BraidWord, made up of list containing integer generators.
-
largestGenerator
int
- Largest Generator in word.
-
genCount
list
- Array of quantity of generators in word.
Attributes
<BraidWord>.methods
-
Boolean stating if cancel at index is a valid move. Cancellation refers to the cancellation of a generator and its consecutive inverse in the braid group.
-
index
int
- Index where canCancel is to be checked.
Parameters
- True if successful, False otherwise.
Returns
-
Checks if destabilize() is a valid move. Destabilization refers to destabilization of a closed braid.
destabilize
is the inverse operation ofstabilize
and is only permissible when the `largestGenerator` appears exactly once at the last index of `word`.
- True if successful, False otherwise.
Returns
-
Checks if flip can be performed at index. A `flip' refers to the second braid relation in the braid group.
-
index
int
- Index where canFlip is to be checked.
Parameters
- True if successful, False otherwise.
Returns
-
Checks if transpose at index is a valid move. A transpose is the first braid relation in the braid group.
-
index
int
- Index where canTranspose is to be checked.
Parameters
- True if successful, False otherwise.
Returns
-
Performs cancellation of the generators at index and (index+1) modulo length and decreases length of word by two. Cancellation refers to the cancellation of a generator and its consecutive inverse in the braid group.
-
index
int
- Index where cancel is to be performed.
Parameters
- Boolean that triggers state of Markov step in logs.
Returns
-
Method to conjugate the word at index. Conjugation is defined for closed braids by AB = BA.
-
index
int
- Index where conjugate is to be performed.
Parameters
- Boolean that triggers state of Markov step in logs.
Returns
-
Destabilizes the BraidWord, decreases word length by one, and decreases largestGenerator if successful. Destabilization is a Markov Move defined for closed braids.
- Boolean that triggers state of Markov step in logs.
Returns
-
Flips generators at index, (index+1) modulo length, and (index+2) modulo length. A flip performs the second braid relation in the braid group.
-
index
int
- Index where flip is to be performed.
Parameters
- Boolean that triggers state of Markov step in logs.
Returns
-
Insert a generator and its inverse into word. Will insert the given generator and its inverse at index and increases word length by two. Insertion is permissible because the braid group is a group.
-
index
int
- Index where insert is to be performed.
-
generator
int
- Generator to be inserted into word.
Parameters
- Boolean that triggers state of Markov step in logs.
Returns
-
Dynamically returns the length of the word.
- Length of word.
Returns
-
Stabilizes the BraidWord, increases word length by one, and increases largestGenerator by one if successful. Stabilization is a Markov Move defined for closed braids.
- Boolean that triggers state of Markov step in logs.
Returns
-
Transposes generators at index and (index+1) modulo length. Transpose performs the first braid relation in the braid group.
-
index
int
- Index where transpose is to be performed.
Parameters
- Boolean that triggers state of Markov step in logs.
Returns
-
The
crossing_change
method performs a crossing change on a BraidWord. That is, it returns a new BraidWord whereby the generator at a specified index is inverted. The resulting index can be set randomly withrandom_index
set toTrue
, or it can be set manually by settingrandom_index=False
and assigningindex
with an integer value between zero and the length of the word of the BraidWord.
-
random_index
bool
- Determines whether method randomly selects index or not.
-
index
int
- Index where generator will be inverted.
Parameters
BraidWord
Returns
-
The
resolution
method performs a resolution on a BraidWord. That is, it returns a new BraidWord whereby the generator at a specified index is removed and the length of the new BraidWord is decreased by one. The resulting index can be set randomly withrandom_index
set toTrue
, or it can be set manually by settingrandom_index=False
and assigningindex
with an integer value between zero and the length of the word of the BraidWord.
-
random_index
bool
- Determines whether method randomly selects index or not.
-
index
int
- Index where generator will be removed.
Parameters
BraidWord
Returns