Mathematica Asked on October 22, 2021
Is it possible to find the derivative of components of a real antisymmetric matrix using index notation? Eg: I have a very large real antisymmetric matrix. Then from Matrix Cookbook, we know the formula that: $$frac{dx_{kell}}{dx_{betaalpha}}=delta_{kbeta}delta_{lalpha}-delta_{kalpha}delta_{lbeta}$$ This formula is a general one and can be applied to any indices. So is there a way to define this in Mathematica for any general indices? That means even if I use, $$frac{dx_{ab}}{dx_{cd}}$$,it should return the answer without any other definition. Is this possible? Please help as I am new to Mathematica. Some other equations that can be obtained from the above relation of differentiation real antisymmetric matrices are given as: $$frac{d}{dx_{betaalpha}}left(x_{upsilon l}x_{kmu}right)=left(delta_{upsilonbeta}delta_{lalpha}-delta_{upsilonalpha}delta_{lbeta}right)x_{kmu}+x_{upsilon l}left(delta_{kbeta}delta_{mualpha}-delta_{kalpha}delta_{mubeta}right)$$ $$frac{d}{dx_{betaalpha}}left(x_{kalpha}x_{beta l}right)=-2left(D-1right)x_{lk}=2left(D-1right)x_{kl}$$ $$frac{d}{dx_{betaalpha}}x_{jalpha}=delta_{jbeta}delta_{alphaalpha}-delta_{jalpha}delta_{alphabeta}=left(D-1right)delta_{jbeta}$$ But my issue is that this is not the only indices I need to use. I need to find out the same with other indices. So is there is a way that Mathematica can find it automatically. Also in the below expression, I have implemented the product rule. $$frac{d}{dx_{betaalpha}}left(x_{upsilon l}x_{kmu}right)=left(delta_{upsilonbeta}delta_{lalpha}-delta_{upsilonalpha}delta_{lbeta}right)x_{kmu}+x_{upsilon l}left(delta_{kbeta}delta_{mualpha}-delta_{kalpha}delta_{mubeta}right)$$ So if these things can be calculated by Mathematica, then I can check my calculations. D is the dimension of the real antisymmetric matrices. $$ sum_{ijkl}f_{ijkl}=-sum_{ijkl}f_{jikl} $$ The above tensor f is defined in such a way that we can exchange it’s indices such a way that one exchange of neighboring indices results in a negative sign. Two nearby exchanges result in no change in sign. $$ sum_{ijkl}f_{ijkl}x_{kalpha}^{-}frac{dx_{ij}^{+}}{dx_{betaalpha}}x_{betaell}^{+} $$ $$= sum_{ijkl}f_{ijkl}x_{kalpha}^{-}left(delta_{ibeta}delta_{jalpha}-delta_{ialpha}delta_{jbeta}right)x_{betaell}^{+}$$ $$=sum_{ijkl}f_{ijkl} x_{kalpha}^{-}x_{betaell}^{+}delta_{ibeta}delta_{jalpha}-sum_{ijkl}f_{ijkl}x_{kalpha}^{-}x_{betaell}^{+}delta_{ialpha}delta_{jbeta}$$ $$=sum_{ijkl}f_{ijkl} x_{kj}^{-}x_{iell}^{+}-sum_{ijkl}f_{ijkl}x_{ki}^{-}x_{jell}^{+}$$ $$= sum_{ijkl}f_{ijkl}x_{kj}^{-}x_{iell}^{+}-sum_{jikl}f_{jikl}x_{kj}^{-}x_{iell}^{+}$$ $$= sum_{ijkl}f_{ijkl}x_{kj}^{-}x_{iell}^{+}+sum_{ijkl}f_{jikl}x_{kj}^{-}x_{iell}^{+}$$ $$= 2sum_{ijkl}f_{ijkl}x_{kj}^{-}x_{iell}^{+} $$ Utilizing the antisymmetric property of x matrices we can rewrite the above expression as: $$ sum_{ijkl}f_{ijkl}x_{kalpha}^{-}frac{dx_{ij}^{+}}{dx_{betaalpha}}x_{betaell}^{+}=-2sum_{ijkl}f_{ijkl}x_{jk}^{+}x_{iell}^{+} $$ We have $$ x_{kj}^{-}=x_{kj}-idelta_{kj}=-x_{jk}-idelta_{kj}=-x_{jk}^{+} $$
When I try to evaluate the following code:
myD[x[v, l] - x[β, α], x[p, u]]
with the following before,
myD[a_ - b_, c_] := myD[a, c] - myD[b, c]
myD[a_ + b_, c_] := myD[a, c] + myD[b, c]
It’s returning zero.
After a second thought I notice it's not that hard to implement:
ClearAll[myD, δ]
myD[x_[k_, l_], x_[β_, α_]] := δ[k, β] δ[l, α] - δ[k, α] δ[l, β]
myD[a_ b_, c_] := a myD[b, c] + b myD[a, c]
SetAttributes[δ, Orderless]
δ /: δ[a_, b_] h_[former___, b_, latter___] := h[former, a, latter]
δ[a_, a_] = [FormalCapitalD];
The following rule isn't necessary but will make the output pretty:
Format[δ[a_, b_]] := Subscript[δ, a, b]
Format[x[a_, b_]] := Subscript[x, a, b]
Test:
myD[x[a, b], x[c, d]]
myD[x[v, l] x[k, μ], x[β, α]]
myD[x[k, α] x[β, l], x[β, α]] // Simplify
myD[x[j, α], x[β, α]]
myD[x[v, l] x[k, μ], x[β, α]]
The property of antisymmetric matrix isn't used in the calculation above so I don't implement it, but it should be easy to add if needed.
As to the new example, just define the following rule for f
:
Clear[f]
f[arg__] /; ! OrderedQ@{arg} := Signature@{arg} f @@ Sort@{arg}
Then the index of f
will be sorted in lexicographical order (dictionary order).
Again, the following is not necessary, but will make the output pretty:
Format[f[arg__]] := Subscript[f, arg]
Test:
f[j, i, k, l]
f[i, j, k, l] x[k, α] myD[x[i, j], x[β, α]] x[β, l] // Simplify
% /. {α -> j, β -> i}
Still, the antisymmetric property of x
doesn't play a role here so I don't implement it, but you can add the property in the same manner as defining f
.
Answered by xzczd on October 22, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP