Singular Values as np_conserved

How do I use this algorithm? What does that parameter do?
Post Reply
nsherman
Posts: 10
Joined: 21 Apr 2021, 00:16

Singular Values as np_conserved

Post by nsherman »

I'm trying to implement the iTDVP algorithm following
https://scipost.org/SciPostPhysLectNotes.7/pdf

In doing this, I need to update both the center site tensor using the '1-site' Hamiltonian, as well as the center site singular values using the '0-site' Hamiltonian. In order to do this, I'd like to have the singular values as a np_conserved quantity to properly take into consideration the charges. Is there a way to easily get this information from the singular values stored in the MPS? These singular values are stored as a numpy array, and not as a TenPy Array, and so this does not incorporate the charge information out of the box. Maybe there's a straightforward way to convert this numpy array into a TenPy Array while incorporating the charge info correctly?

In the finite case, this is circumvented by using the singular values from the previous step in the sweep. In the infinite case, there is only one step, and so this work around is not available. In principle I could just SVD the on-site tensor to extract this information, but I was wondering if there is a simpler way to get this.

Thanks,
Nick
User avatar
Johannes
Site Admin
Posts: 413
Joined: 21 Jul 2018, 12:52
Location: TU Munich

Re: Singular Values as np_conserved

Post by Johannes »

Hi Nick,
not sure if you already solved this.
If you want, you can create a diagonal np_conserved tensor from that with the following snippet, but it is numerically inenfficient to actually do that (because tensordot is more expensive than just scaling an axis, which is what we usually do.

Code: Select all

# assuming you're looking at bond left of site `i`
from tenpy.linalg import np_conserved as npc
S = psi.get_SL(i)
leg = psi.get_B(i).get_leg('vL')
diagS = npc.diag(S, leg, labels=['vL', 'vR'])
How is the implementation of iTDVP going? Did you manage?
Post Reply