Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

QuantumFramework

Tutorials

  • Getting Started
  • Quantum Object Composition

Guides

  • Wolfram Quantum Computation Framework

Tech Notes

  • Bell's Theorem: CHSH inequality
  • Circuit Diagram
  • Exploring Fundamentals of Quantum Theory
  • QPU Service Connection
  • Quantum object abstraction
  • Quantum Optimization
  • Second Quantization Functions
  • Tensor Network
  • Quantum Computation

Symbols

  • CliffordChannel
  • EinsteinSummation
  • GraphState
  • LocalComplement
  • PauliStabilizer
  • QiskitTarget
  • QuantumBasis
  • QuantumChannel
  • QuantumCircuitMultiwayGraph [EXPERIMENTAL]
  • QuantumCircuitOperator
  • QuantumDistance
  • QuantumEntangledQ
  • QuantumEntanglementMonotone
  • QuantumEvolve
  • QuantumMeasurement
  • QuantumMeasurementOperator
  • QuantumMeasurementSimulation
  • QuantumMPS [EXPERIMENTAL]
  • QuantumOperator
  • QuantumPartialTrace
  • QuantumPhaseSpaceTransform
  • QuantumQASM
  • QuantumShortcut [EXPERIMENTAL]
  • QuantumSimilarity
  • QuantumStateEstimate [EXPERIMENTAL]
  • QuantumState
  • QuantumTensorProduct
  • QuantumWignerMICTransform [EXPERIMENTAL]
  • QuantumWignerTransform [EXPERIMENTAL]
  • QuditBasis
  • QuditName
  • StabilizerFrame
  • StabilizerStateQ
