Skip to content

Commit 5913984

Browse files
author
Release Manager
committed
gh-40826: Add some more "long time" annotations Speed up one example so that it doesn't need `# long time`, and add the annotation to some others that can't easily be sped up. URL: #40826 Reported by: Michael Orlitzky Reviewer(s): Frédéric Chapoton
2 parents 3b76ec2 + f37f15c commit 5913984

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/sage/matrix/matrix_gf2e_dense.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ cdef class Matrix_gf2e_dense(matrix_dense.Matrix_dense):
10231023
10241024
EXAMPLES::
10251025
1026-
sage: m = Matrix(GL(2^8, GF(2^8)).random_element())
1026+
sage: m = Matrix(GL(2^6, GF(2^6)).random_element())
10271027
sage: m.is_invertible()
10281028
True
10291029
"""

src/sage/stats/distributions/discrete_gaussian_lattice.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def _normalisation_factor_zz(self, tau=None, prec=None):
254254
255255
sage: Sigma = Matrix(ZZ, [[5, -2, 4], [-2, 10, -5], [4, -5, 5]])
256256
sage: D = DGL(ZZ^3, Sigma, [7, 2, 5])
257-
sage: D._normalisation_factor_zz()
257+
sage: D._normalisation_factor_zz() # long time
258258
78.6804...
259259
260260
sage: M = Matrix(ZZ, [[1, 3, 0], [-2, 5, 1]])
@@ -489,22 +489,23 @@ def __init__(self, B, sigma=1, c=0, r=None, precision=None, sigma_basis=False):
489489
sage: c = vector(ZZ, [7, 2, 5])
490490
sage: D = distributions.DiscreteGaussianDistributionLatticeSampler(ZZ^n, Sigma, c)
491491
sage: f = D.f
492-
sage: nf = D._normalisation_factor_zz(); nf # This has not been properly implemented
492+
sage: # This has not been properly implemented...
493+
sage: nf = D._normalisation_factor_zz(); nf # long time
493494
78.6804...
494495
495496
We can compute the expected number of samples before sampling a vector::
496497
497498
sage: v = vector(ZZ, n, (11, 4, 8))
498499
sage: v.set_immutable()
499-
sage: 1 / (f(v) / nf)
500+
sage: 1 / (f(v) / nf) # long time
500501
2553.9461...
501502
502503
sage: counter = defaultdict(Integer); m = 0
503504
sage: while v not in counter:
504505
....: add_samples(1000)
505506
sage: sum(counter.values()) # random
506507
3000
507-
sage: while abs(m*f(v)*1.0/nf/counter[v] - 1.0) >= 0.1: # needs sage.symbolic
508+
sage: while abs(m*f(v)*1.0/nf/counter[v] - 1.0) >= 0.1: # long time, needs sage.symbolic
508509
....: add_samples(1000)
509510
510511
If the covariance provided is not positive definite, an error is thrown::

src/sage/symbolic/integration/integral.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,12 +684,12 @@ def integrate(expression, v=None, a=None, b=None, algorithm=None, hold=False):
684684
The following definite integral is not found by maxima::
685685
686686
sage: f(x) = (x^4 - 3*x^2 + 6) / (x^6 - 5*x^4 + 5*x^2 + 4)
687-
sage: integrate(f(x), x, 1, 2, algorithm='maxima')
687+
sage: integrate(f(x), x, 1, 2, algorithm='maxima') # long time
688688
integrate((x^4 - 3*x^2 + 6)/(x^6 - 5*x^4 + 5*x^2 + 4), x, 1, 2)
689689
690690
but is nevertheless computed::
691691
692-
sage: integrate(f(x), x, 1, 2)
692+
sage: integrate(f(x), x, 1, 2) # long time
693693
-1/2*pi + arctan(8) + arctan(5) + arctan(2) + arctan(1/2)
694694
695695
Both fricas and sympy give the correct result::

0 commit comments

Comments
 (0)