PHYS 212A Exercises

Matrix Skills

Pauli Algebra

(σ^x)=(({{0, 1}, {1, 0}})),(σ^y)=(({{0, -i}, {i, 0}})),(σ^z)=(({{1, 0}, {0, -1}})).

(σ^i)(σ^j)=(δ^(i j))𝟙+i (ϵ^(i j k))(σ^k),

Vector Notation

Prove a·σ b·σ=a·b 𝟙+i (a×b)·σ.

a·σ b·σ=(Subscript[a, i])(σ^i) (Subscript[b, j])(σ^j)
=(Subscript[a, i]) (Subscript[b, j])((δ^(i j))𝟙+i (ϵ^(i j k))(σ^k))
=(Subscript[a, i])(Subscript[b, i])𝟙+i (ϵ^(i j k))(Subscript[a, i])(Subscript[b, j])(σ^k)
=a·b 𝟙+i (a×b)·σ.

Commutation Relation

Prove [a·σ,b·σ]=2i (a×b)·σ.

[a·σ,b·σ]=a·σ b·σ-b·σ a·σ
=a·b 𝟙+i (a×b)·σ-b·a 𝟙-i (b×a)·σ
=(a·b-b·a)𝟙+i ((a×b)- (b×a))·σ
=2i (a×b)·σ.

Trace Identity

Prove Tr(a·σ b·σ)=2a·b.

Tr(a·σ b·σ)=Tr(a·b 𝟙+i (a×b)·σ)
=a·b Tr 𝟙+i (a×b)·Tr σ
=2 a·b.

Matrix Diagonalization

L=V Λ (SuperDagger[V]),

(({{0, 1}, {1, 0}}))=(1/(Sqrt[2]))(({{1, 1}, {1, -1}}))(({{1, 0}, {0, -1}}))(1/(Sqrt[2]))(({{1, 1}, {1, -1}})),
(({{0, -i}, {i, 0}}))=(1/(Sqrt[2]))(({{1, 1}, {i, -i}}))(({{1, 0}, {0, -1}}))(1/(Sqrt[2]))(({{1, -i}, {1, i}})),
(({{1, 0}, {0, -1}}))=(({{1, 0}, {0, 1}}))(({{1, 0}, {0, -1}}))(({{1, 0}, {0, 1}})).

If L is diagonalized by L=V Λ (SuperDagger[V]), a L+b 𝟙 will be diagonalized by the same unitary V as

a L+b 𝟙=V(a Λ+b 𝟙)(SuperDagger[V]).

Rescaling the matrix by a constant and shifting the diagonal by identity matrix do not change the eigenvectors.

If L can be separated into blocks (Subscript[L, 1]) and (Subscript[L, 2]) with (Subscript[L, 1])=(Subscript[V, 1]) (Subscript[Λ, 1]) (Subscript[V, 1]^†) and (Subscript[L, 2])=(Subscript[V, 2]) (Subscript[Λ, 2]) (Subscript[V, 2]^†), then it can be diagonalized in each block separately

L=(({{(Subscript[L, 1]), 0}, {0, (Subscript[L, 2])}}))=(({{(Subscript[V, 1]) (Subscript[Λ, 1]) (Subscript[V, 1]^†), 0}, {0, (Subscript[V, 2]) (Subscript[Λ, 2]) (Subscript[V, 2]^†)}}))
=(({{(Subscript[V, 1]), 0}, {0, (Subscript[V, 2])}}))(({{(Subscript[Λ, 1]), 0}, {0, (Subscript[Λ, 2])}}))(({{(Subscript[V, 1]^†), 0}, {0, (Subscript[V, 2]^†)}})).

If L can be decomposed to tensor product of (Subscript[L, 1]) and (Subscript[L, 2]) with (Subscript[L, 1])=(Subscript[V, 1]) (Subscript[Λ, 1]) (Subscript[V, 1]^†) and (Subscript[L, 2])=(Subscript[V, 2]) (Subscript[Λ, 2]) (Subscript[V, 2]^†), then it can be diagonalized in each tensor factor separately

L=(Subscript[L, 1])⊗(Subscript[L, 2])
=((Subscript[V, 1]) (Subscript[Λ, 1]) (Subscript[V, 1]^†))⊗((Subscript[V, 2]) (Subscript[Λ, 2]) (Subscript[V, 2]^†))
=((Subscript[V, 1])⊗(Subscript[V, 2]))((Subscript[Λ, 1])⊗(Subscript[Λ, 2]))(SuperDagger[((Subscript[V, 1])⊗(Subscript[V, 2]))]).

Adding Identity

Diagonalize the matrix
(({{3, 2}, {2, 3}})).

(({{3, 2}, {2, 3}}))=3(({{1, 0}, {0, 1}}))+2(({{0, 1}, {1, 0}}))=3𝟙+2(σ^x).

(Ket[3±2])≏(1/(Sqrt[2]))(({{1}, {±1}})).

Block Diagonalization (I)

Diagonalize the matrix
(({{0, 1, 0, 0}, {1, 0, 0, 0}, {0, 0, 0, 2}, {0, 0, 2, 0}}))

(({{A, 0}, {0, B}})) with A=(({{0, 1}, {1, 0}})), B=(({{0, 2}, {2, 0}})).

(Ket[±1])≏(1/(Sqrt[2]))(({{1}, {±1}, {0}, {0}})), (Ket[±2])≏(1/(Sqrt[2]))(({{0}, {0}, {1}, {±1}})).

Block Diagonalization (II)

Diagonalize the matrix
(({{1, 0, 2, 0}, {0, 4, 0, 3}, {2, 0, 1, 0}, {0, 3, 0, 4}}))

(({{1, 2}, {2, 1}})) and (({{4, 3}, {3, 4}})).

(Ket[1±2])≏(1/(Sqrt[2]))(({{1}, {0}, {±1}, {0}})), (Ket[4±3])≏(1/(Sqrt[2]))(({{0}, {1}, {0}, {±1}})).

Dark State

Diagonalize the matrix
(({{0, 1, 1}, {1, 0, 0}, {1, 0, 0}}))

(Ket[1])(Bra[2])+(Ket[1])(Bra[3])+(Ket[2])(Bra[1])+(Ket[3])(Bra[1]),

(Sqrt[2])(Ket[1])(((Bra[2])+(Bra[3]))/(Sqrt[2]))+(Sqrt[2])(((Ket[2])+(Ket[3]))/(Sqrt[2]))(Bra[1]),

(Ket[a])=(Ket[1]), (Ket[b])=(((Ket[2])+(Ket[3]))/(Sqrt[2])),(Ket[c])= (((Ket[2])-(Ket[3]))/(Sqrt[2])),

(Sqrt[2])(Ket[a])(Bra[b])+(Sqrt[2])(Ket[b])(Bra[a]),

(({{0, (Sqrt[2]), 0}, {(Sqrt[2]), 0, 0}, {0, 0, 0}})).

(({{0, 1, 1}, {1, 0, 0}, {1, 0, 0}}))=(({{1, 0, 0}, {0, (1/(Sqrt[2])), (1/(Sqrt[2]))}, {0, (1/(Sqrt[2])), ((-1)/(Sqrt[2]))}}))(({{0, (Sqrt[2]), 0}, {(Sqrt[2]), 0, 0}, {0, 0, 0}}))(({{1, 0, 0}, {0, (1/(Sqrt[2])), (1/(Sqrt[2]))}, {0, (1/(Sqrt[2])), ((-1)/(Sqrt[2]))}})).

