[sage-devel] Matrices over QQbar

2024-05-03 Thread Hakan Granath
Hi, I think sometimes matrices over QQbar give erroneous results (sorry for the messy example, if I try to simplify it the problem disappears): R. = QQ[] v1 = QQbar.polynomial_root(AA.common_polynomial(y^2 + 1), CIF(RIF(RR(0)), RIF(-RR(1 v2 = QQbar.polynomial_root(AA.common_polynomial(y^2 + 1

Re: [sage-devel] matrices: matrix space vs matrix group

2015-04-19 Thread John Cremona
On 19 April 2015 at 12:47, Vincent Delecroix <20100.delecr...@gmail.com> wrote: > Hello, > > I really do not like > > sage: M = MatrixSpace(QQ,3) > sage: G = SL(3, QQ) > sage: m1 = M(1) > sage: m2 = G(1) > sage: m1 > [1 0 0] > [0 1 0] > [0 0 1] > sage: m2 > [1 0 0] > [0 1 0] > [0 0 1] > sage: m1 ==

[sage-devel] matrices: matrix space vs matrix group

2015-04-19 Thread Vincent Delecroix
Hello, I really do not like sage: M = MatrixSpace(QQ,3) sage: G = SL(3, QQ) sage: m1 = M(1) sage: m2 = G(1) sage: m1 [1 0 0] [0 1 0] [0 0 1] sage: m2 [1 0 0] [0 1 0] [0 0 1] sage: m1 == m2 False Shouldn't it be True? One way would be to have a coerce embeddig from G to M which looks natural to

Re: [sage-devel] matrices for the univeral cyclotomic field

2011-05-02 Thread Mike Hansen
On Fri, Apr 22, 2011 at 7:15 AM, Christian Stump wrote: > The problem is that, even though every element in the UCF has a fixed > degree, the elements in the matrix might all have different degrees; > moreover I cannot predict the degree, especially not when adding or > multiplying such matrices.

Re: [sage-devel] matrices for the univeral cyclotomic field

2011-04-22 Thread David Roe
> > Is there a fast way to store the data as a 2-dim array with entries > being dictionaries with keys being basis elements in the Zumbroich > basis, and with rational values? Any other suggestions? I don't have any particularly insightful ideas, but are you thinking about a 2d C array of Python

[sage-devel] matrices for the univeral cyclotomic field

2011-04-22 Thread Christian Stump
Hello there, I could need some help on how to store matrices over the universal cyclotomic field (UCF). Every element is stored as a linear combination of elements in the Zumbroich basis [1], which is similar to the standard basis for the cyclotomic field, but which makes it easy to convert elemen

Re: [sage-devel] matrices and matrix group over a ring

2010-10-16 Thread David Joyner
In addition to what David Roe said, if I remember correctly MatrixGroups in Sage are implemented for matrices over finite fields. At some point I think it calls GAP for the computations. If your field is not finite, it might be better to use GAP directly since Sage only has infinite modular (matri

Re: [sage-devel] matrices and matrix group over a ring

2010-10-16 Thread David Roe
What are you inheriting from? FreeModule is checking to see if you're inheriting from sage.rings.commutative_ring.CommutativeRing. This was written long before categories became available. David On Sat, Oct 16, 2010 at 14:27, Christian Stump wrote: > Hello, > > I am trying to define a matrix gr

[sage-devel] matrices and matrix group over a ring

2010-10-16 Thread Christian Stump
Hello, I am trying to define a matrix group generated by matrices over a field which I have defined. At the moment, I am stuck with the the question of how to make the base_ring an instance of CommutativeRing? In particular, I get that the __init__ in free_module.pyc asks isinstance(base_ring, com

[sage-devel] matrices

2008-07-19 Thread John Cremona
Puzzle question: find a matrix with rank 0 but determinant 1: sage: type(M) sage: M.rank() 0 sage: M.determinant() 1.00 Answer: M is 0x0: sage: M [] sage: [M.nrows(), M.ncols()] [0, 0] Now I am happy with all that (since I am computing regulators of elliptic curves which may have

[sage-devel] matrices with no ring specified default to QQ if the elements are all integers

2008-05-21 Thread Jason Grout
In the recent discussion "Change the default base_ring for matrices from ZZ to QQ", there were lots of opinions shared, and William summarized some feelings from the group, but it wasn't a solid conclusion (at least, based on an IRC conversation, William is rethinking the conclusion). Here are