Wolfram`QuantumFramework`
QuantumState |
|
| | ||||
|
| | ||||
|
| | ||||
|
| | ||||
|
| |
Details and Options
Examples
(27)
Basic Examples
(6)
Pure states can be defined by inputting state vectors, given a basis:
In[1]:=
ψ=
[{α,β},2]
QuantumState |
Out[1]=
QuantumState
|
The first argument is the state vector and the second argument specifies the dimension of basis (which is computational). The default basis is the computational basis, unless specified otherwise. With no basis info, the basis is set by default as a -dimensional computational basis.
n
2
In[2]:=
QuantumState |
QuantumState |
Out[2]=
True
Return amplitudes:
In[3]:=
ψ["Amplitudes"]
Out[3]=
|0〉α,|1〉β
Return formula of the state:
In[4]:=
ψ["Formula"]
Out[4]=
α|0〉+β|1〉
Define a 2-qubit state (2D⊗2D Hilbert space):
In[1]:=
ψ=
[{3,2,5,1}]
QuantumState |
Out[1]=
QuantumState
|
Return qudits dimensions:
In[2]:=
ψ["Dimensions"]
Out[2]=
{2,2}
Again, note that the basis info can be given explicitly too.
In[3]:=
QuantumState |
QuantumState |
Out[3]=
True
Specify the dimension of qudit as 3D:
In[1]:=
ψ=
[{1,2+1,3},3]
QuantumState |
Out[1]=
QuantumState
|
Return qudits dimensions:
In[2]:=
ψ["Dimensions"]
Out[2]=
{3}
Note if no basis info is provided, the state vector will be padded to right by zeroes to reach the first -dimensional space
n
2
In[3]:=
QuantumState |
Out[3]=
{1,1+2,3,0}
In[4]:=
QuantumState |
Out[4]=
{2,2}
A built-in state:
In[1]:=
ψ=
["PhiMinus"]
QuantumState |
Out[1]=
QuantumState
|
Return amplitudes:
In[2]:=
ψ["Formula"]
Out[2]=
|00〉
2
|11〉
2
One can define a state in a given basis. A state in 4D Schwinger basis:
In[1]:=
ψ=
{1,2,3},
[{"Schwinger",3}]
QuantumState |
QuantumBasis |
Out[1]=
QuantumState
|
Return amplitudes:
In[2]:=
ψ["Formula"]
Out[2]=
|〉+2|〉+3|〉
S
00
S
01
S
02
States (pure or mixed) can be also defined by matrices.
Define a generic Bloch vector:
In[1]:=
mat[r_]/;VectorQ[r]:=1/2(IdentityMatrix[2]+r.Table[PauliMatrix[i],{i,3}])
A mixed state:
In[2]:=
r={.1,.1,0};state=
[mat[r]]
QuantumState |
Out[2]=
QuantumState
|
Test if it is mixed:
In[3]:=
state["MixedStateQ"]
Out[3]=
True
Calculate Von Neumann Entropy:
In[4]:=
state["VonNeumannEntropy"]
Out[4]=
0.985525
b
Purity:
In[5]:=
state["Purity"]
Out[5]=
0.51
A pure state:
In[6]:=
state2=
[mat[Normalize@r]]
QuantumState |
Out[6]=
QuantumState
|
Purity:
Calculate Bloch Spherical Coordinates:
Note the Bloch vector can be given directly, too.