Opened 4 years ago

Last modified 4 years ago

#23252 new enhancement

Implement coercions in the category framework

Reported by: tscrim Owned by:
Priority: major Milestone: sage-8.0
Component: coercion Keywords:
Cc: jpflori Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: public/categories/coerce_map_from-23252 (Commits, GitHub, GitLab) Commit: f06ce84b62a1e24f0d970dec2fba3147bcb89574
Dependencies: Stopgaps:

Status badges

Description (last modified by tscrim)

Currently there is no way to implement coercions using categories because of the default implementation of Parent._coerce_map_from_. We currently have two proposals for how to do these.

1) Use the normal hook _coerce_map_from_ with a requirement to the effect of all classes must make a supercall up if not handled. Naturally calling successive super._coerce_map_from_ is feasible and fits to an extent within the current coercion framework, but there are technical limitations with doing this in Python 2 within the category classes.

2) Implement a coercion hook in the relevant ConstructionFunctor (subclasses) with an additional check of this hook in the coercion discovery. This would better reflect the mathematics as the new morphisms usually come from applying the functor to a morphism.

See the discussion on #18700.

Change History (4)

comment:1 Changed 4 years ago by tscrim

  • Branch set to public/categories/coerce_map_from-23252
  • Commit set to f06ce84b62a1e24f0d970dec2fba3147bcb89574

Branch with previous work from Nicolas on #18700. It will probably have a merge conflict with #18700, but I did that so my revert commit will not get applied.


Last 10 new commits:

d07f67018700: lift all features of the GroupAlgebra class to the algebra functor and categories + doc
467fedc18700: lift CombinatorialFreeModule.gens to Modules.WithBasis.FiniteDimensional
499629d18700: conversion from formal sums to CombinatorialFreeModule
1da295a18700: Implement Permutations.degree, for consistency with SymmetricGroup
40c589a18700: Implement PermutationGroup.ngens, for consistency with its gen(i), ngens, ...
bd0778c18700: Symmetric group algebra: better support for SymmetricGroupAlgebra(0, QQ)
ad8875018700: lift group-algebra related methods up the categories
9a62ea118700: follow up on getting rid of GroupAlgebra + documentation cleanup from previous commit
c23f05318700: trivial documentation updates
f06ce8418700: fix generalization of Modules.WithBasis.random_element

comment:2 Changed 4 years ago by tscrim

  • Description modified (diff)

comment:3 Changed 4 years ago by jpflori

  • Cc jpflori added

comment:4 Changed 4 years ago by jdemeyer

What is this ticket about? It's hard to understand from the ticket description...

Note: See TracTickets for help on using tickets.