Summation of Kronecker deltas should give the dimension
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I have a really simple problem but I don't know how to solve it. Basically, I am doing vecor manipulation and I am summing a lot of Kronecker delta here and there. How can I teach Mathematica that for any sum of the form $
sum_i=1^ddelta_munudelta_munu=d $.
I tried
$Assumptions = Sum[KroneckerDelta[μ, ν] KroneckerDelta[μ, ν], u, 1,
d, μ, 1, d] == d
Which does not work. To be precise, consider a Ansatz of the following form, depending on a vector $vecs$ and some coefficients.
customAnsatzC[s_, μ_, ν_, λ_, Ã_] := C1 s.s KroneckerDelta[μ, ν] KroneckerDelta[λ, Ã] +
C2 s.s (KroneckerDelta[μ, Ã] KroneckerDelta[λ, ν] +
KroneckerDelta[μ, λ]KroneckerDelta[ν, Ã]);
When I take the Trace of something like this, it gives back
Sum[KroneckerDelta[μ, ν] KroneckerDelta[λ, Ã] customAnsatzC[s1, s2, s3,
s4, μ, ν, λ, Ã], λ, 1, 4, Ã, 1, 4, μ, 1, 4, ν, 1, 4] // FullSimplify
This gives back $8 (2 C1 + C2) (s1^2 + s2^2 + s3^2 + s4^2)$ but I would like it to give back $(d^2C1 + 2dC2)(s1^2+s2^2+s3^2+s4^2)$ instead. Is there a way to do this ?
linear-algebra vector tensors vector-calculus
add a comment |Â
up vote
1
down vote
favorite
I have a really simple problem but I don't know how to solve it. Basically, I am doing vecor manipulation and I am summing a lot of Kronecker delta here and there. How can I teach Mathematica that for any sum of the form $
sum_i=1^ddelta_munudelta_munu=d $.
I tried
$Assumptions = Sum[KroneckerDelta[μ, ν] KroneckerDelta[μ, ν], u, 1,
d, μ, 1, d] == d
Which does not work. To be precise, consider a Ansatz of the following form, depending on a vector $vecs$ and some coefficients.
customAnsatzC[s_, μ_, ν_, λ_, Ã_] := C1 s.s KroneckerDelta[μ, ν] KroneckerDelta[λ, Ã] +
C2 s.s (KroneckerDelta[μ, Ã] KroneckerDelta[λ, ν] +
KroneckerDelta[μ, λ]KroneckerDelta[ν, Ã]);
When I take the Trace of something like this, it gives back
Sum[KroneckerDelta[μ, ν] KroneckerDelta[λ, Ã] customAnsatzC[s1, s2, s3,
s4, μ, ν, λ, Ã], λ, 1, 4, Ã, 1, 4, μ, 1, 4, ν, 1, 4] // FullSimplify
This gives back $8 (2 C1 + C2) (s1^2 + s2^2 + s3^2 + s4^2)$ but I would like it to give back $(d^2C1 + 2dC2)(s1^2+s2^2+s3^2+s4^2)$ instead. Is there a way to do this ?
linear-algebra vector tensors vector-calculus
What are the dummy indices, exactly?
– Î‘λÎÂξανδÃÂο Ζεγγ
6 hours ago
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a really simple problem but I don't know how to solve it. Basically, I am doing vecor manipulation and I am summing a lot of Kronecker delta here and there. How can I teach Mathematica that for any sum of the form $
sum_i=1^ddelta_munudelta_munu=d $.
I tried
$Assumptions = Sum[KroneckerDelta[μ, ν] KroneckerDelta[μ, ν], u, 1,
d, μ, 1, d] == d
Which does not work. To be precise, consider a Ansatz of the following form, depending on a vector $vecs$ and some coefficients.
customAnsatzC[s_, μ_, ν_, λ_, Ã_] := C1 s.s KroneckerDelta[μ, ν] KroneckerDelta[λ, Ã] +
C2 s.s (KroneckerDelta[μ, Ã] KroneckerDelta[λ, ν] +
KroneckerDelta[μ, λ]KroneckerDelta[ν, Ã]);
When I take the Trace of something like this, it gives back
Sum[KroneckerDelta[μ, ν] KroneckerDelta[λ, Ã] customAnsatzC[s1, s2, s3,
s4, μ, ν, λ, Ã], λ, 1, 4, Ã, 1, 4, μ, 1, 4, ν, 1, 4] // FullSimplify
This gives back $8 (2 C1 + C2) (s1^2 + s2^2 + s3^2 + s4^2)$ but I would like it to give back $(d^2C1 + 2dC2)(s1^2+s2^2+s3^2+s4^2)$ instead. Is there a way to do this ?
linear-algebra vector tensors vector-calculus
I have a really simple problem but I don't know how to solve it. Basically, I am doing vecor manipulation and I am summing a lot of Kronecker delta here and there. How can I teach Mathematica that for any sum of the form $
sum_i=1^ddelta_munudelta_munu=d $.
I tried
$Assumptions = Sum[KroneckerDelta[μ, ν] KroneckerDelta[μ, ν], u, 1,
d, μ, 1, d] == d
Which does not work. To be precise, consider a Ansatz of the following form, depending on a vector $vecs$ and some coefficients.
customAnsatzC[s_, μ_, ν_, λ_, Ã_] := C1 s.s KroneckerDelta[μ, ν] KroneckerDelta[λ, Ã] +
C2 s.s (KroneckerDelta[μ, Ã] KroneckerDelta[λ, ν] +
KroneckerDelta[μ, λ]KroneckerDelta[ν, Ã]);
When I take the Trace of something like this, it gives back
Sum[KroneckerDelta[μ, ν] KroneckerDelta[λ, Ã] customAnsatzC[s1, s2, s3,
s4, μ, ν, λ, Ã], λ, 1, 4, Ã, 1, 4, μ, 1, 4, ν, 1, 4] // FullSimplify
This gives back $8 (2 C1 + C2) (s1^2 + s2^2 + s3^2 + s4^2)$ but I would like it to give back $(d^2C1 + 2dC2)(s1^2+s2^2+s3^2+s4^2)$ instead. Is there a way to do this ?
linear-algebra vector tensors vector-calculus
linear-algebra vector tensors vector-calculus
edited 4 hours ago


