Hi all,
I'm having problems using VarD and VarAction (defined in the notebook ActionVariation_Metric_Fields.nb by Cyril Pitrou) when the lagrangian is defined in terms of the components from xCoba.
I think the problem reduces to applying a variation to an expression with different scalar functions and their derivatives.
VarD and VarAction seem to recognize only tensors. I've tried making a rule to write the scalar functions to "scalar tensors" (i.e. Tensor with no indices). This works for the scalar functions but not for the derivatives of the scalar functions. I haven't been able to write a rule that converts derivatives of a function in a specific basis to derivatives of a tensor that works with VarD or VarAction. I think both use ToCanonical which doesn't work well with partial derivatives.
I'm attaching a simplified notebook that shows the issue but I'm happy to share the notebook with the full problem if this is too simplified. Please let me know if there's something very basic that I'm missing.
Best wishes,
Sergi