up previous next
NewFreeModule    --    create a new FreeModule


Syntax
NewFreeModule(R: RING, N: INT): MODULE
NewFreeModule(R: RING, Shifts: MAT): MODULE

Description
This function returns a free module of rank N over R; for the second form N is taken to be the number of columns in Shifts.

NOTE: as for rings, calling twice NewFreeModule will produce two different modules, even with identical input: equality test is performed on the pointers.

Starting from version CoCoA-5.0.4, this function does accept shifts.

Example
/**/  use R ::= QQ[x,y];
/**/  F := NewFreeModule(R, 3);
/**/  zero(F);
[0, 0, 0]
/**/ type(zero(F));  -- is NOT a LIST
MODULEELEM
/**/ CanonicalBasis(F);
[[1, 0, 0],  [0, 1, 0],  [0, 0, 1]]

/**/ F := NewFreeModule(R, matrix([[1],[2],[3]])); -- shifts
/**/ [wdeg(e) | e in gens(F)];
[[1], [2], [3]]

See Also