Wolfram.com
WolframAlpha.com
WolframCloud.com
Wolfram Language
Example Repository
Ready-to-use examples of the 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 Resource
Learn More about
Wolfram Language
Related Pages
Related Categories
Computer Science
Mathematics
Physics
Quantum Computation
Symbolic Computation for Quantum Circuits
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
`
"
]
Define a BooleanOracle circuit for a Boolean function:
I
n
[
2
]
:
=
q
c
=
Q
u
a
n
t
u
m
C
i
r
c
u
i
t
O
p
e
r
a
t
o
r
[
{
"
B
o
o
l
e
a
n
O
r
a
c
l
e
"
,
a
&
&
!
b
|
|
c
&
&
d
}
]
;
q
c
[
"
D
i
a
g
r
a
m
"
]
O
u
t
[
2
]
=
Transform a superposition using the corresponding BooleanOracle circuit:
I
n
[
3
]
:
=
q
c
[
α
Q
u
a
n
t
u
m
S
t
a
t
e
[
"
1
1
1
1
0
"
]
+
β
Q
u
a
n
t
u
m
S
t
a
t
e
[
"
1
1
0
1
0
"
]
]
/
/
T
r
a
d
i
t
i
o
n
a
l
F
o
r
m
O
u
t
[
3
]
/
/
T
r
a
d
i
t
i
o
n
a
l
F
o
r
m
=
β
|
1
1
0
1
0
〉
+
α
|
1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Information
Contributed by:
Wolfram Research, Quantum Computation Framework Team