Pure states can be defined by inputting state vectors. For example, define 1 qubit state (2D Hilbert space) in computational basis (default basis, unless specified otherwise):
In[1]:=
ψ=
QuantumState
[{α,β}]
Out[1]=
QuantumState
StateType:Vector
Qudits:1
Type:Pure
Dimension:2
Picture:Schrödinger
Return amplitudes:
In[2]:=
ψ["Amplitudes"]
Out[2]=
|0〉α,|1〉β
Return formula of the normalized state:
In[3]:=
ψ["Formula"]
Out[3]=
α|0〉
2
Abs[α]
+
2
Abs[β]
+
β|1〉
2
Abs[α]
+
2
Abs[β]
Dimensions of qudits in the state:
In[4]:=
ψ["Dimensions"]
Out[4]=
{2}
Number of qubits
In[5]:=
ψ["Qudits"]
Out[5]=
1
———
Define 2 qubits state (2D⊗2D Hilbert space):
In[1]:=
ψ=
QuantumState
[{3,2,5,1}]
Out[1]=
QuantumState
StateType:Vector
Qudits:2
Type:Pure
Dimension:4
Picture:Schrödinger
Return qudits dimensions:
In[2]:=
ψ["Dimensions"]
Out[2]=
{2,2}
———
Specify the dimension of qudit as 3D:
In[1]:=
ψ=
QuantumState
[{1,2+1,3},3]
Out[1]=
QuantumState
StateType:Vector
Qudits:1
Type:Pure
Dimension:3
Picture:Schrödinger
Return qudits dimensions:
In[2]:=
ψ["Dimensions"]
Out[2]=
{3}
———
A built-in states:
In[1]:=
ψ=
QuantumState
["PhiMinus"]
Out[1]=
QuantumState
StateType:Vector
Qudits:2
Type:Pure
Dimension:4
Picture:Schrödinger
Return amplitudes:
In[2]:=
ψ["Formula"]
Out[2]=
|00〉
2
-
|11〉
2
———
A state in 4D Schwinger basis:
In[1]:=
ψ=
QuantumState
{1,2,3},
QuantumBasis
[{"Schwinger",3}]
Out[1]=
QuantumState
StateType:Vector
Qudits:1
Type:Pure
Dimension:9
Picture:Schrödinger
Return amplitudes:
In[2]:=
ψ["Formula"]
Out[2]=
|
S
00
〉
14
+
2
7
|
S
01
〉+
3|
S
02
〉
14
In[3]:=
ψ["DensityMatrix"]//MatrixForm
Out[3]//MatrixForm=
1
2
-3
0
0
0
0
0
0
2
4
-6
0
0
0
0
0
0
3
6
9
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
———
States (pure or mixed) can be also defined by matrices