Initialize Quantum Framework

In[]:=
PacletInstall["https://www.wolframcloud.com/obj/wolframquantumframework/QuantumFramework.paclet",ForceVersionInstall->True]
Out[]=
PacletObject
Name: Wolfram/QuantumFramework
Version: 1.0.3

In[]:=
<<Wolfram`QuantumFramework`

Computation of the Entanglement Entropy: Bell State

In[]:=
ψ=QuantumState["PsiPlus"]
Out[]=
QuantumState
StateType: Vector
Qudits: 2
Type: Pure
Dimension: 4
Picture: Schrödinger
​

In[]:=
ψ["Formula"]
Out[]=
|01〉
2
+
|10〉
2
In[]:=
ψ["DensityMatrix"]//MatrixForm
Out[]//MatrixForm=
0
0
0
0
0
1
2
1
2
0
0
1
2
1
2
0
0
0
0
0
In[]:=
ρ=Simplify[QuantumPartialTrace[ψ,{2}]["DensityMatrix"]]
Out[]=
SparseArray
Specified elements: 2
Dimensions: {2,2}

Compute the Entanglement Entropy:
S
ρ
In[]:=
S=-Tr[ρ.MatrixLog[ρ]]
Out[]=
Log[2]