ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 15 Jan 2020 10:59:29 +0100matrix base ring changes by a complex multiplicationhttps://ask.sagemath.org/question/49557/matrix-base-ring-changes-by-a-complex-multiplication/The complex multiplication of matrix changes the base ring.
A = matrix(CDF,[[1,2],[3,4]]); print(A)
B = 2*A
C = I*A
print(type(A))
print(type(B))
print(type(C))
The result is
[1.0 2.0]
[3.0 4.0]
<class 'sage.matrix.matrix_complex_double_dense.Matrix_complex_double_dense'>
<class 'sage.matrix.matrix_complex_double_dense.Matrix_complex_double_dense'>
<class 'sage.matrix.matrix_symbolic_dense.Matrix_symbolic_dense'>
So the multiplication by an imaginary number breaks the CDF property.
This is very inconvenient for numerical calculations, because the symbolic computation is very slow.cxrjddWed, 15 Jan 2020 10:59:29 +0100https://ask.sagemath.org/question/49557/1x1 matrix -> scalarhttps://ask.sagemath.org/question/32288/1x1-matrix-scalar/Hi everyone, i have a problem with dimensions:
I am programing the conjugate gradient algorithm,
unfortunatly, when the result is scalar, Sage still handles it a 1x1 matrix,
and as a result i cannot use multiplication. How can i fix it, maybe there is a good tutorial or a book
for Sage and linear algebra.
Here is my work so far:
https://cloud.sagemath.com/projects/1d25492e-4517-4c0f-99c6-b1205afc8edf/files/2016-01-18-112346.sagews
Thank you in advance.thethaTue, 19 Jan 2016 12:05:44 +0100https://ask.sagemath.org/question/32288/