2.3 Find the eigenvalues and vectors of J$_\theta$ for $\theta$=45


In [1]:
from qutip import *
from numpy import cos, sin, pi, deg2rad

In [2]:
qm = Qobj([[cos(pi/4)**2,cos(pi/4)*sin(pi/4)],[cos(pi/4)*sin(pi/4),sin(pi/4)**2]])

In [3]:
qm


Out[3]:
Quantum object: dims = [[2], [2]], shape = (2, 2), type = oper, isherm = True\begin{equation*}\left(\begin{array}{*{11}c}0.500 & 0.500\\0.500 & 0.500\\\end{array}\right)\end{equation*}

In [4]:
qm.eigenstates()


Out[4]:
(array([ 0.,  1.]),
 array([ Quantum object: dims = [[2], [1]], shape = (2, 1), type = ket
 Qobj data =
 [[ 0.70710678]
  [-0.70710678]],
        Quantum object: dims = [[2], [1]], shape = (2, 1), type = ket
 Qobj data =
 [[-0.70710678]
  [-0.70710678]]], dtype=object))

In [5]:
from numpy import sqrt, exp
1/sqrt(2)


Out[5]:
0.70710678118654746

In [6]:
phi = 1.5
Jphi = Qobj([[exp(1j)*phi,0],[0,1]])
Jphi


Out[6]:
Quantum object: dims = [[2], [2]], shape = (2, 2), type = oper, isherm = False\begin{equation*}\left(\begin{array}{*{11}c}(0.810+1.262j) & 0.0\\0.0 & 1.0\\\end{array}\right)\end{equation*}

In [7]:
hvec = Qobj([[1],[0]])
hvec


Out[7]:
Quantum object: dims = [[2], [1]], shape = (2, 1), type = ket\begin{equation*}\left(\begin{array}{*{11}c}1.0\\0.0\\\end{array}\right)\end{equation*}

In [8]:
vvec = Qobj([[0],[1]])
vvec


Out[8]:
Quantum object: dims = [[2], [1]], shape = (2, 1), type = ket\begin{equation*}\left(\begin{array}{*{11}c}0.0\\1.0\\\end{array}\right)\end{equation*}

In [9]:
Jphi*hvec


Out[9]:
Quantum object: dims = [[2], [1]], shape = (2, 1), type = ket\begin{equation*}\left(\begin{array}{*{11}c}(0.810+1.262j)\\0.0\\\end{array}\right)\end{equation*}

In [10]:
Jphi*vvec


Out[10]:
Quantum object: dims = [[2], [1]], shape = (2, 1), type = ket\begin{equation*}\left(\begin{array}{*{11}c}0.0\\1.0\\\end{array}\right)\end{equation*}

In [ ]: