Function Repository Resource:

MultiwayGroup

Source Notebook

Simulate an arbitrary (potentially abelian) group as a multiway system

Contributed by: Jonathan Gorard

ResourceFunction["MultiwayGroup"][<|"Generators"gen,"Relations"rel,"Identity"id,"Inverses"inv|>]

compiles the group with the specified generators, relations, identity element and inverse elements into a specification of a multiway system.

ResourceFunction["MultiwayGroup"][<|"Generators"gen,"Relations"rel,"Identity"id,"Inverses"inv|>,n]

generates the results of n steps in the evolution of the multiway group with the specified generators, relations, identity element and inverse elements.

ResourceFunction["MultiwayGroup"][<|"Generators"gen,"Relations"rel,"Identity"id,"Inverses"inv|>,n,"prop"]

gives the property "prop" for the specified multiway group evolution.

ResourceFunction["MultiwayGroup"][<|"Generators"gen,"Relations"rel,"Identity"id,"Inverses"inv|>sel,]

uses the function sel to select which of the events obtained at each step to include in the evolution.

ResourceFunction["MultiwayGroup"][gen,]

specifies the free group with generators gen, default identity element "e" and default inverse elements "1","2",.

ResourceFunction["MultiwayGroup"][gen,rel,]

specifies the group with generators gen, relations rel, default identity element "e" and default inverse elements "1","2",.

ResourceFunction["MultiwayGroup"][gen,rel,id,]

specifies the group with generators gen, relations rel, identity element id and default inverse elements "1","2",.

ResourceFunction["MultiwayGroup"][gen,rel,id,inv,]

specifies the group with generators gen, relations rel, identity element id and inverse elements inv.

Details and Options

