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

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
QuantumMob`Q3mini`
QuantumCircuit
​
QuantumCircuit
[a,b,…]
represents the quantum circuit model consisting of the gate operations
a,b,…
.
​
Details and Options

Examples  
(14)
Basic Examples  
(3)
QuantumCircuit
works for labeled qubits. Choose a symbol to refer to a collection of qubits.
In[1]:=
Let[Qubit,S]
Here is a typical example.
In[2]:=
qc=QuantumCircuit[S[1,6],CNOT[S[1],S[2]],S[{2,3},3]]
Out[2]=
You can always convert the quantum circuit model into the corresponding operator expression in terms of the Pauli operators.
In[3]:=
op=Elaborate[qc]
Out[3]=
-

Y
S
2
Z
S
3
2
2
+
Z
S
2
Z
S
3
2
2
+

X
S
1
Y
S
2
Z
S
3
2
2
+
X
S
1
Z
S
2
Z
S
3
2
2
+
Y
S
1
Y
S
2
Z
S
3
2
2
+

Y
S
1
Z
S
2
Z
S
3
2
2
+

Z
S
1
Y
S
2
Z
S
3
2
2
+
Z
S
1
Z
S
2
Z
S
3
2
2
In[4]:=
op=ExpressionFor[qc]
Out[4]=
-

Y
S
2
Z
S
3
2
2
+
Z
S
2
Z
S
3
2
2
+

X
S
1
Y
S
2
Z
S
3
2
2
+
X
S
1
Z
S
2
Z
S
3
2
2
+
Y
S
1
Y
S
2
Z
S
3
2
2
+

Y
S
1
Z
S
2
Z
S
3
2
2
+

Z
S
1
Y
S
2
Z
S
3
2
2
+
Z
S
1
Z
S
2
Z
S
3
2
2
Then, you can operate the expression further on, say, a state vector.
In[5]:=
out=op**Ket[]
Out[5]=

0
S
1
0
S
2

2
-

1
S
1
1
S
2

2
You can directly apply the quantum circuit model on state vectors or other operators as well.
In[6]:=
new=qc**Ket[]
Out[6]=

0
S
1
0
S
2

2
-

1
S
1
1
S
2

2
In[7]:=
out-new//Garner
Out[7]=
0
​
In many cases, the quantum circuit model is automatically converted to an operator expression.
In[1]:=
(2qc-1)**Ket[]
Out[1]=
(-1+
2
)
0
S
1
0
S
2
-
2

1
S
1
1
S
2

In[2]:=
(2op-1)**Ket[]
Out[2]=
(-1+
2
)
0
S
1
0
S
2
-
2

1
S
1
1
S
2

You can also covert the quantum circuit model into a matrix representation in the standard basis.
In[3]:=
mat=Matrix@qc;​​mat//MatrixForm
Out[3]//MatrixForm=
1
2
0
0
0
1
2
0
0
0
0
-
1
2
0
0
0
-
1
2
0
0
0
0
-
1
2
0
0
0
-
1
2
0
0
0
0
1
2
0
0
0
1
2
0
0
1
2
0
0
0
-
1
2
0
0
0
0
-
1
2
0
0
0
1
2
-
1
2
0
0
0
1
2
0
0
0
0
1
2
0
0
0
-
1
2
0
0
​
Consider a slightly different quantum circuit. Now, it has input specified. In the following quantum circuit, recall that
Ket
[S@{1,2,3}]
is equivalent to
KetRegulate
[
Ket
[],S@{1,2,3}]
.
In[1]:=
qc=QuantumCircuit[​​Ket[S@{1,2,3}],​​S[1,6],CNOT[S[1],S[2]],S[{2,3},3]]
Out[1]=
In[2]:=
out=Elaborate[qc]
Out[2]=

0
S
1
0
S
2
0
S
3

2
-

1
S
1
1
S
2
0
S
3

2
Scope  
(8)

Options  
(3)

SeeAlso
CNOT
 
▪
SWAP
 
▪
ControlledGate
 
▪
Phase
 
▪
Rotation
TechNotes
▪
Quantum Computation: Overview
▪
Quantum Information Systems with Q3
▪
Q3: Quick Start
RelatedGuides
▪
Q3: Symbolic Quantum Simulation
▪
Quantum Information Systems
RelatedLinks
▪
M. Nielsen and I. L. Chuang (2022)
, Quantum Computation and Quantum Information (Cambridge University Press).
▪
Mahn-Soo Choi (2022)
, A Quantum Computation Workbook (Springer).
""

© 2025 Wolfram. All rights reserved.

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