Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 45896
Kernel: Python 3

polynomial.split()

Split the expressions of a polynomial of rational expressions. In other words, when an expression is actually a sum of expressions, breaks it in smaller expressions, and return a polynomial of all these smaller expressions.

See also:

Examples

import vcsn c = vcsn.context('expressionset<lal, q>, q') c

RatE[{}Q]Q\mathsf{RatE}[\{\ldots\}\to\mathbb{Q}]\to\mathbb{Q}

Beware that the following polynomial (admittedly badly displayed) is 2(a+b)\langle 2 \rangle \odot (a+b), not 2ab\langle 2 \rangle \odot a \oplus b: it contains a single expression, a+ba+b.

p1 = c.polynomial('<2>a+b') p1

2a+b\left\langle 2\right\rangle a + b

p1.split()

2a2b\left\langle 2\right\rangle a \oplus \left\langle 2\right\rangle b

p2 = c.polynomial('a+b(c+d)') p2

a+b(c+d)a + b \, \left(c + d\right)

p2.split()

ab(c+d)a \oplus b \, \left(c + d\right)

p1 + p2

2a+ba+b(c+d)\left\langle 2\right\rangle a + b \oplus a + b \, \left(c + d\right)

(p1 + p2).split()

3a2bb(c+d)\left\langle 3\right\rangle a \oplus \left\langle 2\right\rangle b \oplus b \, \left(c + d\right)