1 | initial version |
In general it is entirely unclear if "writing out" a composite map is easier/more efficient than keeping the composite form. It depends on the implementations of the maps and the way the maps get used subsequently. Sage is taking a cautious approach here and leaves the map in the form closest to how it's given. It has one optimization: If the identity map finds it gets precomposed with another map than it knows to just return the other map (multiplication happens left-to-right in python). Apparently the other maps don't check if the map they get precomposed with is the identity map. They could, but the test might be more expensive than the gains made.
You can always work out the composed map by using it on the generators:
sage: g=f*one
sage: U.Hom(U)([g(a) for a in U.gens()])
Ring endomorphism of Cyclotomic Field of order 3 and degree 2
Defn: zeta3 |--> -zeta3 - 1