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

Action of mpa.compress() without arguments #35

Open
milan-hl opened this issue May 4, 2017 · 2 comments
Open

Action of mpa.compress() without arguments #35

milan-hl opened this issue May 4, 2017 · 2 comments

Comments

@milan-hl
Copy link
Collaborator

milan-hl commented May 4, 2017

I expected that mpa.compress() without arguments would not perform compression except maybe ensure normalization. This would be useful in order to make compression optional: No arguments cause no compression to be performed.

However, both mpa.compress() and mpa.compression() perform SVD compression without bdim and relerr, i.e. they truncate singular values which are equal to zero. This does not occur frequently. In many cases, this will not reduce the bond dimension by more than a simple mpa.normalize() and CPU time is wasted.

I suggest to change change the two methods to not run SVD compression if method='SVD' is not specified. @dseuss, do you agree?

@dsuess
Copy link
Owner

dsuess commented May 15, 2017

But why would you want to call compress in the first place if you don't want to compress?
I actually think that the current behavior makes sense: It compresses as much as it can without altering the actual tensor. I sometimes use it to get rid of an unnecesarrily high rank:

In [1]: import mpnum as mp
In [2]: a = mp.random_mpa(4, 2, 10, force_bdim=True)
In [3]: a.bdims
Out[3]: (10, 10, 10)
In [4]: a.compression()[0].bdims
Out[4]: (2, 4, 2)

@milan-hl
Copy link
Collaborator Author

I like your off-line suggestion of using compression(method='none') to provide an easy means of replacing compression by a no-op and keeping the current behaviour of compression(). I should implement it soon.

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