[sage-devel] What's the point of GF(2, impl='ntl')?

2023-09-25 Thread John H Palmieri
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+unsubscr...@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.


Re: [sage-devel] Re: Sage CI Failing in SymPy GitHub Actions

2023-09-25 Thread Oscar Benjamin
On Sun, 24 Sept 2023 at 22:43, Matthias Koeppe  wrote:
>
> On Sunday, September 24, 2023 at 2:10:26 PM UTC-7 Oscar Benjamin wrote:
>
> > On Sunday, September 24, 2023 at 11:46:05 AM UTC-7 Oscar Benjamin wrote:
> >
> >> Where would I send the PR for the Sage doctests?
>
> On Sun, 24 Sept 2023 at 20:48, Matthias Koeppe  wrote:
> >
> > I've added this to ci-sage.yml to explain what to do:
> >
> > # To test with a Sage PR, use this:
> > #sage_ref: refs/pull/PR_NUMBER/merge
>
> So currently the SymPy Sage CI job points at:
> https://github.com/sagemath/sage/pull/36276
>
> Yes, this PR contains a hotfix for the build system (which missed its way 
> into the currrent beta version 10.2.beta4).

That is a PR against the sagemath/sage develop branch.

Should any new PR with doctest updates be based off of that PR and set
to merge into develop?

There are some doctest failures:
https://github.com/sympy/sympy/actions/runs/6292982121/job/17082929352

Some are due to this printing change:
https://github.com/sympy/sympy/pull/25673#issuecomment-1719198065

I'm not sure yet that I like that printing change but also not sure
what Sage would want to do about it if SymPy keeps it. Would Sage just
want to accept that change in output?

An example failure is:

**
8567File "src/sage/doctest/forker.py", line 151, in
sage.doctest.forker.init_sage
8568Failed example:
8569 print(PrettyPrinter(settings={'wrap_line': True}).doprint(s))
8570Expected:
8571 29 28 27 26 25 24 23 22 21 20 19 18 17
8572 x + x + x + x + x + x + x + x + x + x + x + x + x +
8573 
8574 16 15 14 13 12 11 10 9 8 7 6 5 4 3
8575 x + x + x + x + x + x + x + x + x + x + x + x + x + x + x
8576 
8577 2
8578 + x
8579Got:
8580 29 28 27 26 25 24 23 22 21 20 19 18 17 ↪
8581 x + x + x + x + x + x + x + x + x + x + x + x + x + ↪
8582 
8583 ↪ 16 15 14 13 12 11 10 9 8 7 6 5 4 3 ↪
8584 ↪ x + x + x + x + x + x + x + x + x + x + x + x + x + x + ↪
8585 
8586 ↪ 2
8587 ↪ x + x

Basically some ↪ arrows are used when wrapping long output lines.

Another doctest failure is due to this change in hyper. The doctest
just needs updating:
https://github.com/sympy/sympy/pull/25641

Failed example:
8800 hypergeometric((5, 4), (4, 4), 3)._sympy_() # needs sage.symbolic
8801Expected:
8802 hyper((5, 4), (4, 4), 3)
8803Got:
8804 hyper((5,), (4,), 3)

There is another doctest failure that I don't understand:

File "src/sage/groups/finitely_presented.py", line 1771, in
sage.groups.finitely_presented.FinitelyPresentedGroup.characteristic_varieties
9400Failed example:
9401 G.characteristic_varieties(groebner=True)
9402Expected:
9403 [[(f1 - 1, f2 - 1, f3 - 1),
9404 (f1 + 1, f2 - 1, f3 - 1),
9405 (f1 - 1, f2 - 1, f3 + 1),
9406 (f3^2 + 1, f1 - f3, f2 - f3),
9407 (f1 - 1, f2 + 1, f3 - 1)],
9408 [(f1 - 1, f2 - 1, f3 - 1),
9409 (f1*f3 + 1, f2 - 1),
9410 (f1*f2 + 1, f3 - 1),
9411 (f2*f3 + 1, f1 - 1),
9412 (f2*f3 + 1, f1 - f2),
9413 (f2*f3 + 1, f1 - f3),
9414 (f1*f3 + 1, f2 - f3)]]
9415Got:
9416 [[(f1 - 1, f2 - 1, f3 - 1),
9417 (f1 + 1, f2 - 1, f3 - 1),
9418 (f1 - 1, f2 - 1, f3 + 1),
9419 (f3^2 + 1, f1 - f3, f2 - f3),
9420 (f1 - 1, f2 + 1, f3 - 1)],
9421 [(f2*f3 + 1, f1 - f2),
9422 (f2*f3 + 1, f1 - f3),
9423 (f2*f3 + 1, f1 - 1),
9424 (f1*f3 + 1, f2 - f3),
9425 (f1 - 1, f2 - 1, f3 - 1),
9426 (f1*f2 + 1, f3 - 1),
9427 (f1*f3 + 1, f2 - 1)]]

How exactly is Sage using SymPy in this calculation?

It looks like the order of the output has changed but I don't know
what caused that change or if that should be considered a bug (in
either SymPy or Sage). Does the order matter here?

Another doctest failure is just a change in the printing code:

File "src/sage/symbolic/expression.pyx", line 1196, in
sage.symbolic.expression.Expression._unicode_art_
14804Failed example:
14805 unicode_art(SR(1.3 - I))
14806Expected:
14807 1.3 - ⅈ
14808Got:
14809 1.3 - 1.0⋅ⅈ

The SymPy expression being printed here does have a 1.0 in it. I don't
know if it is intentional that Sage puts the 1.0 there but the
printing change is correct for SymPy. Either the docstring needs to be
updated or perhaps Sage should not be putting the 1.0 there (I don't
know what Sage intends to do in this context).

--
Oscar

-- 
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/CAHVvXxQ89s1e91RK1U88V78gOkqjMktPM2D%3DC26h-0eJf2gfJQ%40mail.gmail.com.


[sage-devel] Re: Contributing to SageMath

2023-09-25 Thread 'Martin R' via sage-devel
Maybe you also find this helpful:

https://github.com/sagemath/sage/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+

On Monday, 25 September 2023 at 07:59:06 UTC+2 Saatvik Rao wrote:

> Hello developers,
>
> I am currently doing a project course that involves making active 
> contributions to the SageMath library (specifically in the area of graphs). 
> For the successful completion of the project, it is important to get my 
> work merged/pushed/accepted. 
>
> Currently, I have implemented an *induced minor* function in graphs. 
> Could someone guide me on how to contribute to SageMath? I am trying to 
> push my changes, but it shows *Permission to sagemath/sage.git denied to *
> user. 
>
>
>

-- 
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/e18bf2a2-f9d8-4929-bbd2-4a4dc21e6b96n%40googlegroups.com.


Re: [sage-devel] Contributing to SageMath

2023-09-25 Thread Dima Pasechnik
On Mon, 25 Sept 2023, 06:59 Saatvik Rao,  wrote:

> Hello developers,
>
> I am currently doing a project course that involves making active
> contributions to the SageMath library (specifically in the area of graphs).
> For the successful completion of the project, it is important to get my
> work merged/pushed/accepted.
>
> Currently, I have implemented an *induced minor* function in graphs.
> Could someone guide me on how to contribute to SageMath? I am trying to
> push my changes, but it shows *Permission to sagemath/sage.git denied to *
> user.
>

we follow the usual GitHub model for contributing, i.e. you submit PRs from
your fork.
See details in

>
https://doc.sagemath.org/html/en/developer/index.html

>
>
> --
> 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/416b1358-c65f-493a-a129-ab0d6582a6fan%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/CAAWYfq2ppawHJJFy58-vgAJ_V%3DP%2BjwNFbTJ1ZqqT6c8UeqPO-g%40mail.gmail.com.