Density operator for Fermion SiteType

Hello,
I just wanted to double check what the operator “N” is for the Fermion SiteType. In the docs it is a single-site fermion operator just labelled as density operator. Is N = Cdag * C, i.e. is it the fermionic occupation of the site?

Thank you

1 Like

You can see the matrix representation easily to double check its what you want

julia> @show op("N",s[1])
op("N", s[1]) = ITensor ord=2
Dim 1: (dim=2|id=213|"Fermion,Site,n=1")'
Dim 2: (dim=2|id=213|"Fermion,Site,n=1")
NDTensors.Dense{Float64, Vector{Float64}}
 2×2
 0.0  0.0
 0.0  1.0
ITensor ord=2 (dim=2|id=213|"Fermion,Site,n=1")' (dim=2|id=213|"Fermion,Site,n=1")
NDTensors.Dense{Float64, Vector{Float64}}

It’s a diagonal operator that is 0 for unoccupied 1 for occupied. We can also check that this matches Cdag*C

julia> @show op("Cdag * C",s[1])
op("Cdag * C", s[1]) = ITensor ord=2
Dim 1: (dim=2|id=213|"Fermion,Site,n=1")'
Dim 2: (dim=2|id=213|"Fermion,Site,n=1")
NDTensors.Dense{Float64, Vector{Float64}}
 2×2
 0.0  0.0
 0.0  1.0
ITensor ord=2 (dim=2|id=213|"Fermion,Site,n=1")' (dim=2|id=213|"Fermion,Site,n=1")
NDTensors.Dense{Float64, Vector{Float64}}

julia> norm(op("N",s[1]) - op("Cdag * C",s[1]))
0.0

2 Likes

That’s really helpful. Thank you