Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Simulate a quantum evolution as a multiway system
| ResourceFunction["QuantumToMultiwaySystem"][<|"Operator"→op,"Basis"→basis|>] compiles the quantum system with the specified operator and basis into a specification of a multiway system. | |
| ResourceFunction["QuantumToMultiwaySystem"][<|"Operator"→op,"Basis"→basis|>,init,n] generates the results of n steps in the evolution of the multiway quantum system with the specified operator and basis, starting from the initial conditions init. | |
| ResourceFunction["QuantumToMultiwaySystem"][<|"Operator"→op,"Basis"→basis|>,init,n,"prop"] gives the property "prop" for the specified multiway quantum system evolution. | |
| ResourceFunction["QuantumToMultiwaySystem"][<|"Operator"→op,"Basis"→basis|>→sel,init,n,…] uses the function sel to select which of the events obtained at each step to include in the evolution. | |
| ResourceFunction["QuantumToMultiwaySystem"][op,…] uses the default (computational) basis for compiling the specified quantum operator. | 
| "Sequential" | applies the first possible replacement (sequential substitution system) | 
| "Random" | applies a random replacement | 
| {"Random",n} | applies n randomly chosen replacements | 
| "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 relations 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 across all steps | 
| "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 | 
| "EvolutionEventBranchialGraph" | graph of evolution branch pair event ancestry at a given step | 
| "EvolutionEventBranchialGraphStructure" | evolution event branchial graph without labeling | 
| "AllEventsEvolutionBranchialGraph" | graph of evolution branch pair event ancestry across all steps | 
| "AllEventsEvolutionBranchialGraphStructure" | all events evolution 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 | 
| "IncludeStepNumber" | False | whether to label states and events with their respective step numbers | 
| "IncludeStateID" | False | whether to label states and events with unique IDs | 
| "IncludeInitializationEvents" | False | whether to include pseudoevents that set up initial conditions | 
| "IncludeEventInstances" | False | whether to show distinct updating events that connect the same states as separate edges | 
| "IncludeStateWeights" | False | whether to weight state vertices by their rate of occurrence at a particular time step | 
| "IncludeStatePathWeights" | False | whether to weight state vertices by the number of distinct evolution paths that lead to them | 
| "StateRenderingFunction" | Automatic | how to label states that appear in graphs | 
| "EventRenderingFunction" | Automatic | how to label events that appear in graphs | 
| MaxItems | Infinity | how many instances of a causal graph or evolution causal graph to return | 
| "GivePredecessors" | False | whether to label branch pairs with their predecessor state | 
| "GiveResolvents" | False | whether to laebl branch pairs with their resolvent state | 
| "IncludeSelfPairs" | False | whether to include trivial branch pairs | 
| "IncludeFullBranchialSpace" | False | whether to show all possible states in a given branchial graph | 
| "LineThickness" | 1 | absolute line thickness for graph edges | 
| Inherited | use the explicit vertex name as the label | 
| None | use no label for the vertex | 
| "shape" | use a shape from the VertexShapeFunction collection | 
| func | apply the function func to the name of the vertex | 
Show basic quantum operator compilation (compiling the Pauli-X, Pauli-Y and Pauli-Z gates to MultiwaySystem rules):
| In[1]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|"Operator" -> {{0, 1}, {1, 0}}, "Basis" -> {{1, 0}, {0, 1}}|>]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/5e60e307a55d99e9.png)  | 
| Out[1]= |   | 
| In[2]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|"Operator" -> {{0, -I}, {I, 0}}, "Basis" -> {{1, 0}, {0, 1}}|>]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/1921782fc8652e53.png)  | 
| Out[2]= |   | 
| In[3]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|"Operator" -> {{1, 0}, {0, -1}}, "Basis" -> {{1, 0}, {0, 1}}|>]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/4d226455bf46180d.png)  | 
| Out[3]= |   | 
When only the operator is specified, the computational basis is used by default:
| In[4]:= | ![ResourceFunction["QuantumToMultiwaySystem"][{{0, 1}, {1, 0}}]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/51ebd7048bc1609b.png)  | 
| Out[4]= |   | 
Generate a graph showing how each state is obtained from the others for a root-NOT gate evolution:
| In[5]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 3, "StatesGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/64c29f746fed31c9.png)  | 
| Out[5]= |   | 
Show the structure of the graph, without labels:
| In[6]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1, 1}, 3, "StatesGraphStructure"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/00453a45c7ee4679.png)  | 
| Out[6]= |   | 
Generate the list of all updating events applied at each step:
| In[7]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 2, "AllEventsList"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/4f6a2a8e9a6e1e65.png)  | 
| Out[7]= |   | 
Generate a graph of the evolution history, with updating events included:
| In[8]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 3, "EvolutionEventsGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/4651831163af4934.png)  | 
| Out[8]= |   | 
Show the structure of the graph, without labels:
| In[9]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 3, "EvolutionEventsGraphStructure"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/50fea34504ac85a4.png)  | 
| Out[9]= |   | 
Generate the causal graph, showing dependencies between updating events:
| In[10]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 3, "CausalGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/0ca5a12c673d9d7c.png)  | 
| Out[10]= |   | 
Show the structure of the graph, without labels:
| In[11]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 3, "CausalGraphStructure"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/0406cec849c5606d.png)  | 
| Out[11]= |   | 
Generate the evolution events graph, with causal connection included:
| In[12]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 3, "EvolutionCausalGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/3449855bfe0ae362.png)  | 
| Out[12]= |   | 
Show the structure of the graph, without labels:
| In[13]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 3, "EvolutionCausalGraphStructure"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/401e9a93f1e19c43.png)  | 
| Out[13]= |   | 
Specify an event selection function that picks a random event at each step (effectively turning a quantum Turing machine into a nondeterministic Turing machine):
| In[14]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
   "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|> -> "Random", {1 + I, 1 - I}, 3, "StatesGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/79916ac2934b0c77.png)  | 
