Opened 5 years ago
Closed 2 years ago
#11783 closed defect (fixed)
bug in DirichletGroup and/or DirichletCharacter when the modulus is 1
Reported by:  was  Owned by:  was 

Priority:  major  Milestone:  sage6.2 
Component:  number theory  Keywords:  
Cc:  Merged in:  
Authors:  Alex Ghitza  Reviewers:  Peter Bruin 
Report Upstream:  N/A  Work issues:  
Branch:  0693286 (Commits)  Commit:  06932866de2e5308e2bdf58d137e6e9911f29460 
Dependencies:  Stopgaps: 
Description
Observe that the value of chi(1) below depends on whether chi.values()
is called first. Thus there is certainly a bug. I think we should always have chi(1)=1
, since gcd(1,1)=1
; this is also consistent with the rule that if psi is trivial but not primitive, then psi(n)=1
for all n coprime to the modulus of psi.
See this thread: http://groups.google.com/group/sagedevel/browse_thread/thread/fa94a97612c7225b
wstein@ubuntu:~$ sage   Sage Version 4.7.2.alpha2, Release Date: 20110818   Type notebook() for the GUI, and license() for information.   ********************************************************************** * * * Warning: this is a prerelease version, and it may be unstable. * * * ********************************************************************** sage: chi = DirichletGroup(1)[0] sage: chi(1) 1 sage: chi.values() [1] sage: Exiting Sage (CPU time 0m0.09s, Wall time 0m18.02s). wstein@ubuntu:~$ sage   Sage Version 4.7.2.alpha2, Release Date: 20110818   Type notebook() for the GUI, and license() for information.   ********************************************************************** * * * Warning: this is a prerelease version, and it may be unstable. * * * ********************************************************************** sage: chi = DirichletGroup(1)[0] sage: chi.values() [0] sage: chi(1) 0
Change History (7)
comment:1 Changed 3 years ago by
 Milestone changed from sage5.11 to sage5.12
comment:2 Changed 3 years ago by
 Milestone changed from sage6.1 to sage6.2
comment:3 Changed 2 years ago by
comment:4 Changed 2 years ago by
 Branch set to u/AlexGhitza/ticket/11783
 Modified changed from 04/24/14 08:22:09 to 04/24/14 08:22:09
comment:5 Changed 2 years ago by
 Commit set to 06932866de2e5308e2bdf58d137e6e9911f29460
 Status changed from new to needs_review
New commits:
0693286  doctest to verify fix of issue with DirichletCharacter of modulus 1

comment:6 Changed 2 years ago by
 Reviewers set to Peter Bruin
 Status changed from needs_review to positive_review
comment:7 Changed 2 years ago by
 Branch changed from u/AlexGhitza/ticket/11783 to 06932866de2e5308e2bdf58d137e6e9911f29460
 Resolution set to fixed
 Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
This was fixed in #14368. In sage6.1.1 we have:
I am adding a bit to the existing doctest to illustrate this.