Ask Your Question

Tomas's profile - activity

2018-12-10 15:03:37 +0200 received badge  Famous Question (source)
2018-11-16 14:50:26 +0200 received badge  Notable Question (source)
2018-01-16 16:44:21 +0200 received badge  Popular Question (source)
2016-09-12 06:03:40 +0200 received badge  Notable Question (source)
2016-06-28 16:30:11 +0200 received badge  Famous Question (source)
2016-06-28 16:30:11 +0200 received badge  Notable Question (source)
2016-06-28 16:30:11 +0200 received badge  Popular Question (source)
2016-02-05 01:09:35 +0200 received badge  Popular Question (source)
2014-01-22 08:57:11 +0200 received badge  Student (source)
2014-01-22 07:43:46 +0200 asked a question sage-mode in emacs

I'm trying to get the syntax highlighting to work in emacs. I have tried to install sage-mode following the manual on the

This fail on running the first command: $ sage -f sage_mode with error message sage-run received unknown option: -f

I use Sage Version 5.9.

Could someone help me with this please?

2013-08-30 05:40:04 +0200 commented question Long expression in printed-out documents

I have the same problem. My equations are way too long to be shown on one line in pdf file. I have tried to export it to LaTeX and split manually, but it is not an easy job to do. Have you found any solution for that?

2013-08-20 07:06:15 +0200 commented answer vector derivative returns a scalar

Anyway, I reckon that the first example is probably a bug. The derivative of n-dimensional vector should have n-dimensions again no matter to which ring it belongs to. Would you know how to report that, please?

2013-08-20 06:57:21 +0200 marked best answer vector derivative returns a scalar

Look at the help of derivative. It works on symbolic functions, polynomials, and symbolic expressions. Your variable u is not a function, so it is not really being considered a two dimensional symbolic expression or function. If you do

sage: u(x,y) = matrix(1,2,[-1,1])
sage: derivative(u, x)
(x, y) |--> 0

then you can see that it is considering it as a two dimensional function. In the second case, you have a function of one variable in the variable x.

The alternative fix is to work in the symbolic ring:

sage: u = matrix(SR, [-1,1])
sage: derivative(u,x)
[0 0]
2013-08-20 06:57:21 +0200 received badge  Scholar (source)
2013-08-20 06:56:47 +0200 commented answer vector derivative returns a scalar

Thanks, the fix with a symbolic ring is helpful. In my problem the $\vec{u}$ really is a function, just happens to be a constant at this occasion.

2013-08-19 12:45:42 +0200 commented question vector derivative returns a scalar

Compared to: a(x) = function('a',x) b(x) = function('b',x) u = matrix(1,2,[a,b]) r = derivative(u,x);r Which gives a vector as expected: [x |--> D[0](a)(x) x |--> D[0](b)(x)]

2013-08-19 12:38:26 +0200 asked a question vector derivative returns a scalar

Trying to obtain the derivative of $\vec{u} = [-1,1]$ using the following code:

u = matrix(1,2,[-1, 1])

r = derivative(u,x); r

I get a scalar value 0.

Although according the following relation it should be a 2-dimensional zero vector.

$$\frac{\mathrm{d} \vec{u}}{\mathrm{d} x} =\frac{\mathrm{d}}{\mathrm{d} x} [-1, 1] = [ \frac{\mathrm{d}}{\mathrm{d} x}(-1), \frac{\mathrm{d}}{\mathrm{d} x}(1) ] = [0, 0]$$

Why does it happen? In the case it's a bug where could I report it?


2013-08-15 10:10:02 +0200 received badge  Self-Learner (source)
2013-08-15 10:10:02 +0200 received badge  Teacher (source)
2013-08-15 08:36:41 +0200 answered a question append a variable to a vector

So an solution which work is to convert the vector to a list, append the new variable and convert to a vector again. The code for that would be as follows:

u = x.list()


u = vector(u)

Do you see any potential problems with this solution? Why there is no method append in vector? Could I do better?

2013-08-15 08:07:50 +0200 received badge  Supporter (source)
2013-08-15 06:26:48 +0200 received badge  Editor (source)
2013-08-15 06:23:40 +0200 asked a question append a variable to a vector

I would like to define a new vector in Sage $\vec{u} = [O, P, \sigma]$ using a previously defined vecotor $\vec{x} = [O, P]$ and a new variable $\sigma$.

My code looks like:

var(’O, P');


x = vector([O,P]);

u = vector([x, sigma]);

Which gives an error:

TypeError: unable to find a common ring for all elements

Apparently this is because vector() requires the variables to be of the same ring. In my case


Vector space of dimension 2 over Symbolic Ring


sigma.parent() Symbolic Ring

There is any way how to connect this two objects ($\vec{x}$, $\sigma$) together to create one vector?