#11199: QuotientRing elements are not callable
-----------------------------+----------------------------------------------
   Reporter:  vbraun         |          Owner:  AlexGhitza  
       Type:  enhancement    |         Status:  needs_info  
   Priority:  major          |      Milestone:  sage-4.7.1  
  Component:  algebra        |       Keywords:              
Work_issues:                 |       Upstream:  N/A         
   Reviewer:  John Palmieri  |         Author:  Volker Braun
     Merged:                 |   Dependencies:              
-----------------------------+----------------------------------------------
Changes (by jhpalmieri):

  * status:  needs_review => needs_info
  * reviewer:  => John Palmieri


Old description:

> It would be convenient if quotient ring elements would be callable like
> polynomials. This is currently not the case:
> {{{
> sage: R.<x,y> = QQ[]
> sage: I = R.ideal(x)
> sage: Q = R.quotient_ring(I)
> sage: Q
> Quotient of Multivariate Polynomial Ring in x, y over Rational Field by
> the ideal (x)
> sage: Q.inject_variables()
> Defining xbar, ybar
> sage: p = xbar + ybar
> sage: p(1,1)
> ---------------------------------------------------------------------------
> TypeError                                 Traceback (most recent call
> last)
>
> /home/vbraun/opt/sage-4.7.alpha4/devel/sage-main/<ipython console> in
> <module>()
>
> TypeError: 'QuotientRingElement' object is not callable
> }}}
>
> The attached patch implements this functionality by handing the argument
> through to the lift.
>
> Arguably, it should check that the result does not depend on the
> presentation. Pro: catches errors; Con: potentially slow, ideal
> membership test necessary if arguments are polynomials.

New description:

 It would be convenient if quotient ring elements would be callable like
 polynomials. This is currently not the case:
 {{{
 sage: R.<x,y> = QQ[]
 sage: I = R.ideal(x)
 sage: Q = R.quotient_ring(I)
 sage: Q
 Quotient of Multivariate Polynomial Ring in x, y over Rational Field by
 the ideal (x)
 sage: Q.inject_variables()
 Defining xbar, ybar
 sage: p = xbar + ybar
 sage: p(1,1)
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)

 /home/vbraun/opt/sage-4.7.alpha4/devel/sage-main/<ipython console> in
 <module>()

 TypeError: 'QuotientRingElement' object is not callable
 }}}

 The attached patch implements this functionality by handing the argument
 through to the lift.

 Arguably, it should check that the result does not depend on the
 presentation. Pro: catches errors; Con: potentially slow, ideal membership
 test necessary if arguments are polynomials.

 ---------

 Apply [attachment:trac_11199-jhp.patch].

--

Comment:

 Evaluating an element of a quotient ring doesn't make mathematical sense
 in general, only if it makes sense to evaluate the lift: if you're taking
 a quotient of a group algebra or the p-adics, what does it mean to
 evaluate an element of it?  I'm attaching a new patch which adds a comment
 about this to the docstring; is this enough warning?

 I'm happy with the original patch as far as it goes, and I'm almost ready
 to give it a positive review, but I'd like to hear opinions about the
 issue I raised.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11199#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to