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
Baker-Hausdorff Lemma
Bosons
More Examples Related to Spins
Fermions
More Examples with Bilinear Expressions
The Baker-Hausdorff lemma states that
Exp
[a]**b**
Exp
[-a]
is equivalent to the series
b+[a,b]+
1
2!
[a,[a,b]]+
1
3!
[a,[a,[a,b]]]+...
.
Elaborate
[expr]
Expands
expr
into a more explicit form.
LieExp
[a,b]
Evaluates
Exp
[a]**b**
Exp
[-a]
and returns the result if a closed form expression can be found at all.
Multiply
[a,b,…]
Represents the non-commutative multiplication, and also denoted
a**b**…
. It is a Q3 implementation of
NonCommutativeMultiply
.
Functions to be used in the demonstration of the lemma.
For the demonstration,
Q3
is required.
In[81]:=
Needs["QuantumMob`Q3`"]
Bosons
In[82]:=
Let[Real,ϕ]
Consider two species of Bosons.
In[83]:=
Let[Boson,a,b]
Let us start with a so-called single-model squeezing operator, U:
In[84]:=
A=(z*a[1]**a[1]-Conjugate[z]*Dagger[a[1]**a[1]])/2​​U=Exp[A]
Out[84]=
1
2
z
a
1
a
1
-
*
z
†
a
1
†
a
1

Out[85]=
1
2
z
a
1
a
1
-
*
z
†
a
1
†
a
1


In the following, Multiply is already smart enough to expand the first two cases. However, the last example of almost the same complexity is not properly manipulated.
In[86]:=
ex1=U**a[1]**Dagger[U]​​ex2=U**Dagger[a[1]]**Dagger[U]​​ex3=U**Dagger[a[1]]**a[1]**Dagger[U]
Out[86]=
Out[87]=
Out[88]=
For such a case, one can use
Elaborate
.
In[89]:=
ex4=Elaborate[ex3]//ExpToTrig//Simplify​​ex4a=ex4//CauchySimplify
Out[89]=
1
2
z
*
z

z
*
z
-1+Cosh2
z
*
z
+2Cosh2
z
*
z

†
a
1
a
1
+z
a
1
a
1
Sinh2
z
*
z
+
*
z
†
a
1
†
a
1
Sinh2
z
*
z

Out[90]=
Cosh[2z]
†
a
1
a
1
+
Cosh[z]z
a
1
a
1
+
*
z
†
a
1
†
a
1
Sinh[z]
z
+
2
Sinh[z]
In[91]:=
ex5=LieExp[A,Q[a[1]]]//CauchySimplify​​ex4a-ex5//CauchySimplify
Out[91]=
-2z

z
2
(-1+
2z

)
+2(1+
4z

)
†
a
1
a
1
+(-1+
4z

)z
a
1
a
1
+
*
z
†
a
1
†
a
1

4z
Out[92]=
0
Let us check the above result. It should be equal to the following
In[93]:=
ex1a=Elaborate[ex1]​​ex2a=Elaborate[ex2]​​ex5=ex2a**ex1a//ExpToTrig//Simplify​​ex5a=ex5//CauchySimplify​​ex6=LieExp[A,Q@a[1]]//CauchySimplify
Out[93]=
1
2
-
z
*
z

1+
2
z
*
z


a
1
+
-
z
*
z

-1+
2
z
*
z


*
z
†
a
1
2
z
Out[94]=
-
z
*
z

-1+
2
z
*
z


z
a
1
2
*
z
+
1
2
-
z
*
z

1+
2
z
*
z


†
a
1
Out[95]=
1
2
z
*
z

z
*
z
-1+Cosh2
z
*
z
+2Cosh2
z
*
z

†
a
1
a
1
+z
a
1
a
1
Sinh2
z
*
z
+
*
z
†
a
1
†
a
1
Sinh2
z
*
z

Out[96]=
Cosh[2z]
†
a
1
a
1
+
Cosh[z]z
a
1
a
1
+
*
z
†
a
1
†
a
1
Sinh[z]
z
+
2
Sinh[z]
Out[97]=
-2z

z
2
(-1+
2z

)
+2(1+
4z

)
†
a
1
a
1
+(-1+
4z

)z
a
1
a
1
+
*
z
†
a
1
†
a
1

4z
In[98]:=
ex4a-ex5a//Elaborate[#]&//CauchySimplify​​ex5a-ex6//CauchySimplify
Out[98]=
0
Out[99]=
0
Fermions
Here are some more examples:
In[100]:=
b3=I*ϕ*(Dagger[a[1]]**a[1]+2Dagger[a[1]]**a[2]+2Dagger[a[2]**a[1]])​​tmp1=Exp[b3]**Dagger[a[1]]**a[2]**Exp[-b3]​​tmp2=Exp[b3]**Dagger[a[3]]**a[2]**Exp[-b3]​​tmp3=Exp[b3]**Dagger[a[2]]**a[2]**Exp[-b3]
Out[100]=
ϕ
†
a
1
a
1
+2
†
a
1
a
2
+2
†
a
1
†
a
2

Out[101]=
Out[102]=
Out[103]=
In[104]:=
Elaborate[tmp1]​​Elaborate[tmp2]​​Elaborate[tmp3]
Out[104]=
ϕ

†
a
1
a
2
-2
ϕ

(-1+
ϕ

)
†
a
1
†
a
1
Out[105]=
(2-2
ϕ

)
†
a
1
†
a
3
+
†
a
3
a
2
Out[106]=
2(-1+
ϕ

)
†
a
1
a
2
-4
2
(-1+
ϕ

)
†
a
1
†
a
1
+(2-2
ϕ

)
†
a
1
†
a
2
+
†
a
2
a
2
More Examples Related to Spins
In[107]:=
Let[Boson,a,b]​​Let[Fermion,c,d]​​Let[Complex,z]​​Let[Grassmann,g]
In[111]:=
Let[Real,ϕ]
In[116]:=
Sx=FockSpin[c,1];​​Ux=Exp[I*ϕ*Sx];​​ex1=Ux**Dagger[c[Up]]**c[Up]**Dagger[Ux]​​ex2=Ux**c[Up]**Dagger[Ux]
Out[118]=
Out[119]=
ϕ
1
2
†
c
↓
c
↑
+
1
2
†
c
↑
c
↓

c
↑
-ϕ
1
2
†
c
↓
c
↑
+
1
2
†
c
↑
c
↓

The basic feature of
Multiply
is already smart enough to successfully simplify ex2. However, it fails for ex1, whose complexity is almost the same as that of ex2. This is due to the design of
Multiply
for efficiency.
Let us try to expand the expressions using
Elaborate
.
In[120]:=
ex1a=Elaborate[ex1]//Simplify
Out[120]=
2
Cos
ϕ
2

†
c
↑
c
↑
+
†
c
↓
c
↓
2
Sin
ϕ
2

+
1
2

†
c
↓
c
↑
-
†
c
↑
c
↓
Sin[ϕ]
If the above result is correct, then it should be equal to Dagger[ex2]**ex2:
More Examples with Bilinear Expressions

Bosonic Bilinear Expressions

​

Fermionic Bilinear Expressions

​

Bilinear Expression in Majorana Fermions

© 2025 Wolfram. All rights reserved.

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