# Wolfram Language Paclet Repository (Under Development)

Community-contributed installable additions to the Wolfram Language

Exploring Fundamentals of Quantum Theory

We will explore some important experiment in the foundation of quantum theory, using the Wolfram Quantum Framework.

In[1]:=

Quantum Eraser

If there is path information (stored somewhere, regardless of whether it is measured or not), there won’t be any interference. The mere presence of path information kills quantum interference. But by erasing the path information, one can recover quantum interference. In the following setup, clicking all detectors corresponds to a no-interference case, and clicking of only D1 and D4 corresponds to the interference case.

With path information: no interference

Prepare a series of quantum gates representing the above setup:

In[18]:=

ops=

["H"],

["CX"],

["H"],

[],

[{2}];

QuantumOperator |

QuantumOperator |

QuantumOperator |

QuantumMeasurementOperator |

QuantumMeasurementOperator |

Construct the quantum circuit:

In[19]:=

qc=

[ops];qc["Diagram"]

QuantumCircuitOperator |

Out[20]=

Calculate the system evolution through each step:

In[21]:=

steps=ComposeListops,

[{"Register",2}];

QuantumState |

Show the states prior to measurement:

In[22]:=

Grid[Transpose[{Style[#,Bold]&/@{"Initial state","After 1st Hadamard","After CNOT","After 2nd Hadamard"},#["Formula"]&/@steps〚;;-3〛}],FrameAll,AlignmentLeft]

Out[22]=

Get the probability of each outcome:

In[23]:=

qc

[{"Register",2}]["ProbabilityPlot"]

QuantumState |

Out[23]=

Erasing path information: interference

Prepare a series of quantum gates representing above setup:

In[24]:=

ops=

["H"],

["CX"],

["H"],

["H",{2}],

[],

[{2}];

QuantumOperator |

QuantumOperator |

QuantumOperator |

QuantumOperator |

QuantumMeasurementOperator |

QuantumMeasurementOperator |

Construct the quantum circuit:

In[25]:=

qc=

[ops];qc["Diagram"]

QuantumCircuitOperator |

Out[26]=

Note that the Hadamard gate acting on 2nd qubit serves as quantum eraser.

Calculate the system evolution through each step:

In[27]:=

steps=ComposeListops,

[{"Register",2}];

QuantumState |

Show the states prior to measurement:

In[28]:=

Grid[Transpose[{Style[#,Bold]&/@{"Initial state","After Hadamard on 1st qubit","After CNOT","After Hadamard on 1st qubit","After Hadamard on 2nd qubit"},#["Formula"]&/@steps〚;;-3〛}],FrameAll,AlignmentLeft]

Out[28]=

Get the probability of each outcome:

In[29]:=

qc

[{"Register",2}]["ProbabilityPlot"]

QuantumState |

Out[29]=

In[13]:=

Elitzur-Vaidman bomb

Given quantum interference in a Mach-Zehnder setup with only one beam-splitter, a detector click can be inferred as the presence of an object along one arm of interferometer. However, due to the interference, there is a 50% chance that the photon does not move through that arm, as if one can infer the presence of that object without any interaction. To dramatize the case, think about that object as a bomb! This thought experiment is also called the interaction-free measurement.

Simple case: 50:50 beam splitter

Prepare a series of quantum gates representing the above setup:

In[30]:=

ops=

["H"],

["CX"],

["H"],

[],

[{2}];

QuantumOperator |

QuantumOperator |

QuantumOperator |

QuantumMeasurementOperator |

QuantumMeasurementOperator |

Construct the quantum circuit:

In[31]:=

qc=

[ops];qc["Diagram"]

QuantumCircuitOperator |

Out[32]=

Get the probability of each outcome:

In[33]:=

prob=qc

[{"Register",2}]["Probabilities"]

QuantumState |

Out[33]=

00,01,10,11

1

4

1

4

1

4

1

4

Calculate the probability:

Beyond 50:50 beam splitter

Get the probability of each outcome:

Return the efficiency rate:

Plot the efficiency rate:

Increasing efficiency by using a series of beam splitters

Plot the efficiency rate:

In[19]:=

Hardy’s paradox

Get the final state:

Plot the nonlocal probability in 3D:

Show the nonlocal probability as a density plot:

In[7]:=

Quantum Switch

Commuting example

Create a random 2D unitary operator:

Create two random commuting operators:

Consider the case where [A,B]=0:

Construct the circuit based on a quantum switch (defined in the initialization):

Perform the measurement:

The result confirms the commuting case.

Anti-commuting example

Create a random 2D unitary operator:

Create two commuting operators:

Note that we consider the case where {A,B}=0:

Construct the circuit based on a quantum switch (defined in the initialization):

Perform the measurement:

The result confirms the anti-commuting case.