| Out[14]= |   | 
Generate causal graphs for all possible choices of event sequences for a Hadamard gate evolution:
| In[15]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|"Operator" -> {{1, 1}, {1, -1}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 3, "CausalGraphInstances"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/144685115df04435.png)  | 
| Out[15]= |   | 
Show the structures of the graphs, without labels:
| In[16]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|"Operator" -> {{1, 1}, {1, -1}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 3, "CausalGraphStructureInstances"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/77656fd911af6dba.png)  | 
| Out[16]= |   | 
Generate the list of all branch pairs (i.e. critical pairs):
| In[17]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 2, "BranchPairsList"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/02cf28500d4229ca.png)  | 
| Out[17]= |   | 
Generate the association showing which branch pairs converged and which did not:
| In[18]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 2, "BranchPairResolutionsList"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/670e164f66334aaa.png)  | 
| Out[18]= |   | 
Prove that the system is not causal invariant:
| In[19]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 5, "CausalInvariantQ"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/554042bc31ae77ff.png)  | 
| Out[19]= |   | 
Generate a graph showing branch pair ancestry:
| In[20]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 1, "BranchialGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/2e3761ed89536ce6.png)  | 
| Out[20]= |   | 
Show the structure of the graph, without labels:
| In[21]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 1, "BranchialGraphStructure"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/46870be1acd365af.png)  | 
| Out[21]= |   | 
Generate a graph showing branch pair event ancestry:
| In[22]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 1, "EventBranchialGraphStructure"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/76d8bb8ab3478408.png)  | 
| Out[22]= |   | 
Prevent identical states from being merged by including step numbers and state IDs:
| In[23]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 3, "StatesGraph", "IncludeStepNumber" -> True, "IncludeStateID" -> True]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/40907da9b987a3b1.png)  | 
| Out[23]= |   | 
| In[24]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 2, "AllStatesList", "IncludeStepNumber" -> True, "IncludeStateID" -> True]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/15cd4f75e8ea9a9f.png)  | 
| Out[24]= |   | 
Generate a graph of full evolution history, with all events included:
| In[25]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 3, "EvolutionGraphFull"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/7c5d459f6b36c84a.png)  | 
| Out[25]= |   | 
Show the structure of the graph, without labels:
| In[26]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 3, "EvolutionGraphFullStructure"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/5c94dc4d3cf9d393.png)  | 
| Out[26]= |   | 
Generate a graph of full evolution history, with no merging of equivalent states:
| In[27]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 3, "EvolutionGraphUnmerged"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/7a2c24c502043eab.png)  | 
| Out[27]= |   | 
Show the structure of the graph, without labels:
| In[28]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 3, "EvolutionGraphUnmergedStructure"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/035b292ba06c990e.png)  | 
| Out[28]= |   | 
Generate a graph of evolution history, with edges weighted by event multiplicity:
| In[29]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 2 - 2 I}, 3, "EvolutionGraphWeighted", EdgeLabels -> "EdgeWeight"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/2c1b23a43cb12d60.png)  | 
| Out[29]= |   | 
Show the structure of the graph, without labels:
| In[30]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 2 - 2 I}, 3, "EvolutionGraphWeightedStructure", EdgeLabels -> "EdgeWeight"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/035e2219d44e1873.png)  | 
| Out[30]= |   | 
Generate a states graph with vertices weighted by their rate of occurrence on each time step:
| In[31]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 3, "StatesGraph", "IncludeStateWeights" -> True, VertexLabels -> "VertexWeight"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/034d43dcfe2deb6c.png)  | 
| Out[31]= |   | 
Show the structure of the graph, without labels:
| In[32]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 3, "StatesGraphStructure", "IncludeStateWeights" -> True, VertexLabels -> "VertexWeight"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/322eaf60c80a80ae.png)  | 
| Out[32]= |   | 
Generate a states graph with vertices weighted by the number of distinct evolution paths that lead to them:
| In[33]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 3, "StatesGraph", "IncludeStatePathWeights" -> True, VertexLabels -> "VertexWeight"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/0abb19bbf4714079.png)  | 
| Out[33]= |   | 
Show the structure of the graph, without labels:
| In[34]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 3, "StatesGraphStructure", "IncludeStatePathWeights" -> True, VertexLabels -> "VertexWeight"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/49026a756edcce0f.png)  | 
| Out[34]= |   | 
QuantumToMultiwaySystem yields the same result as MatrixPower:
| In[35]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1, 1}, {1, -1}}, {1, -1}, 3, "EvolutionGraph", "IncludeStatePathWeights" -> True, VertexLabels -> "VertexWeight"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/67e776d4e8ba527a.png)  | 
| Out[35]= |   | 
Note that the four instances of {-1,0} cancel with the four instances of {1,0}, and the two instances of {0,-1} cancel with two of the instances of {0,1}, to yield:
| In[36]:= |   | 
| Out[36]= |   | 
This is the same as the answer given by MatrixPower:
| In[37]:= | ![MatrixPower[{{1, 1}, {1, -1}}, 3, {1, -1}]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/1aa60cad4f7b1b8f.png)  | 
| Out[37]= |   | 
QuantumToMultiwaySystem supports any quantum gate with an integer matrix representation. Examples of Pauli-X, Pauli-Y, Pauli-Z, root-NOT and Hadamard were shown previously. Other examples include the SWAP gate:
| In[38]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1, 0, 0, 0}, {0, 0, 1, 0}, {0, 1, 0, 0}, {0, 0, 0, 1}}, {1, 0, 1, 0}, 3, "EvolutionGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/5dd7eeeaf168eb12.png)  | 
| Out[38]= |   | 
The root-SWAP gate:
| In[39]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{2, 0, 0, 0}, {0, 1 + I, 1 - I, 0}, {0, 1 - I, 1 + I, 0}, {0, 0, 0, 2}}, {0, 0, 1 + I, 0}, 5, "EvolutionGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/0d20d4c3854d590c.png)  | 
| Out[39]= |   | 
The CNOT gate:
| In[40]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 0}}, {1, 0, 1, 0}, 3, "EvolutionGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/51491c7e2b6cf4ce.png)  | 
| Out[40]= |   | 
The Toffoli gate:
| In[41]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0,
    0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0, 0, 1, 0}}, {0, 0, 0, 0, 0, 1, 1, 0}, 3, "EvolutionGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/3c0b5c3ddf3657a3.png)  | 
