Using cadabra to calculate antisymmetric tensor field

In summary: Unfortunately, I'm not familiar enough with Cadabra to provide a definite answer for this. From what I've read in the documentation, you should be able to use the @map command to specify multiple substitutions, but I haven't tried it myself. You may also want to consider using the @substitute_only command, which allows you to specify which types of objects you want to apply the substitution to. I hope this helps!
  • #1
aries0152
15
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
  • #2
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?]
 
  • #3
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.
 
  • #4
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:
  • #5
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?
 
  • #6
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:
 
  • #7
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.)
 
  • #8
Yes, when I have run the command @canonicalise!(@); it got stuck. Adding the bracket solve my problem. Thank you. :smile: :smile:
 

1. What is cadabra and how can it be used to calculate antisymmetric tensor fields?

Cadabra is a computer algebra system designed specifically for the needs of field theory and differential geometry. It allows for the manipulation of mathematical expressions involving tensors, differential forms, and other fields. To calculate antisymmetric tensor fields, one can use the built-in functions and algorithms in cadabra to perform operations such as differentiation, contraction, and integration on these fields.

2. What are the advantages of using cadabra for calculating antisymmetric tensor fields?

One major advantage is the ability to handle complicated tensor expressions and perform calculations with high precision. Cadabra also allows for symbolic manipulation, making it easier to deal with abstract mathematical concepts. Additionally, the program has a built-in tensor simplification algorithm, which can greatly reduce the amount of manual work needed in calculations.

3. Can cadabra be used for any type of antisymmetric tensor field?

Yes, cadabra can be used to calculate antisymmetric tensor fields of any rank and dimension. The program has a flexible framework that can handle various types of tensors, including metric tensors, partial derivatives, and Lie derivatives. It also supports different coordinate systems, making it applicable to different geometric spaces.

4. Is it necessary to have a background in programming to use cadabra for calculating antisymmetric tensor fields?

While some basic knowledge of programming may be helpful, it is not necessary to use cadabra for calculating antisymmetric tensor fields. The program has a user-friendly interface and a comprehensive documentation that provides step-by-step instructions on how to perform calculations. Users can also find many tutorials and examples online to help them get started.

5. Are there any limitations to using cadabra for calculating antisymmetric tensor fields?

There may be some limitations depending on the complexity of the calculations and the capabilities of the computer being used. Cadabra is a powerful tool, but it may not be able to handle extremely large or complicated tensor expressions. In such cases, it may be necessary to break down the calculations into smaller steps or use alternative methods.

Similar threads

  • Special and General Relativity
Replies
9
Views
529
  • Special and General Relativity
Replies
2
Views
568
  • Special and General Relativity
Replies
2
Views
970
  • Special and General Relativity
Replies
10
Views
702
  • Special and General Relativity
Replies
3
Views
2K
  • Special and General Relativity
Replies
22
Views
2K
  • Special and General Relativity
2
Replies
62
Views
3K
  • Special and General Relativity
Replies
4
Views
686
  • Special and General Relativity
Replies
4
Views
3K
  • Special and General Relativity
Replies
7
Views
2K
Back
Top