Opened 4 years ago

Closed 3 years ago

#26039 closed defect (invalid)

LieAlgebraHomset is not unique

Reported by: gh-ehaka Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: algebra Keywords: Lie algebras, morphisms
Cc: Merged in:
Authors: Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

sage.algebras.lie_algebras.morphism.LieAlgebraHomset does not have the same unique behavior as Hom. A minimal example:

sage: from sage.algebras.lie_algebras.morphism import LieAlgebraHomset
sage: L = LieAlgebra(QQ,1,abelian=True)
sage: LieAlgebraHomset(L,L) == LieAlgebraHomset(L,L)
True
sage: LieAlgebraHomset(L,L) is LieAlgebraHomset(L,L)
False

This causes an issue with pickling for LieAlgebraHomomorphism_im_gens. Running

L.<X> = LieAlgebra(QQ,1,abelian=True)
f = LieAlgebraHomomorphism_im_gens(LieAlgebraHomset(L,L),[X])
f._test_pickling()

outputs

RuntimeError: There is a bug in the coercion code in Sage.
Both x (=Lie algebra endomorphism of Abelian Lie algebra on generator X over Rational Field
  Defn: X |--> X) and y (=Lie algebra endomorphism of Abelian Lie algebra on generator X over Rational Field
  Defn: X |--> X) are supposed to have identical parents but they don't.
In fact, x has parent 'Set of Lie algebra morphisms from Abelian Lie algebra on generator X over Rational Field to Abelian Lie algebra on generator X over Rational Field'
whereas y has parent 'Set of Lie algebra morphisms from Abelian Lie algebra on generator X over Rational Field to Abelian Lie algebra on generator X over Rational Field'
Original elements Lie algebra endomorphism of Abelian Lie algebra on generator X over Rational Field
  Defn: X |--> X (parent Set of Lie algebra morphisms from Abelian Lie algebra on generator X over Rational Field to Abelian Lie algebra on generator X over Rational Field) and Lie algebra endomorphism of Abelian Lie algebra on generator X over Rational Field
  Defn: X |--> X (parent Set of Lie algebra morphisms from Abelian Lie algebra on generator X over Rational Field to Abelian Lie algebra on generator X over Rational Field) and maps
<type 'NoneType'> None
<type 'sage.structure.coerce_maps.DefaultConvertMap_unique'> (map internal to coercion system -- copy before use)
Coercion map:
  From: Set of Lie algebra morphisms from Abelian Lie algebra on generator X over Rational Field to Abelian Lie algebra on generator X over Rational Field
  To:   Set of Lie algebra morphisms from Abelian Lie algebra on generator X over Rational Field to Abelian Lie algebra on generator X over Rational Field

Change History (4)

comment:1 Changed 4 years ago by tscrim

  • Branch develop deleted
  • Commit ada43b34b3b0fdf4ff6cb6a24468565fafbe09ac deleted
  • Milestone changed from sage-8.4 to sage-duplicate/invalid/wontfix
  • Reviewers set to Travis Scrimshaw
  • Status changed from new to needs_review

This is actually the correct behavior I believe. Part of the reason is that Hom already does the caching:

sage: Hom(L,L) is Hom(L,L)
True

The other is that *Homset should (in principle) work with something that is not a UniqueRepresentation, in which case it should not support that UR behavior.

Yes, it is subtle, and I am not completely sure it is properly documented. However, it is what should be happening and you should be using Hom to construct the homset.

comment:2 Changed 4 years ago by gh-ehaka

I see, it seems that indeed also the Homset superclass behaves the same way. Good to know for the future, thanks!

comment:3 Changed 4 years ago by tscrim

  • Status changed from needs_review to positive_review

comment:4 Changed 3 years ago by embray

  • Resolution set to invalid
  • Status changed from positive_review to closed

Presuming these are all correctly reviewed as either duplicate, invalid, or wontfix.

Note: See TracTickets for help on using tickets.