define an operator which has distributive property

38 views
Skip to first unread message

Anupam Ah

unread,
Mar 7, 2023, 10:05:06 AM3/7/23
to xAct Tensor Computer Algebra
Hi,

  Maybe this is a trivial query. I want to define some operators, let me denote as \delta and \delta^\prime as an example. Initially I want to keep this as abstract, but  want to have similar properties of derivatives such as associative and leibniz property like

\delta(A + B) = \delta(A + B),
\delta (A B)= A \delta(B) + \delta(A) B

similar properties hold for delta^\prime also. 

Can you guys help?

Thanks,

Anupam

Jose

unread,
Mar 14, 2023, 3:34:33 AM3/14/23
to xAct Tensor Computer Algebra
Hi,

There are several ways to do this. A possibility is to use xTensor's internal tool to define derivative operators:

<< xAct`xTensor`

xAct`xTensor`Private`MakeLinearDerivative[{derL, derR}, True]

Then now we have:

In[8]:= derL[a + b]
Out[8]= derR[a] + derR[b]

In[9]:= derL[a b]
Out[9]= b derR[a] + a derR[b]

Note how we write derL in input and we get derR in output. This can be useful when derL has patterns but derR does not, say for example with covariant derivatives like

xAct`xTensor`Private`MakeLinearDerivative[{cd[a_], cd[a]}, True]

Then we can use

In[11]:= cd[b][x y]
Out[11]= y cd[b][x] + x cd[b][y]

The True in the second argument indicates that the Leibniz rule is needed. If we use False then only linearity over Plus is implemented.

Cheers,
Jose.
Reply all
Reply to author
Forward
0 new messages