# Incorrect Hamiltonian from autompo of a spinless Majorana opeator

edited

Hi,
Here is my Hamiltonian with Majorana operator @@\lambda^1=C+C^\dagger@@ :

        auto sites = Spinless(N,{"ConserveNf",false});
// Create the Hamiltonian using AutoMPO
auto ampo = AutoMPO(sites);
for(int i = 1; i <= N; ++i)
{
ampo += -1.0,"C",i;
ampo += -1.0,"Cdag",i;
}


For N=2, the Hamiltonian should be
$$\begin{pmatrix} 0 & -1 & -1 & 0\\ -1 & 0 & 0 & -1\\ -1 & 0 & 0 & -1\\ 0 & -1& -1 & 0\\ \end{pmatrix}$$
However, the ITensor of H is
ITensor r=4: ("Spinless 1",2,Site|578)' ("Spinless 1",2,Site|578) ("Spinless 2",2,Site|138)' ("Spinless 2",2,Site|138)
{log(scale)=1.04, norm=2.83 (Dense Real)}
(2,1,1,1) -1.000000
(1,2,1,1) 1.0000000
(1,1,2,1) -1.000000
(2,2,2,1) -1.000000
(1,1,1,2) 1.0000000
(2,2,1,2) 1.0000000
(2,1,2,2) -1.000000
(1,2,2,2) 1.0000000
which is
$$\begin{pmatrix} 0 & 1 & 1 & 0\\ -1 & 0 & 0 & 1\\ -1 & 0 & 0 & 1\\ 0 & -1& -1 & 0\\ \end{pmatrix}$$
is not Hermitian but DMRG reported energy is
Energy after sweep 6/6 is -2.000000000000
Using overlap <G|H|G> = -0.0000000000
The ground state |G> is
ITensor r=2: ("Spinless 1",2,Site|578) ("Spinless 2",2,Site|138)
{log(scale)=-0.00, norm=1.00 (Dense Real)}
(1,1) 1.0000000
which is |00>
In short, the Autompo seems not working on such @@Hamitonian = C_i + C^\dagger_i@@
Moreover, by using A and F operators instead for two sites,

ampo += -1,"A",1;
ampo += -1,"F",1,"A",2;


Energy after sweep 6/6 is -1.414213562373
Using overlap = -1.4142135624
ITensor r=4: ("Spinless 1",2,Site|28) ("Spinless 1",2,Site|28)' ("Spinless 2",2,Site|438) ("Spinless 2",2,Site|438)'
{log(scale)=1.04, norm=2.83 (Dense Real)}
(2,1,1,1) -1.000000
(1,2,1,1) -1.000000
(1,1,2,1) -1.000000
(2,2,2,1) 1.0000000
(1,1,1,2) -1.000000
(2,2,1,2) 1.0000000
(2,1,2,2) -1.000000
(1,2,2,2) -1.000000
which is
$$\begin{pmatrix} 0 & -1 & -1 & 0\\ -1 & 0 & 0 & -1\\ -1 & 0 & 0 & 1\\ 0 & -1& 1 & 0\\ \end{pmatrix}$$
and it's still not correct.
Could you help me out with it?
Thanks.
Best,
Victor

Hi Victor,
Thanks for the question. So the input you gave to AutoMPO is indeed @@C+C^\dagger@@ because as you can see on the first line you are saying ampo += C and on the second ampo += Cdag (which in words means "add C to the AutoMPO" then "add Cdag to the AutoMPO").

To make a term with a product of C times Cdag, you need to write an input line like this:

ampo += "C",i,"Cdag",j;


Best regards,
Miles

commented by (650 points)
edited
Hi Miles,
Thanks for prompt answer. Actually I'd like to check Majorana operator
@@
\lambda^1_i= C_i + C^\dagger_i
@@
And autompo seems not giving correct Hamiltonian, right?
commented by (650 points)
Also, instead of using C operators in autompo, A and F operators in autompo for two sites as
ampo += -1,"A",1;
ampo += -1,"F",1,"A",2;
which still gives wrong Hamiltonian as added in the original post.
commented by (460 points)
Hi Victor,

I have encountered this kind of problem before. I think the problem is with the C (Cdag) operator, it comes with the Jordan-Wigner string that acts on all the sites before, so the C (Cdag) operator has to come in pairs.

Does anyone know how to make a Majorana fermion operator, or do I need to define my own SiteSet class?

Best,

Yixuan
commented by (70.1k points)
Hi guys, so really the key issue here is that AutoMPO is not needed for measuring this operator, and would actually be an inefficient way to do the measurement even if it worked. The superior approach is just to make the C and Cdag operators as tensors and measure each of them separately (using only a single MPS tensor for the site j you are measuring after calling .position(j) on the MPS), then just add the results together.

Take care to notice that they will only have a non-zero expectation value if the state does not conserve particle number, or if you compute a matrix element of C or Cdag between two different wavefunctions whose particle number differs by 1.

Best regards,
Miles
commented by (650 points)
Hi, all. Thanks for help.
AutoMPO is not required to measure such operators for sure. But the thing is that AutoMPO is not giving the correct Hamiltonian even for two sites neither by C operators or A/F operators. Also, I'm using such for MPO(ampo) so that the result shouldn't converse any quantum numbers.
In short, the question should be what's the correct way to generate the Hamiltonian including Majorana fermion operator?
commented by (70.1k points)
Hi Victor, yes there is a bug in AutoMPO right now where it does not correctly generate terms which have a non-zero quantum number "flux", so terms like a single C or Cdag operator. I had thought this issue only came up when conserving quantum numbers but apparently it's coming up even without that. I'm in the process of rewriting AutoMPO right now for our Julia version of ITensor and plan to fix this bug in the process of rewriting (as I'm making the code much simpler; it's very complex right now and hard to fix as-is). Thanks for letting me know.

Miles