(({{0, (Sqrt[2]), 0}, {(Sqrt[2]), 0, 0}, {0, 0, 0}}))=(({{(1/(Sqrt[2])), (1/(Sqrt[2])), 0}, {(1/(Sqrt[2])), ((-1)/(Sqrt[2])), 0}, {0, 0, 1}}))(({{(Sqrt[2]), 0, 0}, {0, -(Sqrt[2]), 0}, {0, 0, 0}}))(({{(1/(Sqrt[2])), (1/(Sqrt[2])), 0}, {(1/(Sqrt[2])), ((-1)/(Sqrt[2])), 0}, {0, 0, 1}})),

(({{0, 1, 1}, {1, 0, 0}, {1, 0, 0}}))=(({{1, 0, 0}, {0, (1/(Sqrt[2])), (1/(Sqrt[2]))}, {0, (1/(Sqrt[2])), ((-1)/(Sqrt[2]))}}))(({{(1/(Sqrt[2])), (1/(Sqrt[2])), 0}, {(1/(Sqrt[2])), ((-1)/(Sqrt[2])), 0}, {0, 0, 1}}))(({{(Sqrt[2]), 0, 0}, {0, -(Sqrt[2]), 0}, {0, 0, 0}}))(({{(1/(Sqrt[2])), (1/(Sqrt[2])), 0}, {(1/(Sqrt[2])), ((-1)/(Sqrt[2])), 0}, {0, 0, 1}}))(({{1, 0, 0}, {0, (1/(Sqrt[2])), (1/(Sqrt[2]))}, {0, (1/(Sqrt[2])), ((-1)/(Sqrt[2]))}}))
=(({{(1/(Sqrt[2])), (1/(Sqrt[2])), 0}, {(1/2), -(1/2), (1/(Sqrt[2]))}, {(1/2), -(1/2), ((-1)/(Sqrt[2]))}}))(({{(Sqrt[2]), 0, 0}, {0, -(Sqrt[2]), 0}, {0, 0, 0}}))(({{(1/(Sqrt[2])), (1/2), (1/2)}, {(1/(Sqrt[2])), -(1/2), -(1/2)}, {0, (1/(Sqrt[2])), -(1/(Sqrt[2]))}})).

(Ket[(Sqrt[2])])≏(({{(1/(Sqrt[2]))}, {(1/2)}, {(1/2)}})), (Ket[-(Sqrt[2])])≏(({{(1/(Sqrt[2]))}, {-(1/2)}, {-(1/2)}})), (Ket[0])≏(({{0}, {(1/(Sqrt[2]))}, {((-1)/(Sqrt[2]))}})).

Tensor Product Operator

Diagonalize the matrix
(({{0, 0, 2, 1}, {0, 0, 1, 2}, {2, 1, 0, 0}, {1, 2, 0, 0}}))

A⊗B=(({{0, 1}, {1, 0}}))⊗(({{2, 1}, {1, 2}}))

(Ket[+3])≏(1/(Sqrt[2]))(({{1}, {1}}))⊗(1/(Sqrt[2]))(({{1}, {1}}))=(1/2)(({{1}, {1}, {1}, {1}})),
(Ket[+1])≏(1/(Sqrt[2]))(({{1}, {1}}))⊗(1/(Sqrt[2]))(({{1}, {-1}}))=(1/2)(({{1}, {-1}, {1}, {-1}})),
(Ket[-1])≏(1/(Sqrt[2]))(({{1}, {-1}}))⊗(1/(Sqrt[2]))(({{1}, {-1}}))=(1/2)(({{1}, {-1}, {-1}, {1}})),
(Ket[-3])≏(1/(Sqrt[2]))(({{1}, {-1}}))⊗(1/(Sqrt[2]))(({{1}, {1}}))=(1/2)(({{1}, {1}, {-1}, {-1}})).

Matrix Exponential

Block diagonalized matrix can be exponentiated in each block

exp(({{A, 0}, {0, B}}))=(({{exp A, 0}, {0, exp B}})).

Exponential of Diagonal Matrices

H=(({{(Subscript[E, 1]),  ,  }, { , (Subscript[E, 2]),  }, {  ,  , ⋱}})),

(e^(-i H t))=(({{(e^(-i (Subscript[E, 1])t)),  ,  }, { , (e^(-i (Subscript[E, 2])t)),  }, {  ,  , ⋱}})).

Construct the unitary evolution operator generated by the following Hamiltonian
H=(({{0, 0, 0}, {0, 1, 0}, {0, 0, -1}})).

(e^(-i H t))=(({{(e^(-i 0 t)), 0, 0}, {0, (e^(-i 1 t)), 0}, {0, 0, (e^(-i (-1) t))}}))=(({{1, 0, 0}, {0, (e^(-i t)), 0}, {0, 0, (e^(+i t))}})).

Matrix Exponential by Diagonalization

Construct the unitary evolution operator generated by the following Hamiltonian
H=(({{1, 1}, {1, 1}})).

(Ket[1±1])=(1/(Sqrt[2]))(({{1}, {±1}})).

V=(1/(Sqrt[2]))(({{1, 1}, {1, -1}})),

H=(({{1, 1}, {1, 1}}))=(1/(Sqrt[2]))(({{1, 1}, {1, -1}}))(({{2, 0}, {0, 0}}))(1/(Sqrt[2]))(({{1, 1}, {1, -1}}))=V Λ (SuperDagger[V]).

(e^(-i H t))=(e^(-i V Λ (SuperDagger[V]) t))=V (e^(-i Λ  t)) (SuperDagger[V]).

(e^(-i Λ  t))=(({{(e^(-2i t)), 0}, {0, 1}})),

(e^(-i H t))=V (e^(-i Λ  t)) (SuperDagger[V])=(1/(Sqrt[2]))(({{1, 1}, {1, -1}}))(({{(e^(-2i t)), 0}, {0, 1}}))(1/(Sqrt[2]))(({{1, 1}, {1, -1}}))
=(1/2)(({{(e^(-2i t))+1, (e^(-2i t))-1}, {(e^(-2i t))-1, (e^(-2i t))+1}})).

MatrixExp[-I t{{1,1},{1,1}}]

Matrix Exponential by Taylor Expansion

(e^(-i H t))=(∑_(k=0)^∞)((((-i H t))^k)/(k!))
=(∑_(k=0)^∞)((((-i H t))^(2k))/((2k)!))+(∑_(k=0)^∞)((((-i H t))^(2k+1))/((2k+1)!))
=(∑_(k=0)^∞)(((((-1))^k) (t^(2k)))/((2k)!))(H^(2k))-i(∑_(k=0)^∞)(((((-1))^k) (t^(2k+1)))/((2k+1)!))(H^(2k +1))
=cos t 𝟙-i sin t H.

Construct the unitary evolution operator generated by the following Hamiltonian
H=(({{-1, 2, 2}, {2, -1, 2}, {2, 2, -1}})).

(H^2)=(({{-1, 2, 2}, {2, -1, 2}, {2, 2, -1}}))(({{-1, 2, 2}, {2, -1, 2}, {2, 2, -1}}))=(({{9, 0, 0}, {0, 9, 0}, {0, 0, 9}}))=9𝟙,

((OverTilde[H])^2)=((((H/3)))^2)=(1/9)(H^2)=𝟙.

