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

tt2qtt #8

Open
qxy4212 opened this issue Dec 10, 2019 · 1 comment
Open

tt2qtt #8

qxy4212 opened this issue Dec 10, 2019 · 1 comment

Comments

@qxy4212
Copy link

qxy4212 commented Dec 10, 2019

Hi Dr. Gelß,
Thanks a lot for this awesome library,I am a novice in this field ,Can you give me an example in line 990?t_qtt = tt2qtt(t, [M_1, ..., M_d], [N_1, ..., N_d])

Thanks

@PGelss
Copy link
Owner

PGelss commented Jan 7, 2020

Hello,

thank you for your interest in our toolbox. For the conversion from tt to qtt (or in other words the further splitting of a given set of TT cores), you can try the following code:

import scikit_tt.tensor_train as tt

# create a random tensor-train operator with rank 2
t = tt.rand([2, 4, 8], [3, 6, 12], ranks = 2)
print(t)

# split the second core into two and the third core into 3 cores
t_qtt = t.tt2qtt([[2], [2, 2], [2, 2, 2]], [[3], [2, 3], [2, 2, 3]])
print(t_qtt)

t is an order-3 tensor train with row dimensions (2, 4, 8) and column dimensions (3, 6, 12), whereas t_qtt is an order-6 tensor with row dimensions (2, 2, 2, 2, 2, 2) and column dimensions (3, 2, 3, 2, 2, 3). However, their matricizations would be the same (up to numerical errors). Note that the product of the entries in each of the sublists must be equal to the original dimensions, e.g., 12 = 2*2*3.

Best regards,
Patrick

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