Opened 4 years ago

Closed 3 years ago

#26655 closed defect (fixed)

Convert PARI matrices over finite fields into Sage matrix spaces

Reported by: pbruin Owned by:
Priority: minor Milestone: sage-8.7
Component: interfaces Keywords: matrix, finite field, pari
Cc: Merged in:
Authors: Peter Bruin Reviewers: Jeroen Demeyer
Report Upstream: N/A Work issues:
Branch: 32a6527 (Commits, GitHub, GitLab) Commit: 32a6527eacd2d11e3364c5b6d0ec469de2f0cb28
Dependencies: Stopgaps:

Status badges

Description (last modified by pbruin)

It should be possible to convert PARI matrices over finite fields into a Sage matrix space:

sage: F.<a> = GF(9)
sage: M = MatrixSpace(F, 2, 2)
sage: A = M.random_element()
sage: M(A.__pari__())
Traceback (most recent call last):
...
NameError: name 'a' is not defined

This ticket deliberately does not attempt to fix conversion of PARI t_VEC/t_COL etc. to Sage matrices. Maybe this should even be deprecated (there is a risk of confusion since Sage uses row-major order and PARI uses column-major order).

Change History (7)

comment:1 Changed 4 years ago by pbruin

  • Authors set to Peter Bruin
  • Branch set to u/pbruin/26655-PARI_matrix_conversion
  • Commit set to fabc45f76a7d71c09dd75c7f35449cb68949d4c0
  • Description modified (diff)
  • Status changed from new to needs_review

comment:2 Changed 3 years ago by jdemeyer

  • Reviewers set to Jeroen Demeyer
  • Status changed from needs_review to needs_work

You should use list comprehensions instead of map() because it's more readable and it works the same way on Python 3.

comment:3 Changed 3 years ago by git

  • Commit changed from fabc45f76a7d71c09dd75c7f35449cb68949d4c0 to 32a6527eacd2d11e3364c5b6d0ec469de2f0cb28

Branch pushed to git repo; I updated commit sha1. New commits:

32a6527Trac 26655: use list comprehension instead of map

comment:4 Changed 3 years ago by pbruin

  • Status changed from needs_work to needs_review

Good point, thanks. Fixed in the latest commit.

comment:5 Changed 3 years ago by jdemeyer

  • Status changed from needs_review to positive_review

comment:6 Changed 3 years ago by chapoton

  • Milestone changed from sage-8.5 to sage-8.7

comment:7 Changed 3 years ago by vbraun

  • Branch changed from u/pbruin/26655-PARI_matrix_conversion to 32a6527eacd2d11e3364c5b6d0ec469de2f0cb28
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.