this is my first post so forgive me all the mistakes. I am reaching out to you because I can not get the custom operator working.
I have run a test code by defining the operator the same as "Cdagup" and "Cup"
function ITensors.op(::OpName"c_dagup", ::SiteType"Electron", s1::Index)
return op("Cdagup", s1)
end
function ITensors.op(::OpName"c_up", ::SiteType"Electron", s1::Index)
return op("Cup", s1)
end
Hi Lucy, thanks for the question. While I’m not immediately sure why you’re seeing that difference, one strong possibility is that you will also need to define a special method called has_fermion_string for these specific operators to tell our OpSum system to treat these specially, since they anticommute as operators.
I think I see what you’re asking, but the need for the fermion string is not really about whether the operator is a fermion or boson, per se, but more about whether the operator anticommutes with other operators in some “non-local” way. We could discuss some other examples if we need to.
The other notion, of an operator being “bosonic” isn’t really about bosons or even particles at all, but just the idea of an operator acting non-trivially on a certain vector space that makes up part of a larger vector space. In physics jargon, such an operator acts non-trivially on a “site” or small group of sites then as the identity (or trivially) on all the other sites. Basically it is just a “regular” local operator.
So all familiar spin operators (Sz, S+, S-, etc.) are “bosonic” as well as all local quantum gates (Hadamard, etc.) and so on. Also operators consisting of an even number of fermionic \hat{c} or \hat{c}^\dagger operators are “bosonic”, for example the number or density operator \hat{n} = \hat{c}^\dagger \hat{c}.