Ask Your Question
1

Inner products with dimension $n$.

asked 2022-07-28 04:54:36 +0200

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-09-02 10:41:48 +0200

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
edit flag offensive delete link more

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: 2022-07-28 04:54:36 +0200

Seen: 171 times

Last updated: Sep 02 '22