Ticket #2959(closed defect: fixed)

Opened 5 years ago

[with patch, positive review] bug in DirichletGroup over a finite base ring

Reported by: Owned by: wdj craigcitro major sage-3.0 number theory

Description

```sage: G = DirichletGroup(21)
sage: chi = G.0; chi
[-1, 1]
sage: chi.values()
[0, 1, -1, 0, 1, -1, 0, 0, -1, 0, 1, -1, 0, 1, 0, 0, 1, -1, 0, 1, -1]
```

So far, so good (similar code is in the tutorial: http://www.sagemath.org/doc/html/tut/node15.html). Now use a different base ring:

```sage: G = DirichletGroup(21, GF(37))
sage: chi = G.0; chi
[36, 1]
sage: chi.values()
---------------------------------------------------------------------------
<type 'exceptions.IndexError'>            Traceback (most recent call last)

/mnt/drive_hda1/sagefiles/sage-3.0.alpha5/<ipython console> in <module>()

/mnt/drive_hda1/sagefiles/sage-3.0.alpha5/local/lib/python2.5/site-packages/sage/modular/dirichlet.py
in values(self)
1056             ########################
1057             # record character value on n
-> 1058             result_list[n.ivalue] = R_values[value.ivalue]
1059             # iterate:
1060             #   increase the exponent vector by 1,

<type 'exceptions.IndexError'>: list index out of range
```

Change History

comment:1 Changed 5 years ago by craigcitro

• Owner changed from was to craigcitro
• Status changed from new to assigned

Yep, this was a mistake on my part. The attached patch fixes it, adds a few doctests to check the various possibilities (i.e. when the zeta_order of the base_ring is a proper divisor of, is equal to, and is strictly divisible by the modulus for the DirichletGroup?).

comment:2 Changed 5 years ago by craigcitro

• Summary changed from bug in DirichletGroup over a finite base ring to [with patch, needs review] bug in DirichletGroup over a finite base ring

comment:3 Changed 5 years ago by was

• Summary changed from [with patch, needs review] bug in DirichletGroup over a finite base ring to [with patch, positive review] bug in DirichletGroup over a finite base ring

Looks good; works.

comment:4 Changed 5 years ago by mabshoff

• Status changed from assigned to closed
• Resolution set to fixed

Merges in Sage 3.0.rc0

comment:5 Changed 5 years ago by mabshoff

• Milestone changed from sage-3.0.1 to sage-3.0
Note: See TracTickets for help on using tickets.