Opened 8 years ago

Closed 8 years ago

#14047 closed defect (fixed)

AttributeError: 'AlgebraicReal' object has no attribute 'conjugate'

Reported by: gagern Owned by: davidloeffler
Priority: major Milestone: sage-5.11
Component: number fields Keywords: conjugate, AlgebraicReal
Cc: Merged in: sage-5.11.rc0
Authors: Robert Harron Reviewers: Christelle Vincent
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

In sage 5.5 I see the following behaviour:

sage: Matrix(AA, [[1]]).gram_schmidt()
[…]
AttributeError: 'AlgebraicReal' object has no attribute 'conjugate'
sage: AA(1).conjugate()
[…]
AttributeError: 'AlgebraicReal' object has no attribute 'conjugate'
sage: conjugate(AA(1))
1

So I'd say either gram_schmidt (or its backends) should be modified to use the conjugate function instead of the conjugate method. Or the base class for real algebraic numbers should be changed to provide that method. The latter would be more likely to resolve issues similar to this one, in existing and future code, shipped with sage or written by third parties. The former might help for other fields which don't support a conjugate method either.

Attachments (1)

trac_14047_conjugate_method_for_AlgebraicReal_and_doctest_gram_schmidt.patch (2.2 KB) - added by robharron 8 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 8 years ago by robharron

  • Authors set to Robert Harron
  • Keywords conjugate AlgebraicReal added
  • Status changed from new to needs_review

The algebraic reals should definitely have a conjugate method, so I've added that. I also added a doctest in gram_schmidt to test that it now works with algebraic reals (I used the example for QQbar that only has integers and doing the computation with algebraic reals instead of QQbar is in fact faster!).

comment:2 Changed 8 years ago by christelle

  • Status changed from needs_review to positive_review

Everything looks good!

comment:3 Changed 8 years ago by jdemeyer

  • Status changed from positive_review to needs_info

Please add your real name as Reviewer.

comment:4 Changed 8 years ago by christelle

  • Reviewers set to Christelle Vincent
  • Status changed from needs_info to positive_review

comment:5 Changed 8 years ago by jdemeyer

  • Merged in set to sage-5.11.rc0
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.