I definitely agree about tests! There should be a generic "test suite"
that should systematically be run with these all different
implementations. It is a bit ridiculous that your example was not
caught.

On Fri, 29 Sept 2023 at 17:53, John H Palmieri <jhpalmier...@gmail.com> wrote:
>
> First, an error in the original message: it should have been 
> "identity_matrix(F, 1)". That doesn't make any difference in the behavior. A 
> little exploration suggests that the problem goes away if you make the 
> identity matrix sparse: the problem may be with multiplying a dense matrix 
> with a vector. I'm not sure about this, though.
>
> This is with the most recent beta, built from scratch on several different OS 
> X machines. It also happens on Sagecell. I have not yet opened an issue, 
> because there are deeper existential questions: if linear algebra over this 
> field is broken, and if there are no doctests to detect that it's broken, how 
> viable is this implementation? How long has it been broken? Why has no one 
> noticed? What is it used for? Should we keep it?
>
> I think that if someone wanted to add a new implementation of a field to Sage 
> today, we would insist on doctests verifying that it worked as a drop-in 
> replacement for the existing implementations everywhere in Sage where fields 
> get used. GF(2, impl='ntl') does not meet this standard. Someone can 
> presumably fix this one bug, but is someone willing to add all of the 
> doctests that should really be added?
>
> On Friday, September 29, 2023 at 12:32:14 AM UTC-7 Vincent Delecroix wrote:
>>
>> What is your sage version? How did you install it? Did you open an
>> issue on github?
>>
>> Best
>> Vincent
>>
>> On Tue, 26 Sept 2023 at 07:00, John H Palmieri <jhpalm...@gmail.com> wrote:
>> >
>> > Setup:
>> >
>> > sage: F = GF(2, impl='ntl')
>> > sage: m_ntl = identity_matrix(1, F)
>> > sage: v_ntl = vector(F, (1,))
>> >
>> > Now consider
>> >
>> > sage: m_ntl * v_ntl
>> > sage: v_ntl * m_ntl
>> >
>> > I'm trying to multiply a 1x1 matrix by a 1-dimensional vector, in one 
>> > order or the other. Here's what happens: the first line fails with a 
>> > SignalError, and the second actually crashes Sage. If we are defining a 
>> > field that can't do linear algebra, shouldn't there be big warnings posted 
>> > somewhere? If we are defining a field like this, are there any 
>> > expectations that it should work broadly with Sage types and 
>> > constructions? I just discovered that cup products in mod 2 cohomology 
>> > don't work when "mod 2" means coefficients in GF(2, impl='ntl'), and I 
>> > don't know if I should bother trying to fix this.
>> >
>> > For what it's worth, I get the same with `GF(2, impl='givaro')`. Also for 
>> > what it's worth, explicitly converting `v_ntl` to a matrix allows the 
>> > matrix multiplication to work.
>> >
>> > I see this on two different OS X machines, one Intel and one Apple Silicon.
>> >
>> > --
>> > John
>> >
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "sage-devel" group.
>> > To unsubscribe from this group and stop receiving emails from it, send an 
>> > email to sage-devel+...@googlegroups.com.
>> > To view this discussion on the web visit 
>> > https://groups.google.com/d/msgid/sage-devel/faeffb72-3b16-4f37-90c4-f969e4d5c017n%40googlegroups.com.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-devel/378f06a5-2008-42fb-8642-32019a3a4976n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAGEwAA%3DumacWP1W0CbyT40a9oPO6B_ejDcqc7HbZkck2Y_5kBg%40mail.gmail.com.

Reply via email to