Ticket #3638 (new defect)

Opened 3 months ago

Vector equality coercion problems

Reported by: jbmohler Assigned to: tbd
Priority: major Milestone: sage-3.2
Component: algebra Keywords:
Cc:

Description

I think this bit of code should not produce an exception. The vectors should both be coerced to belong to Z8^3 and compared.

sage: Z8=IntegerModRing(8)
sage: vector(ZZ,[1,2,11])==vector(Z8,[1,2,3])
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
...
AttributeError: 'FreeModule_ambient' object has no attribute 'ambient_vector_space'

Note that a similar thing seems to work in other cases (because 7 is prime and Z7 is a field?).

sage: Z7=IntegerModRing(7)
sage: vector(ZZ,[1,2,10])==vector(Z7,[1,2,3])
True

This may or may not be related, but combining QQ and Z7 produces some wrong results:

sage: Z7=IntegerModRing(7)
sage: vector(Z7,[1,2,3])==vector(QQ,[1,2,3])
False

That those vectors are not equal is truly disturbing. This should either raise an exception about not having compatible parents or should be True. I'll let the coercion guru's argue about that. :)