Opened 2 years ago

## #23827 new enhancement

# Improve __getitem__ for p-adic iterators

Reported by: | roed | Owned by: | |
---|---|---|---|

Priority: | major | Milestone: | sage-8.1 |

Component: | padics | Keywords: | |

Cc: | Merged in: | ||

Authors: | Reviewers: | ||

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

Branch: | Commit: | ||

Dependencies: | Stopgaps: |

### Description

#14825 introduced an iterator for p-adic expansions, which is capable of calculating the `n`

th term in the expansion quickly using division (rather than computing all of the digits up to that point):

sage: R = Zp(5, 1000000) sage: a = R.random_element() sage: E = a.expansion() sage: E[876543] 4

The same functionality should be available when using a balanced expansion:

sage: E = a.expansion(lift_mode='smallest') sage: E[876543] # did not terminate

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