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/i have implemented algorithm for point addition and point double operation for elliptichttps://ask.sagemath.org/question/36405/i-have-implemented-algorithm-for-point-addition-and-point-double-operation-for-elliptic/i am using above algorithm for scalar multiplication for point add and double operation but it is not working properly.
the following sage math code i am using for scalar multiplication
F= FiniteField(p); #p=5
E = EllipticCurve(F,[A,B]);
print (E.points()[:8])
l = [0, 0, 1,1];l if my scalar is 3 binary of that is (0011)
for i in range(l):
if(i == 1):
load("pointaddition.sage") # Q=Q+P
else :
("load pointdouble.sage") # P=2p
return Q
when i will load pointaddition it will take Q=0 and some random point p and perform point addition so that i will get new value of Q.
it is not working properly please guidesantoshiFri, 27 Jan 2017 12:51:38 +0100https://ask.sagemath.org/question/36405/Elliptic curve scalar multiplication algorithmhttps://ask.sagemath.org/question/32886/elliptic-curve-scalar-multiplication-algorithm/ I'm doing a prespective on supersinguar elliptic curves. I was wondering how saga calculates scalar multiplications? Does it just calculate it naively or does it use succesive doubling as default? Til is most interesting since there are well known ways of making "shortcuts" when oberating with supersingular curves, but does sage use these?BelphegorFri, 25 Mar 2016 14:41:10 +0100https://ask.sagemath.org/question/32886/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/dividing vector(a,b) by sqrt(x) gives (a/x*sqrt(x),b/x*sqrt(x))https://ask.sagemath.org/question/25980/dividing-vectorab-by-sqrtx-gives-axsqrtxbxsqrtx/ I can't seem to figure out why the behavior above is happening.
I have been trying to familiarize myself with Sage as I am both an IT person at my university and currently a Calc III student and it would seem to me to be helpful for both to know how this software works since many professors use it and I can use it to check work in my classes.
When I attempt to get the unit vector in the direction of <1,1> I divide the vector by its magnitude, and instead of the expected result of <1/sqrt(2), 1/sqrt(2)> I have been getting <1/2*sqrt(2), 1/2*sqrt(2)> and this happens the same way with a vector divided by the sqrt of anything. (i.e. <1,1> / sqrt(3) == <1/3*sqrt(3), 1/3*sqrt(3)>)
Is this a bug, or am I missing something?
EDIT - To clarify, I am dividing a vector by it's magnitude, which is a scalar number. vector{a,b} divded by c should yield vector{a/c, b/c}. This works fine for integers. but when doing so with the sqrt() function it produces odd results. So if c == sqrt(d) the answer is coming back as vector{a/(d*c), b/(d*c)} and I don't understand why the denominator is being multiplied by d.
RickySun, 01 Mar 2015 00:27:40 +0100https://ask.sagemath.org/question/25980/