Argument and option patterns for ResourceFunction["MultiwayGroup"] largely match those of the resource function MultiwaySystem.
Rules are specified as associations of group generators, relations, the identity element and the inverse elements; states are specified as words in the corresponding group.
In group presentation theory, the generators are the elements of the group in terms of which all other elements can be expressed as products of powers, the relations are the defining equations of the group, the identity element is the element that leaves all other elements unchanged when applied and the inverse element of a given element is the element that reduces it to the identity when applied.
Generators, the identity element and the inverse elements should be specified as characters, with relations being two-way rules on strings.
The event selection function sel in ResourceFunction["MultiwayGroup"][rulessel,] can be any function; additionally, it can have the following special forms:
"Sequential"applies the first possible replacement (sequential substitution system)
"Random"applies a random replacement
{"Random",n}applies n randomly chosen replacements
ResourceFunction["MultiwayGroup"][gen,] is interpreted as ResourceFunction["MultiwayGroup"][<|"Generators"gen,"Relations"{},"Identity""e","Inverses"{"1","2",},] (i.e. the free group with default identity element "e" and default inverse elements "1","2",).
ResourceFunction["MultiwayGroup"][gen,rel,] is interpreted as ResourceFunction["MultiwayGroup"][<|"Generators"gen,"Relations"rel,"Identity""e","Inverses"{"1","2",},] (i.e. a group with default identity element "e" and default inverse elements "1","2",).
ResourceFunction["MultiwayGroup"][gen,rel,id,] is interpreted as ResourceFunction["MultiwayGroup"][<|"Generators"gen,"Relations"rel,"Identity"id,"Inverses"{"1","2",},] (i.e. a group with default inverse elements "1","2",).
ResourceFunction["MultiwayGroup"][gen,rel,id,inv,] is interpreted as ResourceFunction["MultiwayGroup"][<|"Generators"gen,"Relations"rel,"Identity"id,"Inverses"inv|>,].
In ResourceFunction["MultiwayGroup"][rules,n,prop], the following properties can be requested:
"AllStatesList"the list of all states generated at each successive step (default)
"StatesCountsList"the number of distinct states generated at each successive step
"AllStatesListUnmerged"the list of all states without any merging
"PredecessorRulesList"the list of states and their corresponding predecessor states at each successive step
"EvolutionGraph"graph formed by the evolution process, with no merging between different time steps
"EvolutionGraphStructure"evolution graph without labeling
"EvolutionGraphFull"graph formed by the evolution process, including equivalent events
"EvolutionGraphFullStructure"full evolution graph without labeling
"EvolutionGraphUnmerged"graph formed by the evolution process, with no merging of equivalent states
"EvolutionGraphUnmergedStructure"unmerged evolution graph without labeling
"EvolutionGraphWeighted"graph formed by the evolution process, with edges weighted by event multiplicity
"EvolutionGraphWeightedStructure"weighted evolution graph without labeling
"StatesGraph"graph of how each distinct state leads to other states
"StatesGraphStructure"states graph without labeling
"AllEventsList"the list of all events that occur at each successive step
"EvolutionEventsGraph"graph showing the evolution process with updating events explicitly included
"EvolutionEventsGraphStructure"evolution events graph without labeling
"CausalGraph"graph of causal relationships between updating events
"CausalGraphStructure"causal graph without labeling
"EvolutionCausalGraph"combined graph of evolution process and causal relationships between events
"EvolutionCausalGraphStructure"evolution causal graph without labeling
"CausalGraphInstances"list of distinct causal graphs for all possible choices of event sequences
"CausalGraphStructureInstances"causal graph instances without labeling
"EvolutionCausalGraphInstances"list of distinct evolution causal graphs for all possible choices of event sequences
"EvolutionCausalGraphStructureInstances"evolution causal graph instances without labeling
"BranchPairsList"list of all branch pairs (i.e. critical pairs) generated in the states graph
"NewBranchPairsList"list of all new branch pairs generated at each successive step
"EvolutionBranchPairsList"list of all branch pairs generated in the evolution graph
"NewEvolutionBranchPairsList"list of all new evolution branch pairs generated at each successive step
"BranchPairEventsList"list of all events yielding branch pairs
"NewBranchPairEventsList"list of all events yielding new branch pairs at each successive step
"EvolutionBranchPairEventsList"list of all events yielding evolution branch pairs
"NewEvolutionBranchPairEventsList"list of all events yielding new evolution branch pairs at each successive step
"BranchialGraph"graph of branch pair ancestry at a given step
"BranchialGraphStructure"branchial graph without labeling
"AllStatesBranchialGraph"graph of branch pair ancestry across all steps
"AllStatesBranchialGraphStructure"all states branchial graph without labeling
"EvolutionBranchialGraph"graph of evolution branch pair ancestry at a given step
"EvolutionBranchialGraphStructure"evolution branchial graph without labeling
"AllStatesEvolutionBranchialGraph"graph of evolution branch pair ancestry
"AllStatesEvolutionBranchialGraphStructure"all states evolution branchial graph without labeling
"EventBranchialGraph"graph of branch pair event ancestry at a given step
"EventBranchialGraphStructure"event branchial graph without labeling
"AllEventsBranchialGraph"graph of branch pair event ancestry across all steps
"AllEventsBranchialGraphStructure"all events branchial graph without labeling
"BranchPairResolutionsList"association of all resolved and unresolved branch pairs up to a given step
"EvolutionBranchPairResolutionsList"association of all resolved and unresolved evolution branch pairs up to a given step
"CausalInvariantQ"whether the system is causal invariant (all branch pairs converge)
"EvolutionCausalInvariantQ"whether the system is evolution causal invariant (all evolution branch pairs converge)
"KnuthBendixCompletion"list of Knuth–Bendix completion rules required to force causal invariance
"EvolutionKnuthBendixCompletion"list of Knuth–Bendix completion rules required to force evolution causal invariance
"StateWeights"list of weights for all vertices in the states graph
Except for "AllStatesListUnmerged", "EvolutionGraphUnmerged" and states containing state IDs, identical states are always merged at each step.
In "StatesGraph", all instances of a given state at any step are merged. Different updating events that connect the same states will only be shown as separate edges if "IncludeEventInstances" is set to True.
Events are represented in the form {rule,input,rest}, where rule is the rule used in the updating event, input is the part of the state to which the rule is applied and rest is the remainder of the state. For substitution systems, rest is given in the form {prefix,suffix}.
Options for ResourceFunction["MultiwayGroup"] include:
"Abelian"Falsewhether the group is abelian
"StyleEdges"Truewhether to style edges according to generators, relations, identity, inverse and commutativity
"AppendOnly"Falsewhether to apply generators only to the end of the word
"IncludeStepNumber"Falsewhether to label states and events with their respective step numbers
"IncludeStateID"Falsewhether to label states and events with unique IDs
"IncludeInitializationEvents"Falsewhether to include pseudoevents that set up initial conditions
"IncludeEventInstances"Falsewhether to show distinct updating events that connect the same states as separate edges
"IncludeStateWeights"Falsewhether to weight state vertices by their rate of occurrence at a particular time step
"IncludeStatePathWeights"Falsewhether to weight state vertices by the number of distinct evolution paths that lead to them
"StateRenderingFunction"Automatichow to label states that appear in graphs
"EventRenderingFunction"Automatichow to label events that appear in graphs
MaxItemsInfinityhow many instances of a causal graph or evolution causal graph to return
"GivePredecessors"Falsewhether to label branch pairs with their predecessor state
"GiveResolvents"Falsewhether to label branch pairs with their resolvent state
"IncludeSelfPairs"Falsewhether to include trivial branch pairs
"IncludeFullBranchialSpace"Falsewhether to show all possible states in a given branchial graph
"LineThickness"1absolute line thickness for graph edges
Possible settings for "StateRenderingFunction" and "EventRenderingFunction" include:
Inheriteduse the explicit vertex name as the label
Noneuse no label for the vertex
"shape"use a shape from the VertexShapeFunction collection
funcapply the function func to the name of the vertex
For "CausalGraphInstances" and "EvolutionCausalGraphInstances", the option MaxItemsn can be used to get only the first n possible instances of causal graphs.
By default, states graphs are styled using red edges to indicate the application of a generator, green edges to indicate the application of a relation, cyan edges to indicate the application of the identity element, magenta edges to indicate the application of an inverse element and blue edges to indicate the application of commutativity.

