-
Notifications
You must be signed in to change notification settings - Fork 132
Open
Labels
ITensorsIssues or pull requests related to the `ITensors` package.Issues or pull requests related to the `ITensors` package.enhancementNew feature or requestNew feature or request
Description
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
endReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ITensorsIssues or pull requests related to the `ITensors` package.Issues or pull requests related to the `ITensors` package.enhancementNew feature or requestNew feature or request