File: factor_in.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 (23 lines) | stat: -rw-r--r-- 694 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
21
22
23
\cdbalgorithm{factor\_in}{}

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:
@factor_in!(%){b,c};
(b + c) a + a d;
\end{screen}
The name is perhaps most easily understood by thinking of it as a
complement to {\tt factor\_out}. Or in case you are familiar with
FORM, {\tt factor\_in} is like its {\tt antibracket} statement.

The algorithm of course also works with indexed objects, as in
\begin{screen}{1,2}
A_{m} B_{m} + C_{m} A_{m};
@factor_in!(%){B_{n},C_{n}};
(B_{m} + C_{m}) A_{m};
\end{screen}
(this is still work in progress).

\cdbseealgo{factor_out}