Examples

Basic Examples (18) 

Show basic group compilation (compiling groups on one, two and three generators to MultiwaySystem rules):

In[1]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"1"}|>]
Out[1]=
In[2]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"abb" <-> "bba"}, "Identity" -> "e", "Inverses" -> {"1", "2"}|>]
Out[2]=
In[3]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b", "c"}, "Relations" -> {"abc" <-> "bca", "bca" <-> "cab"}, "Identity" -> "e", "Inverses" -> {"1", "2", "3"}|>]
Out[3]=

When only the generators are specified, the free group with identity element "e" and inverse elements {"1","2",} is assumed by default:

In[4]:=
ResourceFunction["MultiwayGroup"][{"a", "b"}]
Out[4]=
In[5]:=
ResourceFunction["MultiwayGroup"][{"a", "b"}, {"abb" <-> "bba"}]
Out[5]=
In[6]:=
ResourceFunction["MultiwayGroup"][{"a", "b"}, {"abb" <-> "bba"}, "x"]
Out[6]=
In[7]:=
ResourceFunction[
 "MultiwayGroup"][{"a", "b"}, {"abb" <-> "bba"}, "x", {"u", "v"}]
Out[7]=

Generate a graph showing how each state is obtained from the others for the free group on two generators:

In[8]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"1", "2"}|>, 2, "StatesGraph"]
Out[8]=

Show the structure of the graph, without labels:

In[9]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"1", "2"}|>, 2, "StatesGraphStructure"]
Out[9]=

Generate the states graph for a non-free group on two generators:

In[10]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraph"]
Out[10]=

Show the structure of the graph, without labels:

In[11]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraphStructure"]
Out[11]=

Generate the states graph for the free abelian group on two generators:

In[12]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"1", "2"}|>, 2, "StatesGraph", "Abelian" -> True]
Out[12]=

Compare to the free non-abelian group on two generators (default):

In[13]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"1", "2"}|>, 2, "StatesGraph", "Abelian" -> False]
Out[13]=

Generate the (reduced) states graph for a group on two generators, where generators are applied only to the end of the word:

In[14]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraphStructure", "AppendOnly" -> True]
Out[14]=

Compare to the full states graph for the same group:

In[15]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraphStructure", "AppendOnly" -> False]
Out[15]=

Generate a graph of the evolution history, with updating events included:

In[16]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "EvolutionEventsGraph"]
Out[16]=

Show the structure of the graph, without labels:

In[17]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "EvolutionEventsGraphStructure"]
Out[17]=

Generate the causal graph, showing dependencies between updating events:

In[18]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 3, "CausalGraph"]
Out[18]=

Show the structure of the graph, without labels:

In[19]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 3, "CausalGraphStructure"]
Out[19]=

Generate the evolution events graph, with causal connections included:

In[20]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "EvolutionCausalGraph"]
Out[20]=

Show the structure of the graph, without labels:

In[21]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "EvolutionCausalGraphStructure"]
Out[21]=

Specify an event selection function that picks a random pair of events at each step:

In[22]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|> -> {"Random", 2}, 3, "StatesGraph", "StyleEdges" -> False]
Out[22]=

Generate causal graphs for all possible choices of events sequences:

In[23]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "CausalGraphInstances"]
Out[23]=

Show the structures of the graphs, without labels:

In[24]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "CausalGraphStructureInstances"]
Out[24]=

Generate the list of all branch pairs (i.e. critical pairs):

In[25]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "BranchPairsList"]
Out[25]=

Generate the association showing which branch pairs converged and which did not:

In[26]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "BranchPairResolutionsList"]
Out[26]=

Prove that the system is causal invariant:

In[27]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 4, "CausalInvariantQ"]
Out[27]=

Generate a graph showing branch pair ancestry:

In[28]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "BranchialGraph"]
Out[28]=

Show the structure of the graph, without labels:

In[29]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "BranchialGraphStructure"]
Out[29]=

Generate a graph showing branch pair event ancestry:

In[30]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "EventBranchialGraphStructure"]
Out[30]=

Prevent identical states from being merged by including step numbers and state IDs:

In[31]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "StatesGraph", "IncludeStepNumber" -> True, "IncludeStateID" -> True]
Out[31]=
In[32]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "AllStatesList", "IncludeStepNumber" -> True, "IncludeStateID" -> True]
Out[32]=

Generate a graph of the full evolution history, with all events included:

In[33]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "EvolutionGraphFull"]
Out[33]=

Show the structure of the graph, without labels:

In[34]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "EvolutionGraphFullStructure"]
Out[34]=

Generate a graph of the full evolution history, with no merging of equivalent states:

In[35]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "EvolutionGraphUnmerged", "StyleEdges" -> False]
Out[35]=

Show the structure of the graph, without labels:

In[36]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "EvolutionGraphUnmergedStructure", "StyleEdges" -> False]
Out[36]=

Generate a graph of the evolution history, with edges weighted by event multiplicity:

In[37]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "EvolutionGraphWeighted", EdgeLabels -> "EdgeWeight"]
Out[37]=

Show the structure of the graph, without labels:

In[38]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "EvolutionGraphWeightedStructure", EdgeLabels -> "EdgeWeight"]
Out[38]=

Generate a states graph with vertices weighted by their rate of occurrence on each time step:

In[39]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraph", "IncludeStateWeights" -> True, VertexLabels -> "VertexWeight"]
Out[39]=

Show the structure of the graph, without labels:

In[40]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraphStructure", "IncludeStateWeights" -> True, VertexLabels -> "VertexWeight"]
Out[40]=

Generate a states graph with vertices weighted by the number of distinct evolution paths that lead to them:

In[41]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraph", "IncludeStatePathWeights" -> True, VertexLabels -> "VertexWeight"]
Out[41]=

Show the structure of the graph, without labels:

In[42]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraphStructure", "IncludeStatePathWeights" -> True, VertexLabels -> "VertexWeight"]
Out[42]=

Scope (4) 

Generators, Relations, Identity and Inverses (1) 

MultiwayGroup accepts both partial and full (association) specifications of groups in terms of generators, relations, identity element and inverse elements:

In[43]:=
ResourceFunction["MultiwayGroup"][{"a", "b"}, 2, "StatesGraph"]
Out[43]=
In[44]:=
ResourceFunction[
 "MultiwayGroup"][{"a", "b"}, {"a" <-> "b", "1" <-> "2"}, 2, "StatesGraph"]
Out[44]=
In[45]:=
ResourceFunction[
 "MultiwayGroup"][{"a", "b"}, {"a" <-> "b", "1" <-> "2"}, "i", 2, "StatesGraph"]
Out[45]=
In[46]:=
ResourceFunction[
 "MultiwayGroup"][{"a", "b"}, {"a" <-> "b", "x" <-> "y"}, "i", {"x", "y"}, 2, "StatesGraph"]
Out[46]=
In[47]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"a" <-> "b", "x" <-> "y"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraph"]
Out[47]=

Commutativity (1) 

