Wolfram Language
Paclet Repository
Community-contributed installable additions to the Wolfram Language
Primary Navigation
Categories
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
Create a Paclet
Get Started
Download Definition Notebook
Learn More about
Wolfram Language
Q3mini
Guides
Fermionic Quantum Computation
Q3: Symbolic Quantum Simulation
Quantum Information Systems
Quantum Many-Body Systems
Quantum Spin Systems
Tech Notes
About Q3
Q3: Quick Start
Quantum Fourier Transform
Quantum Information Systems with Q3
Quantum Many-Body Systems with Q3
Quantum Operations
Quantum Spin Systems with Q3
Quantum States
Quantum Teleportation
Quick Quantum Computing with Q3
Symbols
Basis
Boson
Bra
CNOT
ControlledGate
ExpressionFor
Fermion
Heisenberg
Ket
Let
Majorana
Matrix
Multiply
NambuGreen
NambuHermitian
NambuMatrix
NambuUnitary
Pauli
Phase
QuantumCircuit
Qubit
Qudit
RandomWickCircuitSimulate
Rotation
Species
Spin
SWAP
WickCircuit
WickEntanglementEntropy
WickEntropy
WickGreenFunction
WickJump
WickLindbladSolve
WickLogarithmicNegativity
WickMeasurement
WickMonitor
WickMutualInformation
WickNonunitary
WickSimulate
WickState
WickUnitary
Overviews
The Postulates of Quantum Mechanics
Quantum Algorithms
Quantum Computation: Models
Quantum Computation: Overview
Quantum Error-Correction Codes
Quantum Information Theory
Quantum Noise and Decoherence
Quantum Information Systems
Q3 provides various tools and utilities for symbolic and numerical calculations to simulate quantum computation and quantum information processing.
Here listed are frequently used functions for each subject. The subjects are arranged in parallel with the chapters in the
Q
u
a
n
t
u
m
W
o
r
k
b
o
o
k
(
2
0
2
2
)
.
For basic usages of Q3 in the context of quantum computation and quantum information, see tutorial document "
Q
u
a
n
t
u
m
I
n
f
o
r
m
a
t
i
o
n
S
y
s
t
e
m
s
w
i
t
h
Q
3
".
T
h
e
P
o
s
t
u
l
a
t
e
s
o
f
Q
u
a
n
t
u
m
M
e
c
h
a
n
i
c
s
K
e
t
— Represents a vector in the computational basis.
B
r
a
— The Hermitian conjugate of
K
e
t
.
B
a
s
i
s
— Gives the computational basis of the Hilbert space associated with a system of qubits.
D
y
a
d
— Represents a dyadic product two state vectors.
M
e
a
s
u
r
e
m
e
n
t
— Represents a measurement of Pauli operators (including tensor products of single-qubit Pauli operators).
M
e
a
s
u
r
e
m
e
n
t
O
d
d
s
— Analyses the probabilities for possible outcomes and post-measurement states of a measurement of Pauli operators.
S
c
h
m
i
d
t
D
e
c
o
m
p
o
s
i
t
i
o
n
— Gives the Schmidt decomposition of a pure state of a composite system.
P
a
r
t
i
a
l
T
r
a
c
e
— Takes the partial trace of a pure or mixed state or a linear operator.
V
o
n
N
e
u
m
a
n
n
E
n
t
r
o
p
y
— Gives the von Neumann entropy of a subsystem.
M
u
l
t
i
p
l
y
▪
M
u
l
t
i
p
l
y
E
x
p
▪
M
a
t
r
i
x
▪
E
x
p
r
e
s
s
i
o
n
F
o
r
▪
E
l
a
b
o
r
a
t
e
▪
G
a
r
n
e
r
Q
u
a
n
t
u
m
C
o
m
p
u
t
a
t
i
o
n
:
O
v
e
r
v
i
e
w
Q
u
a
n
t
u
m
C
i
r
c
u
i
t
— Represents a quantum circuit model of quantum computation.
R
o
t
a
t
i
o
n
— Represents a single-qubit rotation gate.
P
h
a
s
e
— A relative phase sift on a single qubit.
C
o
n
t
r
o
l
l
e
d
G
a
t
e
— The controlled-unitary gate (including a multi-control unitary gate).
C
N
O
T
— The CNOT gate (including a multi-control and/or multi-target NOT gate).
C
Z
— The controlled-Z gate (including a multi-control and/or multi-target gate).
S
W
A
P
— The SWAP gates.
T
o
f
f
o
l
i
— The Toffoli gate on three qubits.
F
r
e
d
k
i
n
— The Fredkin gate on three qubits.
O
r
a
c
l
e
— Represents a quantum oracle.
H
a
d
a
m
a
r
d
▪
Q
u
a
d
r
a
n
t
▪
O
c
t
a
n
t
▪
E
u
l
e
r
R
o
t
a
t
i
o
n
▪
D
e
u
t
s
c
h
▪
Q
F
T
▪
M
a
t
r
i
x
▪
E
x
p
r
e
s
s
i
o
n
F
o
r
▪
E
l
a
b
o
r
a
t
e
Q
u
a
n
t
u
m
C
o
m
p
u
t
a
t
i
o
n
:
M
o
d
e
l
s
M
u
l
t
i
p
l
y
E
x
p
— The exponential function of an operator.
P
r
o
p
e
r
S
y
s
t
e
m
— Returns both the eigenvalues and eigenstates of an operator in an analytic expression (not a matrix).
P
r
o
p
e
r
V
e
c
t
o
r
s
— Returns the eigenstates of an operator in an analytic expression (not a matrix).
P
r
o
p
e
r
V
a
l
u
e
s
— Returns the eigenvalues of an operator in an analytic expression (not a matrix).
G
r
a
p
h
S
t
a
t
e
— Constructs a graph state corresponding to a graph.
M
e
a
s
u
r
e
m
e
n
t
▪
M
e
a
s
u
r
e
m
e
n
t
O
d
d
s
Q
u
a
n
t
u
m
A
l
g
o
r
i
t
h
m
s
Q
u
a
n
t
u
m
C
i
r
c
u
i
t
— Represents a quantum circuit model of quantum computation.
R
o
t
a
t
i
o
n
— Represents a single-qubit rotation gate.
P
h
a
s
e
— A relative phase sift on a single qubit.
C
o
n
t
r
o
l
l
e
d
G
a
t
e
— The controlled-unitary gate (including a multi-control unitary gate).
C
N
O
T
— The CNOT gate (including a multi-control and/or multi-target NOT gate).
C
Z
— The controlled-Z gate (including a multi-control and/or multi-target gate).
S
W
A
P
— The SWAP gates.
T
o
f
f
o
l
i
— The Toffoli gate on three qubits.
F
r
e
d
k
i
n
— The Fredkin gate on three qubits.
O
r
a
c
l
e
— Represents a quantum oracle.
H
a
d
a
m
a
r
d
▪
Q
u
a
d
r
a
n
t
▪
O
c
t
a
n
t
▪
E
u
l
e
r
R
o
t
a
t
i
o
n
▪
D
e
u
t
s
c
h
▪
Q
F
T
▪
M
a
t
r
i
x
▪
E
x
p
r
e
s
s
i
o
n
F
o
r
▪
E
l
a
b
o
r
a
t
e
Q
u
a
n
t
u
m
N
o
i
s
e
a
n
d
D
e
c
o
h
e
r
e
n
c
e
S
u
p
e
r
m
a
p
— Represents a supermap, a linear map from
ℒ
(
) to
ℒ
(
).
C
h
o
i
M
a
t
r
i
x
— Returns the Choi matrix of a supermap.
L
i
n
d
b
l
a
d
S
u
p
e
r
m
a
p
— Represents the generator of a Lindblad equation (i.e. a quantum master equation).
L
i
n
d
b
l
a
d
S
o
l
v
e
— Solves a Lindblad equation.
H
i
l
b
e
r
t
S
c
h
m
i
d
t
N
o
r
m
— Returns the Hilbert-Schmidt norm (or Frobenius norm) of a (pure or mixed) state.
H
i
l
b
e
r
t
S
c
h
m
i
d
t
D
i
s
t
a
n
c
e
— Returns the Hilbert-Schmidt distance between two of a (pure or mixed) state.
T
r
a
c
e
N
o
r
m
— Returns the trace norm of a (pure or mixed) state.
T
r
a
c
e
D
i
s
t
a
n
c
e
— Returns the trace distance between two (pure or mixed) state.
F
i
d
e
l
i
t
y
— Returns the fidelity between two (pure or mixed) state.
L
i
n
d
b
l
a
d
C
o
n
v
e
r
t
▪
D
a
m
p
i
n
g
O
p
e
r
a
t
o
r
Q
u
a
n
t
u
m
E
r
r
o
r
-
C
o
r
r
e
c
t
i
o
n
C
o
d
e
s
P
a
u
l
i
G
r
o
u
p
— Represents the Pauli group on a system of
n
qubits.
C
l
i
f
f
o
r
d
G
r
o
u
p
— Represents the Clifford group on a system of
n
qubits.
G
o
t
t
e
s
m
a
n
V
e
c
t
o
r
— Returns the binary vector corresponding to a Pauli operator.
F
r
o
m
G
o
t
t
e
s
m
a
n
V
e
c
t
o
r
— Returns the Pauli operator corresponding to a binary vector.
G
o
t
t
e
s
m
a
n
D
o
t
— The symplectic product of Gottesman vectors and matrices of Gottesman vectors.
G
o
t
t
e
s
m
a
n
S
p
l
i
t
— Returns the X- and Z-part of a Gottesman vector or a set of Gottesman vectors.
G
o
t
t
e
s
m
a
n
M
e
r
g
e
— Combines the X- and Z-part to construct a full Gottesman vector or a set of full Gottesman vectors.
G
o
t
t
e
s
m
a
n
M
a
t
r
i
x
— Returns the binary symplectic matrix corresponding to a Clifford operator.
F
r
o
m
G
o
t
t
e
s
m
a
n
M
a
t
r
i
x
— Returns the Clifford operator corresponding to a binary symplectic matrix.
G
r
o
u
p
O
r
d
e
r
▪
G
r
o
u
p
E
l
e
m
e
n
t
s
▪
G
r
o
u
p
G
e
n
e
r
a
t
o
r
s
Q
u
a
n
t
u
m
I
n
f
o
r
m
a
t
i
o
n
T
h
e
o
r
y
H
i
l
b
e
r
t
S
c
h
m
i
d
t
N
o
r
m
— Returns the Hilbert-Schmidt norm (or Frobenius norm) of a (pure or mixed) state.
H
i
l
b
e
r
t
S
c
h
m
i
d
t
D
i
s
t
a
n
c
e
— Returns the Hilbert-Schmidt distance between two of a (pure or mixed) state.
T
r
a
c
e
N
o
r
m
— Returns the trace norm of a (pure or mixed) state.
T
r
a
c
e
D
i
s
t
a
n
c
e
— Returns the trace distance between two (pure or mixed) state.
F
i
d
e
l
i
t
y
— Returns the fidelity between two (pure or mixed) state.
S
h
a
n
n
o
n
E
n
t
r
o
p
y
— Returns the Shannon entropy of a probability distribution.
V
o
n
N
e
u
m
a
n
n
E
n
t
r
o
p
y
— Returns the von Neumann entropy of a density operator.
P
a
r
t
i
a
l
T
r
a
c
e
— Takes the partial trace of a linear operator (or a pure-state vector) over a subsystem.
P
a
r
t
i
a
l
T
r
a
n
s
p
o
s
e
— Takes the partial transposition of a linear operator over a subsystem.
L
o
g
a
r
i
t
h
m
i
c
N
e
g
a
t
i
v
i
t
y
— Returns the logarithmic negativity (an entanglement measure) of a mixed state.
T
e
c
h
N
o
t
e
s
▪
Q
u
a
n
t
u
m
I
n
f
o
r
m
a
t
i
o
n
S
y
s
t
e
m
s
w
i
t
h
Q
3
▪
T
h
e
P
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