(e^(-i H t))=(e^(-i (H/3) 3 t))=(e^(-i (OverTilde[H]) 3t))
=cos(3t)𝟙-i sin(3t)(OverTilde[H])
=cos(3t)𝟙-(i/3) sin(3t)H
=cos(3t)(({{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}))-(i/3) sin(3t)(({{-1, 2, 2}, {2, -1, 2}, {2, 2, -1}}))
=(({{cos(3t)+(i/3) sin(3t), -((2i)/3) sin(3t), -((2i)/3) sin(3t)}, {-((2i)/3) sin(3t), cos(3t)+(i/3) sin(3t), -((2i)/3) sin(3t)}, {-((2i)/3) sin(3t), -((2i)/3) sin(3t), cos(3t)+(i/3) sin(3t)}}))

Simplify@ExpToTrig@MatrixExp[-I t{{-1,2,2},{2,-1,2},{2,2,-1}}]

Exponential of Pauli Matrices

exp(i t n·σ)=cos t 𝟙+i sin t n·σ,

Show that if there was no factor i on the exponent, we should have exp(τ n·σ)=cosh τ 𝟙+sinh τ n·σ.

Block Exponential

Construct the unitary evolution operator generated by the following Hamiltonian
H=(({{0, 0, 0, 0}, {0, 0, -i, 0}, {0, i, 0, 0}, {0, 0, 0, 0}}))

(e^(-i t (σ^y)))=cos t 𝟙-i sin t (σ^y)=(({{cos t, -sin t}, {sin t, cos t}}))

(({{1, 0, 0, 0}, {0, cos t, -sin t, 0}, {0, sin t, cos t, 0}, {0, 0, 0, 1}}))

MatrixExp[-I t{{0,0,0,0},{0,0,-I,0},{0,I,0,0},{0,0,0,0}}]

Matrix Log

ln L =ln (V Λ (SuperDagger[V]))=V (ln Λ) (SuperDagger[V]).

ln Λ=ln (({{(Subscript[λ, 1]),  ,  }, { , (Subscript[λ, 2]),  }, { ,  , ⋱}}))=(({{ln (Subscript[λ, 1]),  ,  }, { , ln (Subscript[λ, 2]),  }, { ,  , ⋱}})).

2×2 Matrix Log

Calculate the following matrix log
ln(({{2, 1}, {1, 2}}))

(({{2, 1}, {1, 2}}))=(1/(Sqrt[2]))(({{1, 1}, {1, -1}}))(({{2+1, 0}, {0, 2-1}}))(1/(Sqrt[2]))(({{1, 1}, {1, -1}})).

ln (({{2, 1}, {1, 2}}))=(1/(Sqrt[2]))(({{1, 1}, {1, -1}}))(({{ln(2+1), 0}, {0, ln(2-1)}}))(1/(Sqrt[2]))(({{1, 1}, {1, -1}}))
=(1/(Sqrt[2]))(({{1, 1}, {1, -1}}))(({{ln 3, 0}, {0, 0}}))(1/(Sqrt[2]))(({{1, 1}, {1, -1}}))
=((ln 3)/2)(({{1, 1}, {1, 1}})).

MatrixLog[{{2,1},{1,2}}]

Log of Single-Qubit Density Matrix

A single-qubit density matrix generally takes the form of 
ρ=(1/2)(𝟙+m·σ),
where m is a three-component real vector. Calculate ln ρ.

m=|m|(OverHat[m]),

|m|=(Sqrt[(Subscript[m, 1]^2)+(Subscript[m, 2]^2)+(Subscript[m, 3]^2)]), (OverHat[m])=((((Subscript[m, 1]),(Subscript[m, 2]),(Subscript[m, 3])))/(Sqrt[(Subscript[m, 1]^2)+(Subscript[m, 2]^2)+(Subscript[m, 3]^2)])).

(Subscript[p, ±])=((1±|m|)/2), (Subscript[P, ±])=(1/2)(𝟙±(OverHat[m])·σ),

ρ=(SubPlus[p])(SubPlus[P])+(SubMinus[p])(SubMinus[P]).

ln ρ=(ln (SubPlus[p]))(SubPlus[P])+(ln (SubMinus[p]))(SubMinus[P])
=(1/2)(𝟙+(OverHat[m])·σ)ln((1+|m|)/2)+(1/2)(𝟙-(OverHat[m])·σ)ln((1-|m|)/2)
=(ln((Sqrt[1-((|m|)^2)])/2))𝟙+(ln(Sqrt[((1+|m|)/(1-|m|))]))(OverHat[m])·σ.

Projection Operator

P(L=λ)=(∑_i)(Ket[(Subscript[λ, i])])δ((Subscript[λ, i])-λ)(Bra[(Subscript[λ, i])]).

Construct by Diagonalization

Given an observable L described by
L=(({{1, 0, 0}, {0, 0, 1}, {0, 1, 0}})),
construct the projection operator corresponds to L=1 and L=-1.

(({{1}, {0}, {0}})), (1/(Sqrt[2]))(({{0}, {1}, {1}}))

(Subscript[V, 1])=(({{1, 0}, {0, (1/(Sqrt[2]))}, {0, (1/(Sqrt[2]))}})).

P(L=1)=(Subscript[V, 1])(Subscript[V, 1]^†)=(({{1, 0}, {0, (1/(Sqrt[2]))}, {0, (1/(Sqrt[2]))}}))(({{1, 0, 0}, {0, (1/(Sqrt[2])), (1/(Sqrt[2]))}}))=(({{1, 0, 0}, {0, 1/2, 1/2}, {0, 1/2, 1/2}})).

(Subscript[V, -1])=(({{0}, {(1/(Sqrt[2]))}, {-(1/(Sqrt[2]))}})).

P(L=-1)=(Subscript[V, -1])(Subscript[V, -1]^†)=(({{0}, {(1/(Sqrt[2]))}, {-(1/(Sqrt[2]))}}))(({{0, (1/(Sqrt[2])), -(1/(Sqrt[2]))}}))=(({{0, 0, 0}, {0, 1/2, -1/2}, {0, -1/2, 1/2}})).

Algebraic Construction

P(L=(Subscript[λ, i]))∝(∏_(j≠i))(L-(Subscript[λ, j])𝟙),

Given an observable L described by
L=(({{1, 0, 0, 0}, {0, -1, 2, 0}, {0, 2, -1, 0}, {0, 0, 0, 1}})),
construct the projection operator corresponds to L=1.

P(L=1)∝L-(-3)𝟙=(({{1, 0, 0, 0}, {0, -1, 2, 0}, {0, 2, -1, 0}, {0, 0, 0, 1}}))+(({{3, 0, 0, 0}, {0, 3, 0, 0}, {0, 0, 3, 0}, {0, 0, 0, 3}}))=(({{4, 0, 0, 0}, {0, 2, 2, 0}, {0, 2, 2, 0}, {0, 0, 0, 4}}))

P(L=1)=(1/2)(({{2, 0, 0, 0}, {0, 1, 1, 0}, {0, 1, 1, 0}, {0, 0, 0, 2}})).

Pauli Observable

P(n·σ=±1)=((𝟙±n·σ)/2).

Prove the result in Eq. ().

P(n·σ=±1)∝n·σ-(∓1)𝟙=n·σ±𝟙.

P(n·σ=±1)=((n·σ±𝟙)/(Tr(n·σ±𝟙)))=((n·σ±𝟙)/(±2))=((𝟙±n·σ)/2).

Singlet v.s. Triplet Projection

Consider a two-qubit system with the following Hamiltonian 
H=(Subscript[σ, A])·(Subscript[σ, B]).
If the system is initially in the (Ket[↑↓]) state, what are the possible measurement outcomes of H (the energy) and what are the associated resulting states after measuring H.

H=(({{1, 0, 0, 0}, {0, -1, 2, 0}, {0, 2, -1, 0}, {0, 0, 0, 1}}))

P(H=1)=(1/2)(({{2, 0, 0, 0}, {0, 1, 1, 0}, {0, 1, 1, 0}, {0, 0, 0, 2}})), P(H=-3)=(1/2)(({{0, 0, 0, 0}, {0, 1, -1, 0}, {0, -1, 1, 0}, {0, 0, 0, 0}})).

(Ket[(Subscript[ψ, 0])])=(Ket[↑↓])=(({{0}, {1}, {0}, {0}})).

(Ket[(Subscript[ψ, 1])])=((P(H=1)(Ket[(Subscript[ψ, 0])]))/((Bra[(Subscript[ψ, 0])])P(H=1)((Ket[(Subscript[ψ, 0])])^(1/2))))=(1/(Sqrt[2]))(({{0}, {1}, {1}, {0}}))=(1/(Sqrt[2]))((Ket[↑↓])+(Ket[↓↑]));

(Ket[(Subscript[ψ, 1])])=((P(H=-3)(Ket[(Subscript[ψ, 0])]))/((Bra[(Subscript[ψ, 0])])P(H=-3)((Ket[(Subscript[ψ, 0])])^(1/2))))=(1/(Sqrt[2]))(({{0}, {1}, {-1}, {0}}))=(1/(Sqrt[2]))((Ket[↑↓])-(Ket[↓↑])).

Partial Trace

Applying the Formula

X=(∑_(i j k l))(Ket[i j])(Subscript[X, i j,k l])(Bra[k l]).

(Subscript[Tr, A])X=(∑_(j l))(Ket[j])((∑_i)(Subscript[X, i j,i l]))(Bra[l]),
(Subscript[Tr, B])X=(∑_(i k))(Ket[i])((∑_j)(Subscript[X, i j,k j]))(Bra[k]).

Given the following operator in a two-qubit system 
X=(({{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}})),
calculate the partial traces (Subscript[Tr, A])X and (Subscript[Tr, B])X.

(Subscript[Tr, A])X=(({{Tr (({{1, 3}, {9, 11}})), Tr (({{2, 4}, {10, 12}}))}, {Tr (({{5, 7}, {13, 15}})), Tr (({{6, 8}, {14, 16}}))}}))=(({{12, 14}, {20, 22}})).

(Subscript[Tr, B])X=(({{Tr (({{1, 2}, {5, 6}})), Tr (({{3, 4}, {7, 8}}))}, {Tr (({{9, 10}, {13, 14}})), Tr (({{11, 12}, {15, 16}}))}}))=(({{7, 11}, {23, 27}})).

Tensor Product Rules

(Subscript[Tr, A])X=(Tr (Subscript[X, A])) (Subscript[X, B]), 
(Subscript[Tr, B])X=(Tr (Subscript[X, B])) (Subscript[X, A]).

Given the following density matrix
ρ=(1/4)(𝟙+(Subscript[σ, A])·(Subscript[σ, B])),
calculate (Subscript[Tr, B])ρ.

ρ=(1/4)(𝟙+(Subscript[σ, A])·(Subscript[σ, B]))=(1/4)((Subscript[𝟙, A])⊗(Subscript[𝟙, B])+(Subscript[σ, A]^x)⊗(Subscript[σ, B]^x)+(Subscript[σ, A]^y)⊗(Subscript[σ, B]^y)+(Subscript[σ, A]^z)⊗(Subscript[σ, B]^z)).

(Subscript[Tr, B])ρ=(1/4)(Subscript[Tr, B])((Subscript[𝟙, A])⊗(Subscript[𝟙, B])+(Subscript[σ, A]^x)⊗(Subscript[σ, B]^x)+(Subscript[σ, A]^y)⊗(Subscript[σ, B]^y)+(Subscript[σ, A]^z)⊗(Subscript[σ, B]^z))
=(1/4)((Subscript[Tr, B])((Subscript[𝟙, A])⊗(Subscript[𝟙, B]))+(Subscript[Tr, B])((Subscript[σ, A]^x)⊗(Subscript[σ, B]^x))+(Subscript[Tr, B])((Subscript[σ, A]^y)⊗(Subscript[σ, B]^y))+(Subscript[Tr, B])((Subscript[σ, A]^z)⊗(Subscript[σ, B]^z)))
=(1/4)((Subscript[𝟙, A])Tr((Subscript[𝟙, B]))+(Subscript[σ, A]^x)Tr((Subscript[σ, B]^x))+(Subscript[σ, A]^y)Tr((Subscript[σ, B]^y))+(Subscript[σ, A]^z)Tr((Subscript[σ, B]^z)))
=(1/4)((Subscript[𝟙, A])×2+(Subscript[σ, A]^x)×0+(Subscript[σ, A]^y)×0+(Subscript[σ, A]^z)×0)
=(1/2)(Subscript[𝟙, A])≏(1/2)(({{1, 0}, {0, 1}})).

State and Operator

State Representation

(Ket[ψ])=(Subscript[ψ, 1])(Ket[1])+(Subscript[ψ, 2])(Ket[2])+(Subscript[ψ, 3])(Ket[3])+…
→(Ket[ψ])≏(({{(Subscript[ψ, 1])}, {(Subscript[ψ, 2])}, {(Subscript[ψ, 3])}, {⋮}})).

Two-Qubit State

Consider a two-qubit system spanned by the basis {(Ket[↑↑]), (Ket[↑↓]), (Ket[↓↑]), (Ket[↓↓])}, represent the EPR state (1/(Sqrt[2]))((Ket[↑↓])-(Ket[↓↑])) as a state vector.

(1/(Sqrt[2]))((Ket[↑↓])-(Ket[↓↑]))=0(Ket[↑↑])+(1/(Sqrt[2]))(Ket[↑↓])+(-(1/(Sqrt[2])))(Ket[↓↑])+0(Ket[↓↓]),

(1/(Sqrt[2]))((Ket[↑↓])-(Ket[↓↑]))≏(({{0}, {(1/(Sqrt[2]))}, {-(1/(Sqrt[2]))}, {0}}))=(1/(Sqrt[2]))(({{0}, {1}, {-1}, {0}})).

Prepend 0 as the coefficient to the basis states that has not appeared.

Always collect the coefficients following the same order of the basis state.

Operator Representation

M=(∑_(i,j))(Subscript[M, i j])(Ket[i])(Bra[j])
→M≏(({{(Subscript[M, 11]), (Subscript[M, 12]), ⋯}, {(Subscript[M, 21]), (Subscript[M, 22]), ⋯}, {⋮, ⋮, ⋱}})).

Permutation Operator

A permutation operator A acts on the basis states {(Ket[♢]), (Ket[♣]), (Ket[♡]), (Ket[♠])} as A(Ket[♢])=(Ket[♡]), A(Ket[♡])=(Ket[♢]), A(Ket[♣])=(Ket[♠]), A(Ket[♠])=(Ket[♣]). Represent A as matrix in the given basis.

(Ket[♢])≏(({{1}, {0}, {0}, {0}})), (Ket[♣])≏(({{0}, {1}, {0}, {0}})), (Ket[♡])≏(({{0}, {0}, {1}, {0}})),(Ket[♠])≏(({{0}, {0}, {0}, {1}})).

A≏(({{(Subscript[A, 11]), (Subscript[A, 12]), (Subscript[A, 13]), (Subscript[A, 14])}, {(Subscript[A, 21]), (Subscript[A, 22]), (Subscript[A, 23]), (Subscript[A, 24])}, {(Subscript[A, 31]), (Subscript[A, 32]), (Subscript[A, 33]), (Subscript[A, 34])}, {(Subscript[A, 41]), (Subscript[A, 42]), (Subscript[A, 43]), (Subscript[A, 44])}})).

(({{(Subscript[A, 11]), (Subscript[A, 12]), (Subscript[A, 13]), (Subscript[A, 14])}, {(Subscript[A, 21]), (Subscript[A, 22]), (Subscript[A, 23]), (Subscript[A, 24])}, {(Subscript[A, 31]), (Subscript[A, 32]), (Subscript[A, 33]), (Subscript[A, 34])}, {(Subscript[A, 41]), (Subscript[A, 42]), (Subscript[A, 43]), (Subscript[A, 44])}}))(({{1}, {0}, {0}, {0}}))=(({{(Subscript[A, 11])}, {(Subscript[A, 21])}, {(Subscript[A, 31])}, {(Subscript[A, 41])}}))=(({{0}, {0}, {1}, {0}})).

A≏(({{0, (Subscript[A, 12]), (Subscript[A, 13]), (Subscript[A, 14])}, {0, (Subscript[A, 22]), (Subscript[A, 23]), (Subscript[A, 24])}, {1, (Subscript[A, 32]), (Subscript[A, 33]), (Subscript[A, 34])}, {0, (Subscript[A, 42]), (Subscript[A, 43]), (Subscript[A, 44])}})).

(({{0, (Subscript[A, 12]), (Subscript[A, 13]), (Subscript[A, 14])}, {0, (Subscript[A, 22]), (Subscript[A, 23]), (Subscript[A, 24])}, {1, (Subscript[A, 32]), (Subscript[A, 33]), (Subscript[A, 34])}, {0, (Subscript[A, 42]), (Subscript[A, 43]), (Subscript[A, 44])}}))(({{0}, {0}, {1}, {0}}))=(({{(Subscript[A, 13])}, {(Subscript[A, 23])}, {(Subscript[A, 33])}, {(Subscript[A, 43])}}))=(({{1}, {0}, {0}, {0}})),

A≏(({{0, (Subscript[A, 12]), 1, (Subscript[A, 14])}, {0, (Subscript[A, 22]), 0, (Subscript[A, 24])}, {1, (Subscript[A, 32]), 0, (Subscript[A, 34])}, {0, (Subscript[A, 42]), 0, (Subscript[A, 44])}})).

(({{0, (Subscript[A, 12]), (Subscript[A, 13]), (Subscript[A, 14])}, {0, (Subscript[A, 22]), (Subscript[A, 23]), (Subscript[A, 24])}, {1, (Subscript[A, 32]), (Subscript[A, 33]), (Subscript[A, 34])}, {0, (Subscript[A, 42]), (Subscript[A, 43]), (Subscript[A, 44])}}))(({{0}, {0}, {1}, {0}}))=(({{(Subscript[A, 13])}, {(Subscript[A, 23])}, {(Subscript[A, 33])}, {(Subscript[A, 43])}}))=(({{1}, {0}, {0}, {0}})),

A≏(({{0, (Subscript[A, 12]), 1, (Subscript[A, 14])}, {0, (Subscript[A, 22]), 0, (Subscript[A, 24])}, {1, (Subscript[A, 32]), 0, (Subscript[A, 34])}, {0, (Subscript[A, 42]), 0, (Subscript[A, 44])}})).

A≏(({{0, 0, 1, (Subscript[A, 14])}, {0, 0, 0, (Subscript[A, 24])}, {1, 0, 0, (Subscript[A, 34])}, {0, 1, 0, (Subscript[A, 44])}})).

A≏(({{0, 0, 1, 0}, {0, 0, 0, 1}, {1, 0, 0, 0}, {0, 1, 0, 0}})).

({{out\in, (Ket[♢]), (Ket[♣]), (Ket[♡]), (Ket[♠])}, {(Ket[♢]), □, □, □, □}, {(Ket[♣]), □, □, □, □}, {(Ket[♡]), □, □, □, □}, {(Ket[♠]), □, □, □, □}})

({{out\in, (Ket[♢]), (Ket[♣]), (Ket[♡]), (Ket[♠])}, {(Ket[♢]), □, □, □, □}, {(Ket[♣]), □, □, □, □}, {(Ket[♡]), 1, □, □, □}, {(Ket[♠]), □, □, □, □}})

({{out\in, (Ket[♢]), (Ket[♣]), (Ket[♡]), (Ket[♠])}, {(Ket[♢]), □, □, 1, □}, {(Ket[♣]), □, □, □, □}, {(Ket[♡]), 1, □, □, □}, {(Ket[♠]), □, □, □, □}})

({{out\in, (Ket[♢]), (Ket[♣]), (Ket[♡]), (Ket[♠])}, {(Ket[♢]), □, □, 1, □}, {(Ket[♣]), □, □, □, □}, {(Ket[♡]), 1, □, □, □}, {(Ket[♠]), □, 1, □, □}})

({{out\in, (Ket[♢]), (Ket[♣]), (Ket[♡]), (Ket[♠])}, {(Ket[♢]), □, □, 1, □}, {(Ket[♣]), □, □, □, 1}, {(Ket[♡]), 1, □, □, □}, {(Ket[♠]), □, 1, □, □}})

A≏(({{0, 0, 1, 0}, {0, 0, 0, 1}, {1, 0, 0, 0}, {0, 1, 0, 0}})).

A=(Ket[♡])(Bra[♢])+(Ket[♢])(Bra[♡])+(Ket[♠])(Bra[♣])+(Ket[♣])(Bra[♠]).

A≏(({{0, 0, 1, 0}, {0, 0, 0, 1}, {1, 0, 0, 0}, {0, 1, 0, 0}})).

Hadamard Gate (I)

Hadamard gate (Subscript[U, H]) is a single-qubit gate that takes |→⟩ to (Ket[↑]) and takes (Ket[←])  to (Ket[↓]). Represent (Subscript[U, H]) in the {(Ket[↑]), (Ket[↓])} basis.

(Ket[→])=(((Ket[↑])+(Ket[↓]))/(Sqrt[2])),(Ket[←])=(((Ket[↑])-(Ket[↓]))/(Sqrt[2])).

(Subscript[U, H])=(Ket[↑])(Bra[→])+(Ket[↓])(Bra[←])
=(Ket[↑])(((Bra[↑])+(Bra[↓]))/(Sqrt[2]))+(Ket[↓])(((Bra[↑])-(Bra[↓]))/(Sqrt[2]))
=(((Ket[↑])(Bra[↑])+(Ket[↑])(Bra[↓])+(Ket[↓])(Bra[↑])-(Ket[↓])(Bra[↓]))/(Sqrt[2])),

(Subscript[U, H])≏(1/(Sqrt[2]))(({{1, 1}, {1, -1}})).

Basis Transformation

(Ket[ψ])→U(Ket[ψ]),

M→U M (SuperDagger[U]).

Hadamard Gate (II)

Hadamard gate (Subscript[U, H])=(Ket[↑])(Bra[→])+(Ket[↓])(Bra[←]) performs basis transformation from (σ^x) eigen basis to (σ^z) eigen basis.
(i) How does the states (Ket[→]) and (Ket[←]) transforms under (Subscript[U, H]).
(ii) How does the operator (σ^x) transforms under (Subscript[U, H])

(Subscript[U, H])(Ket[→])=((Ket[↑])(Bra[→])+(Ket[↓])(Bra[←]))(Ket[→])
=(Ket[↑])(BraKet[→, →])+(Ket[↓])(BraKet[←, →])
=(Ket[↑])1+(Ket[↓])0
=(Ket[↑]).

(Subscript[U, H])(σ^x)(Subscript[U, H]^†)=((Ket[↑])(Bra[→])+(Ket[↓])(Bra[←]))((Ket[→])(Bra[→])-(Ket[←])(Bra[←]))((Ket[→])(Bra[↑])+(Ket[←])(Bra[↓]))
=((Ket[↑])(BraKet[→, →])(Bra[→])-(Ket[↑])(BraKet[→, ←])(Bra[←])+(Ket[↓])(BraKet[←, →])(Bra[→])-(Ket[↓])(BraKet[←, ←])(Bra[←]))((Ket[→])(Bra[↑])+(Ket[←])(Bra[↓]))
=((Ket[↑])(Bra[→])-(Ket[↓])(Bra[←]))((Ket[→])(Bra[↑])+(Ket[←])(Bra[↓]))
=(Ket[↑])(BraKet[→, →])(Bra[↑])+(Ket[↑])(BraKet[→, ←])(Bra[↓])-(Ket[↓])(BraKet[←, →])(Bra[↑])-(Ket[↓])(BraKet[←, ←])(Bra[↓])
=(Ket[↑])(Bra[↑])-(Ket[↓])(Bra[↓])
=(σ^z).

Note that even though (Subscript[U, H]) implements basis transformation, when representing states and operators, one must still stick to a single choice of basis (e.g. (σ^z) eigen basis) for all representations.

(Subscript[U, H])≏(1/(Sqrt[2]))(({{1, 1}, {1, -1}})),
(Ket[→])≏(1/(Sqrt[2]))(({{1}, {1}})), (Ket[←])≏(1/(Sqrt[2]))(({{1}, {-1}})),
(Ket[↑])≏(({{1}, {0}})), (Ket[↓])≏(({{0}, {1}})),
(σ^x)≏(({{0, 1}, {1, 0}})), (σ^z)≏(({{1, 0}, {0, -1}})).

(Subscript[U, H])(Ket[→])≏(1/(Sqrt[2]))(({{1, 1}, {1, -1}}))(1/(Sqrt[2]))(({{1}, {1}}))=(({{1}, {0}}))≏(Ket[↑]),
(Subscript[U, H])(Ket[→])≏(1/(Sqrt[2]))(({{1, 1}, {1, -1}}))(1/(Sqrt[2]))(({{1}, {-1}}))=(({{0}, {1}}))≏(Ket[↓]).

(Subscript[U, H])(σ^x)(Subscript[U, H]^†)≏(1/(Sqrt[2]))(({{1, 1}, {1, -1}}))(({{0, 1}, {1, 0}}))(1/(Sqrt[2]))(({{1, 1}, {1, -1}}))
=(({{1, 0}, {0, -1}}))≏(σ^z).

One can see that (Subscript[U, H]) is actually the unitary transformation that diagonalize the (σ^x) matrix.

Evolution and Measurement

Time Evolution

i(∂_t)(Ket[ψ(t)])=H(Ket[ψ(t)]).

U(t)=(e^(-i H t)),

to evolve a state (Ket[ψ(0)]) in time (Schrödinger picture)

(Ket[ψ(t)])=U(t)(Ket[ψ(0)]),

or to evolve a density matrix ρ(0) in time (Schrödinger picture)

ρ(t)=U(t)ρ(0)(SuperDagger[U(t)]).

Evolution of a Single-Qubit System

Calculate the time evolution of a single-qubit density matrix ρ(0)=(1/2)(𝟙+m·σ) under the Hamiltonian H=h·σ

U(t)=(e^(-i H t))=exp(-i h·σ t)=exp(-i (OverHat[h])·σ |h|t)
=cos(|h|t)𝟙-i sin(|h|t)(OverHat[h])·σ,

ρ(t)=U(t)ρ(0)(SuperDagger[U(t)])
=(cos(|h|t)𝟙-i sin(|h|t)(OverHat[h])·σ)(1/2)(𝟙+m·σ)(cos(|h|t)𝟙+i sin(|h|t)(OverHat[h])·σ).

(cos(|h|t)𝟙-i sin(|h|t)(OverHat[h])·σ)m·σ (cos(|h|t)𝟙+i sin(|h|t)(OverHat[h])·σ)
=(cos^2)(|h|t)m·σ-i sin(|h|t)cos(|h|t)[(OverHat[h])·σ,m·σ]+(sin^2)(|h|t) (OverHat[h])·σ m·σ (OverHat[h])·σ
=(cos^2)(|h|t)m·σ+2sin(|h|t)cos(|h|t)((OverHat[h])×m)·σ+(sin^2)(|h|t) (2(OverHat[h])·m (OverHat[h])·σ-m·σ)
=cos(2|h|t)m·σ-sin(2|h|t)m· ((OverHat[h])×σ)+(1-cos(2|h|t))(OverHat[h])·m (OverHat[h])·σ.

(OverHat[h])·σ m·σ (OverHat[h])·σ=((OverHat[h])·m 𝟙+i ((OverHat[h])×m)·σ) (OverHat[h])·σ
=(OverHat[h])·m (OverHat[h])·σ+i ((OverHat[h])×m)·σ (OverHat[h])·σ
=(OverHat[h])·m (OverHat[h])·σ+i (((OverHat[h])×m)·(OverHat[h]) 𝟙+i (((OverHat[h])×m)×(OverHat[h]))·σ)
=(OverHat[h])·m (OverHat[h])·σ+i (0 𝟙+i (((OverHat[h])·(OverHat[h]))m-((OverHat[h])·m)(OverHat[h]))·σ)
=(OverHat[h])·m (OverHat[h])·σ- (((OverHat[h])·(OverHat[h]))m·σ-(OverHat[h])·m(OverHat[h])·σ)
=2(OverHat[h])·m (OverHat[h])·σ-m·σ.

ρ(t)=(1/2)(𝟙+cos(2|h|t)m·σ-sin(2|h|t)m· ((OverHat[h])×σ)+(1-cos(2|h|t))(OverHat[h])·m (OverHat[h])·σ).

Evolution of a Two-Qubit System

Consider a two-qubit state (Ket[ψ(0)])=(Ket[↑↓]) evolved under the Hamiltonian
H=(Ket[↑↓])(Bra[↓↑])+(Ket[↓↑])(Bra[↑↓]),
write down the state (Ket[ψ(t)]) as a function of time.

(Ket[ψ(0)])=(Ket[↑↓])≏(({{0}, {1}, {0}, {0}})),
H=(Ket[↑↓])(Bra[↓↑])+(Ket[↓↑])(Bra[↑↓])≏(({{0, 0, 0, 0}, {0, 0, 1, 0}, {0, 1, 0, 0}, {0, 0, 0, 0}})).

U(t)=(e^(-i H t))≏(({{1, 0, 0, 0}, {0, cos t, -i sin t, 0}, {0, -i sin t, cos t, 0}, {0, 0, 0, 1}})).

MatrixExp[-I {{0,0,0,0},{0,0,1,0},{0,1,0,0},{0,0,0,0}}t]

(Ket[ψ(t)])=U(t)(Ket[ψ(0)])≏(({{1, 0, 0, 0}, {0, cos t, -i sin t, 0}, {0, -i sin t, cos t, 0}, {0, 0, 0, 1}}))(({{0}, {1}, {0}, {0}}))=(({{0}, {cos t}, {-i sin t}, {0}}))
≏cos t (Ket[↑↓])-i sin t(Ket[↓↑]).

Notice that both the initial state and the Hamiltonian only involves the basis states (Ket[↑↓]) and (Ket[↓↑]). So {(Ket[↑↓]), |↓↑⟩} are the relevant set of basis. The other states like (Ket[↑↑]) and (Ket[↓↓]) are irrelevant to our problem.

(Ket[ψ(0)])=(Ket[↑↓])≏(({{1}, {0}})),
H=(Ket[↑↓])(Bra[↓↑])+(Ket[↓↑])(Bra[↑↓])≏(({{0, 1}, {1, 0}}))=(σ^x).

U(t)=(e^(-i H t))≏(e^(-i (σ^x) t))=cos t 𝟙-i sin t (σ^x)
=(({{cos t, -i sin t}, {-i sin t, cos t}})).

(Ket[ψ(t)])=U(t)(Ket[ψ(0)])≏(({{cos t, -i sin t}, {-i sin t, cos t}}))(({{1}, {0}}))=(({{cos t}, {-i sin t}}))
≏cos t (Ket[↑↓])-i sin t(Ket[↓↑]).

Two-Stage Evolution

(i) Construct the time-evolution operator U for a qubit that first evolve under (Subscript[H, 1])=(σ^x) for time π/4 and then evolve under (Subscript[H, 2])=(σ^y) for time π/4. (assuming ℏ=1 hereinafter)
(ii) Construct the time-evolution operator U' for a qubit that first evolve under (Subscript[H, 2])=(σ^y) for time π/4 and then evolve under (Subscript[H, 1])=(σ^x) for time π/4 (exchanging the order of the two stages). Show that U and U' are different (so that the ordering of stages matters).
(iii) Find the generators of U and U'.

(Subscript[U, 1])=(e^(-i π/4 (Subscript[H, 1])))=(e^(-i π/4 (σ^x)))=cos (π/4) 𝟙-i sin (π/4) (σ^x)=((𝟙-i (σ^x))/(Sqrt[2])).

(Subscript[U, 2])=(e^(-i π/4 (Subscript[H, 2])))=(e^(-i π/4 (σ^y)))=cos (π/4) 𝟙-i sin (π/4) (σ^y)=((𝟙-i (σ^y))/(Sqrt[2])).

U=(Subscript[U, 2])(Subscript[U, 1])=((𝟙-i (σ^y))/(Sqrt[2]))((𝟙-i (σ^x))/(Sqrt[2]))=((𝟙-i (σ^x)-i (σ^y)+i (σ^z))/2).

U'=(Subscript[U, 1])(Subscript[U, 2])=((𝟙-i (σ^x))/(Sqrt[2]))((𝟙-i (σ^y))/(Sqrt[2]))=((𝟙-i (σ^x)-i (σ^y)-i (σ^z))/2).

H=(1/(Sqrt[3]))((σ^x)+ (σ^y)-(σ^z)),

(e^(-i π/3 H))(Overscript[=, (H^2)=𝟙])cos (π/3)𝟙-i sin (π/3)H
=(1/2)𝟙-i((Sqrt[3])/2)(1/(Sqrt[3]))((σ^x)+ (σ^y)-(σ^z))
=((𝟙-i (σ^x)-i (σ^y)+i (σ^z))/2)=U.

H'=(1/(Sqrt[3]))((σ^x)+ (σ^y)+(σ^z)),

(e^(-i π/3 H'))(Overscript[=, (H^(′2))=𝟙])cos (π/3)𝟙-i sin (π/3)H'
=(1/2)𝟙-i((Sqrt[3])/2)(1/(Sqrt[3]))((σ^x)+ (σ^y)+(σ^z))
=((𝟙-i (σ^x)-i (σ^y)-i (σ^z))/2)=U'.

Measurement

for pure state

p(L=λ)=(Bra[ψ])P(L=λ)(Ket[ψ]),

for mixed state

p(L=λ)=Tr ρ P(L=λ).

for pure state

(Ket[ψ])(Overscript[⟶, measure L, get λ])((P(L=λ)(Ket[ψ]))/((p(L=λ))^(1/2))),

for mixed state

ρ (Overscript[⟶, measure L, get λ])((P(L=λ)ρ P(L=λ))/(p(L=λ))).

Single-Qubit Measurement

Consider a single qubit state (Ket[ψ])=cos α (Ket[↑])+sin α(Ket[↓]). Measure (σ^z)
(i) What are the possible measurement outcomes?
(ii) What are the probabilities associated to the possible outcomes?
(iii) For each measurement outcome, what post-measurement state will the system collapse to?

P((σ^z)=±1)=((𝟙±(σ^z))/2).

p((σ^z)=±1)=(Bra[ψ])P((σ^z)=±1)(Ket[ψ])
=(cos α (Bra[↑])+sin α(Bra[↓]))((𝟙±(σ^z))/2)(cos α (Ket[↑])+sin α(Ket[↓]))
=(1/2)(1±((cos^2)α-(sin^2)α)).

p((σ^z)=+1)=(cos^2)α,
p((σ^z)=-1)=(sin^2)α.

(Ket[ψ])(Overscript[⟶, (σ^z)=+1])((P((σ^z)=+1)(Ket[ψ]))/((p((σ^z)=+1))^(1/2)))
=(1/(cos α))((𝟙+(σ^z))/2)(cos α (Ket[↑])+sin α(Ket[↓]))
=(1/(cos α))(cos α ((𝟙+(σ^z))/2)(Ket[↑])+sin α((𝟙+(σ^z))/2)(Ket[↓]))
=(1/(cos α))(cos α ((1+1)/2)(Ket[↑])+sin α((1-1)/2)(Ket[↓]))
=(1/(cos α))cos α (Ket[↑])
=(Ket[↑])

(Ket[ψ])(Overscript[⟶, (σ^z)=-1])((P((σ^z)=-1)(Ket[ψ]))/((p((σ^z)=-1))^(1/2)))=(Ket[↓]).

Measurement with Degenerated Subspace

Consider a quantum state (Ket[ψ])=(1/(Sqrt[3]))((Ket[1])+(Ket[2])+(Ket[3])), measure the observable L=((Ket[1])-(Ket[2]))((Bra[1])-(Bra[2])).
(i) What are the possible measurement out comes?
(ii) If the measurement outcome is L=0, which state will the system collapse to?

(Ket[ψ])=(1/(Sqrt[3]))((Ket[1])+(Ket[2])+(Ket[3]))≏(1/(Sqrt[3]))(({{1}, {1}, {1}})),
L=((Ket[1])+(Ket[2]))((Bra[1])+(Bra[2]))≏(({{1, -1, 0}, {-1, 1, 0}, {0, 0, 0}})).

(Ket[1+1])≏(1/(Sqrt[2]))(({{1}, {-1}, {0}})), (Ket[1-1])≏(1/(Sqrt[2]))(({{1}, {1}, {0}})), (Ket[0])≏(({{0}, {0}, {1}})).

P(L=0)=(∑_i)(Ket[(Subscript[λ, i])])δ((Subscript[λ, i])-0)(Bra[(Subscript[λ, i])])
=(Ket[1+1])δ(2-0)(Bra[1+1])+(Ket[1-1])δ(0-0)(Bra[1-1])+(Ket[0])δ(0-0)(Bra[0])
=(Ket[1-1])(Bra[1-1])+(Ket[0])(Bra[0])
≏(1/(Sqrt[2]))(({{1}, {1}, {0}}))(1/(Sqrt[2]))(({{1, 1, 0}}))+(({{0}, {0}, {1}}))(({{0, 0, 1}}))
=(({{1/2, 1/2, 0}, {1/2, 1/2, 0}, {0, 0, 0}}))+(({{0, 0, 0}, {0, 0, 0}, {0, 0, 1}}))
=(({{1/2, 1/2, 0}, {1/2, 1/2, 0}, {0, 0, 1}})).

p(L=0)=(Bra[ψ])P(L=0)(Ket[ψ])
≏(1/(Sqrt[3]))(({{1, 1, 1}}))(({{1/2, 1/2, 0}, {1/2, 1/2, 0}, {0, 0, 1}}))(1/(Sqrt[3]))(({{1}, {1}, {1}}))
=(1/3)(({{1, 1, 1}}))(({{1}, {1}, {1}}))
=1.

(Ket[ψ])(Overscript[→, L=0])((P(L=0)(Ket[ψ]))/((p(L=0))^(1/2)))
≏(({{1/2, 1/2, 0}, {1/2, 1/2, 0}, {0, 0, 1}}))(1/(Sqrt[3]))(({{1}, {1}, {1}}))
=(1/(Sqrt[3]))(({{1}, {1}, {1}}))≏(Ket[ψ]),

Entanglement by Measurement

Consider a two-qubit system describe by a product state (Ket[ψ])=(1/2)((Ket[↑])+(Ket[↓]))⊗((Ket[↑])+(Ket[↓])), measure L=(Ket[↑↑])(Bra[↓↓])+(Ket[↓↓])(Bra[↑↑]), suppose the outcome L=+1 is obtained, what is the post-measurement state that the system collapses to?

(Ket[ψ])=(1/2)((Ket[↑])+(Ket[↓]))⊗((Ket[↑])+(Ket[↓]))
=(1/2)((Ket[↑↑])+(Ket[↑↓])+(Ket[↓↑])+(Ket[↓↓]))
≏(1/2)(({{1}, {1}, {1}, {1}})),
L≏(({{0, 0, 0, 1}, {0, 0, 0, 0}, {0, 0, 0, 0}, {1, 0, 0, 0}})).

P(L=+1)=((𝟙+L)/2)≏(1/2)(({{1, 0, 0, 1}, {0, 0, 0, 0}, {0, 0, 0, 0}, {1, 0, 0, 1}})).

p(L=+1)=(Bra[ψ])P(L=+1)(Ket[ψ])
≏(1/2)(({{1, 1, 1, 1}}))(1/2)(({{1, 0, 0, 1}, {0, 0, 0, 0}, {0, 0, 0, 0}, {1, 0, 0, 1}}))(1/2)(({{1}, {1}, {1}, {1}}))
=(1/2).

(Ket[ψ])(Overscript[→, L=+1])((P(L=+1)(Ket[ψ]))/((p(L=+1))^(1/2)))
≏(1/(Sqrt[1/2]))(1/2)(({{1, 0, 0, 1}, {0, 0, 0, 0}, {0, 0, 0, 0}, {1, 0, 0, 1}}))(1/2)(({{1}, {1}, {1}, {1}}))
=(1/(Sqrt[2]))(({{1}, {0}, {0}, {1}}))
≏(((Ket[↑↑])+(Ket[↓↓]))/(Sqrt[2])),

Stroboscopic Measurement

Consider a single qubit evolving under a fixed Hamiltonian H=(σ^y). Every π/4 period of time, a measurement of (σ^z) is applied. If the qubit starts from the (Ket[↑]) state (the (σ^z)=+1 state), 
(i) what is the probability for it to remain in the (Ket[↑]) state after each measurement in totally all n times (n period) measurements.
(ii) what is the probability for it to end up in the (Ket[↑]) state after n times of measurement.

U=(e^(-i π/4 H))=(e^(-i π/4 (σ^y)))=cos(π/4)𝟙-i sin (π/4)(σ^y)=((𝟙-i (σ^y))/(Sqrt[2])).

P((σ^z)=±1)=((𝟙±(σ^z))/2).

U(Ket[↑])=((𝟙-i (σ^y))/(Sqrt[2]))(Ket[↑])≏(1/(Sqrt[2]))(({{1, -1}, {1, 1}}))(({{1}, {0}}))=(1/(Sqrt[2]))(({{1}, {1}}))≏(Ket[→]).

p((σ^z)=+1)=((|(BraKet[↑, →])|)^2)=(1/2).

((p((σ^z)=+1))^n)=((((1/2)))^n)=(2^(-n)).

U(Ket[↓])=((𝟙-i (σ^y))/(Sqrt[2]))(Ket[↓])≏(1/(Sqrt[2]))(({{1, -1}, {1, 1}}))(({{0}, {1}}))=(1/(Sqrt[2]))(({{-1}, {1}}))≏-(Ket[←]).

({{ ,  ,  ,  ,  ,  ,  , (Subscript[↗, +1]), (Ket[↑]), …}, { ,  ,  , (Subscript[↗, +1]), (Ket[↑]), (Overscript[→, U]), (Ket[→]), P((σ^z)),  ,  }, { ,  ,  , ,  ,  ,  , (↘^(-1)), (Ket[↓]), …}, {(Ket[↑]), (Overscript[→, U]), (Ket[→]), P((σ^z)),  ,  ,  ,  ,  ,  }, { ,  ,  , (↘^(-1)),  ,  ,  , (Subscript[↗, +1]), (Ket[↑]), …}, { ,  ,  , , (Ket[↓]), (Overscript[→, U]), -(Ket[←]), P((σ^z)),  ,  }, { ,  ,  ,  ,  ,  ,  , (↘^(-1)), (Ket[↓]), …}})

(Subscript[p, all (σ^z)=+1])=((|(Bra[↑])(Underscript[(Underscript[P((σ^z)=+1)U … P((σ^z)=+1)UP((σ^z)=+1)U, ⏟]), n times])(Ket[↑])|)^2)
=((|(((Bra[↑])(P((σ^z)=+1)U))^n)(Ket[↑])|)^2).

P((σ^z)=+1)U=((𝟙+(σ^z))/2)((𝟙-i (σ^y))/(Sqrt[2]))
≏(({{1, 0}, {0, 0}}))(1/(Sqrt[2]))(({{1, -1}, {1, 1}}))
=(1/(Sqrt[2]))(({{1, -1}, {0, 0}}))

(({{1, -1}, {0, 0}}))(({{1, -1}, {0, 0}}))=(({{1, -1}, {0, 0}})).

(((P((σ^z)=+1)U))^n)≏((((1/(Sqrt[2]))))^n)(((({{1, -1}, {0, 0}})))^n)=(2^(-n/2))(({{1, -1}, {0, 0}})).

(Subscript[p, all (σ^z)=+1])≏((|(({{1, 0}}))(2^(-n/2))(({{1, -1}, {0, 0}}))(({{1}, {0}}))|)^2)
=(2^(-n)).

(Subscript[p, {(Subscript[σ, k]^z)=(Subscript[s, k])}])=((|(Bra[↑])(∏_(k=1)^n)(P((σ^z)=(Subscript[s, k]))U)(Ket[↑])|)^2).

P((σ^z)=+1)U≏(1/(Sqrt[2]))(({{1, -1}, {0, 0}})),
P((σ^z)=-1)U≏(1/(Sqrt[2]))(({{0, 0}, {1, 1}})).

P((σ^z)=+1)U(Ket[↑])=(1/(Sqrt[2]))(Ket[↑]),
P((σ^z)=+1)U(Ket[↓])=((-1)/(Sqrt[2]))(Ket[↑]);
P((σ^z)=-1)U(Ket[↑])=(1/(Sqrt[2]))(Ket[↓]),
P((σ^z)=-1)U(Ket[↓])=(1/(Sqrt[2]))(Ket[↓]).

(∏_(k=1)^n)(P((σ^z)=(Subscript[s, k]))U)(Ket[↑])=±((((1/(Sqrt[2]))))^n)(Ket[↑])=±(2^(-n/2))(Ket[↑]).

(Subscript[p, {(Subscript[σ, k]^z)=(Subscript[s, k])}])=((|(Bra[↑])±(2^(-n/2))(Ket[↑])|)^2)=(2^(-n)).

(Subscript[p, last (σ^z)=+1])=(∏_(k=1)^(n-1))(∑_((Subscript[s, k])=±1))(Subscript[p, {(Subscript[σ, k]^z)=(Subscript[s, k])}])
=(∏_(k=1)^(n-1))(∑_((Subscript[s, k])=±1))(2^(-n))
=(2^(n-1))(2^(-n))
=1/2.