Phase Differences
Phase Differences
In[]:=
<<Wolfram`QuantumFramework`
Key Concepts
Key Concepts
◼
Global phase
◼
Relative phase
◼
Phase kickback
Global Phase
Global Phase
Recall that quantum states can be represented by vectors with complex amplitudes. Strictly speaking, the geometry of this vector space is projective. That means if you multiply all amplitudes by the same complex number, this describes the same quantum state:
In[]:=
QuantumState[{a,b}]==zQuantumState[{a,b}]
Out[]=
True
A complex number multiplying all amplitudes is called a global phase. There is no known way to experimentally detect a global phase. In other words, it is a mathematical feature of quantum mechanics that has no physical effects.
However, phases can still lead to some interesting phenomena. The Z gate has a very special relationship to the states and .
|0〉
|1〉
The state is left completely unchanged:
|0〉
In[]:=
QuantumOperator["Z"]@QuantumState["0"]//TraditionalForm
Out[]//TraditionalForm=
|0〉
The state is given a global phase, which has no physical significance by itself:
|1〉
In[]:=
QuantumOperator["Z"]@QuantumState["1"]//TraditionalForm
Out[]//TraditionalForm=
-|1〉
Does this mean that the Z gate does nothing? Consider the effect of the Z gate on a superposition state:
In[]:=
QuantumOperator["Z"][QuantumState[{a,b}]]//TraditionalForm
Out[]//TraditionalForm=
a|0〉-b|1〉
The Z gate introduces a relative phase between the amplitudes for and . If you were to only measure the probabilities after applying the Z gate to this state, the distributions would look the same:
|0〉
|1〉
In[]:=
QuantumState[{a,b}]["Probabilities"]==QuantumOperator["Z"][QuantumState[{a,b}]]["Probabilities"]
Out[]=
True
However, the states themselves are generally not the same (except for the two special examples shown before):
In[]:=
QuantumState[{a,b}]==QuantumOperator["Z"]@QuantumState[{a,b}]//TrueQ
Out[]=
False
Relative phases between amplitudes lead to real, physical effects that can be experimentally detected.
Consider the following quantum states:
In[]:=
ψplus=QuantumState1
2
,12
,"Label"->Subscript["ψ","+"];ψminus=QuantumState12
,-12
,"Label"->Subscript["ψ","-"];Immediately measuring or in the computational basis would give identical results:
ψ
+
ψ
-
Out[]=
However, if you first apply a Hadamard gate before measuring, you see clearly that these are not the same quantum state:
Out[]=
Alternatively, you could measure not in the/ computational basis, but in the / (or “X”) basis:
|0〉
|1〉
|+〉
|-〉
Out[]=
These results show that while relative phases may not be detectable in every measurement basis, there is guaranteed to be some measurement which can physically distinguish states with relative phases.
The effect of relative phase in the computational basis can be detected by the following experiment:
In[]:=
ψθ=QuantumState11
2
,θ
2
,"Label"->Subscript["ψ","θ"];ψθ//TraditionalFormOut[]//TraditionalForm=
1
2
θ
2
In[]:=
phasedetector=QuantumCircuitOperator[{ψθ,"H","M"}];phasedetector["Diagram"]
Out[]=
The probabilities for this experiment have a simple dependence on the relative phase between amplitudes:
In[]:=
mprobs=phasedetector[]["Probabilities"]//Map[FullSimplify[#,θ∈Reals]&]
Out[]=
0,1
2
Cos
θ
2
2
Sin
θ
2
You can visualize these results as shown below:
Out[]=
Phase Kickback
Phase Kickback
Previously, you conceptualized the controlled NOT gate as conditioning the state of the target qubit on the state of the control qubit. However, the phenomenon of phase kickback illustrates that the relationship between target and control qubit is not always so straightforward.
Consider the following pair of experiments. Note that only the first qubit is directly measured, but this experiment clearly gives information about the state of the second qubit:
The CNOT gate “kicks back” information about the relative phase of the target qubit to the control qubit.
In fact, the experiment below gives the same result you have seen before:
Even though the second qubit is never measured, the information about its relative phase has been transferred to the first qubit through the CNOT gate:
These results are summarized in the following plot:
The phenomena of phase kickback is used in several quantum algorithms.
Control-Target Identities
Control-Target Identities
The curious phenomena you have just seen also implies several interesting identities between circuits.
Consider the following two circuits:
Perhaps surprisingly, these two circuits are equivalent:
The Hadamard gates invert the relationship between the control qubit and the target qubit.
A similar relationship is true involving the controlled Z, or “CZ”, gate:
The next lesson will apply everything you have learned to quantum algorithms.