ContractMetric not working with Wedge and CovD - xTerior

50 views
Skip to first unread message

Juan Margalef

unread,
Aug 9, 2024, 5:02:49 PMAug 9
to xAct Tensor Computer Algebra
Hello everyone,

I have found an expected behaviour of ContractMetric on xTerior (although the same happens with any other graded product defined with DefProduct) when Wedge and CovD are present.

    g[b, e] Wedge[Der[-e]@A[a, -b], B[-c]] // ContractMetric
    g[-b, -e] Wedge[Der[e]@A[a, b], B[-c]] // ContractMetric

are not contracted despite having the options

    SetOptions[ContractMetric, AllowUpperDerivatives -> True,OverDerivatives -> True]

 Putting the metric inside does not work either

    Wedge[g[-b, -e] Der[e]@A[a, b], B[-c]] // ContractMetric
    Wedge[g[b, e] Der[-e]@A[a, -b], B[-c]] // ContractMetric

Notice that SeparateMetric[] does work

     Wedge[g[b, e] Der[-e]@A[a, -b], B[-c]]  // SeparateMetric[]

I have attached a minimal example.

Thanks!
Juan
 

 
contractMetric.nb

Juan Margalef

unread,
Aug 19, 2024, 4:58:48 AMAug 19
to xAct Tensor Computer Algebra
I think I found a solution: changing ContractMetric1 (which in turn requires to change differentexpressionsQ)  to allow a Wedge:

differentexpressionsQ[expr1_WWedge, expr2_List] :=
 differentexpressionsQ[List @@ expr1, expr2]

(CM : ContractMetric1[{od_, aud_}, {metric_, nv_}])[
  rest_. HoldPattern[Wedge[der_?FirstDerQ[expr1_], expr2_]] met :
    metric_[b_, c_]] :=
 Module[{dm = der[met], result},
   If[(od || dm === 0) &&
     differentexpressionsQ[result = CM[expr1 met], {expr1, met}],
    rest Wedge[CM[der[result]], expr2] -
     rest Wedge[CM[dm expr1], expr2],
    rest Wedge[CM[met der[expr1]], expr2]
    ]] /; (MemberQ[FindFreeIndices[expr1],
     ChangeIndex[c] | ChangeIndex[b]] && Head[expr1] =!= metric)

In the notebook you can see the code in action.

It would be nice to have this possibility included in xAct since xAct allows to define new products (or at least in xTerior).

Best and thanks,
Juan

Juan Margalef

unread,
Aug 19, 2024, 4:59:22 AMAug 19
to xAct Tensor Computer Algebra
PS. I forgot the file. Sorry about that.

El viernes, 9 de agosto de 2024 a las 18:32:49 UTC-2:30, Juan Margalef escribió:
contractMetric_solution.nb
Reply all
Reply to author
Forward
0 new messages