Home Online Manual
Top
Back: farey
Forward: fglm
FastBack: Functions and system variables
FastForward: Control structures
Up: Functions
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

5.1.38 fetch

Syntax:
fetch ( ring_name, name )
fetch ( ring_name, name, intvec_expression )
fetch ( ring_name, name, intvec_expression, intvec_expression )
Type:
number, poly, vector, ideal, module, matrix or list (the same type as the second argument)
Purpose:
maps objects between rings. fetch is the identity map between rings and qrings, in the first case the i-th variable of the source ring is mapped to the i-th variable of the basering. If the basering has less variables than the source ring these variables are mapped to zero. In the 2nd and 3rd form the intvec describes the permation of the variables: an i at position j maps the variable var(j) of the source to the variable var(i) of the destination. Negative numbers (and the fourth argument) describe mapping of parameters.
A zero means that that variable/parameter is mapped to 0.
The coefficient fields must be compatible. (See map for a description of possible mappings between different ground fields).
fetch offers a convenient way to change variable names or orderings, or to map objects from a ring to a quotient ring of that ring or vice versa.
Note:
Compared with imap, fetch uses the position of the ring variables, not their names.
Example:
 
  ring r=0,(x,y,z),dp;
  ideal i=maxideal(2);
  ideal j=std(i);
  poly f=x+y2+z3;
  vector v=[f,1];
  qring q=j;
  poly f=fetch(r,f);
  f;
==> z3+y2+x
  vector v=fetch(r,v);
  v;
==> z3*gen(1)+y2*gen(1)+x*gen(1)+gen(2)
  ideal i=fetch(r,i);
  i;
==> i[1]=z2
==> i[2]=yz
==> i[3]=y2
==> i[4]=xz
==> i[5]=xy
==> i[6]=x2
  ring rr=0,(a,b,c),lp;
  poly f=fetch(q,f);
  f;
==> a+b2+c3
  vector v=fetch(r,v);
  v;
==> a*gen(1)+b2*gen(1)+c3*gen(1)+gen(2)
  ideal k=fetch(q,i);
  k;
==> k[1]=c2
==> k[2]=bc
==> k[3]=b2
==> k[4]=ac
==> k[5]=ab
==> k[6]=a2
  fetch(q,i,1..nvars(q)); // equivalent to fetch(q,i)
==> _[1]=c2
==> _[2]=bc
==> _[3]=b2
==> _[4]=ac
==> _[5]=ab
==> _[6]=a2
See imap; map; qring; ring.