Tuple Access Functions

Parent(T): Tup -> SetCart

The cartesian product to which the tuple \(T\) belongs.

# T: Tup -> RngIntElt

Number of components of the tuple \(T\).

T[i]: Tup -> Elt

Return the \(i\)-th component of tuple \(T\). Note that this indexing can also be used on the left hand side for modification of \(T\).

Explode(T): Tup -> t1, t2, ...

Given a tuple \(T\) of length \(n\), this function returns the \(n\) entries of \(T\) (in order).

TupleToList(T): Tup -> List
Tuplist(T): Tup -> List

Given a tuple \(T\) return a list containing the entries of \(T\).

Example: Accessing Tuple Entries (ex-58b218)
> f := < 11/2, 13/3, RootOfUnity(3, CyclotomicField(3)) >;
> f;
<11/2, 13/3, (zeta_3)>
> #f;
3
> Parent(f);
Cartesian Product<Rational Field, Rational Field, Cyclotomic field Q(zeta_3)>
> f[1]+f[2]+f[3];
(1/6) * (59 + 6*zeta_3)
> f[3] := 7;
> f;
<11/2, 13/3, 7>

Run in calculator (opens in a new tab)