Ask Your Question
1

Problem with invariant_module()

asked 2021-12-19 12:34:12 +0200

guillecarrion gravatar image

updated 2022-05-01 18:29:09 +0200

FrédéricC gravatar image

Hello, sorry if I'm doing something bad, I'm super noob using Sage in my computer instead of using CoCalc server.

I'm learning about representation theory and I want to make some computations using sagemath.

When I'm using my jupyter notebook repeating the example provided by sage's tutorial we have an error when I call the function invariant_module() I get the following error:

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
/Applications/SageMath-9.2.app/Contents/Resources/sage/local/lib/python3.8/site-packages/sage/structure/category_object.pyx in sage.structure.category_object.CategoryObject.getattr_from_category (build/cythonized/sage/structure/category_object.c:7075)()
    838         try:
--> 839             return self.__cached_methods[name]
    840         except KeyError:

KeyError: 'invariant_module'

During handling of the above exception, another exception occurred:

AttributeError                            Traceback (most recent call last)
<ipython-input-3-e8a722bdce17> in <module>
      1 from sage.modules.with_basis.representation import Representation
      2 R = Representation(G, M, action)
----> 3 I = R.invariant_module()

/Applications/SageMath-9.2.app/Contents/Resources/sage/local/lib/python3.8/site-packages/sage/structure/category_object.pyx in sage.structure.category_object.CategoryObject.__getattr__ (build/cythonized/sage/structure/category_object.c:6994)()
    831             AttributeError: 'PrimeNumbers_with_category' object has no attribute 'sadfasdf'
    832         """
--> 833         return self.getattr_from_category(name)
    834 
    835     cdef getattr_from_category(self, name):

/Applications/SageMath-9.2.app/Contents/Resources/sage/local/lib/python3.8/site-packages/sage/structure/category_object.pyx in sage.structure.category_object.CategoryObject.getattr_from_category (build/cythonized/sage/structure/category_object.c:7160)()
    846                 cls = self._category.parent_class
    847 
--> 848             attr = getattr_from_other_class(self, cls, name)
    849             self.__cached_methods[name] = attr
    850             return attr

/Applications/SageMath-9.2.app/Contents/Resources/sage/local/lib/python3.8/site-packages/sage/cpython/getattr.pyx in sage.cpython.getattr.getattr_from_other_class (build/cythonized/sage/cpython/getattr.c:2553)()
    365         dummy_error_message.cls = type(self)
    366         dummy_error_message.name = name
--> 367         raise AttributeError(dummy_error_message)
    368     cdef PyObject* attr = instance_getattr(cls, name)
    369     if attr is NULL:

AttributeError: 'Representation_with_category' object has no attribute 'invariant_module'

But if I try in Cocalc I have no problem. Am I doing something bad?

edit retag flag offensive close merge delete

Comments

2

Probably CoCalc uses a more recent version of SageMath, so you should try updating your local installation.

rburing gravatar imagerburing ( 2021-12-19 17:57:11 +0200 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2021-12-20 07:15:32 +0200

updated 2021-12-20 07:17:42 +0200

Building off what @rburing said, it looks like the invariant_modulemethod was added in Sage 9.4, and you are running version 9.2. See https://trac.sagemath.org/ticket/31939: this ticket implements invariant modules, invariant algebras, etc., and it was merged about 5 months ago. Sage 9.2 was released in October 2020, 14 months ago.

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

1 follower

Stats

Asked: 2021-12-19 12:34:12 +0200

Seen: 182 times

Last updated: Dec 20 '21