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

expansion.lweight(weight)

The left scalar product of an expansion by a weight.

See also:

Examples

import vcsn c = vcsn.context('lal_char, q')
e = c.expression('<2>a(b+<3>c)') x = e.expansion() x

a[2b+3c]a \odot \left[\left\langle 2\right\rangle b + \left\langle 3 \right\rangle \,c\right]

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

a[8b+3c]a \odot \left[\left\langle 8\right\rangle b + \left\langle 3 \right\rangle \,c\right]

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

c.weight('4') * x

a[8b+3c]a \odot \left[\left\langle 8\right\rangle b + \left\langle 3 \right\rangle \,c\right]

You may even run the simpler:

4 * x

a[8b+3c]a \odot \left[\left\langle 8\right\rangle b + \left\langle 3 \right\rangle \,c\right]

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

(4*e).expansion()

a[8b+3c]a \odot \left[\left\langle 8\right\rangle b + \left\langle 3 \right\rangle \,c\right]