@@ -66,166 +66,3 @@ function c_number(elt::Type{<:Number}=ComplexF64)
6666 blocks (n)[fℤ₂ (1 )] .= one (elt)
6767 return n
6868end
69-
70- #= ==========================================================================================
71- spin 1/2 fermions
72- ===========================================================================================#
73-
74- """
75- e_plus([elt::Type{<:Number}=ComplexF64], particle_symmetry, spin_symmetry; side=:L)
76- e⁺([elt::Type{<:Number}=ComplexF64], particle_symmetry, spin_symmetry; side=:L)
77-
78- The creation operator for electron-like fermions.
79- """
80- function e_plus end
81- function e_plus (particle_symmetry:: Type{<:Sector} , spin_symmetry:: Type{<:Sector} ; kwargs... )
82- return e_plus (ComplexF64, particle_symmetry, spin_symmetry; kwargs... )
83- end
84- function e_plus (elt:: Type{<:Number} = ComplexF64,
85- :: Type{Trivial} = Trivial,
86- :: Type{Trivial} = Trivial;
87- side= :L )
88- pspace = Vect[fℤ₂](0 => 2 , 1 => 2 )
89- vspace = Vect[fℤ₂](1 => 2 )
90- if side == :L
91- e⁺ = TensorMap (zeros, elt, pspace ← pspace ⊗ vspace)
92- blocks (e⁺)[fℤ₂ (0 )][2 , 2 : 3 ] .= [one (elt), - one (elt)]
93- blocks (e⁺)[fℤ₂ (1 )][:, 1 : 2 ] .= [one (elt) zero (elt); zero (elt) one (elt)]
94- elseif side == :R
95- E = e_plus (elt, Trivial, Trivial; side= :L )
96- F = isomorphism (storagetype (E), vspace, flip (vspace))
97- @planar e⁺[- 1 - 2 ; - 3 ] := E[- 2 ; 1 2 ] * τ[1 2 ; 3 - 3 ] * F[3 ; - 1 ]
98- else
99- throw (ArgumentError (" invalid side `:$side `, expected `:L` or `:R`" ))
100- end
101- return e⁺
102- end
103- function e_plus (elt:: Type{<:Number} , :: Type{U1Irrep} , :: Type{SU2Irrep} ; side= :L )
104- pspace = Vect[fℤ₂ ⊠ U1Irrep ⊠ SU2Irrep]((0 , 0 , 0 ) => 1 , (1 , 1 , 1 // 2 ) => 1 ,
105- (0 , 2 , 0 ) => 1 )
106- vspace = Vect[fℤ₂ ⊠ U1Irrep ⊠ SU2Irrep]((1 , 1 , 1 // 2 ) => 1 )
107- if side == :L
108- e⁺ = TensorMap (zeros, elt, pspace ← pspace ⊗ vspace)
109- blocks (e⁺)[fℤ₂ (0 ) ⊠ U1Irrep (2 ) ⊠ SU2Irrep (0 )] .= sqrt (2 )
110- blocks (e⁺)[fℤ₂ (1 ) ⊠ U1Irrep (1 ) ⊠ SU2Irrep (1 // 2 )] .= 1
111- elseif side == :R
112- E = e_plus (elt, U1Irrep, SU2Irrep; side= :L )
113- F = isomorphism (storagetype (E), vspace, flip (vspace))
114- @planar e⁺[- 1 - 2 ; - 3 ] := E[- 2 ; 1 2 ] * τ[1 2 ; 3 - 3 ] * F[3 ; - 1 ]
115- end
116- return e⁺
117- end
118- const e⁺ = e_plus
119-
120- """
121- e_min([elt::Type{<:Number}=ComplexF64], particle_symmetry::Type{<:Sector}, spin_symmetry::Type{<:Sector}; side=:L)
122- e⁻([elt::Type{<:Number}=ComplexF64], particle_symmetry::Type{<:Sector}, spin_symmetry::Type{<:Sector}; side=:L)
123-
124- The annihilation operator for electron-like fermions.
125- """
126- function e_min end
127- function e_min (particle_symmetry:: Type{<:Sector} , spin_symmetry:: Type{<:Sector} ; kwargs... )
128- return e_min (ComplexF64, particle_symmetry, spin_symmetry; kwargs... )
129- end
130- function e_min (elt:: Type{<:Number} = ComplexF64,
131- particle_symmetry:: Type{<:Sector} = Trivial,
132- spin_symmetry:: Type{<:Sector} = Trivial;
133- side= :L )
134- if side === :L
135- E = e_plus (elt, particle_symmetry, spin_symmetry; side= :L )'
136- F = isomorphism (storagetype (E), flip (space (E, 2 )), space (E, 2 ))
137- @planar e⁻[- 1 ; - 2 - 3 ] := E[- 1 1 ; - 2 ] * F[- 3 ; 1 ]
138- elseif side === :R
139- e⁻ = permute (e_plus (elt, particle_symmetry, spin_symmetry; side= :L )' ,
140- ((2 , 1 ), (3 ,)))
141- else
142- throw (ArgumentError (" invalid side `:$side `, expected `:L` or `:R`" ))
143- end
144- return e⁻
145- end
146- const e⁻ = e_min
147-
148- function e_plusmin (elt:: Type{<:Number} = ComplexF64,
149- particle_symmetry:: Type{<:Sector} = Trivial,
150- spin_symmetry:: Type{<:Sector} = Trivial)
151- return contract_twosite (e⁺ (elt, particle_symmetry, spin_symmetry; side= :L ),
152- e⁻ (elt, particle_symmetry, spin_symmetry; side= :R ))
153- end
154- function e_plusmin (particle_symmetry:: Type{<:Sector} , spin_symmetry:: Type{<:Sector} )
155- return e_plusmin (ComplexF64, particle_symmetry, spin_symmetry)
156- end
157- const e⁺e⁻ = e_plusmin
158-
159- function e_minplus (elt:: Type{<:Number} = ComplexF64,
160- particle_symmetry:: Type{<:Sector} = Trivial,
161- spin_symmetry:: Type{<:Sector} = Trivial)
162- return contract_twosite (e⁻ (elt, particle_symmetry, spin_symmetry; side= :L ),
163- e⁺ (elt, particle_symmetry, spin_symmetry; side= :R ))
164- end
165- function e_minplus (particle_symmetry:: Type{<:Sector} , spin_symmetry:: Type{<:Sector} )
166- return e_minplus (ComplexF64, particle_symmetry, spin_symmetry)
167- end
168- const e⁻e⁺ = e_minplus
169-
170- """
171- e_number([elt::Type{<:Number}=ComplexF64], particle_symmetry=fℤ₂, spin_symmetry=ℤ₁)
172-
173- The number operator for electron-like fermions.
174- """
175- function e_number end
176- function e_number (particle_symmetry:: Type{<:Sector} , spin_symmetry:: Type{<:Sector} )
177- return e_number (ComplexF64, particle_symmetry, spin_symmetry)
178- end
179- function e_number (elt:: Type{<:Number} = ComplexF64, :: Type{Trivial} = Trivial,
180- :: Type{Trivial} = Trivial)
181- pspace = Vect[fℤ₂](0 => 2 , 1 => 2 )
182- n = TensorMap (zeros, elt, pspace ← pspace)
183- blocks (n)[fℤ₂ (1 )][1 , 1 ] = 1
184- blocks (n)[fℤ₂ (1 )][2 , 2 ] = 1
185- blocks (n)[fℤ₂ (0 )][2 , 2 ] = 2
186- return n
187- end
188- function e_number (elt:: Type{<:Number} , :: Type{U1Irrep} , :: Type{SU2Irrep} )
189- pspace = Vect[fℤ₂ ⊠ U1Irrep ⊠ SU2Irrep]((0 , 0 , 0 ) => 1 , (1 , 1 , 1 // 2 ) => 1 ,
190- (0 , 2 , 0 ) => 1 )
191- n = TensorMap (zeros, elt, pspace ← pspace)
192- for (c, b) in blocks (n)
193- b .= c. sectors[2 ]. charge
194- end
195- return n
196- end
197-
198- function e_number_up (elt:: Type{<:Number} = ComplexF64, :: Type{Trivial} = Trivial,
199- :: Type{Trivial} = Trivial)
200- pspace = Vect[fℤ₂](0 => 2 , 1 => 2 )
201- n = TensorMap (zeros, elt, pspace ← pspace)
202- blocks (n)[fℤ₂ (1 )][1 , 1 ] = 1
203- blocks (n)[fℤ₂ (0 )][2 , 2 ] = 1
204- return n
205- end
206-
207- function e_number_down (elt:: Type{<:Number} = ComplexF64, :: Type{Trivial} = Trivial,
208- :: Type{Trivial} = Trivial)
209- pspace = Vect[fℤ₂](0 => 2 , 1 => 2 )
210- n = TensorMap (zeros, elt, pspace ← pspace)
211- blocks (n)[fℤ₂ (1 )][2 , 2 ] = 1
212- blocks (n)[fℤ₂ (0 )][2 , 2 ] = 1
213- return n
214- end
215-
216- function e_number_updown (elt:: Type{<:Number} = ComplexF64, :: Type{Trivial} = Trivial,
217- :: Type{Trivial} = Trivial)
218- pspace = Vect[fℤ₂](0 => 2 , 1 => 2 )
219- n = TensorMap (zeros, elt, pspace ← pspace)
220- blocks (n)[fℤ₂ (0 )][2 , 2 ] = 1
221- return n
222- end
223- function e_number_updown (elt:: Type{<:Number} , :: Type{U1Irrep} , :: Type{SU2Irrep} )
224- pspace = Vect[fℤ₂ ⊠ U1Irrep ⊠ SU2Irrep]((0 , 0 , 0 ) => 1 , (1 , 1 , 1 // 2 ) => 1 ,
225- (0 , 2 , 0 ) => 1 )
226- n = TensorMap (zeros, elt, pspace ← pspace)
227- blocks (n)[fℤ₂ (0 ) ⊠ U1Irrep (2 ) ⊠ SU2Irrep (0 )] .= 1
228- return n
229- end
230-
231- const nꜛnꜜ = e_number_updown
0 commit comments