Suppose I have a free module M over QQ[x]. How do I obtain the underlying QQ vector space? FreeModule does not have this coercion:

sage: R = PolynomialRing(QQ,'x')
sage: R in CommutativeAlgebras(QQ)
True
sage: M = FreeModule(R,3)
sage: M in VectorSpaces(QQ)
False


And CombinatorialFreeModule only takes already subcategories of QQ-vector spaces:


sage: M = CombinatorialFreeModule(QQ, ['a','b','c'], category=Modules(R))
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
....
ValueError: Subcategory of Category of vector spaces with basis over Rational Field required; got Category of modules over Univariate Polynomial Ring in x over Rational Field

edit retag close merge delete

Sort by ยป oldest newest most voted
sage: R = PolynomialRing(QQ,'x')
sage: R in CommutativeAlgebras(QQ)
True
sage: M = FreeModule(R,3)
sage: M.parent()
<class 'sage.modules.free_module.FreeModule_ambient_pid_with_category'>
sage: m=M.random_element()
sage: m.parent()
Ambient free module of rank 3 over the principal ideal domain Univariate Polynomial Ring in x over Rational Field


more

Perhaps, I don't understand, which object is an instance of VectorSpaces(QQ).parent_class? or which object is in VectorSpaces(QQ)?

( 2019-09-11 16:12:25 +0200 )edit