polynomial | poly

Build the tuple of polynomial, ie the $k$-tape polynomial which is the Cartesian product of the input polynomials.

See also:

Examples

In [1]:
import vcsn
exp = vcsn.context('lan, q').expression
def poly(e, size=3):
    'The approximation of expression `e` as a polynomial.'
    return exp(e).shortest(3)
p1 = poly('(<2>ab)*')
p1
Out[1]:
$\varepsilon \oplus \left\langle 2\right\rangle \mathit{ab} \oplus \left\langle 4\right\rangle \mathit{abab}$
In [2]:
p2 = poly('(<3>x)*')
p2
Out[2]:
$\varepsilon \oplus \left\langle 3\right\rangle \mathit{x} \oplus \left\langle 9\right\rangle \mathit{xx}$
In [3]:
p1 | p2
Out[3]:
$\varepsilon|\varepsilon \oplus \left\langle 3\right\rangle \varepsilon|\mathit{x} \oplus \left\langle 9\right\rangle \varepsilon|\mathit{xx} \oplus \left\langle 2\right\rangle \mathit{ab}|\varepsilon \oplus \left\langle 6\right\rangle \mathit{ab}|\mathit{x} \oplus \left\langle 18\right\rangle \mathit{ab}|\mathit{xx} \oplus \left\langle 4\right\rangle \mathit{abab}|\varepsilon \oplus \left\langle 12\right\rangle \mathit{abab}|\mathit{x} \oplus \left\langle 36\right\rangle \mathit{abab}|\mathit{xx}$
In [4]:
(exp('(<2>ab)*') |  exp('(<3>x)*')).shortest(9)
Out[4]:
$\varepsilon|\varepsilon \oplus \left\langle 3\right\rangle \varepsilon|\mathit{x} \oplus \left\langle 9\right\rangle \varepsilon|\mathit{xx} \oplus \left\langle 2\right\rangle \mathit{ab}|\varepsilon \oplus \left\langle 6\right\rangle \mathit{ab}|\mathit{x} \oplus \left\langle 18\right\rangle \mathit{ab}|\mathit{xx} \oplus \left\langle 27\right\rangle \varepsilon|\mathit{xxx} \oplus \left\langle 54\right\rangle \mathit{ab}|\mathit{xxx} \oplus \left\langle 81\right\rangle \varepsilon|\mathit{xxxx}$