Problem 1. Consider the density matrix:
show that we have a mixed state. Find the von Neumann entropy.
Solution.
x
1
begin
2
using LinearAlgebra
3
end
xxxxxxxxxx
1
10
1
begin
2
⋅ = *
3
𝚝𝚛 = tr
4
entropy(X::Array{T,1}) where T<: Number = begin
5
χ = 0.00e0
6
for i=1:length(X)
7
χ -= X[i]*log(X[i])
8
end
9
return χ
10
end
11
12
entropy(X::Array{T,2}) where T<: Number = -1⋅𝚝𝚛(X⋅log(X))
13
end;
xxxxxxxxxx
1
1
begin
2
ρ = [5//12 1//6 1//6;
3
1//6 1//6 1//6;
4
1//6 1//6 5//12]
5
end;
First we check if the density matrix is idempotent, i.e.
false
xxxxxxxxxx
1
1
ρ⋅ρ == ρ
So the matrix is not a pure state and indeed a mixed.
The von Neumann entropy can be calculated in two equivalent ways:
where
0.7724450450599503
xxxxxxxxxx
1
1
entropy(ρ)
x
1
𝐞ᵢ = eigen(ρ).values;
0.7724450450599518
xxxxxxxxxx
1
1
entropy(𝐞ᵢ)