Ask Your Question
1

What is the name of a tensor product?

asked 2012-02-27 18:33:16 +0100

darijgrinberg gravatar image

updated 2012-02-27 18:34:09 +0100

I have a tensor like

tensor([a,b,c])

where a, b, c lie in some CombinatorialFreeModule. Where (in Sage syntax) does this tensor lie? (I need to know, because I am writing a function using module_morphism, and it requires me to explicitly specify its codomain.)

Writing

type(tensor([a,b,c]))

doesn't help (it just gives generic trash).

edit retag flag offensive close merge delete

Comments

What does `parent(tensor([a,b,c]))` say?

John Palmieri gravatar imageJohn Palmieri ( 2012-02-27 20:09:04 +0100 )edit

It says, in my case, "The Malvenuto-Reutenauer Hopf algebra over <class 'sage.interfaces.r.r'=""> # The Malvenuto-Reutenauer Hopf algebra over <class 'sage.interfaces.r.r'="">". I wish it would just give me the damned type name...

darijgrinberg gravatar imagedarijgrinberg ( 2012-02-27 20:15:34 +0100 )edit

?! Something's gone horribly wrong. That "R" isn't the R of the reals, it's the R of the statistical package.

DSM gravatar imageDSM ( 2012-02-27 20:27:49 +0100 )edit

It's supposed to be QQ (the rationals)... and I have no idea how the R package could have entered the picture. Here is the part of the code necessary to reproduce the mess: http://mit.edu/~darij/www/wtf.htm / http://mit.edu/~darij/www/wtf.sws

darijgrinberg gravatar imagedarijgrinberg ( 2012-02-27 20:35:36 +0100 )edit

PS. I have taken the tensor of two rather than three elements to simplify the situation.

darijgrinberg gravatar imagedarijgrinberg ( 2012-02-27 20:36:27 +0100 )edit

2 Answers

Sort by ยป oldest newest most voted
4

answered 2012-02-28 10:45:58 +0100

The tensor should lie in tensor([a,b,c]).parent(), which should be the same as parent(tensor([a,b,c])).

sage: a = SteenrodAlgebra(2).an_element()
sage: M = CombinatorialFreeModule(GF(2), 's,t,u')
sage: s = M.basis()['s']
sage: T = tensor([a,s])
sage: parent(T)
mod 2 Steenrod algebra, milnor basis # Free module generated by s,t,u over Finite Field of size 2            
sage: type(parent(T))
<class 'sage.combinat.free_module.CombinatorialFreeModule_Tensor_with_category'>
edit flag offensive delete link more

Comments

Well, I want something that I can use as a codomain for a map. I surely can't write "codomain=mod 2 Steenrod algebra, milnor basis" or "codomain=sage.combinat.free_module.CombinatorialFreeModule_Tensor_with_category".

darijgrinberg gravatar imagedarijgrinberg ( 2012-02-28 18:30:07 +0100 )edit
1

No, but you can write `A = parent(...)`.

John Palmieri gravatar imageJohn Palmieri ( 2012-02-28 19:45:35 +0100 )edit

It works. Thank you!

darijgrinberg gravatar imagedarijgrinberg ( 2012-02-28 21:56:46 +0100 )edit
1

answered 2012-02-28 08:03:55 +0100

niles gravatar image

Other than type, a good trick is to look at the top of the output from introspection:

sage: tensor?
Base Class:     <class 'sage.categories.tensor.TensorProductFunctor'>
String Form:    The tensor functorial construction
Namespace:      Interactive
File:           /Applications/sage/local/lib/python2.6/site-packages/sage/categories/tensor.py
Definition:     tensor(self, args)
Docstring:
...

Two questionmarks, as in

sage: tensor??

will get you the source code too, or you can browse an html version, which is sometimes more helpful.

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

Stats

Asked: 2012-02-27 18:33:16 +0100

Seen: 969 times

Last updated: Feb 28 '12