id	summary	reporter	owner	description	type	status	priority	milestone	component	resolution	keywords	cc	work_issues	upstream	reviewer	author	merged	dependencies	stopgaps
11257	Avoid a coercion when computing an element to the power of 0	nborie	nborie	"In the generic structure of element, a coercion is called to compute an element z to the power of 0 : z^0

The goal of this ticket is trying to replace all call of Parent(1) by Parent.one() to avoid the coercion. (and hope Sage is ready for a such change...)

Before :
{{{
sage: K = CyclotomicField(46)
sage: z = K.gen()
sage: %prun z^0
         11 function calls in 0.000 CPU seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000    0.000    0.000 number_field.py:4871(_coerce_non_number_field_element_in)
        1    0.000    0.000    0.000    0.000 <string>:1(<module>)
        1    0.000    0.000    0.000    0.000 number_field.py:6702(_element_constructor_)
        1    0.000    0.000    0.000    0.000 number_field.py:4221(polynomial_ntl)
        4    0.000    0.000    0.000    0.000 {isinstance}
        1    0.000    0.000    0.000    0.000 number_field.py:4210(absolute_polynomial_ntl)
        1    0.000    0.000    0.000    0.000 gap.py:1299(is_GapElement)
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}

sage: %prun z^3
         2 function calls in 0.000 CPU seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000    0.000    0.000 <string>:1(<module>)
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
}}}

And for the speed :
{{{
sage: timeit('z^0')
625 loops, best of 3: 28 µs per loop
sage: timeit('z^3')
625 loops, best of 3: 7.78 µs per loop
}}}

depends on #9065
depends on #9138"	enhancement	closed	major	sage-5.0	performance	fixed	coercion, element, power, zero, Cernay2012	sage-combinat SimonKing		N/A	Nathann Cohen	Nicolas Borie	sage-5.0.beta4	#11900	