| Out[41]= |   | 
The Fredkin gate:
| In[42]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0,
    0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1}}, {0, 0, 0, 0, 0, 1, 0, 1}, 3, "EvolutionGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/5e2d701c2d3ff56a.png)  | 
| Out[42]= |   | 
By default, QuantumToMultiwaySystem assumes that all states and operators are expressed in the computational basis:
| In[43]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{2, 0, 0, 0}, {0, 1 + I, 1 - I, 0}, {0, 1 - I, 1 + I,
      0}, {0, 0, 0, 2}}, "Basis" -> {{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}}|>]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/74c95bbb169d3ea7.png)  | 
| Out[43]= |   | 
However, QuantumToMultiwaySystem supports any quantum basis with an integer matrix representation. For instance, here is the same gate (root-SWAP) compiled instead using the Bell basis:
| In[44]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{2, 0, 0, 0}, {0, 1 + I, 1 - I, 0}, {0, 1 - I, 1 + I,
      0}, {0, 0, 0, 2}}, "Basis" -> {{1, 0, 0, 1}, {0, 1, 1, 0}, {1, 0, 0, -1}, {0, 1, -1, 0}}|>]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/2bd285c1fe6c3aab.png)  | 
| Out[44]= |   | 
QuantumToMultiwaySystem accepts both full (association) and partial (matrix) specifications of quantum operators:
| In[45]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][<|
  "Operator" -> {{1 + I, 1 - I}, {1 - I, 1 + I}}, "Basis" -> {{1, 0}, {0, 1}}|>, {1 + I, 1 - I}, 3, "StatesGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/383386b44a10aa72.png)  | 
| Out[45]= |   | 
| In[46]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "StatesGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/657a453e9261f966.png)  | 
| Out[46]= |   | 
QuantumToMultiwaySystem accepts both individual initial conditions and lists of initial conditions:
| In[47]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1, -1}, 2, "EvolutionGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/2dde0e9008a8dab7.png)  | 
| Out[47]= |   | 
| In[48]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {{1, -1}, {I, -I}, {-2 I, 2 I}}, 2, "EvolutionGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/4ccfceb8247967c1.png)  | 
| Out[48]= |   | 
Apply only the first possible event at each step (effectively converting a quantum Turing machine into a classical Turing machine):
| In[49]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}} -> "Sequential", {1 + I, 1 - I}, 3, "EvolutionGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/2d73c806636e710e.png)  | 
| Out[49]= |   | 
Apply the first and last possible events at each step:
| In[50]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}} -> ({First[#], Last[#]} &), {1 + I, 1 - I}, 3, "EvolutionGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/411fe11f467860a6.png)  | 
| Out[50]= |   | 
By default, states are labeled by their contents:
| In[51]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "StatesGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/7978dad8e2d03c2c.png)  | 
| Out[51]= |   | 
Use no labeling for states:
| In[52]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "StatesGraph", "StateRenderingFunction" -> None]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/2f0a235b136d2893.png)  | 
| Out[52]= |   | 
"StatesGraphStructure" yields the same result:
| In[53]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "StatesGraphStructure"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/4d2ed4706b8a76c3.png)  | 
| Out[53]= |   | 
Use raw state names as node labels:
| In[54]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "StatesGraph", "StateRenderingFunction" -> Inherited]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/1e3f56980ee3eb2c.png)  | 
| Out[54]= |   | 
Use a named shape as each state label:
| In[55]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "StatesGraph", "StateRenderingFunction" -> "Square"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/69b21ff0bb7e5385.png)  | 
| Out[55]= |   | 
By default, both states and events are labeled by their contents:
| In[56]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "EvolutionEventsGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/0ce6b5c204df4389.png)  | 
| Out[56]= |   | 
Use no labels for states or events:
| In[57]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "EvolutionEventsGraph", "StateRenderingFunction" -> None,
  "EventRenderingFunction" -> None]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/2f5ad7c25bb32560.png)  | 
