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

QuantumPlaybook

Guides

  • QuantumPlaybook

Tech Notes

  • Addition of Numbers
  • Baker-Hausdorff Lemma
  • Chiral Fermion Random Circuit
  • Clifford Operators: How to Test
  • Commutation Relations for Qubits
  • Entanglement Distillation
  • Generalized Pauli Operators: Implementation
  • Hatano-Nelson-Kitaev Model: Monte Carlo Simulation
  • Hatano-Nelson Model: Monte Carlo Simulation
  • Kitaev Chain
  • Kitaev Random Circuit
  • Λ-Matter in a Cavity
  • Measurement of Total Pauli Z
  • Non-Unitary Dynamics of Quantum States
  • Partial Trace: Physical Meaning
  • Quantum Dot Systems
  • A Quantum Playbook
  • Magnetic Exchange Coupling
  • Solovay-Kitaev Algorithm
  • Spin Code
  • Symmetry Effects On Quantum Master Equations
  • Transmon: Quantum Phase Model
  • Transposition as a Supermap
  • Variational Quantum Classifier: Iris
  • Variational Quantum Classifier: Parity
  • Variational Quantum Eigensolver: Transverse-Field Ising Model

Symbols

  • BlochEnergy
  • BlochFunction
  • QuantumPlaybookCheckUpdate
  • QuantumPlaybookEdition
  • QuantumPlaybookUpdate
  • TransmonEnergy
  • TransmonExponent
  • TransmonFunction
  • TransmonHamiltonian
Generalized Pauli Operators: Implementation
Consider a system of
d
-level quantum system (i.e., a
qudit
). The canonical basis of its Hilbert space is
{|0〉,|1〉,|2〉,…,|d-1〉}
. Let
Z:|z〉↦|z〉
z
ω
and
X:|z〉↦|z+1〉
be the generalized Pauli operators, where
z=0,1,2,…,d-1
and
ω:=exp(2π/d)
. Then, the Weyl-Heisenberg basis is the generating set of the generalized Pauli group,

d
:={
c
ω
a
X
b
Z
:a,b,c=0,1,2,…,d-1}
.
Here, we illustrate how to implement generalized Pauli operators of degree
d=
n
2
with a quantum register of n qubits.
Weyl
A genralized Pauli operator
TheWeyl
The matrix represenation of a generalized Pauli operator
WeylBasis
The Weyl-Heisenberg basis
Q3 functions related to this topic.
Make sure that Q3 is loaded.
In[147]:=
Needs["QuantumMob`Q3`"]
Choose a symbol for the quantum register.
In[149]:=
Let[Qubit,S]
In[150]:=
$n=4;​​$N=Power[2,$n];​​SS=S[Range@$n,$]
Out[152]=
{
S
1
,
S
2
,
S
3
,
S
4
}
In[153]:=
xx=Table[CNOT[S@Range[k+1,$n],S[k]],{k,1,$n-1}];​​xx=Append[xx,S[$n,1]];​​qcX=QuantumCircuit@@xx
Out[155]=
In[156]:=
matX=Matrix[qcX];​​matX//MatrixForm
Out[157]//MatrixForm=
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0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S
1
0
S
2
0
S
3
1
S
4


0
S
1
0
S
2
0
S
3
1
S
4

0
S
1
0
S
2
1
S
3
0
S
4


0
S
1
0
S
2
1
S
3
0
S
4

0
S
1
0
S
2
1
S
3
1
S
4


0
S
1
0
S
2
1
S
3
1
S
4

0
S
1
1
S
2
0
S
3
0
S
4


0
S
1
1
S
2
0
S
3
0
S
4

0
S
1
1
S
2
0
S
3
1
S
4


0
S
1
1
S
2
0
S
3
1
S
4

0
S
1
1
S
2
1
S
3
0
S
4


0
S
1
1
S
2
1
S
3
0
S
4

0
S
1
1
S
2
1
S
3
1
S
4


0
S
1
1
S
2
1
S
3
1
S
4

1
S
1
0
S
2
0
S
3
0
S
4


1
S
1
0
S
2
0
S
3
0
S
4

1
S
1
0
S
2
0
S
3
1
S
4


1
S
1
0
S
2
0
S
3
1
S
4

1
S
1
0
S
2
1
S
3
0
S
4


1
S
1
0
S
2
1
S
3
0
S
4

1
S
1
0
S
2
1
S
3
1
S
4


1
S
1
0
S
2
1
S
3
1
S
4

1
S
1
1
S
2
0
S
3
0
S
4


1
S
1
1
S
2
0
S
3
0
S
4

1
S
1
1
S
2
0
S
3
1
S
4


1
S
1
1
S
2
0
S
3
1
S
4

1
S
1
1
S
2
1
S
3
0
S
4


1
S
1
1
S
2
1
S
3
0
S
4

1
S
1
1
S
2
1
S
3
1
S
4


1
S
1
1
S
2
1
S
3
1
S
4

0
S
1
0
S
2
0
S
3
0
S
4

In[161]:=
ang=2Pi/$N;​​zz=Table[Phase[ang*Power[2,$n-k],S[k,3]],{k,1,$n}];​​qcZ=QuantumCircuit[zz]
Out[163]=
In[164]:=
matZ=Matrix[N@qcZ]//IntegerChop;​​matZ//MatrixForm
Out[165]//MatrixForm=
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0.92388+0.382683
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0.707107+0.707107
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0.382683+0.92388
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-0.382683+0.92388
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-0.707107+0.707107
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-0.92388+0.382683
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-0.92388-0.382683
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-0.707107-0.707107
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-0.382683-0.92388
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0.382683-0.92388
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0.707107-0.707107
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0.92388-0.382683
In[166]:=
phs=Diagonal[matZ]//Normal//Arg;​​Mod[$N*phs/(2Pi),$N]//IntegerChop
Out[167]=
{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}
RelatedGuides
▪
Fermionic Quantum Computation
▪
Quantum Many-Body Systems
▪
Q3

© 2025 Wolfram. All rights reserved.

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