Lab 2 - Quantum States, SOLUTIONS
Useful for working examples and problems with photon quantum states. You may notice some similarity to the Jones Calculus ;-)
import numpy as np
from qutip import *These are the polarization states:
H = Qobj([[1],[0]])
V = Qobj([[0],[1]])
P45 = Qobj([[1/np.sqrt(2)],[1/np.sqrt(2)]])
M45 = Qobj([[1/np.sqrt(2)],[-1/np.sqrt(2)]])
R = Qobj([[1/np.sqrt(2)],[-1j/np.sqrt(2)]])
L = Qobj([[1/np.sqrt(2)],[1j/np.sqrt(2)]])VHbra = H.dag()Hbra*VDevices:
HWP - Half-wave plate axis at to the horizontal
LP - Linear polarizer, axis at
QWP - Quarter-wave plate, axis at
Note, these are functions so you need to call them with a specific value of theta.
def HWP(theta):
return Qobj([[np.cos(2*theta),np.sin(2*theta)],[np.sin(2*theta),-np.cos(2*theta)]]).tidyup()def LP(theta):
return Qobj([[np.cos(theta)**2,np.cos(theta)*np.sin(theta)],[np.sin(theta)*np.cos(theta),np.sin(theta)**2]]).tidyup()def QWP(theta):
return Qobj([[np.cos(theta)**2 + 1j*np.sin(theta)**2,
(1-1j)*np.sin(theta)*np.cos(theta)],
[(1-1j)*np.sin(theta)*np.cos(theta),
np.sin(theta)**2 + 1j*np.cos(theta)**2]]).tidyup()QWP(np.pi/4)Example 1) Check that the state is normalized¶
H.dag()*HTo show more information on an object, use the question mark after the function or object:
np.sin?Example 2) Converting from ket to bra:¶
psi = Qobj([[1+1j],[2-1j]])
psipsi.dag()psi.dag().dag()the .dag() python method computes the “daggar” or the complex transpose.
1) Is psi normalized? If not, find the normalization constant and confirm that constant normalizes psi.¶
psi.dag()*psipsi_norm = psi*np.sqrt(1/7)psi_norm.dag() * psi_norm2) Verify that the state is normalized¶
V.dag()*V3) Verify that the and states are orthogonal. Repeat for the other pairs of states.¶
H.dag()*VL.dag()*RP45.dag()*M454) Calculate the horizontal component of the state ¶
psi = 1/np.sqrt(5)*H + 2/np.sqrt(5)*V
psipsi2 = Qobj([[1/np.sqrt(5)],[2/np.sqrt(5)]])
psi2H.dag()*psi5) Verify Eq. (3.18), (which states “The probability that a photon prepared in the +45 state will leave a PA_HV in the Horizontal state is one half.”)¶
expect(H*H.dag(),P45)np.conjugate(H.dag()*P45) * (H.dag()*P45)6) Demonstrate that a half-wave plate at 45-degrees converts to ¶
HWP(np.radians(45)) * HHWP(np.pi/4) * H == V7) Re-create Figure 3.9 by plotting the probability P(+45) vs phase φ¶
import matplotlib.pyplot as pltplt.plot([1,2,3,2,3,4])phi_list = np.linspace(0,8*np.pi,num=100)plt.plot(phi_list,np.sin(phi_list))sin_list = [np.sin(p) for p in phi_list] # notesplt.plot(phi_list,sin_list)def psi(phi):
return 1/np.sqrt(2)*(H + np.exp(1j*phi)*V)answer = [expect(M45*M45.dag(),psi(phi)) for phi in phi_list]plt.plot(phi_list/np.pi,answer,"-o")
plt.xlabel("$\\phi$")
plt.ylabel("P(-45)")