Page 1 of 1

Question about the Hamiltonian MPO

Posted: 01 Feb 2022, 02:48
by Fabio_Mendez
Hi, thanks a lot for creating these libraries. I love the simplicity of constructing DMRG codes with them!

I have a question, why do the first Hamiltonian MPO sites always have two rows instead of one? I have worked with the TNT libraries, and we use 1 row and 1 column at the first and last sites in that software. Wouldn't having two rows or columns make the code inefficient for big Hilbert spaces?

Thanks in advance,

Re: Question about the Hamiltonian MPO

Posted: 09 Feb 2022, 07:19
by Johannes
MPOs are extensive sums of local terms; thus they take a Jordan block form
\[ W = \begin{pmatrix} 1 & C & D \\ 0 & A & B \\ 0 & 0 & 1 \end{pmatrix} = \text{e.g. for transverse field ising} \begin{pmatrix} 1 & X & - Z \\ 0 & 0 & X \\ 0 & 0 & 1 \end{pmatrix} \]
The first and last index here are special, because they have the identity blocks. TeNPy chooses to keep those identity blocks/indices around by default, just because that allows to easily modify/extract onsite terms and avoid complications for some methods that require them (e.g in calc_H_bond_from_MPO).

In general, this is a tiny bit of extra work for finite MPS, yes, but it's definitely a subleading contribution - even for huge local bond dimensions, it's not gonna give you a substantial speedup of more than a few percent (unless you only have this huge local dimension only at the boundaries, and/or a tiny system).
That being said, if it really bothers you that much, you can easily disable this by setting the option insert_all_Ids=False of the function from_terms when constructing the MPO, presumably in the source code of calc_H_MPO.