Opened 4 years ago

## #24454 new defect

# Strange behaviour of change_ring(CC) for Dirichlet characters

Reported by: | mneururer | Owned by: | |
---|---|---|---|

Priority: | minor | Milestone: | sage-8.2 |

Component: | number theory | Keywords: | dirichlet characters, DirichletGroup |

Cc: | wuthrich | Merged in: | |

Authors: | Michael Neururer | Reviewers: | |

Report Upstream: | N/A | Work issues: | |

Branch: | Commit: | ||

Dependencies: | Stopgaps: |

### Description

Changing the base ring of a Dirichlet character defined over a number field to the complex numbers does not work. The following code shows some unexpected behaviour:

sage: G = DirichletGroup(5); sage: G_CC = G.change_ring(CC) sage: phi = G[1] sage: phi.change_ring(CC) #NotImplementedError <repr(<sage.modular.dirichlet.DirichletGroup_class_with_category.element_class at 0x6fe8c3e94b0>) failed: NotImplementedError: order of element not known> sage: G_CC(phi) #NotImplementedError <repr(<sage.modular.dirichlet.DirichletGroup_class_with_category.element_class at 0x6fe9012c550>) failed: NotImplementedError: order of element not known> sage: G_CC[2]; sage: phi.change_ring(CC) Dirichlet character modulo 5 of conductor 5 mapping 2 |--> 6.12323399573677e-17 + 1.00000000000000*I

It seems that when calling G_CC[2] (or calling any other element of G_CC) some values get cached that make phi.change_ring(CC) work.

**Note:**See TracTickets for help on using tickets.