| Out[57]= |   | 
"EvolutionEventsGraphStructure" yields an equivalent result:
| In[58]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "EvolutionEventsGraphStructure"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/02813074aa7a7329.png)  | 
| Out[58]= |   | 
Use raw event expressions as their labels:
| In[59]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "EvolutionEventsGraph", "StateRenderingFunction" -> None,
  "EventRenderingFunction" -> Inherited]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/69ca620dd3734503.png)  | 
| Out[59]= |   | 
By default, "AllEventsList" does not include initialization events:
| In[60]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 2, "AllEventsList"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/501ea5472af95287.png)  | 
| Out[60]= |   | 
The option "IncludeInitializationEvents" allows one to override this default:
| In[61]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 2, "AllEventsList", "IncludeInitializationEvents" -> True]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/352eba04bd2f431e.png)  | 
| Out[61]= |   | 
Initialization events have special default rendering:
| In[62]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "EvolutionEventsGraph", "IncludeInitializationEvents" -> True]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/7b610c16baa5ee07.png)  | 
| Out[62]= |   | 
Places arrows in the middle of edges:
| In[63]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "StatesGraph", EdgeShapeFunction -> GraphElementData["ShortFilledArrow", "ArrowSize" -> 0.03]]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/39abb9c4ef583106.png)  | 
| Out[63]= |   | 
Generate an example of multiway quantum evolution:
| In[64]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1, 0}, 3, "StatesGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/40d055c58cef755f.png)  | 
| Out[64]= |   | 
Force the initial state node to be at the top:
| In[65]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1, 0}, 3, "StatesGraph", GraphLayout -> {"LayeredDigraphEmbedding", "RootVertex" -> ToString[{1, 0}]}]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/369c59e1b208b459.png)  | 
| Out[65]= |   | 
By default, equivalent states are merged across all time steps:
| In[66]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "StatesGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/748c91d86cbe1298.png)  | 
| Out[66]= |   | 
| In[67]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "AllStatesList"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/08fc0c5bdede4585.png)  | 
| Out[67]= |   | 
Merging of equivalent states across different time steps can be prevented by including step numbers:
| In[68]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "StatesGraph", "IncludeStepNumber" -> True]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/02d921a6382e8f1f.png)  | 
| Out[68]= |   | 
List the states:
| In[69]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "AllStatesList", "IncludeStepNumber" -> True]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/59f7b9f56e24146b.png)  | 
| Out[69]= |   | 
Merging of equivalent states at the same time step can be prevented by also including state IDs:
| In[70]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "StatesGraph", "IncludeStepNumber" -> True, "IncludeStateID" -> True]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/0f2999d72cd8885a.png)  | 
| Out[70]= |   | 
List the states:
| In[71]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 2, "AllStatesList", "IncludeStepNumber" -> True, "IncludeStateID" -> True]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/779fe1179c0b3392.png)  | 
| Out[71]= |   | 
Step numbers and IDs also apply to events:
| In[72]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 2, "EvolutionEventsGraph", "IncludeStepNumber" -> True, "IncludeStateID" -> True]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/6c5858e3c5e19149.png)  | 
| Out[72]= |   | 
See the events:
| In[73]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 2, "AllEventsList", "IncludeStepNumber" -> True, "IncludeStateID" -> True]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/385b504378459472.png)  | 
| Out[73]= |   | 
By default, multiple instances of equivalent updating events are merged in the states graph:
| In[74]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "StatesGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/204e7e7ccdb781ca.png)  | 
| Out[74]= |   | 
Merging of equivalent events can be prevented by including event instances:
| In[75]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "StatesGraph", "IncludeEventInstances" -> True]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/6308b85bebf5ade3.png)  | 
| Out[75]= |   | 
Vertices of a states graph can be weighted by their relative rate of occurrence at each time step:
| In[76]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "StatesGraph", "IncludeStateWeights" -> True, VertexLabels -> "VertexWeight"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/41e01bc09b2b6af3.png)  | 
| Out[76]= |   | 
Vertices can also be weighted by the number of distinct evolution paths that lead to them:
| In[77]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "StatesGraph", "IncludeStatePathWeights" -> True, VertexLabels -> "VertexWeight"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/30463ae7b1bd5feb.png)  | 
| Out[77]= |   | 
By default, "CausalGraphInstances" returns all possible causal graphs:
| In[78]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1, 0}, 3, "CausalGraphInstances"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/7f06b5f4c3e026be.png)  | 
| Out[78]= |   | 
The number of causal graphs returned can be limited using MaxItems:
| In[79]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1, 0}, 3, "CausalGraphInstances", MaxItems -> 5]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/70bf4f9d990eb29b.png)  | 
| Out[79]= |   | 
By default, "BranchPairsList" returns only a list of branch pairs:
| In[80]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "BranchPairsList"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/69b6029111a463ed.png)  | 
| Out[80]= |   | 
Common predecessor states can be shown using "GivePredecessors":
| In[81]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "BranchPairsList", "GivePredecessors" -> True]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/4716335c2b2d9b41.png)  | 
| Out[81]= |   | 
Similarly, "BranchPairResolutionsList" by default lists only resolved and unresolved branch pairs:
| In[82]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 2, "BranchPairResolutionsList"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/62768cfcddbe266b.png)  | 
| Out[82]= |   | 
Common resolvents of resolved branch pairs can be shown using "GiveResolvents":
| In[83]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 2, "BranchPairResolutionsList", "GiveResolvents" -> True]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/7ca6565fdc827cba.png)  | 
| Out[83]= |   | 
Show both common predecessors and common resolvents, where appropriate:
| In[84]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 2, "BranchPairResolutionsList", "GivePredecessors" -> True, "GiveResolvents" -> True]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/3f00b063314e8c8c.png)  | 
| Out[84]= |   | 
By default, non-branch pair states are not shown as part of the branchial graph:
| In[85]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 2, "BranchialGraph"]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/7d29925ce45c4061.png)  | 
| Out[85]= |   | 
They can be shown using "IncludeFullBranchialSpace":
| In[86]:= | ![ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 2, "BranchialGraph", "IncludeFullBranchialSpace" -> True]](https://www.wolframcloud.com/obj/resourcesystem/images/11c/11c8aade-c41e-481e-85c0-10424fa9edbd/222bbb657aacdb0d.png)  | 
| Out[86]= |   | 
This work is licensed under a Creative Commons Attribution 4.0 International License