Hi!
I have some problems with factor_in and factor_out . They don't quite work as i expect them to and I didn't find any posts about it.
There are three different things i would like to mention:
First, factor_out is index-sensitive, but not really consistent about it:
ex:= g_{a b} p_c + g_{a b} q_c + g_{a c} p_b + g_{a c} q_b;
factor_out(_,$g_{a b}$);
and
ex:= g_{a b} p_c + g_{a b} q_c + g_{a c} p_b + g_{a c} q_b;
factor_out(_,$g_{a c}$);
give the expected result.
On the other hand:
ex:= g_{a b} p_c + g_{a b} q_c + g_{a c} p_b + g_{a c} q_b;
factor_out(_,$g_{b c}$);
factors out the g{a c}, but not the g{a b}.
Second, factor_out and factor_in do not work anymore, if the prefactors are too "complicated":
ex2:= (a + b - c) d + (-a -b + c) d
factor_out(_,$d$);
factor_out(_,$a + b - c$);
factor_in(_,$d$);
all do nothing here. Of course I could just use "distribute" here, but i get complicated expressions, where I need to factor in $a,b,c$ first and only then can think about further simplifications.
Third, factor_out does not work, if products of tensors are used:
ex3:= g_{a b} g_{c d} p + g_{a b} g_{c d} q;
factor_out(_,$g_{a b}$);
factor_out(_,$g_{a b}g_{c d}$);
factor_out(_,$g_{a b},g_{c d}$);
do not simplify the expression.
factor_in(_,$q,p$);
works just fine, but p and q themselves can take complicated forms and it's tedious to write them out in factor_in. Also, as mentioned before, this does not simplify the expressions anyway.
Thanks for working on the project, it is exactly what I was looking for and really like the "do it step by step" philosophy!