<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Lab 2 - Quantum States
Useful for working examples and problems with photon quantum states. You may notice some similarity to the Jones Calculus ;-)
Step1:  These are the polarization states
Step2:  Devices
Step3:  Example 1) Check that the $|H\rangle$ state is normalized
Step4:  To show more information on an object, use the question mark after the function or object
Step5:  Example 2) Converting from ket to bra
<ASSISTANT_TASK:>
Python Code:
import numpy as np
from qutip import *
Explanation: Lab 2 - Quantum States
Useful for working examples and problems with photon quantum states. You may notice some similarity to the Jones Calculus ;-)
End of explanation
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)]])
V
Explanation: These are the polarization states:
End of explanation
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)
Explanation: Devices:
HWP - Half-wave plate axis at $\theta$ to the horizontal
LP - Linear polarizer, axis at $\theta$
QWP - Quarter-wave plate, axis at $\theta$
Note, these are functions so you need to call them with a specific value of theta.
End of explanation
H.dag()*H
Explanation: Example 1) Check that the $|H\rangle$ state is normalized
End of explanation
np.sin?
Explanation: To show more information on an object, use the question mark after the function or object:
End of explanation
psi = Qobj([[1+1j],[2-1j]])
psi
psi.dag()
psi.dag().dag()
Explanation: Example 2) Converting from ket to bra:
End of explanation
<END_TASK>