Dag Sverre Seljebotn wrote: > 3) As mentioned earlier I'd like to implement explicitly diagonal and > hermitian matrices (at least for RDF and CDF). Would this be OK?: > > sage: parent(hermitian_matrix(RDF, 3)) > Full MatrixSpace of 3 by 3 Hermitian matrices over Real Double Field > > sage: parent(hermitian_matrix(CDF, 3)) > Full MatrixSpace of 3 by 3 Hermitian matrices over Complex Double Field > > sage: parent(diagonal_matrix(RDF, 3, enforce=True)) > Full MatrixSpace of 3 by 3 diagonal matrices over Real Double Field > > It could kind of work to simply add flags about sparsity patterns and > keep them in the sparse matrixspace, but ideally I'd like them to raise > exceptions when assigning outside the lower triangle/diagonal, and that > seems to call for another parent? Also these spaces would only allow > square matrices I think. > Hmm. Actually it makes sense with both dense and sparse Hermitian matrices (1/2 dense matrix is still pretty dense), so those two are orthogonal:
sage: parent(hermitian_matrix(CDF, 3, sparse=True)) Full MatrixSpace of 3 by 3 sparse Hermitian matrices over Complex Double Field sage: parent(hermitian_matrix(CDF, 3)) Full MatrixSpace of 3 by 3 dense Hermitian matrices over Complex Double Field Dag Sverre -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org