John Cremona on Thu, 24 Dec 2009 12:36:55 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: How to implement equivalent of magma NullSpace in Pari/GP


2009/12/24 Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>:
> On Thu, Dec 24, 2009 at 08:33:41PM +1100, Kevin Acres wrote:
>> Hi,
>>
>> I'm trying to implement an equivalent of the Magma NullSpace() function.
>
> In PARI, this is called matker().
>
>> For example I'd like:
>>
>> [0 0 0 1 0 0 1 0]
>> [1 0 1 0 0 0 1 0]
>> [1 1 0 0 0 0 0 1]
>> [0 1 1 0 0 0 0 1]
>> [0 1 1 0 0 0 0 0]
>> [0 0 1 0 0 1 0 0]
>>
>> to return
>>
>> [0 1 0 0 0 0 0 0 1]
>> [0 0 1 0 0 1 1 0 0]
>
> Really ?  If you want to compute the kernel over Z/2Z then you should do
> matker(M*Mod(1,2)).

Perhaps not "should":  from the documentation of matker,

   Note:  The library function FpM_ker(x,  p),  where x has integer
entries reduced mod p and p is
prime,  is equivalent to,  but orders of magnitude faster than,
matker(x*Mod(1,p)) and needs much
less stack space. To use it under gp, type install(FpM_ker, GG) first.

John


>
> Cheers,
> Bill.
>