Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
+1 vote

Hi, I would like to work with non-commuting objects. I dont want them to commute under any circumstance unless I told them to do so. My fields are {A{\mu}, A^{I}{\mu}, \alpha, \alpha^{I}}. The indices are free to be raised and lowered. Nevertheless in some special combinations, when partial derivatives are involved, they commute. I'm not sure if I'm making some mistake in my code or it's a bug. Here is my code:

{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}::Indices(full, position=free);
{\mu,\nu,\rho,\gamma,\kappa,\tau,\lambda,\epsilon,eta}::Indices(subspace1, position=free, parent=full);
{I,J,K,L,M,N}::Indices(subspace2, position=free, parent=full);
\partial{#}::PartialDerivative;
A{#}::Depends(\partial{#});
A{#}::SelfNonCommuting;
{A{#}, \alpha{#} ,\alpha}::NonCommuting; 
exp1:=\partial_{J}{A^{I}_{\nu}}\alpha^{K}\partial_{K}{A^{J}_{\mu}} + \partial_{K}{A^{J}_{\mu}}\alpha^{K}\partial_{J}{A^{I}_{\nu}};
unwrap(_);
sort_product(_);
canonicalise(_);
exp2:=\partial_{J}{A^{I}_{\nu}}\partial_{I}{A^{J}_{\mu}} + \partial_{I}{A^{J}_{\mu}}\partial_{J}{A^{I}_{\nu}};
unwrap(_);
sort_product(_);
canonicalise(_);

I'm expecting expression "exp1" and "exp2" to not change at all, but, however, terms in both expressions add up together. How can I avoid this to happen? Thank you in advance

Victor

in Bug reports by (200 points)

1 Answer

+1 vote

Yes, that's a bug, or rather an incompleteness, as I haven't had time to sort out what is the right thing to do for inheritance of non-commutativity that works in all situations. The problem is that the partial derivative does not automatically inherit the commutativity properties of its arguments.

For the time being, you can add

\partial{#}::SelfNonCommuting;

which enforces that any partial derivative does not commute with any other, or do something more restrictive, e.g.

\partial_{J}{A{#}}::SelfNonCommuting;
by (76.4k points)
...