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
QuantumFramework
Tutorials
Getting Started
Guides
Wolfram Quantum Computation Framework
Tech Notes
Bell's Theorem
Circuit Diagram
Exploring Fundamentals of Quantum Theory
Quantum object abstraction
Tensor Network
Symbols
QuantumBasis
QuantumChannel
QuantumCircuitMultiwayGraph [EXPERIMENTAL]
QuantumCircuitOperator
QuantumDistance
QuantumEntangledQ
QuantumEntanglementMonotone
QuantumEvolve
QuantumMeasurement
QuantumMeasurementOperator
QuantumMeasurementSimulation
QuantumMPS [EXPERIMENTAL]
QuantumOperator
QuantumPartialTrace
QuantumShortcut [EXPERIMENTAL]
QuantumStateEstimate [EXPERIMENTAL]
QuantumState
QuantumTensorProduct
QuantumWignerMICTransform [EXPERIMENTAL]
QuantumWignerTransform [EXPERIMENTAL]
QuditBasis
QuditName
Wolfram`QuantumFramework`
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
[
E
X
P
E
R
I
M
E
N
T
A
L
]
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
c
]
r
e
p
r
e
s
e
n
t
s
a
m
u
l
t
i
w
a
y
g
r
a
p
h
o
f
t
h
e
q
u
a
n
t
u
m
c
i
r
c
u
i
t
q
c
D
e
t
a
i
l
s
a
n
d
O
p
t
i
o
n
s
Examples
(
3
)
Basic Examples
(
3
)
Multiway graph of Bell circuit:
I
n
[
1
]
:
=
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
[
"
B
e
l
l
"
]
,
V
e
r
t
e
x
L
a
b
e
l
s
A
u
t
o
m
a
t
i
c
O
u
t
[
1
]
=
Using annotations on multiway graph, show corresponding operators of each edge:
I
n
[
2
]
:
=
G
r
a
p
h
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
[
"
B
e
l
l
"
]
,
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
]
,
P
e
r
f
o
r
m
a
n
c
e
G
o
a
l
"
Q
u
a
l
i
t
y
"
O
u
t
[
2
]
=
Create a circuit as composition of magic circuit and Fourier:
I
n
[
1
]
:
=
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
"
,
"
F
o
u
r
i
e
r
"
}
]
[
"
D
i
a
g
r
a
m
"
]
O
u
t
[
1
]
=
Create corresponding multiway graph, and label edges:
I
n
[
2
]
:
=
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
"
,
"
F
o
u
r
i
e
r
"
}
]
,
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
[
2
]
=
As one can see, the gate CNOT is the one creating entanglement.
Create a graph of 4 vertexes and 5 edges:
I
n
[
1
]
:
=
g
=
G
r
a
p
h
[
{
1
2
,
1
3
,
1
4
,
2
3
,
2
4
}
,
V
e
r
t
e
x
L
a
b
e
l
s
A
u
t
o
m
a
t
i
c
]
O
u
t
[
1
]
=
Create its corresponding graph 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
[
"
G
r
a
p
h
"
[
g
]
]
[
"
D
i
a
g
r
a
m
"
]
O
u
t
[
2
]
=
I
n
[
3
]
:
=
g
r
=
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
[
"
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
[
S
u
p
e
r
s
c
r
i
p
t
[
R
e
p
l
a
c
e
[
o
p
[
"
L
a
b
e
l
"
]
,
H
e
a
d
_
[
_
_
]
H
e
a
d
]
,
o
p
[
"
I
n
p
u
t
O
r
d
e
r
"
]
]
,
B
o
l
d
]
,
C
e
n
t
e
r
]
O
u
t
[
3
]
=
Find the leaf nodes (vertices with no outgoing edges) in a spanning tree of a graph (not including the loops):
I
n
[
4
]
:
=
F
o
l
d
[
T
r
e
e
I
n
s
e
r
t
[
#
1
,
T
r
e
e
[
#
2
〚
2
〛
,
{
}
]
,
#
2
〚
3
,
"
T
r
e
e
P
o
s
i
t
i
o
n
"
〛
]
&
,
T
r
e
e
[
F
i
r
s
t
[
V
e
r
t
e
x
L
i
s
t
[
g
r
]
]
,
{
}
,
T
r
e
e
E
l
e
m
e
n
t
L
a
b
e
l
F
u
n
c
t
i
o
n
_
(
V
e
r
t
e
x
I
n
d
e
x
[
g
r
,
#
]
&
)
]
,
E
d
g
e
L
i
s
t
[
g
r
]
]
O
u
t
[
4
]
=
which is a nested list, with lists within it describe the corresponding state of each branch, in above graph.
Show the final state of the circuit is the same as linear combination of that nested list of states: