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

expansion.rweight(weight)

The right scalar product of an expansion by a weight.

See also:

Examples

import vcsn c = vcsn.context('lal_char, q')

Note that left-scalar product and right-scalar product are very different: the left-scalar product changes the weights in the polynomials, while the right-scalar product changes the expressions.

e = c.expression('<2>a<3>bc', 'none') x = e.expansion() e

2a(3bc) \left\langle 2 \right\rangle \,a \, \left( \left\langle 3 \right\rangle \,b \, c\right)

x.rweight(c.weight('4'))

a[2(ε(3bc))4]a \odot \left[\left\langle 2\right\rangle \left(\varepsilon \, \left( \left\langle 3 \right\rangle \,b \, c\right)\right)\, \left\langle 4 \right\rangle \right]

Instead of x.rweight(w), you may write x * w.

x * c.weight('4')

a[2(ε(3bc))4]a \odot \left[\left\langle 2\right\rangle \left(\varepsilon \, \left( \left\langle 3 \right\rangle \,b \, c\right)\right)\, \left\langle 4 \right\rangle \right]

You may even run the simpler:

x * 4

a[2(ε(3bc))4]a \odot \left[\left\langle 2\right\rangle \left(\varepsilon \, \left( \left\langle 3 \right\rangle \,b \, c\right)\right)\, \left\langle 4 \right\rangle \right]

The expansion of a scalar product is the scalar product of the expansion:

(e*4).expansion()

a[2(ε(3bc))4]a \odot \left[\left\langle 2\right\rangle \left(\varepsilon \, \left( \left\langle 3 \right\rangle \,b \, c\right)\right)\, \left\langle 4 \right\rangle \right]