Computation of the Entanglement Entropy: Generalized Bell States

In[]:=
Ψ=
QuantumState
[<|{0,1}->Cos[θ],{1,0}->-Sin[θ]|>,2,2]
Out[]=
QuantumState
StateType: Vector
Qudits: 2
Type: Pure
Dimension: 4
Picture: Schrödinger
​

In[]:=
Ψ["DensityMatrix"]//MatrixForm
Out[]//MatrixForm=
0
0
0
0
0
Conjugate[Cos[θ]]Cos[θ]
-Conjugate[Sin[θ]]Cos[θ]
0
0
-Conjugate[Cos[θ]]Sin[θ]
Conjugate[Sin[θ]]Sin[θ]
0
0
0
0
0
In[]:=
Ψ["Formula"]
Out[]=
Cos[θ]|01〉-|10〉Sin[θ]
In[]:=
=Simplify[QuantumPartialTrace[Ψ,{2}]["DensityMatrix"]]
Out[]=
SparseArray
Specified elements: 2
Dimensions: {2,2}

Compute the Entanglement Entropy:
S

In[]:=
S=Simplify[-Tr[.MatrixLog[]],Assumptions0<=θ<=π/2]
Out[]=
-2(
2
Cos[θ]
Log[Cos[θ]]+Log[Sin[θ]]
2
Sin[θ]
)
Find the maximum entanglement value
In[]:=
S//.Solve[D[S,θ]==0,θ][[1]]
Out[]=
Log[2]
In[]:=
Plot[{S},{θ,0,π/2},AxesLabel{θ,HoldForm[S]},EpilogLine[{{π/4,Simplify[S//.{θ->π/4}]},{π/4,0}}]]
Out[]=