Wolfram Research

Function Repository Resource:

QuantumToMultiwaySystem

Source Notebook

Simulate a quantum evolution as a multiway system

Contributed by: Jonathan Gorard

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.

Details and Options

Argument and option patterns for ResourceFunction["QuantumToMultiwaySystem"] largely match those of the resource function MultiwaySystem.
Rules are specified as associations of quantum operators and quantum bases; states are specified as state vectors.
The event selection function sel in ResourceFunction["QuantumToMultiwaySystem"][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["QuantumToMultiwaySystem"][rules,init] is interpreted as ResourceFunction["QuantumToMultiwaySystem"][rules,{init}].
ResourceFunction["QuantumToMultiwaySystem"][op,] is interpreted as ResourceFunction["QuantumToMultiwaySystem"][<|"Operator"op,"Basis"id|>,], where id is the default (computational) basis.
In ResourceFunction["QuantumToMultiwaySystem"][rules,init,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 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 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
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 "IncludeEventsInstances" 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["QuantumToMultiwaySystem"] include:
"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 udpating 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
Possible settings for "StateRenderingFunction" and "EventRenderingFunction" include:
Inherited use the explicti 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
For "CausalGraphInstances" and "EvolutionCausalGraphInstances", the option MaxItemsn can be used to get only the first n possible instances of causal graphs.

Examples

Basic Examples

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}}|>]
Out[1]=
In[2]:=
ResourceFunction[
 "QuantumToMultiwaySystem"][<|"Operator" -> {{0, -I}, {I, 0}}, "Basis" -> {{1, 0}, {0, 1}}|>]
Out[2]=
In[3]:=
ResourceFunction[
 "QuantumToMultiwaySystem"][<|"Operator" -> {{1, 0}, {0, -1}}, "Basis" -> {{1, 0}, {0, 1}}|>]
Out[3]=

When only the operator is specified, the computational basis is used by default:

In[4]:=
ResourceFunction["QuantumToMultiwaySystem"][{{0, 1}, {1, 0}}]
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"]
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"]
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"]
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"]
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"]
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"]
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"]
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"]
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"]
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"]
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"]
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"]
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"]
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"]
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"]
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"]
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"]
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"]
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]
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]
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"]
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"]
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"]
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"]
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"]
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"]
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"]
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"]
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"]
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"]
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"]
Out[35]=

Note that the 4 instances of {-1,0} cancel with the 4 instances of {1,0}, and the 2 instances of {0,-1} cancel with 2 of the instances of {0,1}, to yield:

In[36]:=
4*{-1, 0} + 2*{0, -1} + 6*{0, 1} + 4*{1, 0}
Out[36]=

This is the same as the answer given by MatrixPower:

In[37]:=
MatrixPower[{{1, 1}, {1, -1}}, 3, {1, -1}]
Out[37]=

Scope

Quantum Gates

QuantumToMultiwaySystem supports any quantum gate with an integer matrix representation. Examples of Pauli-X, Pauli-Y, Pauli-Z, root-NOT and Hadamard are shown above. 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"]
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"]
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"]
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"]
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"]
Out[42]=

Quantum Bases

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}}|>]
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}}|>]
Out[44]=

Rules and Initial Conditions

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"]
Out[45]=
In[46]:=
ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "StatesGraph"]
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"]
Out[47]=
In[48]:=
ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {{1, -1}, {I, -I}, {-2 I, 2 I}}, 2, "EvolutionGraph"]
Out[48]=

Event Selection Functions

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"]
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"]
Out[50]=

Options

State Node Rendering

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"]
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]
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"]
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]
Out[54]=

Use 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"]
Out[55]=

Event Node Rendering

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"]
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]
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"]
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]
Out[59]=

Initialization Events

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"]
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]
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]
Out[62]=

Graph Layout Options

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]]
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"]
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}]}]
Out[65]=

Step Numbers and State IDs

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"]
Out[66]=
In[67]:=
ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1 + I, 1 - I}, 3, "AllStatesList"]
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]
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]
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]
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]
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]
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]
Out[73]=

Event Instances

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"]
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]
Out[75]=

State (Path) Weights

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"]
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"]
Out[77]=

MaxItems

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

In[78]:=
ResourceFunction[
 "QuantumToMultiwaySystem"][{{1 + I, 1 - I}, {1 - I, 1 + I}}, {1, 0}, 3, "CausalGraphInstances"]
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]
Out[79]=

Predecessors and Resolvents

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"]
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]
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"]
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]
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]
Out[84]=

Full Branchial Space

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"]
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]
Out[86]=

Resource History

Source Metadata

Related Resources

License Information