Opened 4 years ago

Closed 3 years ago

#27081 closed enhancement (fixed)

Section for composite maps

Reported by: Sebastian Oehms Owned by:
Priority: major Milestone: sage-8.9
Component: categories Keywords: section map
Cc: Merged in:
Authors: Sebastian Oehms Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: bb25f16 (Commits, GitHub, GitLab) Commit: bb25f1664654e85e4eddee8e356dfd8d876b916d
Dependencies: Stopgaps:

Status badges


Currently, a section method for the class FormalCompositeMap is not implemented. This ticket supplies a section in cases, where all factors of the composite map have section implemented.

Examples which will be improved are:

sage: P.<x> = QQ[]
sage: P.coerce_map_from(ZZ).section() is None
sage: k = GF(47)
sage: R.<x> = PolynomialRing(k)
sage: R.coerce_map_from(ZZ).section() is None

Change History (9)

comment:1 Changed 4 years ago by Sebastian Oehms

Branch: u/soehms/section_of_composite_map_27081

comment:2 Changed 4 years ago by Sebastian Oehms

Commit: 3fd303ece2b1cefc9bcec69e67de88391d7d8038
Status: newneeds_review

New commits:

3fd303e27081: initial version

comment:3 Changed 4 years ago by Erik Bray

Milestone: sage-8.7sage-8.8

Ticket retargeted after milestone closed (if you don't believe this ticket is appropriate for the Sage 8.8 release please retarget manually)

comment:4 Changed 3 years ago by Erik Bray

Milestone: sage-8.8sage-8.9

Moving tickets from the Sage 8.8 milestone that have been actively worked on in the last six months to the next release milestone (optimistically).

comment:5 Changed 3 years ago by Travis Scrimshaw

Reviewers: Travis Scrimshaw

Sorry for letting my review of this take so long. Once these changes are done, then it is a positive review:

-        Compute a section map from sections of the factors of self if they have been implemented
+        Compute a section map from sections of the factors of
+        ``self`` if they have been implemented.

I would write this with short-circuiting and the reversal already built-in:

        sections = []
        for m in reversed(self):
                sec = m.section()
            except TypeError:
                return None
            if sec is None:
                return None

        from sage.categories.homset import Hom
        from sage.categories.sets_with_partial_maps import SetsWithPartialMaps
        H = Hom(self.codomain(), self.domain(), category=SetsWithPartialMaps())
        return FormalCompositeMap(H, sections)

Capitalize the beginning of the .. NOTE:: in polynomial_element.pyx.

comment:6 Changed 3 years ago by git

Commit: 3fd303ece2b1cefc9bcec69e67de88391d7d8038bb25f1664654e85e4eddee8e356dfd8d876b916d

Branch pushed to git repo; I updated commit sha1. New commits:

c049ce9Merge branch 'u/soehms/section_of_composite_map_27081' of git:// into section_of_composite_map_27081
bb25f1627081: corrections according to review

comment:7 Changed 3 years ago by Sebastian Oehms

thanks, Travis! I'll be waiting for the patchbot!

comment:8 Changed 3 years ago by Travis Scrimshaw

Status: needs_reviewpositive_review

Thank you.

comment:9 Changed 3 years ago by Volker Braun

Branch: u/soehms/section_of_composite_map_27081bb25f1664654e85e4eddee8e356dfd8d876b916d
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.