Wolfram`QuantumFramework`
QuantumState
​
QuantumState
[qs,qb]
represents a quantum state specified by the state vector or density matrix
qs
, in the quantum basis
qb
.
​
​
QuantumState
[qs]
represents a quantum state specified by the state vector or density matrix
qs
, in the computational basis.
​
​
QuantumState
[asso,qb]
represents a quantum state specified by the association
asso
, in the quantum basis
qb
.
​
​
QuantumState
["name"]
represents the named quantum state identified by
name
.
​
​
QuantumState
[QuantumState[...,qb1],qb2]
changes the basis from the quantum basis
qb1
to
qb2
.
​
Details and Options
▪
The following native properties (those distinguishing QuantumState from QuantumBasis) are the most commonly accessed via state["PropertyName"].
"Amplitudes"
association of basis-name  amplitude, including zeros
"Amplitude"
sparse association of basis-name  non-zero amplitude
"StateVector"
the state as a 1D SparseArray of complex amplitudes
"DensityMatrix"
the state as a density matrix
ρ
"Formula"
typeset Dirac-notation expression of the state
"Norm"
norm of the state vector or trace of the density matrix
"TraceNorm"
Schatten 1-norm, sum of singular values of
ρ
"VonNeumannEntropy"
Von Neumann entropy
−Tr[ρlogρ]
, returned as a Quantity (alias: Entropy)
"LogicalEntropy"
1−Tr[
2
ρ
]
, a measure of mixedness
"Purity"
Tr[
2
ρ
]
, equal to 1 for pure states
"PureStateQ"
True if the state is pure (
Type==="Pure"
)
"MixedStateQ"
True if the state is mixed (
Type==="Mixed"
)
"Probabilities"
association of basis-name  probability, including zeros
"Probability"
sparse association of basis-name  non-zero probability
"BlochCartesianCoordinates"
{x,y,z}
on the Bloch sphere (qubit-only)
"BlochSphericalCoordinates"
{r,θ,ϕ}
on the Bloch sphere (qubit-only)
"BlochPlot"
Graphics3D of the Bloch vector on the unit sphere (qubit-only; alias: BlochSpherePlot)
"Eigenvalues"
eigenvalues of the density matrix
"Eigenvectors"
eigenvectors of the density matrix
"Eigenstates"
list of eigenstates as QuantumState objects
"SchmidtBasis"
QuantumState in the Schmidt basis
∑
λ
k
|
u
k
〉|
v
k
〉
"SchmidtDecompose"
symbolic
∑
p
i
Inactive[⊗][
U
i
,
V
i
]
"Bend"
flatten
ρ
into a pure vector-state on a doubled ("bent") basis
"Unbend"
inverse of Bend; recover the density-matrix state
"Purify"
qs
["Bend"]
: lift mixed state to a pure state in a larger space
"Unpurify"
2
(qs["Unbend"])
: inverse of Purify
"Projector"
projector
|ψ〉〈ψ|
on the doubled basis, as a QuantumState
"Operator"
QuantumOperator corresponding to the projector
▪
See Properties & Relations for the complete native-property ladder with worked examples.
▪
The following named states are supported:
"Plus"
the normalized eigenstate of Pauli-X with +1 eigenvalue
"Minus"
the normalized eigenstate of Pauli-X with −1 eigenvalue
"Left"
the normalized eigenstate of Pauli-Y with −1 eigenvalue
"Right"
the normalized eigenstate of Pauli-Y with +1 eigenvalue
"PhiPlus"
the Bell state
|Φ+〉=(|00〉+|11〉)/
2
"PhiMinus"
the Bell state
|Φ-〉=(|00〉−|11〉)/
2
"PsiPlus"
the Bell state
|ψ+〉=(|01〉+|10〉)/
2
"PsiMinus"
the Bell state
|ψ-〉=(|01〉−|10〉)/
2
"BlochVector"[{
r
x
,
r
y
,
r
z
}]
a one-qubit state from Bloch vector
{
r
x
,
r
y
,
r
z
}
"Register"[s]
a quantum register with
s
qubits in the 1st computational basis state
"Register"[s,i]
a quantum register with
s
qubits in the
i
-th computational basis state
"UniformSuperposition"
a uniform superposition of 1 qubit
"UniformSuperposition"[s]
a uniform superposition of
s
qubits
"UniformMixture"
a maximally mixed state of 1 qubit
"UniformMixture"[s]
a maximally mixed state of
s
qubits
"RandomPure"
a random pure state of 1 qubit
"RandomPure"[s]
a random pure state of
s
qubits
"RandomMixed"
a random mixed state of 1 qubit
"RandomMixed"[s]
a random mixed state of
s
qubits
"GHZ"
Greenberger–Horne–Zeilinger (GHZ) state of 3 qubits
"GHZ"[s]
Greenberger–Horne–Zeilinger state of
s
qubits
"Dicke"[n,k]
Dicke's state of
n
-qubits with
k
of them being 1
"Dicke"[{
k
1
,
k
2
,…}]
Dicke's state of
n
-qudits (
n=∑
k
i
) with
k
i
qudits in the
i
-th computational basis
"W"
W state of 3 qubits
"W"[s]
W state of
s
qubits
"Werner"[p,d]
a Werner state of
d×d
-dimensional bipartite system with weight
p
"Graph"[g]
the graph state corresponding to the graph
g
​
Examples  
(35)
Basic Examples  
(6)
Pure states can be defined by inputting state vectors, given a basis:
In[1]:=
ψ=
QuantumState
[{α,β},2]
Out[1]=
QuantumState
Pure state
Qudits: 1
Type: Vector
Dimension: 2

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
n
2
-dimensional computational basis.
In[2]:=
QuantumState
[{α,β},2]
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]:=
ψ=
QuantumState
[{3,2,5,1}]
Out[1]=
QuantumState
Pure state
Qudits: 2
Type: Vector
Dimension: 4

Return qudits dimensions:
In[2]:=
ψ["Dimensions"]
Out[2]=
{2,2}
Again, note that the basis info can be given explicitly too.
In[3]:=
QuantumState
[{3,2,5,1}]
QuantumState
[{3,2,5,1},{2,2}]
Out[3]=
True
​
Specify the dimension of qudit as 3D:
In[1]:=
ψ=
QuantumState
[{1,2+1,3},3]
Out[1]=
QuantumState
Pure state
Qudits: 1
Type: Vector
Dimension: 3

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
n
2
-dimensional space
​
A built-in state:
Return amplitudes:
Show the tradition form (on Mac, click on the output cell and then Cmd+Shift+T)
​
One can define a state in a given basis. A state in 4D Schwinger basis:
Return amplitudes:
​
States (pure or mixed) can be also defined by matrices.
A mixed state:
Test if it is mixed:
Calculate Von Neumann Entropy:
Purity:
A pure state:
Purity:
Calculate Bloch Spherical Coordinates:
Note the Bloch vector can be given directly, too.

© 2026 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com