Problem 1. Consider the density matrix:
go through the conditions to ensure that this matrix is indeed a density matrix. Furthermore is the matrix a pure or mixed state, i.e.
Also calculate the
Solution 1. The criteria that a matrix be a density matrix is the following:
Positive semidefinite operator, therefore is Hermitian with eigenvalues
.Has
xxxxxxxxxxbegin using SymPy using Plots pyplot()end;x
begin 𝑖 = sympy.I π = sympy.symbols("π") ϕ = sympy.symbols("ϕ",real=true) 𝚝𝚛(X) = sympy.trace(X) ⋅ = *end;x
begin ρ₁₁ = sympy.Rational(3,4) ρ₁₂ = sympy.sqrt(2)/4 ⋅ exp(-𝑖⋅ϕ) ρ₂₁ = sympy.sqrt(2)/4 ⋅ exp(𝑖⋅ϕ) ρ₂₂ = sympy.Rational(1,4) ρ = [ρ₁₁ ρ₁₂; ρ₂₁ ρ₂₂]endSo the easiest condition to check is the second one by taking the trace of the ensity matrix, as below:
x
𝚝𝚛(ρ)It satisfies this criteria. Now we need to check if its positive semidefinite. Since this requires that its Hermitian, we can check that
ρ == ρ.adjoint()
Now to see if the is postive valued, we can get the eigenspectrum[1]:
xxxxxxxxxxe = [ i for i in keys(ρ.eigenvals())];as we can see
The next part is to determine if the density matrix corresponds to a pure or mixed state.
For a pure state we can check that
falsexxxxxxxxxxρ^2 == ρso its not a pure state but a mixed state. Finally we want to evaluate the expectation of the Pauli operator
xxxxxxxxxxσₓ = [0 1; 1 0];x
begin _σₓ_ =𝚝𝚛(σₓ⋅ρ) _σₓ_ = _σₓ_.rewrite(exp).simplify()endxxxxxxxxxxϕ⃗ = range(-pi,stop=pi,length=100);xxxxxxxxxxplot(ϕᵢ->ϕᵢ,ϕᵢ->_σₓ_(ϕ => ϕᵢ),ϕ⃗, xlabel="ϕ",ylabel="⟨σₓ⟩", size=(400,200),legend=false, xticks=([pi*i/4 for i=-4:4],[π*i/4 for i=-4:4]))1
the returned data type from ρ.eigenvals() is a julia dictionary with keys being eigenvalues (SymPy) and values the degeneracy/multiplicty. We just want the dictionary keys here.