-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
best illustrated by example:
// Create SeQuant expression with r as a regular contracted index
// CP decomposition: g[i1, i2, a3, a4] = sum_r U1[i1,r] * U2[i2,r] * U3[a3,r] * U4[a4,r]
// Then contract with t1 and t2
auto U1 = ex<Tensor>(L"U1", bra{L"i_1"}, ket{}, aux{L"r_1"});
auto U2 = ex<Tensor>(L"U2", bra{L"i_2"}, ket{}, aux{L"r_1"});
auto U3 = ex<Tensor>(L"U3", bra{}, ket{L"a_3"}, aux{L"r_1"});
auto U4 = ex<Tensor>(L"U4", bra{}, ket{L"a_4"}, aux{L"r_1"});
auto t1 = ex<Tensor>(L"t1", bra{L"a_3"}, ket{L"i_1"});
auto t2 = ex<Tensor>(L"t2", bra{L"a_4"}, ket{L"i_2"});
Variable R(L"R");
// Simplified test: just two CP factors to debug
ExprPtr product = U1 * U2 * U3 * U4 * t1 * t2;
results in this TextGenerator export
Declare index i_1
Declare index i_2
Declare index a_3
Declare index a_4
Declare index r_1
Declare variable R
Declare tensor I[i_1, i_2]
Declare tensor I[i_2, a_4]
Declare tensor I[i_1, i_2, a_3]
Declare tensor I[i_1, i_2, a_3, a_4]
Declare tensor U1[i_1, r_1]
Declare tensor U2[i_2, r_1]
Declare tensor U3[a_3, r_1]
Declare tensor U4[a_4, r_1]
Declare tensor t1[a_3, i_1]
Declare tensor t2[a_4, i_2]
Create R and initialize to zero
Create I[i_2, a_4] and initialize to zero
Create I[i_1, i_2, a_3, a_4] and initialize to zero
Create I[i_1, i_2, a_3] and initialize to zero
Create I[i_1, i_2] and initialize to zero
Load U1[i_1, r_1]
Load U2[i_2, r_1]
Compute I[i_1, i_2] += U1[i_1, r_1] U2[i_2, r_1]
Unload U2[i_2, r_1]
Unload U1[i_1, r_1]
Load U3[a_3, r_1]
Compute I[i_1, i_2, a_3] += I[i_1, i_2] U3[a_3, r_1]
Unload U3[a_3, r_1]
Unload I[i_1, i_2]
Load U4[a_4, r_1]
Compute I[i_1, i_2, a_3, a_4] += I[i_1, i_2, a_3] U4[a_4, r_1]
Unload U4[a_4, r_1]
Unload I[i_1, i_2, a_3]
Load t1[a_3, i_1]
Compute I[i_2, a_4] += I[i_1, i_2, a_3, a_4] t1[a_3, i_1]
Unload t1[a_3, i_1]
Unload I[i_1, i_2, a_3, a_4]
Load t2[a_4, i_2]
Compute R += I[i_2, a_4] t2[a_4, i_2]
Unload t2[a_4, i_2]
Unload I[i_2, a_4]
Persist R
Clearly binarizer does not deduce indices of intermediates correctly.
P.S. @ajay-mk until this is resolved no PT for you
Metadata
Metadata
Assignees
Labels
No labels