Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News Sign UpSign In
| Download
Views: 45856
Kernel: Python 3

expression.lweight(weight)

The left scalar product of an expression by a weight.

See also:

Examples

import vcsn c = vcsn.context('lal_char, q')
e = c.expression('<2>a<3>bc', 'trivial') e

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

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

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

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

c.weight('4') * e

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

You may even run the simpler:

4 * e

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