Inner Product of two MPS Without Conjugation and QN Conservation

Hi,
I attempted to compute the inner product of two MPS without the complex conjugate by removing dag(psi) from the innerC function. Below is the modified implementation I am using

   Cplx innerB(MPS const& psi, MPS const& phi)
{
    auto N = length(psi);
    if (N != length(phi)) Error("inner: mismatched N");
    auto psi_mod = psi;
    psi_mod.replaceSiteInds(siteInds(phi));
    psi_mod.replaceLinkInds(sim(linkInds(psi_mod)));

    auto L = phi(1) * psi_mod(1);
    if (N == 1) return eltC(L);
    
    for (auto i : range1(2, N))
        L = L * phi(i) * psi_mod(i);
    
    return eltC(L);
}

This works well and gives correct result when quantum number (QN) conservation is not enforced. However, when QN conservation is enabled, I encounter a mismatched QN Index error. Moreover, my MPS correctly conserve QN prior to applying innerB.

Is there an issue with the innerB function? Alternatively, is there a built-in ITensor function that computes the inner product without conjugation while correctly handling quantum numbers (QNs)? I would appreciate any guidance on this.

Thanks!

Hi Sambu,
I’m working mostly with Julia but I think I have an idea of where the problem could be. the Index class has the attribute Arrow that you can obtain by using the functiondir(Index)->Arrow. The point is that when working with QNIndex only indexes with opposite direction of the arrow can be contracted, or else you’d get an error. This is done inside the dag function, so if you don’t call it, the arrows will have the same direction giving error. You can try to change this line

psi_mod.replaceSiteInds(siteInds(phi));

to

 psi_mod.replaceSiteInds(dag(siteInds(phi)));

This is going to flip the direction of the indexes allowing you to contract the tensors

@Sambu_1234 could you give some more mathematical context about what you’re hoping to achieve?

What I wonder is whether it is mathematically meaningful to expect a way to correctly handle quantum numbers without having the conjugation step in the norm?

The reason I say this is that the usual inner product <v,w> = \sum v^*_j w_j that is used for complex vectors obeys important mathematical properties that make it a valid inner product. If the conjugation step is skipped, then I doubt it will have those important properties anymore. If so, I’m not sure what “correctly handling” quantum numbers means in a precise sense.

Hi Vincenzo,
Thank you for your response. I tried your suggestion, but it still violates quantum number conservation.

Hi Miles,
Thank you for your response. I am interested in evaluating the expression ⟨ψ|e^{-iHt}|ψ⟩. To simplify the computation, I decompose the exponential term as
⟨ψ∣e^{−iHt}∣ψ⟩=⟨ψ∣e^{−iHt/2} e^{−iHt/2}∣ψ⟩.

In my case, the state |ψ> is real, and the Hamiltonian H is a real symmetric matrix in the Sz basis. This structure implies that the first part, ⟨ψ∣e^{−iHt/2} is simply the transpose of the second part, e^{−iHt/2}∣ψ⟩, without requiring complex conjugation.

Given this setup, I would like to compute the expression overlap = ⟨ψ∣e^{−iHt/2} e^{−iHt/2}∣ψ⟩ without introducing the complex conjugation.

Ah that’s really interesting. I am doing some time evolution too and if that worked it would be very useful. An extra factor of 2 faster on top of the well-known benefits of only evolving by half the time.

I see your point about this appearing to work if |\psi \rangle is real.

But are you also applying some kind of operator like c^\dagger_j to the state to make |\psi \rangle in the first place? If that operator is not Hermitian then this trick may not work. However if you are applying something like S^z then maybe it has a chance.

Perhaps it could work to just call conj(...) on each of the MPS tensor in addition to the usual dag that inner uses which also flips the index arrows (which changes the sense of the quantum number arithmetic).

Let me think about it and get back to you. Also let me know about how you are preparing |\psi \rangle in the first place.

I completely agree with your point. If this inner function works well, then we can compute the dynamical properties of a system with a real symmetric Hamiltonian H and a real state ∣ψ⟩, along with the application of a Hermitian operator, over a total time T by evolving the state only up to T/2. This is highly beneficial, as it effectively reduces the computational cost by half.

In my case, I begin by constructing a product of singlet pair states between neighboring spins in a 2N-spin chain. Then, I apply the imaginary-time evolution operator e^{−βH/2}, followed by the Hermitian Sz operator to obtain the state ∣ψ⟩.

Thanks, Miles! I tried applying conj(...) to each of the MPS tensor in addition to the usual dag, and it preserves the QN conservation.

I didn’t get to try it out myself yet, but did you try the whole idea and does it appear to give correct results?

Yes, I have tried implementing the approach for calculating the dynamical spin correlation ⟨S^z_{L/2}(t) Sz_{L/2}(0)⟩ using the innerB function.

Cplx
innerB(MPS const& psi,MPS const& phi)
{
 auto N = length(psi);
 if(N != length(phi)) Error("inner: mismatched N");

 auto psidag = dag(psi);
 psidag.replaceSiteInds(siteInds(phi));
 psidag.replaceLinkInds(sim(linkInds(psidag)));

 auto L = phi(1) * conj(psidag(1));
 if(N == 1) return eltC(L);
 for(auto i : range1(2,N) ) 
     L = L * phi(i) * conj(psidag(i));
 return eltC(L);
}

It preserves quantum number (QN) conservation, and the results generally match the traditional approach. However, at large times (t), there is still a minor discrepancy.

Very interesting, thanks