Opened 5 months ago
Closed 4 months ago
#34175 closed defect (fixed)
`global_height` for polynomials fails when passed the zero polynomial
Reported by:  Jing Guo  Owned by:  

Priority:  minor  Milestone:  sage9.7 
Component:  algebra  Keywords:  gsoc2022 
Cc:  Ben Hutz, Alexander Galarraga  Merged in:  
Authors:  Jing Guo  Reviewers:  Ben Hutz 
Report Upstream:  N/A  Work issues:  
Branch:  b8a2b44 (Commits, GitHub, GitLab)  Commit:  b8a2b4491cf2ce7d2e8499b91e3c27821279c932 
Dependencies:  #34060  Stopgaps: 
Description
The global_height
for polynomials would fail when passed the zero polynomial, since number_of_terms
would return 0, and then it would create a projective space of dimension 1:
sage: R.<x> = QQ[] sage: f = 0 * x sage: f.global_height() error
This ticket aims to fix this.
Change History (6)
comment:1 Changed 5 months ago by
Branch:  → u/ghguojing0/34175_zero_height 

Commit:  → 913fe1511bb171fae3ae4d6bd57958700bf38838 
Status:  new → needs_review 
comment:2 Changed 5 months ago by
Reviewers:  → Ben Hutz 

Status:  needs_review → needs_work 
The idea here is fine, but the return value needs to be of the correct type (i.e., a real number of the appropriate precision)
comment:3 Changed 5 months ago by
Commit:  913fe1511bb171fae3ae4d6bd57958700bf38838 → b8a2b4491cf2ce7d2e8499b91e3c27821279c932 

Branch pushed to git repo; I updated commit sha1. New commits:
b8a2b44  34175: Return zero as real of specific precision

comment:4 Changed 5 months ago by
Status:  needs_work → needs_review 

I thought Sage/Python? would cast to appropriate type, and hence precision.
comment:5 Changed 5 months ago by
Status:  needs_review → positive_review 

comment:6 Changed 4 months ago by
Branch:  u/ghguojing0/34175_zero_height → b8a2b4491cf2ce7d2e8499b91e3c27821279c932 

Resolution:  → fixed 
Status:  positive_review → closed 
Note: See
TracTickets for help on using
tickets.
New commits:
34175: global_height returns zero for zero poly