Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evenly keep eigenvalues among different sector for abeliantensor #2

Open
brucelyu opened this issue Dec 16, 2020 · 4 comments
Open

Comments

@brucelyu
Copy link

brucelyu commented Dec 16, 2020

Hi Markus, the current matrix_eig method in abeliantensor.py keep the first several largest eigenvalues among all eigenvalues. For example, if we truncate a leg with bound dimension 30 to 20 for Z2 symmetric tensor, and let's say the initial shape is [15,15], the truncation could end up like [9,11]. However, sometimes, we may wish the truncation is evenly distributed among two sectors to be [10,10], so is it possible to support this "evenly truncation feature" for the eigenvalue decomposition for the abeliantensor?

I think the key is in line 1978 of the abeliantensor.py in matrix_eig method

 # Figure out what bond dimension to truncate to, how this bond
 # dimension is distributed over the different sectors, and what the
 # truncation error is.
        chi, dims, rel_err = type(self)._find_trunc_dim(
            all_eigs,
            eigdecomps,
            minusabs_next_eigs,
            dims,
            chis=chis,
            eps=eps,
            break_degenerate=break_degenerate,
            degeneracy_eps=degeneracy_eps,
            trunc_err_func=trunc_err_func,
            norm_sq=norm_sq,
        )

Current what I do is to add something like this after, just design for Z2-symmetric tensors

if evenTrunc:
            # This piece of codes is only designed
            # with Z2 symmetry tensor in mind
            errmeg = "The matrix should have two sectors (0,0) and (1,1)."
            assert len(dims) == 2, errmeg
            if chiSpec % 2 == 0:
                dims[(0, 0)] = int(chiSpec / 2)
                dims[(1, 1)] = int(chiSpec / 2)
            else:
                dims[(0, 0)] = int((chiSpec + 1) / 2)
                dims[(1, 1)] = int((chiSpec - 1) / 2)

where evenTrunc is a boolean variable specifying whether we want to evenly truncate among sectors or not. However, I think there must be a better way to do it.

Xinliang

@brucelyu brucelyu changed the title Evenly keep singular values among different sector for abeliantensor Evenly keep eigenvalues among different sector for abeliantensor.matrix_eig Dec 16, 2020
@brucelyu brucelyu changed the title Evenly keep eigenvalues among different sector for abeliantensor.matrix_eig Evenly keep eigenvalues among different sector for abeliantensor Dec 16, 2020
@mhauru
Copy link
Owner

mhauru commented Dec 18, 2020

Hi Xinliang,
As a quick hack for the Z2 case, what you wrote doesn't seem bad to me. I'm a little hesitant to implement something like this more generically though, mainly for two reasons:

  1. There is no equivalent behavior for non-symmetric tensors. Currently, up to machine epsilon level numerical errors, whether you decompose a Z2 tensor or the equivalent dense tensor, you get the same result. But if the sizes of the symmetry sectors are fixed to be the same, this might correspond to something like keeping the first 10 eigenvalues of the dense tensor, leaving out the 11th, but then keeping the 12th, if the 11th one happens to be in the "wrong" symmetry sector. This seems like a weird thing to do to me.
  2. Perhaps more importantly, I don't know what doing this would mean more generically than for Z2. Especially for U(1), where the number of symmetry sectors is unbounded.

Can I ask, in what context would you need this?

@brucelyu
Copy link
Author

Markus,

You may already know that I'm now combining the HOTRG with you Gilt in order to generate an RG flow that will go to the critical fixed-point tensor of, for example, the 2D Ising model.

However, in practice, when the tensor comes near to the critical fixed-point tensor, the shape of the Z2 symmetric tensor sometimes oscillates. For example, if we have bound dimension 30, one leg of the tensor sometimes has a shape going like [15,15] → [14,16] → [15,15] → [14,16] under the RG, even though the singular value spectrum of the tensor (as is defined in your Gilt-TNR paper) is already very stable. I remember I saw a similar behavior for the TRG combined with Gilt when I played with your Gilt-TNR codes, but I'm not 100% sure my memory is correct.

In my current research project, I want to find a manifestly fixed-point tensor by adding some gauge fixing procedure as Evenbly and Vidal did in their TNR paper. This is the reason why I want to have the freedom to impose the bound dimension distributed evenly between two sectors. Current, I'm using the above quick hack for the Z2 case, and it works. I just finished writing up the paper and I believe I can upload it to arXiv in a few weeks. I will tell you when I do.

Your two reasons make sense to me. So I think I will keep using my quick hack version.

@mhauru
Copy link
Owner

mhauru commented Dec 22, 2020

Ah yes, I now remember you talking about the issue of the oscillating bond dimension. Looking forward to reading your paper!

One thing that might work is providing a way for the user to specify the exact sizes of the different symmetry sectors. This would be independent of whether it's Z2 or something else, and then in your case you would just have to specify that you want the dimensions of the sectors to be the same as in the previous iteration. Options like break_degenerate or truncation error thresholds would be then be disabled when this way of specifying bond dimensions is used.

@brucelyu
Copy link
Author

That is true! The freedom to specify the sizes of different sectors is really useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants