Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • 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
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

Q3mini

Guides

  • Fermionic Quantum Computation
  • Q3: Symbolic Quantum Simulation
  • Quantum Information Systems
  • Quantum Many-Body Systems
  • Quantum Spin Systems

Tech Notes

  • About Q3
  • Q3: Quick Start
  • Quantum Fourier Transform
  • Quantum Information Systems with Q3
  • Quantum Many-Body Systems with Q3
  • Quantum Operations
  • Quantum Spin Systems with Q3
  • Quantum States
  • Quantum Teleportation
  • Quick Quantum Computing with Q3

Symbols

  • Basis
  • Boson
  • Bra
  • CNOT
  • ControlledGate
  • ExpressionFor
  • Fermion
  • Heisenberg
  • Ket
  • Let
  • Majorana
  • Matrix
  • Multiply
  • NambuGreen
  • NambuHermitian
  • NambuMatrix
  • NambuUnitary
  • Pauli
  • Phase
  • QuantumCircuit
  • Qubit
  • Qudit
  • RandomWickCircuitSimulate
  • Rotation
  • Species
  • Spin
  • SWAP
  • WickCircuit
  • WickEntanglementEntropy
  • WickEntropy
  • WickGreenFunction
  • WickJump
  • WickLindbladSolve
  • WickLogarithmicNegativity
  • WickMeasurement
  • WickMonitor
  • WickMutualInformation
  • WickNonunitary
  • WickSimulate
  • WickState
  • WickUnitary

Overviews

  • The Postulates of Quantum Mechanics
  • Quantum Algorithms
  • Quantum Computation: Models
  • Quantum Computation: Overview
  • Quantum Error-Correction Codes
  • Quantum Information Theory
  • Quantum Noise and Decoherence
QuantumMob`Q3mini`
Rotation
​
Rotation[ϕ,0]
represents the identity operator on the two-dimensional Hilbert space regardless of angle ϕ.
​
​
Rotation[ϕ,μ]
returns the operator corresponding to the rotation by angle ϕ around the axis μ (=1,2,3) on a two-dimensional Hilbert space.
​
​
Rotation[{
ϕ
1
,
μ
1
},{
ϕ
2
,
μ
2
},...]
is equivalent to
Rotation[
ϕ
1
,
μ
1
]⊗Rotation[
ϕ
2
,
μ
2
]⊗...
.
​
​
Rotation[ϕ,q[…,μ]]
represents the rotation by angle ϕ around the axis μ on the species
q[…,
$
]
.
​
​
Rotation[ϕ,{x,y,z},q]
represents the rotation operator by angle ϕ around the axis
{x,y,z}
acting on the species
q
.
​
​
Rotation[ϕ,{
q
1
,
q
2
,…},rest]
gives the list of rotation operators on species
q
1
,
q
2
,…
.
​
Details and Options

Examples  
(5)
Basic Examples  
(5)
This gives the rotation operator in terms of the Pauli operators.
In[1]:=
op=Rotation[ϕ,2]
Out[1]=
Cos
ϕ
2
I-YSin
ϕ
2

This gives the matrix representation of the above rotation operator.
In[2]:=
mat=Matrix[op]//ExpToTrig;​​mat//MatrixForm
Out[2]//MatrixForm=
Cos
ϕ
2

-Sin
ϕ
2

Sin
ϕ
2

Cos
ϕ
2

For a quick access to the rotation matrix, you can use
TheRotation
.
In[3]:=
TheRotation[ϕ,2]//MatrixForm
Out[3]//MatrixForm=
Cos
ϕ
2

-Sin
ϕ
2

Sin
ϕ
2

Cos
ϕ
2

This is a way to specify a rotation operator on multiple qubits.
In[4]:=
Rotation[{a,2},{b,3}]//Garner
Out[4]=
Cos
a
2
Cos
b
2
I⊗I-Cos
b
2
Y⊗ISin
a
2
-Cos
a
2
I⊗ZSin
b
2
-Y⊗ZSin
a
2
Sin
b
2

​
You can specify an arbitrary axis other than the coordinates axes.
In[1]:=
Rotation[ϕ,{1,1,0}]
Out[1]=
Cos
ϕ
2
I-
X
2
+
Y
2
Sin
ϕ
2

Construct an rotation operator on multiple qubits.
In[2]:=
op=Rotation[{ϕ,{1,0,0}},{ϕ,{0,1,0}}]
Out[2]=
2
Cos
ϕ
2

I⊗I-X⊗Y
2
Sin
ϕ
2

-
1
2
I⊗YSin[ϕ]-
1
2
X⊗ISin[ϕ]
The above is equivalent to the following as the rotation axes happen to coincide with the coordinate axes.
In[3]:=
new=Rotation[{ϕ,1},{ϕ,2}]
Out[3]=
2
Cos
ϕ
2

I⊗I-X⊗Y
2
Sin
ϕ
2

-
1
2
I⊗YSin[ϕ]-
1
2
X⊗ISin[ϕ]
In[4]:=
opnew
Out[4]=
True
​
Let us consider rotations on qubits.
In[1]:=
Let[Qubit,S]​​Let[Real,ϕ]
Consider a rotation around the z-axis.
In[2]:=
op=Rotation[ϕ,S[1,3]]
Out[2]=
Exp-
1
2
ϕ
Z
S
1
In[3]:=
Dagger@Rotation[ϕ,S[1,3]]
Out[3]=
Exp
1
2
ϕ
Z
S
1
In[4]:=
Elaborate[op]
Out[4]=
Cos
ϕ
2
-
Z
S
1
Sin
ϕ
2

In[5]:=
Matrix[op,S@{1,2}]//MatrixForm
Out[5]//MatrixForm=
-
ϕ
2

0
0
0
0
-
ϕ
2

0
0
0
0
ϕ
2

0
0
0
0
ϕ
2

You can specify an arbitrary rotation axis.
In[6]:=
op=Rotation[ϕ,{1,1,1},S[1,$]]
Out[6]=
Exp-
1
2
ϕ
X
S
1
3
+
Y
S
1
3
+
Z
S
1
3
In[7]:=
Dagger[op]
Out[7]=
Exp
1
2
ϕ
X
S
1
3
+
Y
S
1
3
+
Z
S
1
3
In[8]:=
Elaborate[op]
Out[8]=
Cos
ϕ
2
-

X
S
1
Sin
ϕ
2

3
-

Y
S
1
Sin
ϕ
2

3
-

Z
S
1
Sin
ϕ
2

3
In[9]:=
Matrix[op,S@{1,2}]//ExpToTrig//MatrixForm
Out[9]//MatrixForm=
Cos
ϕ
2
-
Sin
ϕ
2

3
0
-
(1+)Sin
ϕ
2

3
0
0
Cos
ϕ
2
-
Sin
ϕ
2

3
0
-
(1+)Sin
ϕ
2

3
(1-)Sin
ϕ
2

3
0
Cos
ϕ
2
+
Sin
ϕ
2

3
0
0
(1-)Sin
ϕ
2

3
0
Cos
ϕ
2
+
Sin
ϕ
2

3
In[10]:=
QuantumCircuit[op]
Out[10]=
In[11]:=
Let[Real,ϕ]​​qc=QuantumCircuit[Rotation[ϕ,S[1,3]],Rotation[ϕ,S[2,1]]]
​
​
Again, you can specify an arbitrary rotation axis by a vector along the axis.

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com