Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

resize 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');

var('sigma');

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

x.parent()

Vector space of dimension 2 over Symbolic Ring

and

sigma.parent() Symbolic Ring

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

resize 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');

var('sigma');

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

x.parent()

Vector space of dimension 2 over Symbolic Ring

and

sigma.parent() Symbolic Ring

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

resize 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');

var('sigma');

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

x.parent()

Vector space of dimension 2 over Symbolic Ring

and

sigma.parent() Symbolic Ring

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