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.Tue, 12 Nov 2019 16:39:41 +0100Vector multiplicationhttps://ask.sagemath.org/question/48709/vector-multiplication/ I would like to know why this procedure doesn't work
aa = list(var('delta_%d' % i) for i in (0..2))
c=n(matrix(1,3,(-0.5,0.2,.3)),2)
U = e^(c*transpose(aa))
show(U)Tue, 12 Nov 2019 16:09:27 +0100https://ask.sagemath.org/question/48709/vector-multiplication/Answer by rburing for <p>I would like to know why this procedure doesn't work </p>
<pre><code>aa = list(var('delta_%d' % i) for i in (0..2))
c=n(matrix(1,3,(-0.5,0.2,.3)),2)
U = e^(c*transpose(aa))
show(U)
</code></pre>
https://ask.sagemath.org/question/48709/vector-multiplication/?answer=48710#post-id-48710For one, because you can't transpose `list`s. Secondly, you should take the (single) entry of `c*aa`.
aa = vector(var('delta_%d' % i) for i in (0..2))
c = n(matrix(1,3,(-0.5,0.2,.3)),2)
U = e^((c*aa)[0])
show(U)
$$e^{\left(-0.50 \delta_{0} + 0.19 \delta_{1} + 0.25 \delta_{2}\right)}$$
(Note that you specified 2 *bits* of precision with `n`.)Tue, 12 Nov 2019 16:39:41 +0100https://ask.sagemath.org/question/48709/vector-multiplication/?answer=48710#post-id-48710