Hi,
I was looking at the source of molecular_orbital_hamiltonian.jl and noticed that the F operator was not included while creating the OpSum of the electronic hamiltonian.
for i in 1:nα, j in 1:nα
if norm(hα[i, j]) > atol
add!(hamiltonian, hα[i, j], "c†↑", i, "c↑", j)
add!(hamiltonian, hα[i, j], "c†↓", i, "c↓", j)
end
end
I’ve seen in literature that operator F
function op!(Op::ITensor, ::OpName"F", ::SiteType"ElecK", s::Index)
Op[s' => 1, s => 1] = +1.0
Op[s' => 2, s => 2] = -1.0
Op[s' => 3, s => 3] = -1.0
return Op[s' => 4, s => 4] = +1.0
end
must be applied on the sites that have an odd number of fermionic operators on the left.
Can I have some clarification?
Yes, i was cross-checking sitetypes and operator used in ITensorChemistry.
The definition of “ElectK” I’ve made a mistake for searching the source code in ITensor repository.
In ITensorChemistry the sitetype is “Electron”, so I’m referring to this:
In some papers, I’ve seen that fermionic operators have to be integrated with F to keep track of the phase factor originating from two anticommuting electrons on the same site with opposite spin
Thanks for the question. So the way this works in ITensors.jl is that when using the OpSum system, that system will put in the F operators for you when making Hamiltonians and other kinds of MPO’s. So it will be included, but you won’t see it happening because it will be done automatically behind the scenes.
Similarly, if you use functions like correlation_matrix to compute quantities like \langle c^\dagger_i c_j \rangle then ITensor will put in the F strings for you there too.
The only case where you as a user have to put your own F strings is if you write code purely at the tensor contraction level where you contract e.g. MPS tensors together to compute observables. Hope that helps -