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
Visualization of Quantum Measurement Probabilities
Visualize measurement results
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
`
"
]
Given a random pure state, measure qubit-1 in the computational basis:
I
n
[
2
]
:
=
m
e
a
=
Q
u
a
n
t
u
m
M
e
a
s
u
r
e
m
e
n
t
O
p
e
r
a
t
o
r
[
]
[
Q
u
a
n
t
u
m
S
t
a
t
e
[
"
R
a
n
d
o
m
P
u
r
e
"
]
]
O
u
t
[
2
]
=
Q
u
a
n
t
u
m
M
e
a
s
u
r
e
m
e
n
t
T
a
r
g
e
t
:
{
1
}
M
e
a
s
u
r
e
m
e
n
t
O
u
t
c
o
m
e
s
:
2
Plot measurement probabilities:
I
n
[
3
]
:
=
m
e
a
[
"
P
r
o
b
a
b
i
l
i
t
y
P
l
o
t
"
]
O
u
t
[
3
]
=
Measure a 3D-qubit in its computational basis:
I
n
[
4
]
:
=
m
e
a
=
Q
u
a
n
t
u
m
M
e
a
s
u
r
e
m
e
n
t
O
p
e
r
a
t
o
r
[
Q
u
a
n
t
u
m
B
a
s
i
s
[
3
]
]
[
Q
u
a
n
t
u
m
S
t
a
t
e
[
"
R
a
n
d
o
m
P
u
r
e
"
,
{
3
}
]
]
O
u
t
[
4
]
=
Q
u
a
n
t
u
m
M
e
a
s
u
r
e
m
e
n
t
T
a
r
g
e
t
:
{
1
}
M
e
a
s
u
r
e
m
e
n
t
O
u
t
c
o
m
e
s
:
3
Plot measurement probabilities:
I
n
[
5
]
:
=
m
e
a
[
"
P
r
o
b
a
b
i
l
i
t
y
P
l
o
t
"
]
O
u
t
[
5
]
=
Given a random pure state, measure qubit-1 in Pauli-X basis:
I
n
[
6
]
:
=
m
e
a
=
Q
u
a
n
t
u
m
M
e
a
s
u
r
e
m
e
n
t
O
p
e
r
a
t
o
r
[
"
X
"
]
[
Q
u
a
n
t
u
m
S
t
a
t
e
[
"
R
a
n
d
o
m
P
u
r
e
"
]
]
O
u
t
[
6
]
=
Q
u
a
n
t
u
m
M
e
a
s
u
r
e
m
e
n
t
T
a
r
g
e
t
:
{
1
}
M
e
a
s
u
r
e
m
e
n
t
O
u
t
c
o
m
e
s
:
2
Show measurement probabilities:
I
n
[
7
]
:
=
m
e
a
[
"
P
r
o
b
a
b
i
l
i
t
i
e
s
"
]
O
u
t
[
7
]
=
ψ
x
-
0
.
8
5
4
6
6
8
,
ψ
x
+
0
.
1
4
5
3
3
2
Plot measurement probabilities for measuring a 2x3 composite system in computational basis:
I
n
[
8
]
:
=
Q
u
a
n
t
u
m
M
e
a
s
u
r
e
m
e
n
t
O
p
e
r
a
t
o
r
[
Q
u
a
n
t
u
m
B
a
s
i
s
[
{
2
,
3
}
]
]
[
Q
u
a
n
t
u
m
S
t
a
t
e
[
"
R
a
n
d
o
m
P
u
r
e
"
,
{
2
,
3
}
]
]
[
"
P
r
o
b
a
b
i
l
i
t
y
P
l
o
t
"
]
O
u
t
[
8
]
=
Define a random pure state for 2-qubits:
I
n
[
9
]
:
=
ψ
=
Q
u
a
n
t
u
m
S
t
a
t
e
[
{
"
R
a
n
d
o
m
P
u
r
e
"
,
2
}
]
O
u
t
[
9
]
=
Q
u
a
n
t
u
m
S
t
a
t
e
P
u
r
e
s
t
a
t
e
Q
u
d
i
t
s
:
2
T
y
p
e
:
V
e
c
t
o
r
D
i
m
e
n
s
i
o
n
:
4
P
i
c
t
u
r
e
:
S
c
h
r
ö
d
i
n
g
e
r
Find measurement probabilities, with and without a bit-flip noise channel with the probability 0.3:
I
n
[
1
0
]
:
=
m
1
=
Q
u
a
n
t
u
m
M
e
a
s
u
r
e
m
e
n
t
O
p
e
r
a
t
o
r
[
{
1
,
2
}
]
[
ψ
]
;
m
2
=
Q
u
a
n
t
u
m
M
e
a
s
u
r
e
m
e
n
t
O
p
e
r
a
t
o
r
[
{
1
,
2
}
]
[
Q
u
a
n
t
u
m
C
h
a
n
n
e
l
[
{
"
B
i
t
F
l
i
p
"
,
.
3
}
]
[
ψ
]
]
;
Compare measurement results:
I
n
[
1
1
]
:
=
B
a
r
C
h
a
r
t
T
r
a
n
s
p
o
s
e
[
V
a
l
u
e
s
/
@
{
m
1
[
"
P
r
o
b
a
b
i
l
i
t
i
e
s
"
]
,
m
2
[
"
P
r
o
b
a
b
i
l
i
t
i
e
s
"
]
}
]
,
O
u
t
[
1
1
]
=
External Links
QuantumState
QuantumMeasurementOperator
See Also
Wolfram/QuantumFramework
Publisher Information
Contributed by:
Wolfram Research, Quantum Computation Framework Team