<<"http://www.physics.wisc.edu/~tgwalker/448-9Mathematica/ThadStuff.m"

bell={{0,1,1,0},{0,1,-1,0},{1,0,0,1},{1,0,0,-1}};

bell=Normalize[bell,Norm]

cnot=({{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 0}});
Had[qbit_]:=(Piecewise[{{HadamardMatrix[2]⊗(Subscript[𝕀, 2]), qbit==1}, {(Subscript[𝕀, 2])⊗ HadamardMatrix[2], qbit==2}}])

(cnot.Had[1].(Subscript[𝕀, 4]))\[Transpose]

Had[1].cnot.bell\[Transpose]

rotation[θ_,axis_]:=MatrixExp[I (θ/2) Normalize[axis].σ]

rotation[π,{0,0,1}]

-I rotation[π,{0,0,1}].rotation[(π/2),{0,1,0}]//MatrixForm

σ[[1]]Cos[th]+σ[[2]]Sin[th]//TrigToExp//MatrixForm

(SuperDagger[rotation[th,{0,0,1}]]).σ[[1]].rotation[th,{0,0,1}]