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

When I use 'canonicalise', I find following code won't give right results

{\mu,\nu,\rho,\sigma}::Indices(vector).
A^{\mu\nu}::Symmetric.
B^{\mu\nu}::AntiSymmetric.
\tr{#}::LaTeXForm("{\rm Tr}").
\tr{#}::Trace.
\epsilon^{\mu\nu\rho\sigma}::EpsilonTensor.
{A^{\mu\nu}, B^{\mu\nu}}::ImplicitIndex.

ex1:=\epsilon^{\mu\nu\rho\sigma}\tr{A^{\mu\nu} B^{\rho\sigma}};
canonicalise(_);

ex2:=\epsilon^{\mu\nu\rho\sigma} \tr{A^{\mu\nu} B^{\rho\sigma}}+\epsilon^{\mu\nu\rho\sigma} \tr{A^{\nu\mu} B^{\rho\sigma}};
canonicalise(_);

ex3:=\tr{A^{\mu\nu}}\tr{B^{\mu\nu}};
canonicalise(_);
in Bug reports by (2.2k points)
edited by

1 Answer

+1 vote
 
Best answer

Well spotted, thanks for reporting this. I have just pushed a fix to github that handles part of the problem (when the content of the trace is a simple tensor, not a sum or product). The problem was (and to some extent still is) that the symmetries did not make it 'out of' the trace. Will post here when a full solution is available.

by (82.5k points)
selected by

Final fix now on github. Note that if you have a trace containing a sum, you will still need to distribute the trace over the individual terms before canonicalise can pick up any index symmetries (just like when you canonicalise things like A_{m n} * (B^{m n} + C^{m n})).

Thanks, but I can't build successfully, and I get the folllowing errors

[ 44%] Built target cadabra2cadabra
Scanning dependencies of target cadabra2
make[2]: *** No rule to make target 'core/CMakeFiles/cadabra2.dir/build'.  Stop.
CMakeFiles/Makefile2:390: recipe for target 'core/CMakeFiles/cadabra2.dir/all' failed
make[1]: *** [core/CMakeFiles/cadabra2.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

Did you nuke your build directory first?

I have removed the whole file "cadabra2", and git clone agian.

That error does not make any sense, it complains that it does not know how to create a build directory. Have you messed with make/cmake or related tools recently? It builds fine here on various machines from a clean clone.

I don't remember if I have fiddled with make/cmake tool or related tools recently. I find when I write 'cmake ..', the following errors will arise

CMake Error at libs/pybind11/tools/pybind11Tools.cmake:131 (add_library):
  Cannot find source file:

    properties/TableauInherit.cc

  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx
Call Stack (most recent call first):
  core/CMakeLists.txt:275 (pybind11_add_module)


CMake Error: CMake can not determine linker language for target: cadabra2
CMake Error: Cannot determine link language for target "cadabra2".

Do you get more information from it?

Ah, that was my fault. Missing files. Pull again from github, just pushed them.

Ok, It works now. Nice work.

Hi @kasper, I find another bug

{\mu,\nu,\rho}::Indices(vector).
\nabla{#}::Derivative.
V^{\mu\nu}::AntiSymmetric.
u^{\mu}::SelfNonCommuting.
u^{\mu}::Depends(\nabla{#}).
ex:=V^{\mu\nu}\nabla^{\rho}{u^{\mu}}\nabla^{\rho}{u^{\nu}};
canonicalise(_);
...