norm attribute when doing compress_svd()

How do I use this algorithm? What does that parameter do?
Post Reply
sc_
Posts: 2
Joined: 10 Nov 2022, 17:08

norm attribute when doing compress_svd()

Post by sc_ »

I've been playing with the MPO.apply() methods to an MPS, but I'm a bit puzzled by what happens to the "norm" attribute of the MPS when doing the subsequent SVD compression - ideally I'd like to compress and get to a normalized state, but it seems that the psi.compress_svd() brings psi.norm to an insanely small value, and I can't seem to find a way to put it back to 1 (aside from setting it back to 1 by hand.. ) - there is no "renormalize" option in the compress_svd function as far as I can tell -

it seems that the responsible for this is the fact that in the backwards SVD tenpy does
https://github.com/tenpy/tenpy/blob/04e ... s.py#L4036

```
U, S, VH, err, norm_new = svd_theta(B, trunc_par)
trunc_err += err
self.norm *= norm_new
```

and if I remove the last line, the norm stays untouched to 1 (of course), but it's not clear to me whether this is breaking some other stuff elsewhere,
I guess in general I'm not too sure how tenpy keeps track of this norm attribute (and how it is related to the canonical forms and all that) - I had a quick look at the bug reports and found issue Issue #165 , so I guess I'm not the only one confused..

any hint would be greatly appreciated!
User avatar
Johannes
Site Admin
Posts: 413
Joined: 21 Jul 2018, 12:52
Location: TU Munich

Re: norm attribute when doing compress_svd()

Post by Johannes »

Sorry for the slow response. I've answered the Issue #165 rather extensively, I hope that clarifies things.

If the operator you apply is not exactly unitary, it is to be expected that it changes the norm, isn't it?

But you can indeed manually reset psi.norm = 1 by hand if needed.
The norm is only relevant for overlaps, algorithms completely ignore it (except for updating the number, if they apply non-unitary operators, to allow keeping track of the norm).
sc_
Posts: 2
Joined: 10 Nov 2022, 17:08

Re: norm attribute when doing compress_svd()

Post by sc_ »

ok I see what you mean, thanks for the reply Johannes!
Post Reply