File: factorise.tex

package info (click to toggle)
cadabra 1.46-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,244 kB
  • sloc: cpp: 33,188; ansic: 2,724; makefile: 329; yacc: 180; sh: 157; python: 45; lex: 38; lisp: 19
file content (20 lines) | stat: -rw-r--r-- 538 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
\cdbalgorithm{factorise}{}

Given a list of symbols, this algorithm collects terms in a sum that
only differ by pre-factors consisting of these given symbols. As an
example,
\begin{screen}{1,2}
a b + a c + a d:
@factorise!(%){b,c};
(b + c) a + a d;
\end{screen}
This is like the {\tt antibracket} statement of FORM. A better name is
probably {\tt factor\_in}.

The algorithm of course also works with indexed objects, as in
\begin{screen}{1,2}
A_{m} B_{m} + C_{m} A_{m};
@factorise!(%){B_{n},C_{n}};
(B_{m} + C_{m}) A_{m};
\end{screen}
~