cadabra2 icon indicating copy to clipboard operation
cadabra2 copied to clipboard

canonicalise with numeric indices

Open slazav opened this issue 3 years ago • 2 comments

{a,b,c}::Indices;
{a,b,c}::Integer(1..3);

ex := (n_{3})**2 n_{a};
canonicalise(_);

Result: RuntimeError: Internal error in fill_index_position_map; cannot find index 1.

Sorry for so many issues. I'm trying to apply this program to my calculations and still can't go through such things:)

slazav avatar Jan 19 '22 17:01 slazav

Similar problem with epsilon_to_delta:

{a,b,c,i,j,k}::Indices;
{a,b,c,i,j,k}::Integer(1..3);
{d{#}}::KroneckerDelta;
{e_{a b c}}::EpsilonTensor(delta=d);
ex := e_{a j 3} e_{a k 3} n_{j} n_{k};
epsilon_to_delta(_);

Result: RuntimeError: No dimension known for summation index. Expected: n_{k} n_{k}-n_{3} n_{3}

slazav avatar Jan 19 '22 18:01 slazav

The second issue is resolved through a different bug fix. The first one is due to the power appearing in your expression. Canonicalise really isn't meant for that, and should probably refuse to work on expressions which contains powers of tensor components, but you can get around it by first calling expand_power.

kpeeters avatar Jan 29 '22 22:01 kpeeters

These seem to work now as expected, feel free to re-open the issue if this is still a problem.

kpeeters avatar Jan 01 '24 21:01 kpeeters

Thank you, I will check it!

slazav avatar Jan 01 '24 21:01 slazav