Skip to content

Commit

Permalink
#10712: mark various doctests as long time
Browse files Browse the repository at this point in the history
  • Loading branch information
jdemeyer committed Feb 14, 2011
1 parent 6b33548 commit 7d4da58
Show file tree
Hide file tree
Showing 36 changed files with 178 additions and 191 deletions.
4 changes: 2 additions & 2 deletions src/doc/en/thematic_tutorials/group_theory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -900,8 +900,8 @@ command takes a few minutes to run, so go get a cup of coffee after
you set it in motion. ::

sage: G = SymmetricGroup(8)
sage: subgroups = G.conjugacy_classes_subgroups()
sage: map(order, subgroups)
sage: subgroups = G.conjugacy_classes_subgroups() # long time (9s on sage.math, 2011)
sage: map(order, subgroups) # long time
[1, 2, 2, 2, 2, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 10, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 18, 18, 18, 18, 18, 18, 18, 20, 20, 20, 21, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 30, 30, 30, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 40, 42, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56, 60, 60, 60, 60, 60, 64, 64, 64, 64, 64, 64, 64, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 120, 120, 120, 120, 120, 120, 120, 128, 144, 144, 144, 168, 168, 168, 180, 192, 192, 192, 192, 192, 240, 240, 288, 288, 288, 336, 360, 360, 360, 360, 384, 576, 576, 576, 720, 720, 720, 720, 1152, 1344, 1440, 2520, 5040, 20160, 40320]

The ``map(order, subgroups)`` command will apply the ``order()``
Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/thematic_tutorials/lie/branching_rules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ by other methods::
14
sage: ad.frobenius_schur_indicator()
1
sage: for r in D7.fundamental_weights():
sage: for r in D7.fundamental_weights(): # long time (35s on sage.math, 2011)
... print D7(r).branch(G2, rule=branching_rule_from_plethysm(ad, "D7"))
...
G2(0,1)
Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/thematic_tutorials/lie/weyl_character_ring.rst
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ So far we have been working with `n=3`. For general `n`::
... tr = R(R.fundamental_weights()[1])
... return sum(x[1]^2 for x in (tr^k).hlist())
...
sage: [f(n,5) for n in [2..7]]
sage: [f(n,5) for n in [2..7]] # long time (37s on sage.math, 2011)
[42, 103, 119, 120, 120, 120]

