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


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

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


Your matrix is 9x8 and has rank 8.  pari computes the right kernel
(space of vectors v such that m2*v=0) which is 0-dimensional.  Perhaps
you meant the left kernel (which is what Magma gives)?  For that,
transpose before and after:

? matker(m2~)~
%11 =
[0 -1 0 0 0 0 0 0 1]


John

2009/12/24 Kevin Acres <research@research-systems.com>:
> Hi John,
>
> I thought that it should be as easy as that. I did just realise that my cut
> and paste in the original post missed 3 rows off of the matrix.
>
> However, the following code gives an empty matrix:
>
> mprint(M2);
> print("result of matker: ",matker(M2,1));
>
> Output is:
>
> [0, 1, 0, 0, 1, 0, 0, 0]
> [0, 0, 1, 0, 0, 1, 0, 0]
> [1, 0, 1, 0, 0, 0, 0, 0]
> [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]
> result of matker: [;]
> Goodbye!
>
> Any idea what I'm doing wrong?
>
>
> Best Regards,
>
> Kevin.
>
>
> At 09:22 PM 24/12/2009, you wrote:
>>
>> matker:
>>
>>
>> ? ?matker
>> matker(x,{flag=0}): basis of the kernel of the matrix x. flag is
>> optional, and may be set to 0:
>> default; non-zero: x is known to have integral entries.
>>
>> John Cremona
>>
>> 2009/12/24 Kevin Acres <research@research-systems.com>:
>> > Hi,
>> >
>> > I'm trying to implement an equivalent of the Magma NullSpace() function.
>> >
>> > 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]
>> >
>> > I'm sure that it must be pretty trivial. It's just that I haven't worked
>> > out
>> > how as yet.
>> >
>> > Any pointers in the right direction would be greatly appreciated.
>> >
>> >
>> > Kevin.
>> >
>> >
>
>