Direct sum of matrix spaces
Is it possible to construct a direct sum of matrix spaces?
For example:
M1 = MatrixSpace(QQ, 1)
M2 = MatrixSpace(QQ, 2)
M = DirectSum(M1, M1, M2) # doesnt work
Thanks
Is it possible to construct a direct sum of matrix spaces?
For example:
M1 = MatrixSpace(QQ, 1)
M2 = MatrixSpace(QQ, 2)
M = DirectSum(M1, M1, M2) # doesnt work
Thanks
You can do:
sage: M = CartesianProduct(M1, M1, M2)
sage: M
Cartesian product of Full MatrixSpace of 1 by 1 dense matrices over Rational Field, Full MatrixSpace of 1 by 1 dense matrices over Rational Field, Full MatrixSpace of 2 by 2 dense matrices over Rational Field
But then you will lose the algebra structure:
sage: M.category()
Category of enumerated sets
sage: M1.category()
Category of algebras over Rational Field
It should be possible to keep this structure by doing something like:
sage: M1.cartesian_product(M1,M2)
But then you will get an
AttributeError: type object 'MatrixSpace' has no attribute 'CartesianProduct'
Asked: 11 years ago
Seen: 931 times
Last updated: Mar 25 '14