At the moment, op(s,"F") returns the identity operator unless explicitly specified for the SiteType of s.
I would suggest that if isfermionic(s) == true, then this should return the parity operator.
This is useful, for example, on combine indices of multiple fermionic sites, where I would not want to explicitly define a new SiteType for each combination. Could be implemented maybe like this:
function ITensors.op!(o::ITensor, ::OpName"F", st::SiteType"Generic", s::Index; kwargs...)
op!(o, OpName("Id"), st, s; kwargs...)
if isfermionic(s)
[o[Block(b,b)] *= (1-2f) for (b,f) in enumerate(fparity.(qn.(s.space)))]
end
return o
end
At the moment,
op(s,"F")returns the identity operator unless explicitly specified for theSiteTypeofs.I would suggest that if
isfermionic(s) == true, then this should return the parity operator.This is useful, for example, on combine indices of multiple fermionic sites, where I would not want to explicitly define a new
SiteTypefor each combination. Could be implemented maybe like this: