Ask Your Question
2

canonicalize_radical for matrices.

asked 2016-08-02 20:46:22 +0100

Saul Schleimer gravatar image

updated 2023-01-10 00:01:10 +0100

tmonteil gravatar image

The following all works

sage: a = sqrt(2)*sqrt(3)*sqrt(6)
sage: v = vector([a])
sage: M = Matrix([v, v])
sage: a.canonicalize_radical()
6
sage: v.canonicalize_radical()
(6)

However the following doesn't work:

sage: M = Matrix([v, v])
sage: M.canonicalize_radical()

EDIT: Could somebody please tell me the right place to ask for "vectorization of canonicalize_radical for matrices" as a new feature of sage?

edit retag flag offensive close merge delete

Comments

you will find relevant links on this related question

mforets gravatar imagemforets ( 2016-08-05 20:28:12 +0100 )edit

2 Answers

Sort by » oldest newest most voted
1

answered 2016-08-02 21:12:53 +0100

FrédéricC gravatar image

Like that:

sage: M.apply_map(lambda u: u.canonicalize_radical())
[6]
[6]
edit flag offensive delete link more

Comments

Yes, I know that I can write some code to do want I want (and I have done so!). However, as my question states, I am asking for a feature to be implemented - namely the simplify methods should work the same for "scalars", "vectors", and "matrices". In any case, thank you for the reply.

Saul Schleimer gravatar imageSaul Schleimer ( 2016-08-02 22:14:55 +0100 )edit

In the end, I went with

M = Matrix([v.canonicalize_radical() for v in M])

because it feels a bit more "pythonic". I suppose what I really want is to be told how to make a feature request. I'll add that to the original question.

Saul Schleimer gravatar imageSaul Schleimer ( 2016-08-05 19:52:51 +0100 )edit
1

answered 2016-08-06 22:50:47 +0100

tmonteil gravatar image

updated 2016-08-25 23:40:13 +0100

Regarding your last question, ask.sagemath is not a bad place since quite a lot of developers are looking around, see the tags confirmed_bug and fixed_bug.

However, since you are able to add the feature yourself and since we need more developers, let me suggest you to:

  • ask for an account on trac
  • open a ticket
  • make your changes on the source code (adding a method on src/sage/matrix/matrix_symbolic_dense.pyx following the existing simplify_full method)
  • push your changes
  • ask for a review

EDIT : during sage days 75, Fangan Dosso opened and filled trac ticket 21332 about that, so the feature will be available in the next versions of Sage.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-08-02 20:46:22 +0100

Seen: 695 times

Last updated: Aug 25 '16