We see that the 10-th moment of `tr(g)` is just `5!` when `n` is sufficiently
Expand Down
5 changes: 1 addition & 4 deletions src/sage/coding/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,8 @@ def decode(C, v, algorithm="syndrome"):
Linear code of length 13, dimension 10 over Finite Field of size 3
sage: V = VectorSpace(GF(3), 13)
sage: v = V([2]+[0]*12)
sage: decode(C, v)
sage: decode(C, v) # long time (9s on sage.math, 2011)
(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
sage: decode(C, v, algorithm="nearest neighbor")
(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
"""
V = C.ambient_space()
if not(type(v)==list):
Expand Down
24 changes: 12 additions & 12 deletions src/sage/combinat/crystals/alcove_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,12 @@ def e(self, i, verbose=False):
EXAMPLES::
sage: C = ClassicalCrystalOfAlcovePaths(['E',6],[1,0,0,0,0,0])
sage: C.module_generators
sage: C = ClassicalCrystalOfAlcovePaths(['E',6],[1,0,0,0,0,0]) # long time (20s on sage.math, 2011)
sage: C.module_generators # long time
[[]]
sage: C([]).f(1)
sage: C([]).f(1) # long time
[0]
sage: C([]).f(1).e(1)
sage: C([]).f(1).e(1) # long time
[]
"""
assert i in self.index_set()
Expand Down Expand Up @@ -480,18 +480,18 @@ def f(self, i, verbose=False):
EXAMPLES::
sage: C = ClassicalCrystalOfAlcovePaths(['E',6],[1,0,0,0,0,0])
sage: C.module_generators
sage: C = ClassicalCrystalOfAlcovePaths(['E',6],[1,0,0,0,0,0]) # long time (21s on sage.math, 2011)
sage: C.module_generators # long time
[[]]
sage: C([]).f(1)
sage: C([]).f(1) # long time
[0]
sage: C([]).f(1).f(3)
sage: C([]).f(1).f(3) # long time
[0, 1]
sage: C([]).f(1).f(3).f(4)
sage: C([]).f(1).f(3).f(4) # long time
[0, 1, 2]
sage: C([]).f(1).f(3).f(4).f(5)
sage: C([]).f(1).f(3).f(4).f(5) # long time
[0, 1, 2, 4]
sage: C([]).f(1).f(3).f(4).f(2)
sage: C([]).f(1).f(3).f(4).f(2) # long time
[0, 1, 2, 3]
"""
assert i in self.index_set()
Expand Down Expand Up @@ -651,7 +651,7 @@ def test_some_specific_examples():
EXAMPLES::
sage: sage.combinat.crystals.alcove_path.test_some_specific_examples()
sage: sage.combinat.crystals.alcove_path.test_some_specific_examples() # long time (12s on sage.math, 2011)
G2 example passed.
C3 example passed.
B3 example 1 passed.
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/crystals/kirillov_reshetikhin.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ class KR_type_E6(KirillovReshetikhinCrystalFromPromotion):
sage: K = KirillovReshetikhinCrystal(['E',6,1], 2,1)
sage: La = K.weight_lattice_realization().fundamental_weights()
sage: all(b.weight() == sum( (K.affine_weight(b.lift())[i] * La[i] for i in K.index_set()), 0*La[0]) for b in K)
sage: all(b.weight() == sum( (K.affine_weight(b.lift())[i] * La[i] for i in K.index_set()), 0*La[0]) for b in K) # long time (26s on sage.math, 2011)
True
"""

Expand Down
5 changes: 1 addition & 4 deletions src/sage/combinat/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -4164,10 +4164,7 @@ def number_of_partitions(n,k=None, algorithm='default'):
sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0
True
sage: n = 100000000 + randint(0,100000000)
sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0
True
sage: n = 1000000000 + randint(0,1000000000)
sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 # takes a long time
sage: number_of_partitions( n - (n % 385) + 369) % 385 == 0 # long time (4s on sage.math, 2011)
True
Another consistency test for n up to 500::
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/root_system/weyl_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ def long_element_hardcoded(self):
sage: types = [ ['A',5],['B',3],['C',3],['D',4],['G',2],['F',4],['E',6] ]
sage: [WeylGroup(t).long_element().length() for t in types]
[15, 9, 9, 12, 6, 24, 36]
sage: all( WeylGroup(t).long_element() == WeylGroup(t).long_element_hardcoded() for t in types )
sage: all( WeylGroup(t).long_element() == WeylGroup(t).long_element_hardcoded() for t in types ) # long time (17s on sage.math, 2011)
True
"""
type = self.cartan_type()
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/sf/dual.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self, dual_basis, scalar, scalar_name="", prefix=None):
sage: h = SFAElementary(QQ)
sage: f = h.dual_basis(prefix = "m")
sage: TestSuite(f).run()
sage: TestSuite(f).run() # long time (11s on sage.math, 2011)
This class defines canonical coercions between self and
self^*, as follow:
Expand Down
16 changes: 9 additions & 7 deletions src/sage/crypto/mq/sr.py
Original file line number Diff line number Diff line change
Expand Up @@ -3323,17 +3323,19 @@ def test_consistency(max_n=2, **kwargs):
INPUT:
- ``max_n`` - maximal number of rounds to consider (default: 2)
- ``kwargs`` - are passed to the SR constructor
- ``max_n`` -- maximal number of rounds to consider (default: 2)
- ``kwargs`` -- are passed to the SR constructor
TESTS::
TESTS:
The following test called with ``max_n`` = 2 requires a LOT of RAM
(much more than 2GB). Since this might cause the doctest to fail
on machines with "only" 2GB of RAM, we test ``max_n`` = 1, which
has a more reasonable memory usage. ::
sage: from sage.crypto.mq.sr import test_consistency
sage: test_consistency(1) # long time -- calling w/ max_n = 2 requires a LOT of RAM (>> 2GB, evidently). Calling w/ max_n = 1 is far more manageable.
sage: test_consistency(1) # long time (80s on sage.math, 2011)
True
The above doctest used to fail on a machine with "only" 2GB RAM.
Using ``max_n = 1`` appears to be a more reasonable memory usage.
"""
consistent = True
for r in (1, 2, 4):
Expand Down
7 changes: 3 additions & 4 deletions src/sage/functions/prime_pi.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ cdef class PrimePi:
Make sure we actually compute correct results::
sage: for n in (30..40):
... prime_pi(2**n)
sage: for n in (30..40): print prime_pi(2**n) # long time (22s on sage.math, 2011)
54400028
105097565
203280221
Expand All @@ -175,15 +174,15 @@ cdef class PrimePi:
sage: prime_pi(2^40+1)
Traceback (most recent call last):
...
NotImplementedError: computation of prime_pi() greater 2**40 not implemented
NotImplementedError: computation of prime_pi() greater than 2^40 not implemented
"""
if mem_mult < 1:
raise ValueError, "mem_mult must be positive"
if x < 2:
return 0
if x > 1099511627776L:
raise NotImplementedError, "computation of prime_pi() greater 2**40 not implemented"
raise NotImplementedError, "computation of prime_pi() greater than 2^40 not implemented"
x += x & 1
# m_max is the current sieving value, for prime counting - this value is sqrt(x)
cdef long m_max = sqrt_longlong(x) + 1
Expand Down
10 changes: 5 additions & 5 deletions src/sage/geometry/lattice_polytope.py
Original file line number Diff line number Diff line change
Expand Up @@ -2047,7 +2047,7 @@ def nef_partitions(self, keep_symmetric=False, keep_products=True,
But they can be obtained from ``nef.x`` for all nef-partitions at once.
Partitions will be exactly the same::
sage: o.nef_partitions(hodge_numbers=True)
sage: o.nef_partitions(hodge_numbers=True) # long time (2s on sage.math, 2011)
[
Nef-partition {0, 1, 4, 5} U {2, 3, 6, 7} (direct product),
Nef-partition {0, 1, 2, 4} U {3, 5, 6, 7},
Expand Down Expand Up @@ -3602,13 +3602,13 @@ def hodge_numbers(self):
nef-partitions::
sage: o = lattice_polytope.octahedron(5)
sage: np = o.nef_partitions()[0]
sage: np.hodge_numbers()
sage: np = o.nef_partitions()[0] # long time (4s on sage.math, 2011)
sage: np.hodge_numbers() # long time
Traceback (most recent call last):
...
NotImplementedError: use nef_partitions(hodge_numbers=True)!
sage: np = o.nef_partitions(hodge_numbers=True)[0]
sage: np.hodge_numbers()
sage: np = o.nef_partitions(hodge_numbers=True)[0] # long time (13s on sage.math, 2011)
sage: np.hodge_numbers() # long time
(19, 19)
"""
try:
Expand Down
4 changes: 2 additions & 2 deletions src/sage/geometry/triangulation/base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -692,10 +692,10 @@ cdef class ConnectedTriangulationsIterator(SageObject):
sage: p = PointConfiguration([[0,4],[2,3],[3,2],[4,0],[3,-2],[2,-3],[0,-4],[-2,-3],[-3,-2],[-4,0],[-3,2],[-2,3]])
sage: from sage.geometry.triangulation.base import ConnectedTriangulationsIterator
sage: ci = ConnectedTriangulationsIterator(p)
sage: len(list(ci)) # long time
sage: len(list(ci)) # long time (23s on sage.math, 2011)
16796
sage: ci = ConnectedTriangulationsIterator(p, star=3)
sage: len(list(ci)) # long time
sage: len(list(ci)) # long time (23s on sage.math, 2011)
1
"""
if star==None:
Expand Down
4 changes: 2 additions & 2 deletions src/sage/graphs/matchpoly.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ def matching_polynomial(G, complement=True, name=None):
tom^10 - 15*tom^8 + 75*tom^6 - 145*tom^4 + 90*tom^2 - 6
sage: g = Graph()
sage: L = [graphs.RandomGNP(8, .3) for i in [1..5]]
sage: prod([h.matching_polynomial() for h in L]) == sum(L, g).matching_polynomial()
sage: prod([h.matching_polynomial() for h in L]) == sum(L, g).matching_polynomial() # long time (up to 10s on sage.math, 2011)
True
::
sage: from sage.graphs.matchpoly import matching_polynomial
sage: for i in [1..12]:
sage: for i in [1..12]: # long time (10s on sage.math, 2011)
... for t in graphs.trees(i):
... c = t.complement()
... assert matching_polynomial(t) == t.characteristic_polynomial()
Expand Down
6 changes: 4 additions & 2 deletions src/sage/groups/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -853,16 +853,18 @@ def discrete_log_lambda(a, base, bounds, operation='*', hash_function=hash):
sage: P=E.lift_x(a); P
(a : 9*a^4 + 22*a^3 + 23*a^2 + 30 : 1)
This will return a multiple of the order of P:
This will return a multiple of the order of P::
sage: discrete_log_lambda(P.parent()(0), P, Hasse_bounds(F.order()), operation='+')
69327408
sage: K.<a> = GF(89**5)
sage: hs = lambda x: hash(x) + 15
sage: discrete_log_lambda(a**(89**3 - 3), a, (89**2, 89**4), operation = '*', hash_function = hs)
sage: discrete_log_lambda(a**(89**3 - 3), a, (89**2, 89**4), operation = '*', hash_function = hs) # long time (10s on sage.math, 2011)
704966
AUTHOR:
-- Yann Laigle-Chapuy (2009-01-25)
"""
Expand Down
4 changes: 2 additions & 2 deletions src/sage/groups/matrix_gps/matrix_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ def invariant_generators(self):
sage: F = GF(5); MS = MatrixSpace(F,2,2)
sage: gens = [MS([[1,2],[-1,1]]),MS([[1,1],[-1,1]])]
sage: G = MatrixGroup(gens)
sage: G.invariant_generators() ## takes a long time (several mins)
sage: G.invariant_generators() # long time (68s on sage.math, 2011)
[x1^20 + x1^16*x2^4 + x1^12*x2^8 + x1^8*x2^12 + x1^4*x2^16 + x2^20, x1^20*x2^4 + x1^16*x2^8 + x1^12*x2^12 + x1^8*x2^16 + x1^4*x2^20]
sage: F=CyclotomicField(8)
sage: z=F.gen()
Expand All @@ -1079,7 +1079,7 @@ def invariant_generators(self):
sage: g2=MS([[1,0],[0,b]])
sage: g3=MS([[b,0],[0,1]])
sage: G=MatrixGroup([g1,g2,g3])
sage: G.invariant_generators()
sage: G.invariant_generators() # long time (12s on sage.math, 2011)
[x1^8 + 14*x1^4*x2^4 + x2^8,
x1^24 + 10626/1025*x1^20*x2^4 + 735471/1025*x1^16*x2^8 + 2704156/1025*x1^12*x2^12 + 735471/1025*x1^8*x2^16 + 10626/1025*x1^4*x2^20 + x2^24]
Expand Down
15 changes: 7 additions & 8 deletions src/sage/groups/perm_gps/partn_ref/refinement_graphs.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ def all_labeled_graphs(n):
sage: st = sage.groups.perm_gps.partn_ref.refinement_graphs.search_tree
sage: Glist = {}
sage: Giso = {}
sage: for n in [1..5]:
sage: for n in [1..5]: # long time (4s on sage.math, 2011)
... Glist[n] = all_labeled_graphs(n)
... Giso[n] = []
... for g in Glist[n]:
Expand All @@ -756,7 +756,7 @@ def all_labeled_graphs(n):
... inn = True
... if not inn:
... Giso[n].append(b)
sage: for n in Giso:
sage: for n in Giso: # long time
... print n, len(Giso[n])
1 1
2 2
Expand All @@ -783,7 +783,7 @@ def all_labeled_graphs(n):
return Glist


def random_tests(num=20, n_max=60, perms_per_graph=10):
def random_tests(num=20, n_max=50, perms_per_graph=8):
"""
Tests to make sure that C(gamma(G)) == C(G) for random permutations gamma
and random graphs G, and that isomorphic returns an isomorphism.
Expand All @@ -803,13 +803,12 @@ def random_tests(num=20, n_max=60, perms_per_graph=10):
under the generated permutation are equal, and that the isomorphic function
returns an isomorphism.
TESTS:
sage: import sage.groups.perm_gps.partn_ref.refinement_graphs
sage: sage.groups.perm_gps.partn_ref.refinement_graphs.random_tests()
All passed: ... random tests on ... graphs.
TESTS::
sage: import sage.groups.perm_gps.partn_ref.refinement_graphs
sage: sage.groups.perm_gps.partn_ref.refinement_graphs.random_tests() # long time (up to 25s on sage.math, 2011)
All passed: 640 random tests on 40 graphs.
"""
from sage.misc.misc import walltime
from sage.misc.prandom import random, randint
from sage.graphs.graph_generators import GraphGenerators
from sage.graphs.digraph_generators import DiGraphGenerators
Expand Down
16 changes: 8 additions & 8 deletions src/sage/groups/perm_gps/partn_ref/refinement_matrices.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,12 @@ def random_tests(n=15, nrows_max=50, ncols_max=50, nsymbols_max=20, perms_per_ma
isomorphism.
INPUT:
n -- run tests on this many matrices
nrows_max -- test matrices with at most this many rows
ncols_max -- test matrices with at most this many columns
perms_per_matrix -- test each matrix with this many random permutations
nsymbols_max -- maximum number of distinct symbols in the matrix
DISCUSSION:
- n -- run tests on this many matrices
- nrows_max -- test matrices with at most this many rows
- ncols_max -- test matrices with at most this many columns
- perms_per_matrix -- test each matrix with this many random permutations
- nsymbols_max -- maximum number of distinct symbols in the matrix
This code generates n random matrices M on at most ncols_max columns and at
most nrows_max rows. The density of entries in the basis is chosen randomly
Expand All @@ -331,9 +330,10 @@ def random_tests(n=15, nrows_max=50, ncols_max=50, nsymbols_max=20, perms_per_ma
under the generated permutation are equal, and that the isomorphism is
discovered by the double coset function.
DOCTEST:
TESTS::
sage: import sage.groups.perm_gps.partn_ref.refinement_matrices
sage: sage.groups.perm_gps.partn_ref.refinement_matrices.random_tests()
sage: sage.groups.perm_gps.partn_ref.refinement_matrices.random_tests() # long time (up to 30s on sage.math, 2011)
All passed: ... random tests on ... matrices.
"""
Expand Down
11 changes: 7 additions & 4 deletions src/sage/gsl/dwt.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ def WaveletTransform(n, wavelet_type, wavelet_k):
The wavelet transform uses J=log_2(n) levels.
OUTPUT:
An array of the form
(s_{-1,0},d_{0,0},d_{1,0},d_{1,1}, d_{2,0}...,d_{J-1,2^{J-1}-1})
for d_{j,k} the detail coefficients of level j.
The centered forms align the coefficients of the sub-bands on edges.
EXAMPLES:
EXAMPLES::
sage: a = WaveletTransform(128,'daubechies',4)
sage: for i in range(1, 11):
... a[i] = 1
Expand All @@ -76,14 +78,15 @@ def WaveletTransform(n, wavelet_type, wavelet_k):
sage: a.forward_transform()
sage: a.plot().show(ymin=0)
This example gives a simple example of wavelet compression.
This example gives a simple example of wavelet compression::
sage: a = DWT(2048,'daubechies',6)
sage: for i in range(2048): a[i]=float(sin((i*5/2048)**2))
sage: a.plot().show()
sage: a.plot().show() # long time (7s on sage.math, 2011)
sage: a.forward_transform()
sage: for i in range(1800): a[2048-i-1] = 0
sage: a.backward_transform()
sage: a.plot().show()
sage: a.plot().show() # long time (7s on sage.math, 2011)
"""
cdef size_t _n, _k
_n = int(n)
Expand Down
Loading

0 comments on commit 7d4da58

Please sign in to comment.