[sage-support] field of symbolic expressions

2010-09-06 Thread Michael Beeson
I want to create a vector space of dimension three,  over the field
whose elements are symbolic expressions.   (The reason is that then I
can do vector calculus on such objects, which represent surfaces in 3-
space if the expressions depend on 2 parameters.)   How can I do
this?  The following, for example, doesn't work:


sage: cos(t)
cos(t)
sage: type(cos(t))
type 'sage.symbolic.expression.Expression'
sage: V = VectorSpace(Expression,3)
---
AttributeErrorTraceback (most recent call
last)

/Users/beeson/ipython console in module()

/Applications/sage/local/lib/python2.6/site-packages/sage/modules/
free_module.pyc in VectorSpace(K, dimension, sparse,
inner_product_matrix)
399 TypeError: Argument K (= Integer Ring) must be a
field.
400 
-- 401 if not K.is_field():
402 raise TypeError, Argument K (= %s) must be a field.
% K
403 if not sparse in (True,False):

AttributeError: type object 'sage.symbolic.expression.Expression' has
no attribute 'is_field'

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] field of symbolic expressions

2010-09-06 Thread Mike Hansen
On Mon, Sep 6, 2010 at 11:58 AM, Michael Beeson profbee...@gmail.com wrote:
 I want to create a vector space of dimension three,  over the field
 whose elements are symbolic expressions.   (The reason is that then I
 can do vector calculus on such objects, which represent surfaces in 3-
 space if the expressions depend on 2 parameters.)   How can I do
 this?  The following, for example, doesn't work:

Use SR instead of Expression:

sage: cos(x).parent()
Symbolic Ring
sage: SR
Symbolic Ring
sage: VectorSpace(SR, 3)
Vector space of dimension 3 over Symbolic Ring

--Mike

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org