Changeset 5789:bc830aafbcdc
- Timestamp:
- 08/18/07 16:15:46 (6 years ago)
- Branch:
- default
- File:
-
- 1 edited
-
sage/modular/modform/space.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sage/modular/modform/space.py
r4875 r5789 403 403 def integral_basis(self): 404 404 """ 405 405 Return an integral basis for this space of modular forms. 406 407 EXAMPLES: 406 408 """ 407 409 try: … … 417 419 return I 418 420 419 def _q_expansion_module(self, prec=None): 421 def _q_expansion_module(self): 422 """ 423 Return module spanned by coefficients of q-expansions to 424 sufficient precision to determine elements of this space. 425 426 EXAMPLES: 427 """ 420 428 try: 421 429 return self.__q_expansion_module 422 430 except AttributeError: 423 431 pass 424 if prec is None: 425 prec = int(1.2*self.dimension()) + 2 426 C = self.q_expansion_basis(prec) 427 V = self.base_ring()**prec 428 try: 429 W = V.span_of_basis([f.padded_list(prec) for f in C]) 430 except AttributeError: 431 return self._q_expansion_module(self, 2*prec) 432 prec = int(1.2*self.dimension()) + 3 # +3 for luck. 433 tries = 0 434 while True: 435 C = self.q_expansion_basis(prec) 436 V = self.base_ring()**prec 437 try: 438 W = V.span_of_basis([f.padded_list(prec) for f in C]) 439 break 440 except Exception: 441 prec += self.dimension() 442 tries += 1 443 if tries > 5: 444 print "WARNING: possibly bug in _q_expansion_module for modular forms space %s"%self 432 445 self.__q_expansion_module = W 433 446 return W … … 435 448 def q_expansion_basis(self, prec=None): 436 449 """ 437 The number of q-expansions returned equals the dimension.450 Return a sequence of q-expansions for this space. 438 451 439 452 INPUT: … … 460 473 current_prec, B = self.__q_expansion_basis 461 474 except AttributeError: 462 current_prec, B = -1, Sequence([], cr=True)475 (current_prec, B) = (-1, Sequence([], cr=True)) 463 476 if current_prec == prec: 464 477 return B
Note: See TracChangeset
for help on using the changeset viewer.
