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

Guides

  • Wolfram Quantum Computation Framework

Tech Notes

  • Circuit Diagram
  • Exploring Fundamentals of Quantum Theory
  • Quantum object abstraction
  • Tensor Network
  • Quantum Computation

Symbols

  • QuantumBasis
  • QuantumChannel
  • QuantumCircuitMultiwayGraph[EXPERIMENTAL]
  • QuantumCircuitOperator
  • QuantumDistance
  • QuantumEntangledQ
  • QuantumEntanglementMonotone
  • QuantumEvolve
  • QuantumMeasurement
  • QuantumMeasurementOperator
  • QuantumMeasurementSimulation
  • QuantumMPS [EXPERIMENTAL]
  • QuantumOperator
  • QuantumPartialTrace
  • QuantumStateEstimate[EXPERIMENTAL]
  • QuantumState
  • QuantumTensorProduct
  • QuditBasis
  • QuditName
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

Examples  
(13)
Basic Examples  
(5)
Construct an operator given by a matrix of components in a given basis:
In[1]:=
QuantumOperator
[{{1,-1},{1,1}},{1},"X"]
Out[1]=
QuantumOperator
Picture: Schrödinger
Arity: 1
Dimension: 2→2
Qudits: 1→1

​
Create a CNOT gate:
In[1]:=
cnot=
QuantumOperator
["CNOT",{3,4}]
Out[1]=
QuantumOperator
Picture: Schrödinger
Arity: 2
Dimension: 4→4
Qudits: 2→2

In[2]:=
{#["ControlOrder"],#["TargetOrder"]}&@cnot
Out[2]=
{{3},{4}}
​
Define a Pauli-X operator acting on qubit-3 only:
In[1]:=
QuantumOperator
["X",{3}]
Out[1]=
QuantumOperator
Picture: Schrödinger
Arity: 1
Dimension: 2→2
Qudits: 1→1

In[2]:=
QuantumOperator
["X",{3}]
QuantumState
["000"]["Formula"]
Out[2]=
|001〉
​
Controlled operators, for example acting "X" on target qubits, with many controlled-0 and 1 qubits:
In[1]:=
target={1,2};​​ctrl1={3};​​ctrl0={4,5};​​cu=
QuantumOperator
[{"C","X"{1,2},ctrl1,ctrl0}]
Out[1]=
QuantumOperator
Picture: Schrödinger
Arity: 5
Dimension: 32→32
Qudits: 5→5

In[2]:=
cu["CircuitDiagram"]
Out[2]=
​
There are many named operators. For example, one can create a quantum Multiplexer:
In[1]:=
cu=
QuantumOperator
"Multiplexer",
QuantumOperator
[{"I",6}],
QuantumOperator
["NOT"]
Out[1]=
QuantumOperator
Picture: Schrödinger
Arity: 1
Dimension: 8→8
Qudits: 1→1

which is a controlled-NOT operator, with qubit 1 and 2 as control and qubit-3 as target
In[2]:=
cu
QuantumOperator
[{"Controlled","X",{1,2}},{3}]
Out[2]=
True
Scope  
(4)

Generalizations & Extensions  
(2)

Properties & Relations  
(2)

SeeAlso
QuantumState
 
▪
QuantumBasis
 
▪
QuantumMeasurementOperator
RelatedGuides
▪
Wolfram Quantum Computation Framework
""

© 2025 Wolfram. All rights reserved.

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