TDVP for Hamiltonian with three-site interaction

Good morning,

I have a question related to ITensor c++.
I was trying to implement the time evolution by exploting TDVP (present here TDVP/tdvp.h at master · ITensor/TDVP · GitHub) of of a system with three-site interaction such as:

    for(int i = 1; i <= N-3; ++ i)
        {
        ampo += 0.5,"S+",i,"S-",i+1,"S+",i+2;          
       } 

is it possible? I got the following error:
“From line 1518, file mps/autompo.cc
Only at most 2-operator terms allowed for AutoMPO conversion to MPO/IQMPO”

Thank you in advance,
Federico

Hi Federico,
Glad you’re trying TDVP with ITensor.

Regarding the C++ version, what version of it are you using? We did add support for multi-site operator inputs to AutoMPO quite some time ago. For example, this code works for me with the latest version:

#include "itensor/all.h"
#include "itensor/util/print_macro.h"
using namespace itensor;

int main()
    {
    int N = 10;

    auto sites = SpinOne(N,{"ConserveQNs=",false});

    auto ampo = AutoMPO(sites);
    for(int i = 1; i <= N-3; ++ i)
       {
       ampo += 0.5,"S+",i,"S-",i+1,"S+",i+2;
       }

    auto H = toMPO(ampo);

    return 0;
    }

P.S. Have you considered using our newer Julia-based version of ITensor? We are supporting and developing that one a lot more.