# expansion.project(tape)¶

An expansion that keeps only the selected tape of the original expansion.

Preconditions:

• the original expression is multitape.
• the tape number is smaller than the number of tapes.

## Examples¶

In [1]:
import vcsn
ctx = vcsn.context("lat<lan_char(ab), lan_char(cd), lan_char(ef)>, q")

In [2]:
e = ctx.expression("a*|c|[ef]")
x = e.expansion()
x

Out[2]:
$\varepsilon|c|e \odot \left[\varepsilon\right] \oplus \varepsilon|c|f \odot \left[\varepsilon\right] \oplus a|c|e \odot \left[ \left. {a}^{*} \middle| \varepsilon \middle| \varepsilon \right. \right] \oplus a|c|f \odot \left[ \left. {a}^{*} \middle| \varepsilon \middle| \varepsilon \right. \right]$
In [3]:
x.project(0)

Out[3]:
$\left\langle 2\right\rangle \oplus a \odot \left[\left\langle 2\right\rangle {a}^{*}\right]$
In [4]:
x.project(1)

Out[4]:
$c \odot \left[\left\langle 4\right\rangle \varepsilon\right]$
In [5]:
x.project(2)

Out[5]:
$e \odot \left[\left\langle 2\right\rangle \varepsilon\right] \oplus f \odot \left[\left\langle 2\right\rangle \varepsilon\right]$

Beware that, because of possible redundancy on other tapes, the projection of an expansion is not necessarily the expansions of the projection.

In [6]:
e.project(0).expansion()

Out[6]:
$\left\langle 1\right\rangle \oplus a \odot \left[{a}^{*}\right]$
In [7]:
e.project(1).expansion()

Out[7]:
$c \odot \left[\varepsilon\right]$
In [8]:
e.project(2).expansion()

Out[8]:
$e \odot \left[\varepsilon\right] \oplus f \odot \left[\varepsilon\right]$