On Friday, January 1, 2016 at 2:41:25 PM UTC-8, saad khalid wrote:
>
> The error I'm getting when I plug in a and b into fx1y0 is this:
>
> TypeError: unsupported operand parent(s) for '+': 'Vector space of dimension 
> 1 over Symbolic Ring' and 'Integer Ring'
>
>
> I think the problem is that it is treating a and b as 1 dimensional vectors, 
> when all I want is for a and b to contain the values at the location in the 
> matrix that I specify. Basically, I think I want it to treat the matrix as an 
> array, in terms of me getting values from it. Does anyone know how I could 
> fix this? 
>
>
You are correct: AC is a 2-by-1 matrix, and AC[0] selects the first row. 
You can select the appropriate elements via

a = AC[0,0]
b = AC[1,0]

or

a = AC[0][0]
b = AC[1][0]

Note that vectors in sage are normally row vectors, so you if you rewrite 
it so that C can be a row vector, you can avoid this problem:

AC = C*A(3,2).transpose()
a = AC[0]
b = AC[1]

(if you go this route, you should rewrite the definition of A so that no 
transpose is required, of course)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to