MultiwayGroup can handle both abelian and non-abelian (default) groups:

In[48]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraph", "Abelian" -> True]
Out[48]=
In[49]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraph", "Abelian" -> False]
Out[49]=

Event Selection Functions (2) 

Apply only the first possible event at each step:

In[50]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|> -> "Sequential", 3, "StatesGraph", "StyleEdges" -> False]
Out[50]=

Apply the first and last possible events at each step:

In[51]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|> -> ({First[#], Last[#]} &), 3, "StatesGraph", "StyleEdges" -> False]
Out[51]=

Options (31) 

Commutativity (2) 

By default, all groups are non-abelian:

In[52]:=
group = ResourceFunction[
  "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraph"]
Out[52]=
In[53]:=
FindShortestPath[group, "ab", "ba"]
Out[53]=

Make the group abelian:

In[54]:=
group2 = ResourceFunction[
  "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraph", "Abelian" -> True]
Out[54]=
In[55]:=
FindShortestPath[group2, "ab", "ba"]
Out[55]=

Append Only (2) 

By default, MultiwayGroup evolves by applying generators at all possible places within a word:

In[56]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b", "c"}, "Relations" -> {"ab" <-> "bc", "bc" <-> "ca", "xy" <-> "yz", "yz" <-> "zx"}, "Identity" -> "e", "Inverses" -> {"x", "y", "z"}|>, 2, "StatesGraph"]
Out[56]=

Apply generators only at the end of the word:

In[57]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b", "c"}, "Relations" -> {"ab" <-> "bc", "bc" <-> "ca", "xy" <-> "yz", "yz" <-> "zx"}, "Identity" -> "e", "Inverses" -> {"x", "y", "z"}|>, 2, "StatesGraph", "AppendOnly" -> True]
Out[57]=

Edge Styling (2) 

By default, edges are styled in red if they correspond to the application of a generator, green if they correspond to the application of a relation, cyan if they correspond to the application of the identity element, magenta if they correspond to the application of an inverse element and blue if they correspond to the application of commutativity:

In[58]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b", "c"}, "Relations" -> {"ab" <-> "bc", "bc" <-> "ca", "xy" <-> "yz", "yz" <-> "zx"}, "Identity" -> "e", "Inverses" -> {"x", "y", "z"}|>, 2, "StatesGraph", "Abelian" -> True]
Out[58]=

Use no styling for edges:

In[59]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b", "c"}, "Relations" -> {"ab" <-> "bc", "bc" <-> "ca", "xy" <-> "yz", "yz" <-> "zx"}, "Identity" -> "e", "Inverses" -> {"x", "y", "z"}|>, 2, "StatesGraph", "Abelian" -> True, "StyleEdges" -> False]
Out[59]=

State Node Rendering (5) 

By default, states are labeled by their contents:

In[60]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraph"]
Out[60]=

Use no labeling for states:

In[61]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraph", "StateRenderingFunction" -> None]
Out[61]=

"StatesGraphStructure" yields the same result:

In[62]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraphStructure"]
Out[62]=

Use raw state names as node labels:

In[63]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraph", "StateRenderingFunction" -> Inherited]
Out[63]=

Use a named shape as each state label:

In[64]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraph", "StateRenderingFunction" -> "Square"]
Out[64]=

Event Node Rendering (4) 

By default, both states and events are labeled by their contents:

In[65]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "EvolutionEventsGraph"]
Out[65]=

Use no labels for states or events:

In[66]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "EvolutionEventsGraph", "StateRenderingFunction" -> None, "EventRenderingFunction" -> None]
Out[66]=

"EvolutionEventsGraphStructure" yields an equivalent result:

In[67]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "EvolutionEventsGraphStructure"]
Out[67]=

Use raw event expressions as their labels:

In[68]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "EvolutionEventsGraph", "StateRenderingFunction" -> None, "EventRenderingFunction" -> Inherited]
Out[68]=

Initialization Events (2) 

By default, "AllEventsList" does not include initialization events:

In[69]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "AllEventsList"]
Out[69]=

The option "IncludeInitializationEvents" allows one to override this default:

In[70]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "AllEventsList", "IncludeInitializationEvents" -> True]
Out[70]=

Initialization events have special default rendering:

In[71]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "EvolutionEventsGraph",
  "IncludeInitializationEvents" -> True]
Out[71]=

