Skip to content

Can't multiply a linear morphism defined by a matrix by an element of the base field #16830

@nthiery

Description

@nthiery
sage: K = GF(7); K
Finite Field of size 7
sage: sage: phi = End(K^2)([[1,1],[1,1]])
sage: phi
Vector space morphism represented by the matrix:
[1 1]
[1 1]
Domain: Vector space of dimension 2 over Finite Field of size 7
Codomain: Vector space of dimension 2 over Finite Field of size 7
sage: 2*phi
Vector space morphism represented by the matrix:
[2 2]
[2 2]
Domain: Vector space of dimension 2 over Finite Field of size 7
Codomain: Vector space of dimension 2 over Finite Field of size 7

So far, so good. But:

sage: K(2)*phi
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-35-81e4c450e31e> in <module>()
----> 1 K(Integer(2))*phi

/opt/sage-git/local/lib/python2.7/site-packages/sage/structure/element.so in sage.structure.element.RingElement.__mul__ (build/cythonized/sage/structure/element.c:15355)()

/opt/sage-git/local/lib/python2.7/site-packages/sage/structure/coerce.so in sage.structure.coerce.CoercionModel_cache_maps.bin_op (build/cythonized/sage/structure/coerce.c:8323)()

TypeError: unsupported operand parent(s) for '*': 'Finite Field of size 7' and 'Set of Morphisms (Linear Transformations) from Vector space of dimension 2 over Finite Field of size 7 to Vector space of dimension 2 over Finite Field of size 7'

In particular this prevents illustrating Cayley-Hamilton on the morphism side:

sage: phi.characteristic_polynomial()(phi)
...
TypeError: unsupported operand parent(s) for '*': 'Finite Field of size 7' and 'Set of Morphisms (Linear Transformations) from Vector space of dimension 2 over Finite Field of size 7 to Vector space of dimension 2 over Finite Field of size 7'

Update 2016/09/20: things have gotten even worse. Now 2*phi does not work anymore.

CC: @tscrim

Component: linear algebra

Issue created by migration from https://trac.sagemath.org/ticket/16830

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions