1
$\begingroup$

I am working with xAct / xCoba / xTras and I would like to construct a matrix out of a vector. So, I have a vector V on a manifold M:

DefManifold[M, 3, IndexRange[a, n]]
DefTensor[V[\[Mu]], M]

Now, I would like to take the outer / dyadic product to construct a 4x4 matrix on the manifold M4 by doing something like

{1,B[mu]} * {1,B[nu]}
= 
{{1 , B1    , B2    , B3},
{B1 , B1.B1 , B1.B2 , B1.B3},
{B2 , B2.B1 , B2.B2 , B2.B3},
{B3 , B3.B1 , B3.B2 , B3.B3}}

where * is the outer product and . the scalar (or dot) product between the vector components Bi.

How can this be done? Thank you very much in advance for your reply. :)

$\endgroup$
2
  • $\begingroup$ Would Outer (dyadic) product between vectors of the same index in two lists help? $\endgroup$
    – MarcoB
    Commented Nov 27, 2020 at 16:51
  • $\begingroup$ Thank you @MarcoB for your reply. Actually, Outer[Times, {1, Bi[[Mu]]}, {1, Bi[[Nu]]}]//MatrixForm looks good, but when I try Outer[Times, {1, Bi[[Mu]]}, {1, Bi[[Nu]]}] - {{1, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}} it tells me "IndexForm::nouse: Attempting to apply IndexForm on {<<2>>}." and "Thread::tdlen: Objects of unequal length in [...]". It seems that it doesn't know how long Bi[[Mu]] is. :S $\endgroup$
    – kalle
    Commented Nov 29, 2020 at 12:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.