Graph Layout Options (2) 

Place arrows in the middle of edges:

In[72]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraph", EdgeShapeFunction -> GraphElementData["ShortFilledArrow", "ArrowSize" -> 0.03]]
Out[72]=

Generate an example of a (free) multiway group:

In[73]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraph"]
Out[73]=

Force the initial state nodes to be at the top:

In[74]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraph", GraphLayout -> {"LayeredDigraphEmbedding", "RootVertex" -> {"a", "b", "x", "y", "e"}}, AspectRatio -> 1/4]
Out[74]=

Step Numbers and State IDs (2) 

By default, equivalent states are merged across all time steps:

In[75]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "StatesGraph"]
Out[75]=
In[76]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "AllStatesList"]
Out[76]=

Merging of equivalent states across different time steps can be prevented by including step numbers:

In[77]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "StatesGraph", "IncludeStepNumber" -> True]
Out[77]=

List the states:

In[78]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "AllStatesList", "IncludeStepNumber" -> True]
Out[78]=

Merging of equivalent states at the same time step can be prevented by also including state IDs:

In[79]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "StatesGraph", "IncludeStepNumber" -> True, "IncludeStateID" -> True]
Out[79]=

List the states:

In[80]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "AllStatesList", "IncludeStepNumber" -> True, "IncludeStateID" -> True]
Out[80]=

Step numbers and state IDs also apply to events:

In[81]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "EvolutionEventsGraph",
  "IncludeStepNumber" -> True, "IncludeStateID" -> True]
Out[81]=

See the events:

In[82]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "AllEventsList", "IncludeStepNumber" -> True, "IncludeStateID" -> True]
Out[82]=

Event Instances (2) 

By default, multiple instances of equivalent updating events are merged in the states graph:

In[83]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraph"]
Out[83]=

Merging of equivalent events can be prevented by including event instances:

In[84]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraph", "IncludeEventInstances" -> True]
Out[84]=

State (Path) Weights (2) 

Vertices of a states graph can be weighted by their relative rate of occurrence at each time step:

In[85]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraph", "IncludeStateWeights" -> True, VertexLabels -> "VertexWeight"]
Out[85]=

Vertices can also be weighted by the number of distinct evolution paths that lead to them:

In[86]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 2, "StatesGraph", "IncludeStatePathWeights" -> True, VertexLabels -> "VertexWeight"]
Out[86]=

MaxItems (2) 

By default, "CausalGraphInstances" returns all possible causal graphs:

In[87]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "CausalGraphInstances"]
Out[87]=

The number of causal graphs can be limited using MaxItems:

In[88]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "CausalGraphInstances",
  MaxItems -> 5]
Out[88]=

Predecessors and Resolvents (2) 

By default, "BranchPairsList" returns only a list of branch pairs:

In[89]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "BranchPairsList"]
Out[89]=

Common predecessor states can be shown using "GivePredecessors":

In[90]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "BranchPairsList", "GivePredecessors" -> True]
Out[90]=

Similarly, "BranchPairResolutionsList" by default lists only resolved and unresolved branch pairs:

In[91]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "BranchPairResolutionsList"]
Out[91]=

Common resolvents of resolved branch pairs can be shown using "GiveResolvents":

In[92]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "BranchPairResolutionsList", "GiveResolvents" -> True]
Out[92]=

Show both common predecessors and common resolvents, where appropriate:

In[93]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a"}, "Relations" -> {}, "Identity" -> "e", "Inverses" -> {"x"}|>, 2, "BranchPairResolutionsList", "GivePredecessors" -> True, "GiveResolvents" -> True]
Out[93]=

Full Branchial Space (2) 

By default, non-branch pair states are not shown as part of the branchial graph:

In[94]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 3, "BranchialGraph"]
Out[94]=

They can be shown using "IncludeFullBranchialSpace":

In[95]:=
ResourceFunction[
 "MultiwayGroup"][<|"Generators" -> {"a", "b"}, "Relations" -> {"aa" <-> "bb", "xx" <-> "yy"}, "Identity" -> "e", "Inverses" -> {"x", "y"}|>, 3, "BranchialGraph", "IncludeFullBranchialSpace" -> True]
Out[95]=

Publisher

Jonathan Gorard

Version History

  • 1.0.0 – 02 September 2020

Source Metadata

Related Resources

License Information