# HG changeset patch
# User William Stein <wstein@gmail.com>
# Date 1269571788 25200
# Node ID 5cdca91b73b6c279400e0b6578ae669888f2a777
# Parent db7143738e1dbcb0c5415884ebaeee4500da1520
trac 8610 -- fix caching bug in modular/modsym/element.pyx
diff --git a/sage/modular/modsym/ambient.py b/sage/modular/modsym/ambient.py
|
a
|
b
|
|
| 1119 | 1119 | |
| 1120 | 1120 | .. note:: |
| 1121 | 1121 | |
| 1122 | | Users will instead use the simpler interface defined, for |
| 1123 | | example, by ``hecke_matrix()`` (see examples). |
| | 1122 | Users will usually instead use the simpler interface |
| | 1123 | defined, for example, by ``hecke_matrix()`` (see examples), |
| | 1124 | though this function allows one to compute much more |
| | 1125 | general operators. |
| 1124 | 1126 | |
| 1125 | 1127 | INPUT: |
| 1126 | 1128 | |
| 1127 | 1129 | - ``codomain`` - space of modular symbols |
| 1128 | 1130 | |
| 1129 | | - ``R`` (list) -- a list of lists `[a,b,c,d]` of length 4, which |
| 1130 | | we view as elements of `GL_2(`QQ)`. |
| | 1131 | - ``R`` (list) -- a list of lists `[a,b,c,d]` of length 4, |
| | 1132 | which we view as elements of `GL_2(`QQ)`. |
| 1131 | 1133 | |
| 1132 | 1134 | |
| 1133 | 1135 | OUTPUT: |
| 1134 | 1136 | |
| 1135 | | (matrix) The matrix of the operator |
| | 1137 | -- (matrix) The matrix of the operator |
| 1136 | 1138 | |
| 1137 | 1139 | .. math:: |
| 1138 | 1140 | |
diff --git a/sage/modular/modsym/element.py b/sage/modular/modsym/element.py
|
a
|
b
|
|
| 294 | 294 | """ |
| 295 | 295 | Returns a representation of self as a formal sum of Manin symbols. |
| 296 | 296 | |
| 297 | | (The result is cached for future use.) |
| 298 | | |
| 299 | 297 | EXAMPLE:: |
| 300 | 298 | |
| 301 | | sage: ModularSymbols(37, 4).0.manin_symbol_rep() |
| | 299 | sage: x = ModularSymbols(37, 4).0 |
| | 300 | sage: x.manin_symbol_rep() |
| 302 | 301 | [X^2,(0,1)] |
| | 302 | |
| | 303 | The result is cached:: |
| | 304 | |
| | 305 | sage: x.manin_symbol_rep() is x.manin_symbol_rep() |
| | 306 | True |
| 303 | 307 | """ |
| 304 | 308 | try: |
| 305 | 309 | return self.__manin_symbols |
| … |
… |
|
| 312 | 316 | range(v.degree()) if v[i] != 0], check=False, reduce=False) |
| 313 | 317 | self.__manin_symbols = ms |
| 314 | 318 | return self.__manin_symbols |
| 315 | | |
| | 319 | |
| 316 | 320 | def modular_symbol_rep(self): |
| 317 | 321 | """ |
| 318 | 322 | Returns a representation of self as a formal sum of modular |
| 319 | 323 | symbols. |
| 320 | 324 | |
| 321 | | (The result is cached for future use.) |
| 322 | | |
| 323 | 325 | EXAMPLE:: |
| 324 | 326 | |
| 325 | | sage: ModularSymbols(37, 4).0.modular_symbol_rep() |
| | 327 | sage: x = ModularSymbols(37, 4).0 |
| | 328 | sage: x.modular_symbol_rep() |
| 326 | 329 | X^2*{0, Infinity} |
| | 330 | |
| | 331 | The result is cached:: |
| | 332 | |
| | 333 | sage: x.modular_symbol_rep() is x.modular_symbol_rep() |
| | 334 | True |
| 327 | 335 | """ |
| 328 | 336 | try: |
| 329 | 337 | return self.__modular_symbols |
| … |
… |
|
| 333 | 341 | if v == 0: |
| 334 | 342 | return v |
| 335 | 343 | w = [c * x.modular_symbol_rep() for c, x in v] |
| 336 | | return sum(w) |
| 337 | | return self.__modular_symbols |
| | 344 | self.__modular_symbols = sum(w) |
| | 345 | return self.__modular_symbols |
| 338 | 346 | |
| 339 | 347 | |