Opened 11 years ago

Closed 9 years ago

#11783 closed defect (fixed)

bug in DirichletGroup and/or DirichletCharacter when the modulus is 1

Reported by: William Stein Owned by: William Stein
Priority: major Milestone: sage-6.2
Component: number theory Keywords:
Cc: Merged in:
Authors: Alex Ghitza Reviewers: Peter Bruin
Report Upstream: N/A Work issues:
Branch: 0693286 (Commits, GitHub, GitLab) Commit: 06932866de2e5308e2bdf58d137e6e9911f29460
Dependencies: Stopgaps:

Status badges

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/sage-devel/browse_thread/thread/fa94a97612c7225b

wstein@ubuntu:~$ sage
----------------------------------------------------------------------
| Sage Version 4.7.2.alpha2, Release Date: 2011-08-18                |
| 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: 2011-08-18                |
| 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 9 years ago by Jeroen Demeyer

Milestone: sage-5.11sage-5.12

comment:2 Changed 9 years ago by For batch modifications

Milestone: sage-6.1sage-6.2

comment:3 Changed 9 years ago by Alex Ghitza

This was fixed in #14368. In sage-6.1.1 we have:

sage: chi = DirichletGroup(1)[0]
sage: chi.values()
[1]
sage: chi(1)
1

I am adding a bit to the existing doctest to illustrate this.

comment:4 Changed 9 years ago by Alex Ghitza

Branch: u/AlexGhitza/ticket/11783
Modified: Apr 24, 2014, 8:22:09 AMApr 24, 2014, 8:22:09 AM

comment:5 Changed 9 years ago by Alex Ghitza

Authors: Alex Ghitza
Commit: 06932866de2e5308e2bdf58d137e6e9911f29460
Status: newneeds_review

New commits:

0693286doctest to verify fix of issue with DirichletCharacter of modulus 1

comment:6 Changed 9 years ago by Peter Bruin

Reviewers: Peter Bruin
Status: needs_reviewpositive_review

comment:7 Changed 9 years ago by Volker Braun

Branch: u/AlexGhitza/ticket/1178306932866de2e5308e2bdf58d137e6e9911f29460
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.