@@ -3,7 +3,7 @@ module HubbardOperators
33using TensorKit
44
55export hubbard_space
6- export e_num, u_num, d_num, ud_num, half_ud_num
6+ export e_num, u_num, d_num, ud_num, half_ud_num, h_num
77export S_x, S_y, S_z, S_plus, S_min
88export u_plus_u_min, d_plus_d_min
99export u_min_u_plus, d_min_d_plus
@@ -15,7 +15,7 @@ export e_plus_e_min, e_min_e_plus, e_hopping
1515export singlet_plus, singlet_min
1616export S_plus_S_min, S_min_S_plus, S_exchange
1717
18- export n, nꜛ, nꜜ, nꜛꜜ
18+ export n, nꜛ, nꜜ, nꜛꜜ, nʰ
1919export Sˣ, Sʸ, Sᶻ, S⁺, S⁻
2020export u⁺u⁻, d⁺d⁻, u⁻u⁺, d⁻d⁺
2121export u⁻d⁻, d⁻u⁻, u⁺d⁺, d⁺u⁺
7272# Single-site operators
7373# ---------------------
7474function single_site_operator (
75- T , particle_symmetry:: Type{<:Sector} ,
75+ elt :: Type{<:Number} , particle_symmetry:: Type{<:Sector} ,
7676 spin_symmetry:: Type{<:Sector}
7777 )
7878 V = hubbard_space (particle_symmetry, spin_symmetry)
79- return zeros (T , V ← V)
79+ return zeros (elt , V ← V)
8080end
8181
8282@doc """
132132const nꜛ = u_num
133133
134134@doc """
135- d_num([particle_symmetry::Type{<:Sector}], [spin_symmetry::Type{<:Sector}])
136- nꜜ([particle_symmetry::Type{<:Sector}], [spin_symmetry::Type{<:Sector}])
135+ d_num([elt::Type{<:Number}], [ particle_symmetry::Type{<:Sector}], [spin_symmetry::Type{<:Sector}])
136+ nꜜ([elt::Type{<:Number}], [ particle_symmetry::Type{<:Sector}], [spin_symmetry::Type{<:Sector}])
137137
138138Return the one-body operator that counts the number of spin-down particles.
139139""" d_num
@@ -262,6 +262,17 @@ function half_ud_num(elt::Type{<:Number}, ::Type{SU2Irrep}, ::Type{SU2Irrep})
262262 return t
263263end
264264
265+ @doc """
266+ h_num([elt::Type{<:Number}], [particle_symmetry::Type{<:Sector}], [spin_symmetry::Type{<:Sector}])
267+ nʰ([elt::Type{<:Number}], [particle_symmetry::Type{<:Sector}], [spin_symmetry::Type{<:Sector}])
268+
269+ Return the one-body operator that counts the number of holes, i.e. the number of non-occupied sites.
270+ """ h_num
271+ h_num (P:: Type{<:Sector} , S:: Type{<:Sector} ) = h_num (ComplexF64, P, S)
272+ h_num (elt:: Type{<:Number} , particle_symmetry:: Type{<:Sector} , spin_symmetry:: Type{<:Sector} ) =
273+ id (elt, hubbard_space (particle_symmetry, spin_symmetry)) - e_num (elt, particle_symmetry, spin_symmetry)
274+ const nʰ = h_num
275+
265276@doc """
266277 S_plus(elt::Type{<:Number}, particle_symmetry::Type{<:Sector}, spin_symmetry::Type{<:Sector})
267278 S⁺(elt::Type{<:Number}, particle_symmetry::Type{<:Sector}, spin_symmetry::Type{<:Sector})
@@ -312,7 +323,7 @@ const S⁻ = S_min
312323 S_x(elt::Type{<:Number}, particle_symmetry::Type{<:Sector}, spin_symmetry::Type{<:Sector})
313324 Sˣ(elt::Type{<:Number}, particle_symmetry::Type{<:Sector}, spin_symmetry::Type{<:Sector})
314325
315- Return the one-body spin-1/2 x-operator on the electrons (only defined for `Trivial` symmetry). .
326+ Return the one-body spin-1/2 x-operator on the electrons (only defined for `Trivial` symmetry).
316327""" S_x
317328function S_x (P:: Type{<:Sector} = Trivial, S:: Type{<:Sector} = Trivial)
318329 return S_x (ComplexF64, P, S)
@@ -332,7 +343,7 @@ const Sˣ = S_x
332343 S_y(elt::Type{<:Number}, particle_symmetry::Type{<:Sector}, spin_symmetry::Type{<:Sector})
333344 Sʸ(elt::Type{<:Number}, particle_symmetry::Type{<:Sector}, spin_symmetry::Type{<:Sector})
334345
335- Return the one-body spin-1/2 y-operator on the electrons (only defined for `Trivial` symmetry).
346+ Return the one-body spin-1/2 y-operator on the electrons (only defined for `Trivial` symmetry).
336347""" S_y
337348function S_y (P:: Type{<:Sector} = Trivial, S:: Type{<:Sector} = Trivial)
338349 return S_y (ComplexF64, P, S)
@@ -352,7 +363,7 @@ const Sʸ = S_y
352363 S_z(elt::Type{<:Number}, particle_symmetry::Type{<:Sector}, spin_symmetry::Type{<:Sector})
353364 Sᶻ(elt::Type{<:Number}, particle_symmetry::Type{<:Sector}, spin_symmetry::Type{<:Sector})
354365
355- Return the one-body spin-1/2 z-operator on the electrons.
366+ Return the one-body spin-1/2 z-operator on the electrons.
356367""" S_z
357368function S_z (P:: Type{<:Sector} = Trivial, S:: Type{<:Sector} = Trivial)
358369 return S_z (ComplexF64, P, S)
@@ -600,7 +611,7 @@ const e⁻e⁺ = e_min_e_plus
600611 e_hop([elt::Type{<:Number}], [particle_symmetry::Type{<:Sector}], [spin_symmetry::Type{<:Sector}])
601612
602613Return the two-body operator that describes a particle that hops between the first and the second site.
603- """ e_hop
614+ """ e_hopping
604615e_hopping (P:: Type{<:Sector} , S:: Type{<:Sector} ) = e_hopping (ComplexF64, P, S)
605616function e_hopping (
606617 elt:: Type{<:Number} , particle_symmetry:: Type{<:Sector} ,
0 commit comments