expansion.lweight(weight)

The left scalar product of an expansion by a weight.

See also:

Examples

In [1]:
import vcsn
c = vcsn.context('lal_char, q')
In [2]:
e = c.expression('<2>a(b+<3>c)')
x = e.expansion()
x
Out[2]:
$a \odot \left[\left\langle 2\right\rangle b + \left\langle 3 \right\rangle \,c\right]$
In [3]:
x.lweight(c.weight('4'))
Out[3]:
$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.

In [4]:
c.weight('4') * x
Out[4]:
$a \odot \left[\left\langle 8\right\rangle b + \left\langle 3 \right\rangle \,c\right]$

You may even run the simpler:

In [5]:
4 * x
Out[5]:
$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:

In [6]:
(4*e).expansion()
Out[6]:
$a \odot \left[\left\langle 8\right\rangle b + \left\langle 3 \right\rangle \,c\right]$