Quantum States and Amplitudes
Quantum States and Amplitudes
In[]:=
<<Wolfram`QuantumFramework`
Key Concepts
Key Concepts
◼
Quantum Amplitudes
◼
State Vector
◼
Density Matrix
State Vectors and Amplitudes
State Vectors and Amplitudes
You have already seen bra-ket notation for quantum states like or . What about other kinds of quantum states? For example, the result of applying a Hadamard gate to the register state:
|0〉
|1〉
In[]:=
state1=QuantumOperator["H"]@QuantumState["0"]
Out[]=
QuantumState
In[]:=
state1["BlochPlot"]
Out[]=
You can see from the Bloch plot that this state is plainly neither nor .
|0〉
|1〉
In[]:=
state1["Formula"]
Out[]=
1
2
1
2
This state is instead a particular combination of and . Since it is a linear combination, this suggests that quantum states can be represented by vectors and operators can be represented by matrices.
|0〉
|1〉
In[]:=
state1["StateVector"]//MatrixForm//TraditionalForm
Out[]//TraditionalForm=
1 2 |
1 2 |
In[]:=
QuantumOperator["H"]["Matrix"]//MatrixForm//TraditionalForm
Out[]//TraditionalForm=
1 2 | 1 2 |
1 2 | - 1 2 |
Notice the relationship between the vector coefficients and the probabilities for each classical outcome.
In[]:=
state1["Probabilities"]
Out[]=
0,1
1
2
1
2
The computational basis is called a basis because the states and can be used as basis elements for the complex vector space :
|0〉
|1〉
2
In[]:=
QuantumState["0"]["StateVector"]//MatrixForm//TraditionalForm
Out[]//TraditionalForm=
1 |
0 |
In[]:=
QuantumState["1"]["StateVector"]//MatrixForm//TraditionalForm
Out[]//TraditionalForm=
0 |
1 |
The coefficients of each basis element are known as the quantum amplitudes. A quantum state can be defined by giving its amplitudes:
In[]:=
state2=QuantumState[{a,b}]
Out[]=
QuantumState
This can be written in Dirac notation:
In[]:=
state2["Formula"]//TraditionalForm
Out[]//TraditionalForm=
a|0〉+b|1〉
The norm squared of the normalized amplitudes give the probability for measuring each of the basis elements as the outcome of a measurement interaction:
In[]:=
state2["Probabilities"]
Out[]=
0+,1+
2
Abs[a]
2
Abs[a]
2
Abs[b]
2
Abs[b]
2
Abs[a]
2
Abs[b]
Typically, qubit amplitudes are already normalized such that +=1.
2
a
2
b
In[]:=
state2["Probabilities"]//Map[#/.Abs[a]^2+Abs[b]^2->1&]
Out[]=
|0〉,|1〉
2
Abs[a]
2
Abs[b]
This quantum state can also be represented as a state vector:
In[]:=
state2["StateVector"]//MatrixForm//TraditionalForm
Out[]//TraditionalForm=
a |
b |
Some quantum states require a matrix representation known as the density matrix:
In[]:=
state2["DensityMatrix"]//MatrixForm//TraditionalForm
Out[]//TraditionalForm=
a * a | a * b |
b * a | b * b |
Keep in mind that the amplitudes can be complex numbers. The following plot lets you explore the relationship between the probability of measuring each state in the computational basis and the complex phase difference between each amplitude:
Out[]=
Example
Example
Consider the quantum state |0〉+|1〉.
1
2
3
2
What is the state vector, the density matrix, the Bloch plot, and the measurement distribution in the computational basis?
Solution
Define the state with the given amplitudes:
In[]:=
state3=QuantumState12,
3
2Out[]=
QuantumState
Probabilities are the (normalized) norm squared of these amplitudes:
In[]:=
state3["Probabilities"]
Out[]=
0,1
1
4
3
4
Compute the state vector, density matrix, and Bloch plot:
In[]:=
state3["StateVector"]//MatrixForm//TraditionalForm
Out[]//TraditionalForm=
1 2 |
3 2 |
In[]:=
state3["DensityMatrix"]//MatrixForm//TraditionalForm
Out[]//TraditionalForm=
1 4 | 3 4 |
3 4 | 3 4 |
The Bloch vector can be given in either spherical or Cartesian coordinates:
States vs Measurements
States vs Measurements
While a measurement operation is always necessary to obtain practical results from quantum circuits, it is often helpful to analyze what happens to quantum states as each gate operation is applied to the qubits.
Consider the following quantum circuit:
What happens to the initial state after each gate is applied?
Recall that amplitudes do not have to be real numbers. They can take on complex values. What about a similar circuit but different initial state?
Even though the measurement distributions for each of the two initial states were identical, they are different quantum states. Thus, this circuit has very different effects on them.