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

  • Bell's Theorem: CHSH inequality
  • Bosonic Operator Algebra
  • Circuit Diagram
  • Exploring Fundamentals of Quantum Theory
  • Getting Started
  • An IBM Quantum Error Map
  • Connecting to QPU Services
  • Quantum Machine Learning in Phase Space
  • Quantum object abstraction
  • Quantum Object Composition
  • Sending Queries to IBM QPUs
  • Tensor Network
  • Time Evolution
  • Fast Gates on a Transmon
  • Quantum Computation

Guides

  • Wolfram Quantum Computation Framework

Tech Notes

  • Quantum Optimization
  • Second Quantization Functions

Symbols

  • CliffordChannel
  • EinsteinSummation
  • GraphState
  • IBMJob
  • IBMJobSubmit
  • LocalComplement
  • PauliStabilizer
  • QiskitCircuit
  • 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`
QuantumOperator
​
QuantumOperator
[rep,order,qb]
represents an operator with matrix/tensor representation
rep
that acts on a state at the qubits indexed in
order
, in the quantum basis
qb
.
​
​
QuantumOperator
["name",order,qb]
represents the named operator
"name"
that acts on a state at the qubits indexed in
order
, in the discrete quantum basis
qb
.
​
​
QuantumOperator
[qo,basis]
changes the basis of the
QuantumOperator
qo
to the quantum basis
qb
.
​
Details and Options
▪
Quantum operator is a quantum state, with an order. The order can be a nested list as
{{
output
1
,
output
2
,…},{
input
1
,
input
2
,…}}
or a rule as
{
input
1
,
input
2
,…}{
output
1
,
output
2
,…}
.
▪
When the basis
qb
is not specified, the computational basis is used as default.
▪
Properties of a
QuantumOperator
can be obtained using
QuantumOperator
[…]["prop"]
​
The following properties
prop
are supported:
"Basis"
gives the basis of the operator
"BasisElements"
gives a list of basis for each matrix element of the operator's matrix representation
"MatrixRepresentation"or"Matrix"
gives the matrix representation of the operator
"OrderedMatrixRepresentation"
gives the matrix representation of the operator adjusted according to its
order
"Arity"
gives the arity of the operator
"Dimensions"
gives the dimensionality of the operator
"HermitianQ"
returns
True
if the operator is Hermitian and
False
otherwise
"UnitaryQ"
returns
True
if the operator is Unitary and
False
otherwise
"Order"
returns the
order
, the wire positions of the operator
"State"
returns the state (a pure map) corresponding to the vector obainted by flattening of the operator matrix
"MatrixQuantumState"
returns a quantum state using the matrix of the operator
"Dagger"
returns complex conjugate of the operator
"CircuitDiagram"
represents the corresponding circuit diagram
"ZYZ"
for a 1-qubit unitary operator, it returns a global phase multiplied by corresponding ZYZ-decomposition
(
R
Z
R
Y
R
Z
)
▪
The following named operators are supported:
"Identity"or"I"
identity operator in 2D
"Identity"[n]or"I"[n]
identity operator in n dimension
"Diagonal"[{
eigen
1
,
eigen
2
,...}]
identity operator with elements
eigen
i
"Phase"[θ]or"P"[θ]or"U1"[θ]
a phase operator (in 2D) by an angle
θ
, with the matrix representation as
{1,0},0,
θ


"Phase"[θ,n]
a phase operator with the angle θ in the n-dimension
"U3"[θ,ϕ,λ]or"U"[θ,ϕ,λ]
U3 gate (also called as U gate), with the matrix repreration as

Cos

θ
2
,-
λ

Sin

θ
2
,
ϕ

Sin

θ
2
,
(λ+ϕ)

Cos

θ
2

"U2"[ϕ,λ]
U2 gate, which is the same as "U3"[π/2,ϕ,λ]
"GlobalPhase"[θ]
a global phase operator by an angle
θ
"GlobalPhase"[θ,n]
a global phase operator by an angle
θ
in the n-dimension
"RX"[θ]or"XRotation"[θ]
represents a rotation by an angle
θ
around the x-axis
"RY"[θ]or"YRotation"[θ]
represents a rotation by an angle
θ
around the y-axis
"RZ"[θ]or"ZRotation"[θ]
represents a rotation by an angle
θ
around the z-axis (equivalent to a PHASE gate)
"R"[θ,op]
represents a rotation by an angle
θ
for the operator
op
(which is the same as Exp[-
θ/2
op ] )
"PhaseShift"[n]
a phase operator an angle
2π/
n
2
"S"
the S-gate (π/2 PHASE)
"T"
the T-gate (π/4 PHASE)
"H"or"Hadamard"
the Hadamard gate
"NOT"
the NOT operator
"RootNOT"
the root NOT operator
"Braid"
the Braid operator (Bell basis change operator)
"CNOT"
the CNOT gate
"CNOT"[n]
the CNOT gate with dimensionality
n
(dimension of control and target qudits is both n)
"CX"
the controlled-X operator
"CT"
the controlled-T operator
"CS"
the controlled-S operator
"CH"
the controlled-H operator
"CPHASE"[θ]or"CP"[θ]
the controlled-Phase operator by an angle
θ
(if no angle given, the angle will be by default π)
"CPHASE"[θ,n]
the controlled-phase operator in the dimension n
"C"[op,cntl1,cntl0]or"Controlled"[op,cntl1,cntl0]
the controlled-U with the operator op, controlled1-qubits cntl1, and controlled0-qubits cntl0
"C0"[op,cntl0]or"Controlled0"[op,cntl0]
the controlled-U with the operator op, and controlled0-qubits cntl0
"Fourier"
the quantum Fourier Transform operator for one qubit
"Fourier"[n]
the quantum Fourier Transform operator for one qudit of the dimension
n
"JX"[j]or"JY"[j]or"JZ"[j]
the angular-momentum operator (along X, Y or Z directions), corresponding to spin
j
"J+"[j]
the raising operator corresponding to spin
j
"J-"[j]
the lowering operator corresponding to spin
j
"WignerD"[j,{ψ,θ,ϕ}]
the Wigner D-operator, corresponding to spin
j
with corresponding angles of rotation
"SUM"
the SUM operator
"SUM"[n]
the SUM operator with dimensionality
n
"X"or"PauliX"
the PauliX operator
"X"[n]or"PauliX"[n]
the PauliX operator with dimensionality
n
(shift matrix)
"Y"or"PauliY"
the PauliY operator
"Y"[n]or"PauliY"[n]
the PauliX operator with dimensionality
n
"Z"or"PauliZ"
the PauliZ operator
"Z"[n]or"PauliZ"[n]
the PauliZ operator with dimensionality
n
(clock matrix)
"Toffoli"
the Toffoli operator
"SWAP"
the SWAP operator
"RootSWAP"
the root SWAP operator
"CSWAP"or"Fredkin"
the controlled-SWAP operator
"Deutsch"[θ]
the Deutsch gate with angle
θ
"RandomUnitary"
a random unitary operator from uniform distribution over the unitary square matrices (also known as the Haar measure on the unitary group
U(n)
)
"RandomUnitary"[n]
a random unitary operator with dimensionality
n
"RandomHermitian"[n]
a random Hermitian operator with dimensionality
n
"RootNOT"
the root-NOT operator
"Switch"[
op
1
,
op
2
]
the quantum switch (superimposed quantum operations) of two operators op1 and op2
"Permutation"[dims,cycles]
the permulation operator, for the list of dimensions
dims
given the cycle
cycles
(dimensions will be by default 2, unless specificied)
"BlockDiagonal"[
op
1
,
op
2
,…]
an operator corresponding a block-diagonal matrix with diagonal blocks
op
1
,
op
2
, ...
"Multiplexer"[
op
1
,
op
2
,…]
the quantum Multiplexer operator, made out of
op
1
,
op
2
, ...
"Curry"[basis]or"Curry"[bases]
curry an operator that takes a high dimensional input to an operator that takes multiple inputs (
f(a⊗b)f'(a,b)
)
"Uncurry"[basis]or"Uncurry"[bases]
uncurry an operator that takes multiple inputs to an operator with a single higher dimensional input (
f(a,b)f'(a⊗b)
)
"Cup"[d]
an identity with no inputs
"Cap"[d]
an identity with no outputs
"Spider"[basis,angles]->inputs->outputs
a spider, given a quantum
basis
, with angle or list of angles, given a list of inputs and outputs
"Copy"[basis]
a spider with a single input leg and two output legs in a given
basis
"Decohere"[basis]
a spider with a single output leg and two input legs in a given
basis
"Encode"[basis]
a curried copy spider
"Measure"[basis]
a uncurried decohere spider
"Discard"[basis]
a spider with no output legs and input legs in a given
basis
"Marginal"[basis]
an operator corresponding to the action of
〈
b
1
|+〈
b
2
|+…
on the state ("UniformSuperposition" conjugate)
"Trace"[d]
an operator corresponding to a partial trace of a
d
-dimensional quantum state ("UniformMixture" conjugate)
"Liouvillian"[H,{
L
1
,
L
2
,...},{
γ
1
,
γ
2
,...}]
Liouvillian operator ℒ in the master equation dρ/dt=ℒ[ρ] with
ℒ[ρ]=-[H,ρ]+
∑
j
γ
j
(
L
j
ρ
†
L
j
-
1
2
{
L
j
†
L
j
,ρ})
"Hamiltonian"[H,{
L
1
,
L
2
,...},{
γ
1
,
γ
2
,...}]
Hamiltonian operator in the master equation
dρ/dt=-ℋ[ρ]
, where
ℋ=ℒ
"Right"[op]
turns
op
into a quantum superoperator acting on the right
"Left"[op]
turns
op
into a quantum superoperator acting on the left
Examples  
(65)
Basic Examples  
(6)
Create an operator, given a matrix, with
order=3
, in the Pauli X basis:
In[1]:=
QuantumOperator
[{{1,-1},{1,1}},{3},"X"]
Out[1]=
QuantumOperator
Pure map
​
Dimension: 2→2
Order: {3}→{3}

​
Create an angular-momentum operator
J
z
with
j=3/2
:
In[1]:=
jz=
QuantumOperator
[{"JZ",3/2}]
Out[1]=
QuantumOperator
Picture: Schrödinger
Arity: 1
Dimension: 4→4
Qudits: 1→1

​
Create a generalized Pauli X in the 3 dimension:
​
Create a CNOT gate, with qubit-3 as the control and qubit-4 as the target:
​
Controlled operators, for example acting "X" on target qubits, with many controlled-0 and 1 qubits:
​
Create a quantum Multiplexer:
Represent its circuit diagram:

© 2026 Wolfram. All rights reserved.

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