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
QuantumMob`Q3mini`
C
o
n
t
r
o
l
l
e
d
G
a
t
e
C
o
n
t
r
o
l
l
e
d
G
a
t
e
[
{
c
1
,
c
2
,
…
}
,
o
p
]
r
e
p
r
e
s
e
n
t
s
a
m
u
l
t
i
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
1
]
:
=
L
e
t
[
Q
u
b
i
t
,
S
]
This is a controlled-U operator. Usually it remains unevaluated.
I
n
[
2
]
:
=
o
p
=
C
o
n
t
r
o
l
l
e
d
G
a
t
e
[
S
[
1
]
,
S
[
2
,
1
]
]
O
u
t
[
2
]
=
C
o
n
t
r
o
l
l
e
d
G
a
t
e
{
S
1
1
}
,
X
S
2
I
n
[
3
]
:
=
E
l
a
b
o
r
a
t
e
[
o
p
]
O
u
t
[
3
]
=
1
2
-
1
2
Z
S
1
X
S
2
+
1
2
Z
S
1
+
1
2
X
S
2
I
n
[
4
]
:
=
M
a
t
r
i
x
[
o
p
]
/
/
M
a
t
r
i
x
F
o
r
m
O
u
t
[
4
]
/
/
M
a
t
r
i
x
F
o
r
m
=
1
0
0
0
0
1
0
0
0
0
0
1
0
0
1
0
I
n
[
5
]
:
=
E
l
a
b
o
r
a
t
e
[
o
p
]
O
u
t
[
5
]
=
1
2
-
1
2
Z
S
1
X
S
2
+
1
2
Z
S
1
+
1
2
X
S
2
I
n
[
6
]
:
=
o
p
*
*
S
[
2
,
3
]
/
/
E
l
a
b
o
r
a
t
e
O
u
t
[
6
]
=
1
2
Z
S
1
Y
S
2
+
1
2
Z
S
1
Z
S
2
-
1
2
Y
S
2
+
1
2
Z
S
2
In the quantum circuit model, a controlled-U gate is depicted by the following quantum circuit element.
I
n
[
1
]
:
=
Q
u
a
n
t
u
m
C
i
r
c
u
i
t
[
o
p
]
O
u
t
[
1
]
=
C
N
O
T
is a special case of controlled-U gate.
I
n
[
2
]
:
=
x
1
=
E
l
a
b
o
r
a
t
e
@
C
o
n
t
r
o
l
l
e
d
G
a
t
e
[
S
[
1
]
,
S
[
2
,
1
]
]
/
/
S
i
m
p
l
i
f
y
x
2
=
E
l
a
b
o
r
a
t
e
@
C
N
O
T
[
S
[
1
]
,
S
[
2
]
]
/
/
S
i
m
p
l
i
f
y
x
1
-
x
2
/
/
S
i
m
p
l
i
f
y
O
u
t
[
2
]
=
1
2
1
-
Z
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