Best way to move from electron to fermion site type

I have a quantum number MPS represented in terms of electron sites that I want to rewrite in terms of fermion sites.

My idea consisted of the following steps

  1. Create the fermion sites.
  2. Use a combiner to combine them into a combined site.
  3. Replace the sites in the electron MPS with the combined sites.
  4. Use the combiner to split apart the sites in the MPS, resulting in the final fermion sites.

However, it appears that step 3 runs into problems, because quantum number order of the combined fermion sites do not match those of the electron site. As far as I am aware there is no rearrange the quantum numbers of the combined site.

Below is a little example

using ITensors, ITensorMPS

es = siteindex("Electron"; conserve_qns=true);
@show es

fs1 = Index([QN(("Nf", 0, -1), ("Sz", 0)) => 1, QN(("Nf", 1, -1), ("Sz", +1)) => 1], "Fermion,Site,1");
@show fs1

fs2 = Index([QN(("Nf", 0, -1), ("Sz", 0)) => 1, QN(("Nf", 1, -1), ("Sz", -1)) => 1], "Fermion,Site,1");
@show fs2

@show combinedind(combiner(fs1, fs2))
@show combinedind(combiner(fs2, fs1))
es = (dim=4|id=391|"Electron,Site") <Out>
 1: QN(("Nf",0,-1),("Sz",0)) => 1
 2: QN(("Nf",1,-1),("Sz",1)) => 1
 3: QN(("Nf",1,-1),("Sz",-1)) => 1
 4: QN(("Nf",2,-1),("Sz",0)) => 1

fs1 = (dim=2|id=739|"Fermion,Site,n=1") <Out>
 1: QN(("Nf",0,-1),("Sz",0)) => 1
 2: QN(("Nf",1,-1),("Sz",1)) => 1

fs2 = (dim=2|id=696|"Fermion,Site,n=2") <Out>
 1: QN(("Nf",0,-1),("Sz",0)) => 1
 2: QN(("Nf",1,-1),("Sz",-1)) => 1

combinedind(combiner(fs1, fs2)) = (dim=4|id=2|"CMB,Link") <Out>
 1: QN(("Nf",0,-1),("Sz",0)) => 1
 2: QN(("Nf",1,-1),("Sz",-1)) => 1
 3: QN(("Nf",1,-1),("Sz",1)) => 1
 4: QN(("Nf",2,-1),("Sz",0)) => 1

combinedind(combiner(fs2, fs1)) = (dim=4|id=710|"CMB,Link") <Out>
 1: QN(("Nf",0,-1),("Sz",0)) => 1
 2: QN(("Nf",1,-1),("Sz",-1)) => 1
 3: QN(("Nf",1,-1),("Sz",1)) => 1
 4: QN(("Nf",2,-1),("Sz",0)) => 1

You could also apply a combiner to the electron sites to “canonicalize” the ordering of the sectors so they match the ordering of the combined fermion sites.

I’m not really sure what that would entail, but I realized I could just copy the values of the tensor (duh). Might not be as cute as a solution with combiners, but it works. Probably not the most efficient method either, but I’m only using it for small bond dimension MPSs.

function electron_to_fermion_site(t::ITensor, es::Index, fup::Index, fdn::Index)::ITensor
  indices = inds(t)
  nonSiteInds = [i for i in indices if i != es]
 
  t = permute(t, nonSiteInds..., es)

  newInds = copy(nonSiteInds)
  push!(newInds, fup, fdn)
  newT = ITensors.BlockSparseTensor(eltype(t), Block{length(newInds)}[], newInds)

  for coords in CartesianIndex([1 for _ in nonSiteInds]...):CartesianIndex([dim(i) for i in nonSiteInds]...)
    newT[coords.I..., 1, 1] = t[coords.I..., 1]
    newT[coords.I..., 2, 1] = t[coords.I..., 2]
    newT[coords.I..., 1, 2] = t[coords.I..., 3]
    newT[coords.I..., 2, 2] = t[coords.I..., 4]
  end

  return itensor(newT)
end

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.