Using cadabra to calculate antisymmetric tensor field

  • Context: Graduate 
  • Thread starter Thread starter aries0152
  • Start date Start date
  • Tags Tags
    Field Tensor
Click For Summary

Discussion Overview

The discussion revolves around using Cadabra software to calculate products of antisymmetric tensor fields, particularly focusing on the mathematical expressions involving derivatives and tensor products in the context of relativity and field theory.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant seeks assistance on calculating the product of two antisymmetric tensors using Cadabra, providing a specific mathematical expression.
  • Another participant suggests that the task should be straightforward in Cadabra if the documentation is studied, and questions the necessity of using Cadabra for a simple example.
  • A different participant shares their steps in using Cadabra, including defining indices and antisymmetric properties, and asks for feedback on their approach.
  • Concerns are raised about the use of the @asym command and the implications of using the "%" symbol in substitution commands, with suggestions for correcting these issues.
  • Participants discuss the need to separate time and space coordinates in their calculations, indicating that this adds complexity to the problem.
  • One participant successfully calculates a result using Cadabra and expresses gratitude for the assistance received.
  • Another participant inquires about substituting both covariant and contravariant forms of the tensor, seeking a method to handle both in their calculations.
  • A later reply indicates that declaring two separate substitutions for the covariant and contravariant forms resolves the issue.
  • Concerns are raised about properly treating partial derivatives in the context of Cadabra, with a suggestion to use braces for clarity.
  • One participant confirms that adding braces resolved an issue they encountered during the canonicalization process.

Areas of Agreement / Disagreement

Participants express varying levels of confidence in their approaches, with some agreeing on the necessity of careful handling of indices and substitutions, while others question the need for Cadabra in simpler cases. The discussion remains unresolved regarding the best practices for using Cadabra for these calculations.

Contextual Notes

Participants mention limitations related to the complexity of tensor products and the need to manage both covariant and contravariant indices, as well as the implications of metric signatures in their calculations.