Carl Woll
63.6k282165
63.6k282165
asked 6 hours ago
Ezareth
708
708
What are the dummy indices, exactly?
– Î‘λÎÂξανδÃÂο Ζεγγ
6 hours ago
add a comment |Â
What are the dummy indices, exactly?
– Î‘λÎÂξανδÃÂο Ζεγγ
6 hours ago
What are the dummy indices, exactly?
– Î‘λÎÂξανδÃÂο Ζεγγ
6 hours ago
What are the dummy indices, exactly?
– Î‘λÎÂξανδÃÂο Ζεγγ
6 hours ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
6
down vote
You could just do:
Sum[KroneckerDelta[μ, ν] KroneckerDelta[μ, ν], ν, d, μ, d, Assumptions->d>1]
d
Although it might make sense to use symbolic tensors instead, e.g., something like:
Tr[IdentityMatrix[d] . IdentityMatrix[d]]
although in this case you would need some extra code for simplification (as you can find in my TensorSimplify
package). Install the paclet with:
PacletInstall[
"TensorSimplify",
"Site" -> "http://raw.githubusercontent.com/carlwoll/TensorSimplify/master"
]
Once installed, you can load the package with:
<<TensorSimplify`
Then:
Tr[IdentityMatrix[d] . IdentityMatrix[d]] //TensorSimplify
d
Update
(For the updated question)
Using symbolic tensors, your customAnsatz
function can be written:
IXI = TensorProduct[IdentityMatrix[d], IdentityMatrix[d]];
ansatz[s_] := s.s (
C1 IXI +
C2 (TensorTranspose[IXI, 1, 4, 3, 2] + TensorTranspose[IXI, 1,3,2,4])
)
Then, your sum can be written:
$Assumptions = (C1|C2) ∈ Complexes && s ∈ Vectors[d];
TensorContract[
TensorProduct[IXI, ansatz[s]],
1, 5, 2, 6, 3, 7, 4, 8
] //TensorSimplify
2 C2 d s.s + C1 d^2 s.s
Thank you for your answer. I updated the question more specifically to what I am actually needing. Would be wonderful if you could have a second look.
– Ezareth
4 hours ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
You could just do:
Sum[KroneckerDelta[μ, ν] KroneckerDelta[μ, ν], ν, d, μ, d, Assumptions->d>1]
d
Although it might make sense to use symbolic tensors instead, e.g., something like:
Tr[IdentityMatrix[d] . IdentityMatrix[d]]
although in this case you would need some extra code for simplification (as you can find in my TensorSimplify
package). Install the paclet with:
PacletInstall[
"TensorSimplify",
"Site" -> "http://raw.githubusercontent.com/carlwoll/TensorSimplify/master"
]
Once installed, you can load the package with:
<<TensorSimplify`
Then:
Tr[IdentityMatrix[d] . IdentityMatrix[d]] //TensorSimplify
d
Update
(For the updated question)
Using symbolic tensors, your customAnsatz
function can be written:
IXI = TensorProduct[IdentityMatrix[d], IdentityMatrix[d]];
ansatz[s_] := s.s (
C1 IXI +
C2 (TensorTranspose[IXI, 1, 4, 3, 2] + TensorTranspose[IXI, 1,3,2,4])
)
Then, your sum can be written:
$Assumptions = (C1|C2) ∈ Complexes && s ∈ Vectors[d];
TensorContract[
TensorProduct[IXI, ansatz[s]],
1, 5, 2, 6, 3, 7, 4, 8
] //TensorSimplify
2 C2 d s.s + C1 d^2 s.s
Thank you for your answer. I updated the question more specifically to what I am actually needing. Would be wonderful if you could have a second look.
– Ezareth
4 hours ago
add a comment |Â
up vote
6
down vote
You could just do:
Sum[KroneckerDelta[μ, ν] KroneckerDelta[μ, ν], ν, d, μ, d, Assumptions->d>1]
d
Although it might make sense to use symbolic tensors instead, e.g., something like:
Tr[IdentityMatrix[d] . IdentityMatrix[d]]
although in this case you would need some extra code for simplification (as you can find in my TensorSimplify
package). Install the paclet with:
PacletInstall[
"TensorSimplify",
"Site" -> "http://raw.githubusercontent.com/carlwoll/TensorSimplify/master"
]
Once installed, you can load the package with:
<<TensorSimplify`
Then:
Tr[IdentityMatrix[d] . IdentityMatrix[d]] //TensorSimplify
d
Update
(For the updated question)
Using symbolic tensors, your customAnsatz
function can be written:
IXI = TensorProduct[IdentityMatrix[d], IdentityMatrix[d]];
ansatz[s_] := s.s (
C1 IXI +
C2 (TensorTranspose[IXI, 1, 4, 3, 2] + TensorTranspose[IXI, 1,3,2,4])
)
Then, your sum can be written:
$Assumptions = (C1|C2) ∈ Complexes && s ∈ Vectors[d];
TensorContract[
TensorProduct[IXI, ansatz[s]],
1, 5, 2, 6, 3, 7, 4, 8
] //TensorSimplify
2 C2 d s.s + C1 d^2 s.s
Thank you for your answer. I updated the question more specifically to what I am actually needing. Would be wonderful if you could have a second look.
– Ezareth
4 hours ago
add a comment |Â
up vote
6
down vote
up vote
6
down vote
You could just do:
Sum[KroneckerDelta[μ, ν] KroneckerDelta[μ, ν], ν, d, μ, d, Assumptions->d>1]
d
Although it might make sense to use symbolic tensors instead, e.g., something like:
Tr[IdentityMatrix[d] . IdentityMatrix[d]]
although in this case you would need some extra code for simplification (as you can find in my TensorSimplify
package). Install the paclet with:
PacletInstall[
"TensorSimplify",
"Site" -> "http://raw.githubusercontent.com/carlwoll/TensorSimplify/master"
]
Once installed, you can load the package with:
<<TensorSimplify`
Then:
Tr[IdentityMatrix[d] . IdentityMatrix[d]] //TensorSimplify
d
Update
(For the updated question)
Using symbolic tensors, your customAnsatz
function can be written:
IXI = TensorProduct[IdentityMatrix[d], IdentityMatrix[d]];
ansatz[s_] := s.s (
C1 IXI +
C2 (TensorTranspose[IXI, 1, 4, 3, 2] + TensorTranspose[IXI, 1,3,2,4])
)
Then, your sum can be written:
$Assumptions = (C1|C2) ∈ Complexes && s ∈ Vectors[d];
TensorContract[
TensorProduct[IXI, ansatz[s]],
1, 5, 2, 6, 3, 7, 4, 8
] //TensorSimplify
2 C2 d s.s + C1 d^2 s.s
You could just do:
Sum[KroneckerDelta[μ, ν] KroneckerDelta[μ, ν], ν, d, μ, d, Assumptions->d>1]
d
Although it might make sense to use symbolic tensors instead, e.g., something like:
Tr[IdentityMatrix[d] . IdentityMatrix[d]]
although in this case you would need some extra code for simplification (as you can find in my TensorSimplify
package). Install the paclet with:
PacletInstall[
"TensorSimplify",
"Site" -> "http://raw.githubusercontent.com/carlwoll/TensorSimplify/master"
]
Once installed, you can load the package with:
<<TensorSimplify`
Then:
Tr[IdentityMatrix[d] . IdentityMatrix[d]] //TensorSimplify
d
Update
(For the updated question)
Using symbolic tensors, your customAnsatz
function can be written:
IXI = TensorProduct[IdentityMatrix[d], IdentityMatrix[d]];
ansatz[s_] := s.s (
C1 IXI +
C2 (TensorTranspose[IXI, 1, 4, 3, 2] + TensorTranspose[IXI, 1,3,2,4])
)
Then, your sum can be written:
$Assumptions = (C1|C2) ∈ Complexes && s ∈ Vectors[d];
TensorContract[
TensorProduct[IXI, ansatz[s]],
1, 5, 2, 6, 3, 7, 4, 8
] //TensorSimplify
2 C2 d s.s + C1 d^2 s.s
edited 4 hours ago
answered 6 hours ago


Carl Woll
63.6k282165
63.6k282165
Thank you for your answer. I updated the question more specifically to what I am actually needing. Would be wonderful if you could have a second look.
– Ezareth
4 hours ago
add a comment |Â
Thank you for your answer. I updated the question more specifically to what I am actually needing. Would be wonderful if you could have a second look.
– Ezareth
4 hours ago
Thank you for your answer. I updated the question more specifically to what I am actually needing. Would be wonderful if you could have a second look.
– Ezareth
4 hours ago
Thank you for your answer. I updated the question more specifically to what I am actually needing. Would be wonderful if you could have a second look.
– Ezareth
4 hours ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f185053%2fsummation-of-kronecker-deltas-should-give-the-dimension%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
What are the dummy indices, exactly?
– Î‘λÎÂξανδÃÂο Ζεγγ
6 hours ago