Wolfram.com
WolframAlpha.com
WolframCloud.com
Wolfram Language
Example Repository
Ready-to-use examples of Wolfram Language
Primary Navigation
Categories
Astronomy
Audio Processing
Calculus
Cellular Automata
Chemistry
Complex Systems
Computer Science
Computer Vision
Control Systems
Creative Arts
Data Science
Engineering
Finance & Economics
Finite Element Method
Food & Nutrition
Geography
Geometry
Graphs & Networks
Image Processing
Life Sciences
Machine Learning
Mathematics
Optimization
Physics
Puzzles and Recreation
Quantum Computation
Signal Processing
Social Sciences
System Modeling
Text & Language Processing
Time-Related Computation
Video Processing
Visualization & Graphics
Alphabetical List
Submit a New Example
Learn More about
Wolfram Language
Related Pages
Related Categories
Computer Science
Mathematics
Physics
Quantum Computation
Quantum Circuit Diagrams and Graphs
Visualize quantum circuits with custom labels and layout
Example Notebook
Open in Cloud
Download Notebook
Install and load the QuantumFramework paclet:
I
n
[
1
]
:
=
P
a
c
l
e
t
I
n
s
t
a
l
l
[
"
W
o
l
f
r
a
m
/
Q
u
a
n
t
u
m
F
r
a
m
e
w
o
r
k
"
]
N
e
e
d
s
[
"
W
o
l
f
r
a
m
`
Q
u
a
n
t
u
m
F
r
a
m
e
w
o
r
k
`
"
]
Show the diagram of a quantum circuit:
I
n
[
2
]
:
=
Q
u
a
n
t
u
m
C
i
r
c
u
i
t
O
p
e
r
a
t
o
r
[
{
"
X
"
,
"
C
N
O
T
"
,
"
T
"
2
,
"
S
"
,
"
F
o
u
r
i
e
r
"
,
{
1
}
,
{
2
}
}
]
[
"
D
i
a
g
r
a
m
"
]
O
u
t
[
2
]
=
Visualize the corresponding topology of a circuit:
I
n
[
3
]
:
=
Q
u
a
n
t
u
m
C
i
r
c
u
i
t
O
p
e
r
a
t
o
r
[
{
"
X
"
,
"
C
N
O
T
"
,
"
T
"
2
,
"
S
"
,
"
F
o
u
r
i
e
r
"
,
{
1
}
,
{
2
}
}
]
[
"
T
o
p
o
l
o
g
y
"
,
E
d
g
e
L
a
b
e
l
s
A
u
t
o
m
a
t
i
c
]
O
u
t
[
3
]
=
Show the diagram of a quantum phase estimation circuit:
I
n
[
4
]
:
=
Q
u
a
n
t
u
m
C
i
r
c
u
i
t
O
p
e
r
a
t
o
r
[
{
"
P
h
a
s
e
E
s
t
i
m
a
t
i
o
n
"
,
Q
u
a
n
t
u
m
O
p
e
r
a
t
o
r
[
"
S
"
]
,
3
}
]
[
"
D
i
a
g
r
a
m
"
]
O
u
t
[
4
]
=
Show the diagram of the Magic circuit:
I
n
[
5
]
:
=
Q
u
a
n
t
u
m
C
i
r
c
u
i
t
O
p
e
r
a
t
o
r
[
"
M
a
g
i
c
"
]
[
"
D
i
a
g
r
a
m
"
]
O
u
t
[
5
]
=
Circuit diagram features can be customized. For more details, please refer to the
Diagram
documentation.
Show the tensor network of the magic circuit:
I
n
[
6
]
:
=
Q
u
a
n
t
u
m
C
i
r
c
u
i
t
O
p
e
r
a
t
o
r
[
"
M
a
g
i
c
"
]
[
"
T
e
n
s
o
r
N
e
t
w
o
r
k
"
,
E
d
g
e
L
a
b
e
l
s
A
u
t
o
m
a
t
i
c
,
G
r
a
p
h
L
a
y
o
u
t
{
"
L
a
y
e
r
e
d
D
i
g
r
a
p
h
E
m
b
e
d
d
i
n
g
"
,
"
O
r
i
e
n
t
a
t
i
o
n
"
L
e
f
t
}
]
O
u
t
[
6
]
=
This TensorNetwork representation also uses indices as graph vertices with tensors as cliques:
I
n
[
7
]
:
=
T
e
n
s
o
r
N
e
t
w
o
r
k
I
n
d
e
x
G
r
a
p
h
[
Q
u
a
n
t
u
m
C
i
r
c
u
i
t
O
p
e
r
a
t
o
r
[
"
M
a
g
i
c
"
]
[
"
T
e
n
s
o
r
N
e
t
w
o
r
k
"
]
,
E
d
g
e
L
a
b
e
l
s
A
u
t
o
m
a
t
i
c
,
G
r
a
p
h
L
a
y
o
u
t
{
"
L
a
y
e
r
e
d
D
i
g
r
a
p
h
E
m
b
e
d
d
i
n
g
"
,
"
O
r
i
e
n
t
a
t
i
o
n
"
L
e
f
t
}
]
O
u
t
[
7
]
=
Generate the corresponding multiway graph of a circuit:
I
n
[
8
]
:
=
g
=
Q
u
a
n
t
u
m
C
i
r
c
u
i
t
M
u
l
t
i
w
a
y
G
r
a
p
h
[
Q
u
a
n
t
u
m
C
i
r
c
u
i
t
O
p
e
r
a
t
o
r
[
"
M
a
g
i
c
"
]
]
O
u
t
[
8
]
=
Add more info on the edges:
I
n
[
9
]
:
=
G
r
a
p
h
g
,
E
d
g
e
L
a
b
e
l
s
_
K
e
y
V
a
l
u
e
P
a
t
t
e
r
n
[
"
O
p
e
r
a
t
o
r
"
o
p
_
]
_
P
l
a
c
e
d
[
S
t
y
l
e
[
o
p
[
"
L
a
b
e
l
"
]
,
B
o
l
d
]
,
C
e
n
t
e
r
]
O
u
t
[
9
]
=
Note that branching in the multiway graph implies the entanglement is created there.
External Links
Diagram (QuantumCircuitOperator property)
QuantumCircuitOperator
See Also
Wolfram/QuantumFramework
TensorDiagram
Publisher Information
Contributed by:
Wolfram Research, Quantum Computation Framework Team