You should assume that odd numbers of fermion operators will need their strings handled manually (OpSum
doesn’t support this yet).
Another important thing to note, once you write c1 = op("c", ss[1])
, then c1
is an ITensor and has no knowledge of being fermionic as it has no QNs.
The strings are handled at an operator level, so OpSum
and some of correlation_matrix
can insert JW strings.
See the discussion here for some more: Proper way to construct fermion gates