Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question
1

Inner products with dimension n.

asked 2 years ago

Luis gravatar image

Is there a way to work with inner products with unspecified dimension in Sage? All the options that I've been able to find e.g. FreeModule have a required argument that asks for a dimension, basis or rank of some sort.

Ideally, what I need would work like:

INN = InnerProdSpace(RR); u, v = INN(u,v); u.dot(v)

and it would be able to perform basic simplifications like:

u.dot(v + ru) = u.dot(v) + ru.dot(u)

I know that some modules like VectorSpace already do this and much more; but I would like to do it without needing to specify the dimension.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 2 years ago

Sylvain gravatar image

You may use symbolic variables and interpret the * operator as the inner poduct:

sage: u,v,r = var("u v r")
sage: (u*(v+r*u)).expand()
r*u^2 + u*v
Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2 years ago

Seen: 319 times

Last updated: Sep 02 '22