Cadabra
a field-theory motivated approach to computer algebra

expand_power

Expand powers into repeated products
Expand powers into repeated products, i.e. do the opposite of collect_factors. For example,
ex:=(A B)**3;
\(\displaystyle{}\left(A B\right)^{3}\)
expand_power(_);
\(\displaystyle{}A B A B A B\)
sort_product(_);
\(\displaystyle{}A A A B B B\)
collect_factors(_);
\(\displaystyle{}A^{3} B^{3}\)
This command automatically takes care of index relabelling when necessary, as in the following example
{m,n,p,q,r}::Indices(vector). ex:= (A_m B_m)**3;
\(\displaystyle{}\left(A_{m} B_{m}\right)^{3}\)
expand_power(_);
\(\displaystyle{}A_{m} B_{m} A_{n} B_{n} A_{p} B_{p}\)
Copyright © 2001-2024 Kasper Peeters
Questions? info@cadabra.science