First time here? Check out the FAQ!

Ask Your Question
2

canonicalize_radical for matrices.

asked 8 years ago

Saul Schleimer gravatar image

updated 2 years ago

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?

Preview: (hide)

Comments

you will find relevant links on this related question

mforets gravatar imagemforets ( 8 years ago )

2 Answers

Sort by » oldest newest most voted
1

answered 8 years ago

FrédéricC gravatar image

Like that:

sage: M.apply_map(lambda u: u.canonicalize_radical())
[6]
[6]
Preview: (hide)
link

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 ( 8 years ago )

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 ( 8 years ago )
1

answered 8 years ago

tmonteil gravatar image

updated 8 years ago

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.

Preview: (hide)
link

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: 8 years ago

Seen: 876 times

Last updated: Aug 25 '16