SR bug?

2 views
Skip to first unread message

Alex Raichev

unread,
Apr 7, 2010, 7:56:01 PM4/7/10
to sage-support
What the?

----------------------------------------------------------------------
| Sage Version 4.3.5, Release Date: 2010-03-28 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: a= matrix([[2,2,I],[2,2,-I],[I,-I,0]]).determinant(); a
8
sage: a^(-1/2)
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)

/Users/arai021/Dropbox/sage_work/<ipython console> in <module>()

/Applications/sage/local/lib/python2.6/site-packages/sage/symbolic/
expression.so in sage.symbolic.expression.Expression.__pow__ (sage/
symbolic/expression.cpp:11892)()

/Applications/sage/local/lib/python2.6/site-packages/sage/rings/
number_field/number_field_element.so in
sage.rings.number_field.number_field_element.NumberFieldElement.__pow__
(sage/rings/number_field/number_field_element.cpp:10038)()

/Applications/sage/local/lib/python2.6/site-packages/sage/symbolic/
power_helper.so in sage.symbolic.power_helper.try_symbolic_power (sage/
symbolic/power_helper.cpp:633)()

/Applications/sage/local/lib/python2.6/site-packages/sage/symbolic/
power_helper.so in sage.symbolic.power_helper.try_symbolic_power (sage/
symbolic/power_helper.cpp:509)()

/Applications/sage/local/lib/python2.6/site-packages/sage/symbolic/
expression.so in sage.symbolic.expression.Expression.__pow__ (sage/
symbolic/expression.cpp:11892)()

/Applications/sage/local/lib/python2.6/site-packages/sage/rings/
rational.so in sage.rings.rational.Rational.__pow__ (sage/rings/
rational.c:15609)()

/Applications/sage/local/lib/python2.6/site-packages/sage/structure/
element.so in sage.structure.element.RingElement.__mul__ (sage/
structure/element.c:11337)()

/Applications/sage/local/lib/python2.6/site-packages/sage/structure/
coerce.so in sage.structure.coerce.CoercionModel_cache_maps.bin_op
(sage/structure/coerce.c:6994)()

TypeError: unsupported operand parent(s) for '*': 'Rational Field' and
'<type 'NoneType'>'

Burcin Erocal

unread,
Apr 8, 2010, 6:12:39 AM4/8/10
to sage-s...@googlegroups.com
Hi Alex,

On Wed, 7 Apr 2010 16:56:01 -0700 (PDT)
Alex Raichev <tortoi...@gmail.com> wrote:

> What the?
>
> ----------------------------------------------------------------------
> | Sage Version 4.3.5, Release Date: 2010-03-28 |
> | Type notebook() for the GUI, and license() for information. |
> ----------------------------------------------------------------------
> sage: a= matrix([[2,2,I],[2,2,-I],[I,-I,0]]).determinant(); a
> 8
> sage: a^(-1/2)
> ---------------------------------------------------------------------------
> TypeError Traceback (most recent call
> last)

<snip traceback>


> TypeError: unsupported operand parent(s) for '*': 'Rational Field' and
> '<type 'NoneType'>'

I opened a ticket:

http://trac.sagemath.org/sage_trac/ticket/8659

Thanks for the report.

Cheers,
Burcin

Jason Grout

unread,
Apr 8, 2010, 10:47:14 AM4/8/10
to sage-s...@googlegroups.com
On 04/08/2010 05:12 AM, Burcin Erocal wrote:
> Hi Alex,
>
> On Wed, 7 Apr 2010 16:56:01 -0700 (PDT)
> Alex Raichev<tortoi...@gmail.com> wrote:
>
>> What the?
>>
>> ----------------------------------------------------------------------
>> | Sage Version 4.3.5, Release Date: 2010-03-28 |
>> | Type notebook() for the GUI, and license() for information. |
>> ----------------------------------------------------------------------
>> sage: a= matrix([[2,2,I],[2,2,-I],[I,-I,0]]).determinant(); a
>> 8
>> sage: a^(-1/2)
>> ---------------------------------------------------------------------------
>> TypeError Traceback (most recent call
>> last)
> <snip traceback>
>> TypeError: unsupported operand parent(s) for '*': 'Rational Field' and
>> '<type 'NoneType'>'


This problem might not be in symbolics, but in number fields:

----------------------------------------------------------------------
| Sage Version 4.3.4, Release Date: 2010-03-19 |


| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: a= matrix([[2,2,I],[2,2,-I],[I,-I,0]]).determinant();

sage: a
8
sage: type(a.pyobject())
<type
'sage.rings.number_field.number_field_element_quadratic.NumberFieldElement_quadratic'>
sage: b=a.pyobject()
sage: b
8
sage: parent(b)
Number Field in I with defining polynomial x^2 + 1
sage: sqrt(b)
2*sqrt(2)
sage: 1/sqrt(b)
1/4*sqrt(2)
sage: b^(-1/2)


---------------------------------------------------------------------------
TypeError Traceback (most recent call last)

/home/jason/<ipython console> in <module>()

/home/jason/sage/local/lib/python2.6/site-packages/sage/rings/number_field/number_field_element.so
in
sage.rings.number_field.number_field_element.NumberFieldElement.__pow__
(sage/rings/number_field/number_field_element.cpp:10038)()

/home/jason/sage/local/lib/python2.6/site-packages/sage/symbolic/power_helper.so
in sage.symbolic.power_helper.try_symbolic_power
(sage/symbolic/power_helper.cpp:633)()

/home/jason/sage/local/lib/python2.6/site-packages/sage/symbolic/power_helper.so
in sage.symbolic.power_helper.try_symbolic_power
(sage/symbolic/power_helper.cpp:509)()

/home/jason/sage/local/lib/python2.6/site-packages/sage/symbolic/expression.so
in sage.symbolic.expression.Expression.__pow__
(sage/symbolic/expression.cpp:11892)()

/home/jason/sage/local/lib/python2.6/site-packages/sage/rings/rational.so in
sage.rings.rational.Rational.__pow__ (sage/rings/rational.c:15609)()

/home/jason/sage/local/lib/python2.6/site-packages/sage/structure/element.so
in sage.structure.element.RingElement.__mul__
(sage/structure/element.c:11337)()

/home/jason/sage/local/lib/python2.6/site-packages/sage/structure/coerce.so
in sage.structure.coerce.CoercionModel_cache_maps.bin_op
(sage/structure/coerce.c:6994)()

TypeError: unsupported operand parent(s) for '*': 'Rational Field' and
'<type 'NoneType'>'


Thanks,

Jason

Reply all
Reply to author
Forward
0 new messages