aries0152
Messages
15
Reaction score
0
I was searching for a software that can calculate the tensor. I found in this forum some people suggest Cadabra (http://cadabra.phi-sci.com/) to calculate the tensors for relativity and field theory.
Can anyone help me how can I calculate the product of two antisymmetric tensor using Cadabra? like this:

[tex]\frac{1}{12}G_{\mu\nu\rho}G^{\mu\nu\rho}=\frac{1}{12}(\partial_{\mu}\phi_{\nu\rho}+\partial_{\nu} \phi_{\rho\mu}+\partial_{\rho}\phi_{\mu\nu})( \partial^{\mu}\phi^{\nu\rho}+\partial^{\nu}\phi^{ \rho \mu}+\partial^{\rho}\phi^{\mu\nu})[/tex]

Here [tex]\phi_{\mu\nu}[/tex] is antisymmetric tensor
 
Physics news on Phys.org
aries0152 said:
I was searching for a software that can calculate the tensor. I found in this forum some people suggest Cadabra (http://cadabra.phi-sci.com/) to calculate the tensors for relativity and field theory.
Can anyone help me how can I calculate the product of two antisymmetric tensor using Cadabra? like this:

[tex]\frac{1}{12}G_{\mu\nu\rho}G^{\mu\nu\rho}=\frac{1}{12}(\partial_{\mu}\phi_{\nu\rho}+\partial_{\nu} \phi_{\rho\mu}+\partial_{\rho}\phi_{\mu\nu})( \partial^{\mu}\phi^{\nu\rho}+\partial^{\nu}\phi^{ \rho \mu}+\partial^{\rho}\phi^{\mu\nu})[/tex]

Here [tex]\phi_{\mu\nu}[/tex] is antisymmetric tensor

That should be quite straightforward in Cadabra (after one has studied the documentation). There are several tutorial notebook files on the Cadabra website, and also some examples in the main documentation (also available on the website).

Since you didn't post your Cadabra notebook file (nor even a fragment), I have no idea what difficulty you're having. Maybe if you tell me which of the Cadabra example notebooks you've downloaded and tried, and what documentation you've already studied, I could say something more helpful.

[Edit: why are you trying to calculate this using Cadabra anyway? It can be done easily enough by hand since there's only 9 terms in the product. Or are you just doing a simple example to see how Cadabra works?]
 
That is what I did-
{a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u#}::Indices.
G_{a b c}::AntiSymmetric.
check:=G_{a b c}*G^{a b c};
@asym!(%){_{a},_{b},_{c}};
G:=G^{a b c} -> (
\partial^{a}\phi^{b c}+\partial^{b}\phi^{c a}+\partial^{c}\phi^{a b};
@substitute!(%)(@(G));

Are my steps correct?

[Edit: why are you trying to calculate this using Cadabra anyway? It can be done easily enough by hand since there's only 9 terms in the product.

Actually these 9 terms are not my final result. I have posted the general formate of the equation. After the multiplication, I have to separate the terms in time and space coordinates. It will give me about 12-14 separate terms from each of the 9 terms (total of 9x14=126 terms). So I think cadabra is my best bet for calculating this.
 
aries0152 said:
Are my steps correct?

Firstly, I don't think you need the explicit @asym command, because if you instead give \phi the AntiSymmetric property, G is then antisymmetric automatically.

Second, in your

G:=G^{a b c} -> \partial^{a}\phi^{b c}+\partial^{b}\phi^{c a}+\partial^{c}\phi^{a b};
@substitute!(%)(@(G));

you forgot that the "%" means "the previous expression". So your @substitute command is actually applying the G substitution specification to G itself.

Also, your substitution specification is only for contravariant G, so it won't work on the covariant G. However, if you don't care about metric signature you can put all the indices downstairs.

Doing the above, and a few more things, I worked it out this way:

{a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u#}::Indices.
\phi_{a b}::AntiSymmetric.

G := G_{a b c} -> \partial_{a}\phi_{b c}+\partial_{b}\phi_{c a}+\partial_{c}\phi_{a b};

GG := G_{a b c} G_{a b c};

@substitute!(%)(@(G));
@distribute!(%);
@canonicalise!(%);
@collect_terms!(%);

and I get the result:
[tex] GG := 3\, {\partial}_{a} {\phi}_{b c} {\partial}_{a} {\phi}_{b c} + 6\, {\partial}_{a} {\phi}_{a b} {\partial}_{c} {\phi}_{b c};[/tex]


Actually these 9 terms are not my final result. I have posted the general formate of the equation. After the multiplication, I have to separate the terms in time and space coordinates. It will give me about 12-14 separate terms from each of the 9 terms (total of 9x14=126 terms).

I guess this means metric signature matters for you, so you'll need to be more careful with upstairs/downstairs indices. You could possibly still use only covariant G and then introduce 3 Minkowski metric factors to perform the contraction. (Read up on the "Metric" property. Also the @eliminate_metric and @eliminate_kr, commands, and related stuff.) Cadabra has features to deal with separated time/space indices (IIRC), but I haven't used them so I can't offer much help there. I think one of the tutorials gives an example though.)

HTH.
 
Last edited:
strangerep said:
{a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u#}::Indices.
\phi_{a b}::AntiSymmetric.

G := G_{a b c} -> \partial_{a}\phi_{b c}+\partial_{b}\phi_{c a}+\partial_{c}\phi_{a b};

GG := G_{a b c} G_{a b c};

@substitute!(%)(@(G));
@distribute!(%);
@canonicalise!(%);
@collect_terms!(%);

and I get the result:
[tex] GG := 3\, {\partial}_{a} {\phi}_{b c} {\partial}_{a} {\phi}_{b c} + 6\, {\partial}_{a} {\phi}_{a b} {\partial}_{c} {\phi}_{b c};[/tex]

Thanks that's really helpful.
But if I want to calculate

GG := G_{a b c} G^{a b c};

How can I substitute the term 'G^{a b c}' with upper indices? I mean
G := G^{a b c} -> \partial_{a}\phi^{b c}+\partial_{b}\phi^{c a}+\partial_{c}\phi^{a b};

Because declaring

G := G_{a b c} -> \partial_{a}\phi_{b c}+\partial_{b}\phi_{c a}+\partial_{c}\phi_{a b};

Only substitute G_{a b c}.
Is there anyway that I can substitute both G_{a b c} and G^{a b c}? And give me the final result?
 
Ok, I figured it out :smile: . I have to declare two substitution by two different name-

GaG := G_{a b c} -> \partial_{a}\phi_{b c}+\partial_{b}\phi_{c a}+\partial_{c}\phi_{a b};

GbG := G^{a b c} -> \partial^{a}\phi^{b c}+\partial^{b}\phi^{c a}+\partial^{c}\phi^{a b};

Then substitute them by two different command.

@substitute!(%)(@(GaG));
@substitute!(%)(@(GbG));

Thank you for your help :smile:
 
aries0152 said:
\partial_{a}\phi_{b c}

I just noticed one more possible problem. If (later) you want to treat
\partial_{a} as a genuine partial derivative, e.g., by adding lines
like these near the start:

\partial{#}::PartialDerivative.
\phi_{a b}::Depends(\partial).

then you'll need to enclose the argument of \partial_{a} in braces.
Thus, your

\partial_{a}\phi_{b c}

should be

\partial_{a} {\phi_{b c}}

etc.

(Neglecting to do this causes a problem later in @canonicalise.)
 
Yes, when I have run the command @canonicalise!(@); it got stuck. Adding the bracket solve my problem. Thank you. :smile: :smile:
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
880
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 14 ·
Replies
14
Views
619
  • · Replies 9 ·
Replies
9
Views
2K