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.

Parameters

braidword list
List containing integers (representing Artin generators) to be used as initial word.

Attributes

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.

<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.

Parameters

index int
Index where canCancel is to be checked.

Returns

True if successful, False otherwise.

Checks if destabilize() is a valid move. Destabilization refers to destabilization of a closed braid. destabilize is the inverse operation of stabilize and is only permissible when the `largestGenerator` appears exactly once at the last index of `word`.

Returns

True if successful, False otherwise.

Checks if flip can be performed at index. A `flip' refers to the second braid relation in the braid group.

Parameters

index int
Index where canFlip is to be checked.

Returns

True if successful, False otherwise.

Checks if transpose at index is a valid move. A transpose is the first braid relation in the braid group.

Parameters

index int
Index where canTranspose is to be checked.

Returns

True if successful, False otherwise.

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.

Parameters

index int
Index where cancel is to be performed.

Returns

Boolean that triggers state of Markov step in logs.

Method to conjugate the word at index. Conjugation is defined for closed braids by AB = BA.

Parameters

index int
Index where conjugate is to be performed.

Returns

Boolean that triggers state of Markov step in logs.

Destabilizes the BraidWord, decreases word length by one, and decreases largestGenerator if successful. Destabilization is a Markov Move defined for closed braids.

Returns

Boolean that triggers state of Markov step in logs.

Flips generators at index, (index+1) modulo length, and (index+2) modulo length. A flip performs the second braid relation in the braid group.

Parameters

index int
Index where flip is to be performed.

Returns

Boolean that triggers state of Markov step in logs.

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.

Parameters

index int
Index where insert is to be performed.
generator int
Generator to be inserted into word.

Returns

Boolean that triggers state of Markov step in logs.

Dynamically returns the length of the word.

Returns

Length of word.

Stabilizes the BraidWord, increases word length by one, and increases largestGenerator by one if successful. Stabilization is a Markov Move defined for closed braids.

Returns

Boolean that triggers state of Markov step in logs.

Transposes generators at index and (index+1) modulo length. Transpose performs the first braid relation in the braid group.

Parameters

index int
Index where transpose is to be performed.

Returns

Boolean that triggers state of Markov step in logs.

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 with random_index set to True, or it can be set manually by setting random_index=False and assigning index with an integer value between zero and the length of the word of the BraidWord.

Parameters

random_index bool
Determines whether method randomly selects index or not.
index int
Index where generator will be inverted.

Returns

BraidWord

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 with random_index set to True, or it can be set manually by setting random_index=False and assigning index with an integer value between zero and the length of the word of the BraidWord.

Parameters

random_index bool
Determines whether method randomly selects index or not.
index int
Index where generator will be removed.

Returns

BraidWord