Ask Your Question

A.S.'s profile - activity

2024-02-16 11:34:17 +0200 received badge  Popular Question (source)
2020-07-04 11:11:42 +0200 received badge  Good Question (source)
2020-07-03 13:48:19 +0200 received badge  Nice Question (source)
2020-06-22 21:13:38 +0200 received badge  Student (source)
2020-06-22 20:00:11 +0200 asked a question How to use forgetful functors effectively in Sage?

I am trying to define a linear operator on a graded commutative algebra in Sage. The only way I know to do this is to forget the multiplication on the algebra, and then to define a linear operator in the underlying vector space.

Here is some Sage code, with output:

sage: A.<h1, h2> = GradedCommutativeAlgebra(QQ, degrees=(1, 1))
sage: A.category()
Category of graded algebras over Rational Field
sage: F = ForgetfulFunctor(A.category(), Modules(QQ).Graded())
sage: F(A).category()
Category of graded algebras over Rational Field

Evidently Sage forgets the multiplication on the graded commutative algebra A, but then immediately re-remembers the multiplication, so that the forgetful functor applied to A simply returns A again?

I have tried many variations on this code, e.g. switching to a forgetful functor landing in Q-vector spaces rather than graded Q-modules, ForgetfulFunctor(A.category(), Modules(QQ).Graded()), yields the error message:

TypeError: 'GCAlgebra_with_category' object has no attribute 'vector_space'

What am I missing here?

Even if this odd behavior of forgetful functors can't be figured out, I would be satisfied with another way to get what I want in the end: I am trying to define the Hodge star operator on the Chevalley-Eilenberg DGA of some specific Lie algebras given by specific presentations. While Sage supports the Hodge star on the differential forms on a manifold, it is not obvious how to write down an explicit Lie group whose Lie algebra is any specific one in this family of Lie algebras, and our Lie algebras are also defined over finite fields, so we would prefer to not have the restriction to characteristic zero that comes with the differential forms on a manifold.