Wolfram.com
WolframAlpha.com
WolframCloud.com
Wolfram Language
Example Repository
Ready-to-use examples for the Wolfram Language
Primary Navigation
Categories
Astronomy
Audio Processing
Calculus
Chemistry
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
Video Processing
Visualization & Graphics
Alphabetical List
Submit a New Resource
Related Pages
Related Categories
Computer Science
Mathematics
Physics
Quantum Computation
Basis Transformation of Quantum States
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 2D quantum state in the computational basis:
I
n
[
2
]
:
=
ψ
1
=
Q
u
a
n
t
u
m
S
t
a
t
e
[
{
1
,
}
]
O
u
t
[
2
]
=
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
:
1
T
y
p
e
:
V
e
c
t
o
r
D
i
m
e
n
s
i
o
n
:
2
P
i
c
t
u
r
e
:
S
c
h
r
ö
d
i
n
g
e
r
Transform it into the Pauli-X basis and show the formula:
I
n
[
3
]
:
=
ψ
2
=
Q
u
a
n
t
u
m
S
t
a
t
e
[
ψ
1
,
"
X
"
]
;
ψ
2
[
"
F
o
r
m
u
l
a
"
]
O
u
t
[
3
]
=
-
(
1
-
)
ψ
x
-
2
+
(
1
+
)
ψ
x
+
2
I
n
[
4
]
:
=
ψ
1
[
"
F
o
r
m
u
l
a
"
]
O
u
t
[
4
]
=
|
0
〉
+
|
1
〉
Test that the states are still the same:
I
n
[
5
]
:
=
ψ
1
ψ
2
O
u
t
[
5
]
=
T
r
u
e
Transform the state into the Fourier basis and show the formula:
I
n
[
6
]
:
=
Q
u
a
n
t
u
m
S
t
a
t
e
[
ψ
1
,
"
F
o
u
r
i
e
r
"
]
[
"
F
o
r
m
u
l
a
"
]
O
u
t
[
6
]
=
Let's look at another example, with a more complicated quantum basis.
Define a random state in the Schwinger basis:
I
n
[
7
]
:
=
ψ
3
=
Q
u
a
n
t
u
m
S
t
a
t
e
[
"
R
a
n
d
o
m
P
u
r
e
"
,
Q
u
a
n
t
u
m
B
a
s
i
s
[
"
S
c
h
w
i
n
g
e
r
"
]
]
O
u
t
[
7
]
=
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
:
1
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
Show the formula:
I
n
[
8
]
:
=
ψ
3
[
"
F
o
r
m
u
l
a
"
]
O
u
t
[
8
]
=
(
-
0
.
1
6
1
6
7
1
+
0
.
3
8
6
2
2
8
)
|
S
0
0
〉
-
(
0
.
0
4
7
5
4
9
5
+
0
.
0
6
1
2
5
7
9
)
|
S
0
1
〉
-
(
0
.
0
6
4
2
4
5
7
-
0
.
2
9
5
5
5
9
)
|
S
1
0
〉
+
(
0
.
3
7
4
5
5
3
+
0
.
2
9
4
7
9
4
)
|
S
1
1
〉
Transform the state into a new basis:
I
n
[
9
]
:
=
ψ
4
=
Q
u
a
n
t
u
m
S
t
a
t
e
[
ψ
3
,
{
2
,
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
Show the formula of the transformed basis:
I
n
[
1
0
]
:
=
ψ
4
[
"
F
o
r
m
u
l
a
"
]
O
u
t
[
1
0
]
=
(
-
0
.
2
0
9
2
2
1
+
0
.
3
2
4
9
7
)
|
0
0
〉
-
(
0
.
4
3
8
7
9
9
-
0
.
0
0
0
7
6
5
0
1
4
)
|
0
1
〉
+
(
0
.
3
1
0
3
0
7
+
0
.
5
9
0
3
5
4
)
|
1
0
〉
-
(
0
.
1
1
4
1
2
2
-
0
.
4
4
7
4
8
6
)
|
1
1
〉
Test that the states are still the same:
I
n
[
1
1
]
:
=
ψ
3
ψ
4
O
u
t
[
1
1
]
=
T
r
u
e
See Also
Wolfram/QuantumFramework
Publisher Information
Contributed by:
Wolfram Research, Quantum Computation Framework Team