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

expression.rweight(weight)

The right 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.rweight(c.weight('4'))

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

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

e * c.weight('4')

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

You may even run the simpler:

e * 4

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