Ticket #14184: 14184_optional.patch
File 14184_optional.patch, 103.1 KB (added by , 9 years ago) |
---|
-
doc/de/tutorial/interfaces.rst
# HG changeset patch # User Jeroen Demeyer <jdemeyer@cage.ugent.be> # Date 1361957573 -3600 # Node ID 61eb27ccc8c70911bf7fa464028c2c26f7045726 # Parent 5bd25dfa55f94c516a883b431a7e5ac054a2267d Fix # optional tags diff --git a/doc/de/tutorial/interfaces.rst b/doc/de/tutorial/interfaces.rst
a b 160 160 Group( [ (1,2,3)(4,5), (3,4) ] ) 161 161 sage: G.Center() 162 162 Group( () ) 163 sage: G.IdGroup() # requires optional database_gap package163 sage: G.IdGroup() # optional - database_gap 164 164 [ 120, 34 ] 165 165 sage: G.Order() 166 166 120 … … 173 173 sage: G = PermutationGroup([[(1,2,3),(4,5)],[(3,4)]]) 174 174 sage: G.center() 175 175 Subgroup of (Permutation Group with generators [(3,4), (1,2,3)(4,5)]) generated by [()] 176 sage: G.group_id() # requires optional database_gap package176 sage: G.group_id() # optional - database_gap 177 177 [120, 34] 178 178 sage: n = G.order(); n 179 179 120 -
doc/en/bordeaux_2008/modular_forms_and_hecke_operators.rst
diff --git a/doc/en/bordeaux_2008/modular_forms_and_hecke_operators.rst b/doc/en/bordeaux_2008/modular_forms_and_hecke_operators.rst
a b 166 166 11156973844800 167 167 sage: a = [dimension_cusp_forms(Gamma0(N),2) for N in [1..25]]; a 168 168 [0, 0, ..., 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 2, 2, 1, 0] 169 sage: sloane_find(a) # optional -- requiresinternet169 sage: sloane_find(a) # optional - internet 170 170 Searching Sloane's online database... 171 171 [[1617, 172 172 'Genus of modular group GAMMA_0 (n). Or, genus of -
doc/en/constructions/groups.rst
diff --git a/doc/en/constructions/groups.rst b/doc/en/constructions/groups.rst
a b 261 261 sage: G = PermutationGroup(['(1,2,3)(4,5)', '(3,4)']) 262 262 sage: G.order() 263 263 120 264 sage: G.group_id() # requires optional GAP database package264 sage: G.group_id() # optional - database_gap 265 265 [120, 34] 266 266 267 267 Another example of using the small groups database: ``group_id`` -
doc/en/constructions/interface_issues.rst
diff --git a/doc/en/constructions/interface_issues.rst b/doc/en/constructions/interface_issues.rst
a b 498 498 499 499 :: 500 500 501 sage: octave("atanh(1.1)") ## requires optionaloctave501 sage: octave("atanh(1.1)") ## optional - octave 502 502 (1.52226,-1.5708) 503 503 504 504 Here's an example using Sage's interface to ``pari``'s special -
doc/en/constructions/linear_algebra.rst
diff --git a/doc/en/constructions/linear_algebra.rst b/doc/en/constructions/linear_algebra.rst
a b 462 462 sage: A = M33([1,2,3,4,5,6,7,8,0]) 463 463 sage: V3 = VectorSpace(QQ,3) 464 464 sage: b = V3([1,2,3]) 465 sage: octave.solve_linear_system(A,b) # requires optionaloctave465 sage: octave.solve_linear_system(A,b) # optional - octave 466 466 [-0.33333299999999999, 0.66666700000000001, 0] -
doc/en/constructions/number_fields.rst
diff --git a/doc/en/constructions/number_fields.rst b/doc/en/constructions/number_fields.rst
a b 18 18 19 19 :: 20 20 21 sage: J = JonesDatabase() # requires optionaldatabase22 sage: J # requires optionaldatabase21 sage: J = JonesDatabase() # optional - database 22 sage: J # optional - database 23 23 John Jones's table of number fields with bounded ramification and degree <= 6 24 24 25 25 .. index:: … … 32 32 33 33 :: 34 34 35 sage: [(k.degree(), k.disc()) for k in J.unramified_outside([2])] # requires optionaldatabase35 sage: [(k.degree(), k.disc()) for k in J.unramified_outside([2])] # optional - database 36 36 [(4, -2048), (2, 8), (4, -1024), (1, 1), (4, 256), (2, -4), (4, 2048), (4, 512), (4, 2048), (2, -8), (4, 2048)] 37 37 38 38 List the discriminants of the fields of degree exactly 2 unramified … … 42 42 43 43 :: 44 44 45 sage: [k.disc() for k in J.unramified_outside([2],2)] # requires optionaldatabase45 sage: [k.disc() for k in J.unramified_outside([2],2)] # optional - database 46 46 [8, -4, -8] 47 47 48 48 List the discriminants of cubic field in the database ramified … … 52 52 53 53 :: 54 54 55 sage: [k.disc() for k in J.ramified_at([3,5],3)] # requires optionaldatabase55 sage: [k.disc() for k in J.ramified_at([3,5],3)] # optional - database 56 56 [-6075, -6075, -675, -135] 57 57 sage: factor(6075) 58 58 3^5 * 5^2 … … 67 67 68 68 :: 69 69 70 sage: J.ramified_at(101) # requires optional database70 sage: J.ramified_at(101) # optional - database 71 71 [Number Field in a with defining polynomial x^2 - 101, 72 72 Number Field in a with defining polynomial x^4 - x^3 + 13*x^2 - 19*x + 361, 73 73 Number Field in a with defining polynomial x^5 - x^4 - 40*x^3 - 93*x^2 - 21*x + 17, -
doc/en/developer/coding_in_other.rst
diff --git a/doc/en/developer/coding_in_other.rst b/doc/en/developer/coding_in_other.rst
a b 710 710 sage: A = M33([1,2,3,4,5,6,7,8,0]) 711 711 sage: V3 = VectorSpace(QQ,3) 712 712 sage: b = V3([1,2,3]) 713 sage: octave.solve_linear_system(A,b) # requires optionaloctave713 sage: octave.solve_linear_system(A,b) # optional - octave 714 714 [-0.33333299999999999, 0.66666700000000001, -3.5236600000000002e-18] 715 715 716 716 AUTHOR: David Joyner and William Stein -
doc/en/tutorial/interfaces.rst
diff --git a/doc/en/tutorial/interfaces.rst b/doc/en/tutorial/interfaces.rst
a b 158 158 Group( [ (1,2,3)(4,5), (3,4) ] ) 159 159 sage: G.Center() 160 160 Group( () ) 161 sage: G.IdGroup() # requires optional database_gap package161 sage: G.IdGroup() # optional - database_gap 162 162 [ 120, 34 ] 163 163 sage: G.Order() 164 164 120 … … 171 171 sage: G = PermutationGroup([[(1,2,3),(4,5)],[(3,4)]]) 172 172 sage: G.center() 173 173 Subgroup of (Permutation Group with generators [(3,4), (1,2,3)(4,5)]) generated by [()] 174 sage: G.group_id() # requires optional database_gap package174 sage: G.group_id() # optional - database_gap 175 175 [120, 34] 176 176 sage: n = G.order(); n 177 177 120 -
doc/ru/tutorial/interfaces.rst
diff --git a/doc/ru/tutorial/interfaces.rst b/doc/ru/tutorial/interfaces.rst
a b 153 153 Group( [ (1,2,3)(4,5), (3,4) ] ) 154 154 sage: G.Center() 155 155 Group( () ) 156 sage: G.IdGroup() # requires optional database_gap package156 sage: G.IdGroup() # optional - database_gap 157 157 [ 120, 34 ] 158 158 sage: G.Order() 159 159 120 … … 166 166 sage: G = PermutationGroup([[(1,2,3),(4,5)],[(3,4)]]) 167 167 sage: G.center() 168 168 Subgroup of (Permutation Group with generators [(3,4), (1,2,3)(4,5)]) generated by [()] 169 sage: G.group_id() # requires optional database_gap package169 sage: G.group_id() # optional - database_gap 170 170 [120, 34] 171 171 sage: n = G.order(); n 172 172 120 -
sage/calculus/calculus.py
diff --git a/sage/calculus/calculus.py b/sage/calculus/calculus.py
a b 537 537 538 538 This summation only Mathematica can perform:: 539 539 540 sage: symbolic_sum(1/(1+k^2), k, -oo, oo, algorithm = 'mathematica') # optional -- requiresmathematica540 sage: symbolic_sum(1/(1+k^2), k, -oo, oo, algorithm = 'mathematica') # optional - mathematica 541 541 pi*coth(pi) 542 542 543 543 An example of this summation with Giac:: 544 544 545 sage: symbolic_sum(1/(1+k^2), k, -oo, oo, algorithm = 'giac') # optional - - requiresgiac545 sage: symbolic_sum(1/(1+k^2), k, -oo, oo, algorithm = 'giac') # optional - giac 546 546 -(pi*e^(-2*pi) - pi*e^(2*pi))/(e^(-2*pi) + e^(2*pi) - 2) 547 547 548 548 Use Maple as a backend for summation:: 549 549 550 sage: symbolic_sum(binomial(n,k)*x^k, k, 0, n, algorithm = 'maple') # optional -- requiresmaple550 sage: symbolic_sum(binomial(n,k)*x^k, k, 0, n, algorithm = 'maple') # optional - maple 551 551 (x + 1)^n 552 552 553 553 TESTS: -
sage/categories/finite_permutation_groups.py
diff --git a/sage/categories/finite_permutation_groups.py b/sage/categories/finite_permutation_groups.py
a b 152 152 sage: 60 * AlternatingGroup(5).cycle_index() 153 153 p[1, 1, 1, 1, 1] + 15*p[2, 2, 1] + 20*p[3, 1, 1] + 24*p[5] 154 154 155 sage: for G in TransitiveGroups(5): # requires optionaldatabase_gap # long time155 sage: for G in TransitiveGroups(5): # optional - database_gap # long time 156 156 ... G.cardinality() * G.cycle_index() 157 157 p[1, 1, 1, 1, 1] + 4*p[5] 158 158 p[1, 1, 1, 1, 1] + 5*p[2, 2, 1] + 4*p[5] -
sage/coding/code_bounds.py
diff --git a/sage/coding/code_bounds.py b/sage/coding/code_bounds.py
a b 210 210 EXAMPLES:: 211 211 sage: codesize_upper_bound(10,3,2) 212 212 93 213 sage: codesize_upper_bound(10,3,2,algorithm="gap") # requires optional GAP package Guava213 sage: codesize_upper_bound(10,3,2,algorithm="gap") # optional - gap_packages (Guava package) 214 214 85 215 215 216 216 """ … … 275 275 EXAMPLES:: 276 276 sage: plotkin_upper_bound(10,2,3) 277 277 192 278 sage: plotkin_upper_bound(10,2,3,algorithm="gap") # requires optional GAP package Guava278 sage: plotkin_upper_bound(10,2,3,algorithm="gap") # optional - gap_packages (Guava package) 279 279 192 280 280 """ 281 281 if algorithm=="gap": … … 306 306 EXAMPLES:: 307 307 sage: griesmer_upper_bound(10,2,3) 308 308 128 309 sage: griesmer_upper_bound(10,2,3,algorithm="gap") # requires optional GAP package Guava309 sage: griesmer_upper_bound(10,2,3,algorithm="gap") # optional - gap_packages (Guava package) 310 310 128 311 311 """ 312 312 if algorithm=="gap": … … 341 341 342 342 sage: elias_upper_bound(10,2,3) 343 343 232 344 sage: elias_upper_bound(10,2,3,algorithm="gap") # requires optional GAP package Guava344 sage: elias_upper_bound(10,2,3,algorithm="gap") # optional - gap_packages (Guava package) 345 345 232 346 346 347 347 """ -
sage/coding/guava.py
diff --git a/sage/coding/guava.py b/sage/coding/guava.py
a b 50 50 Returns the binary 'Reed-Muller code' with dimension k and order r. 51 51 52 52 EXAMPLE:: 53 sage: C = BinaryReedMullerCode(2,4); C # requires optional package53 sage: C = BinaryReedMullerCode(2,4); C # optional - gap_packages (Guava package) 54 54 Linear code of length 16, dimension 11 over Finite Field of size 2 55 sage: C.minimum_distance() # requires optional package55 sage: C.minimum_distance() # optional - gap_packages (Guava package) 56 56 4 57 sage: C.gen_mat() # requires optional package57 sage: C.gen_mat() # optional - gap_packages (Guava package) 58 58 [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 59 59 [0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1] 60 60 [0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1] … … 94 94 Returns a QQR code of length 2p. 95 95 96 96 EXAMPLES:: 97 sage: C = QuasiQuadraticResidueCode(11); C # requires optional package97 sage: C = QuasiQuadraticResidueCode(11); C # optional - gap_packages (Guava package) 98 98 Linear code of length 22, dimension 11 over Finite Field of size 2 99 99 100 100 REFERENCES: … … 133 133 Returns a "random" linear code with length n, dimension k over field F. 134 134 135 135 EXAMPLES:: 136 sage: C = RandomLinearCodeGuava(30,15,GF(2)); C # requires optional package136 sage: C = RandomLinearCodeGuava(30,15,GF(2)); C # optional - gap_packages (Guava package) 137 137 Linear code of length 30, dimension 15 over Finite Field of size 2 138 sage: C = RandomLinearCodeGuava(10,5,GF(4,'a')); C # requires optional package138 sage: C = RandomLinearCodeGuava(10,5,GF(4,'a')); C # optional - gap_packages (Guava package) 139 139 Linear code of length 10, dimension 5 over Finite Field in a of size 2^2 140 140 141 141 AUTHOR: David Joyner (11-2005) -
sage/coding/linear_code.py
diff --git a/sage/coding/linear_code.py b/sage/coding/linear_code.py
a b 369 369 370 370 This output is different but still a minimum weight vector: 371 371 372 sage: sage.coding.linear_code.min_wt_vec_gap(Gstr,7,4,GF(2),algorithm="guava") # requires optional GAP package Guava372 sage: sage.coding.linear_code.min_wt_vec_gap(Gstr,7,4,GF(2),algorithm="guava") # optional - gap_packages (Guava package) 373 373 (0, 0, 1, 0, 1, 1, 0) 374 374 375 375 Here ``Gstr`` is a generator matrix of the Hamming [7,4,3] binary code. … … 418 418 419 419 EXAMPLES:: 420 420 421 sage: best_known_linear_code(10,5,GF(2)) # long time and requires optional GAP package Guava421 sage: best_known_linear_code(10,5,GF(2)) # long time; optional - gap_packages (Guava package) 422 422 Linear code of length 10, dimension 5 over Finite Field of size 2 423 sage: gap.eval("C:=BestKnownLinearCode(10,5,GF(2))") # long time and requires optional GAP package Guava423 sage: gap.eval("C:=BestKnownLinearCode(10,5,GF(2))") # long time; optional - gap_packages (Guava package) 424 424 'a linear [10,5,4]2..4 shortened code' 425 425 426 426 This means that best possible binary linear code of length 10 and … … 461 461 462 462 EXAMPLES:: 463 463 464 sage: L = best_known_linear_code_www(72, 36, GF(2)) # requires internet, optional465 sage: print L # requires internet, optional464 sage: L = best_known_linear_code_www(72, 36, GF(2)) # optional - internet 465 sage: print L # optional - internet 466 466 Construction of a linear code 467 467 [72,36,15] over GF(2): 468 468 [1]: [73, 36, 16] Cyclic Linear Code over GF(2) … … 1241 1241 EXAMPLES:: 1242 1242 1243 1243 sage: C = HammingCode(5,GF(2)) 1244 sage: C.covering_radius() # requires optional GAP package Guava1244 sage: C.covering_radius() # optional - gap_packages (Guava package) 1245 1245 1 1246 1246 """ 1247 1247 F = self.base_ring() … … 1284 1284 (1, 1, 0, 1, 0, 0, 1) 1285 1285 sage: C.decode(v1,algorithm="nearest neighbor") 1286 1286 (1, 1, 0, 1, 0, 0, 1) 1287 sage: C.decode(v1,algorithm="guava") # requires optional GAP package Guava1287 sage: C.decode(v1,algorithm="guava") # optional - gap_packages (Guava package) 1288 1288 (1, 1, 0, 1, 0, 0, 1) 1289 1289 sage: v2 = matrix([[a,a,F(0),a,a,F(0),a]]) 1290 1290 sage: C.decode(v2) … … 1305 1305 (1, 0, 1, 1, 1) 1306 1306 sage: C.decode(v, algorithm="nearest neighbor") 1307 1307 (1, 0, 1, 1, 1) 1308 sage: C.decode(v, algorithm="guava") # requires optional GAP package Guava1308 sage: C.decode(v, algorithm="guava") # optional - gap_packages (Guava package) 1309 1309 (1, 0, 1, 1, 1) 1310 1310 1311 1311 Does not work for very long codes since the syndrome table grows too … … 1852 1852 sage: C = HammingCode(3,GF(2)) 1853 1853 sage: C.is_self_orthogonal() 1854 1854 False 1855 sage: C = QuasiQuadraticResidueCode(11) # requires optional GAP package Guava1856 sage: C.is_self_orthogonal() # requires optional GAP package Guava1855 sage: C = QuasiQuadraticResidueCode(11) # optional - gap_packages (Guava package) 1856 sage: C.is_self_orthogonal() # optional - gap_packages (Guava package) 1857 1857 True 1858 1858 """ 1859 1859 return self.is_subcode(self.dual_code()) … … 2010 2010 2011 2011 sage: C.minimum_distance(algorithm="gap") 2012 2012 3 2013 sage: C.minimum_distance(algorithm="guava") # requires optional GAP package Guava2013 sage: C.minimum_distance(algorithm="guava") # optional - gap_packages (Guava package) 2014 2014 3 2015 2015 2016 2016 Another example.:: … … 2167 2167 Linear code of length 5, dimension 3 over Finite Field in z of size 2^2 2168 2168 sage: C.permutation_automorphism_group(algorithm="partition") 2169 2169 Permutation Group with generators [(1,3)(4,5), (1,4)(3,5)] 2170 sage: C.permutation_automorphism_group(algorithm="gap") # requires optional GAP package Guava2170 sage: C.permutation_automorphism_group(algorithm="gap") # optional - gap_packages (Guava package) 2171 2171 Permutation Group with generators [(1,3)(4,5), (1,4)(3,5)] 2172 2172 sage: C = TernaryGolayCode() 2173 sage: C.permutation_automorphism_group(algorithm="gap") # requires optional GAP package Guava2173 sage: C.permutation_automorphism_group(algorithm="gap") # optional - gap_packages (Guava package) 2174 2174 Permutation Group with generators [(3,4)(5,7)(6,9)(8,11), (3,5,8)(4,11,7)(6,9,10), (2,3)(4,6)(5,8)(7,10), (1,2)(4,11)(5,8)(9,10)] 2175 2175 2176 2176 However, the option ``algorithm="gap+verbose"``, will print out:: … … 2630 2630 [1, 0, 0, 30, 15, 18] 2631 2631 sage: C = HammingCode(3,GF(2)); C 2632 2632 Linear code of length 7, dimension 4 over Finite Field of size 2 2633 sage: C.spectrum(algorithm="leon") # requires optional GAP package Guava2633 sage: C.spectrum(algorithm="leon") # optional - gap_packages (Guava package) 2634 2634 [1, 0, 0, 7, 7, 0, 0, 1] 2635 2635 sage: C.spectrum(algorithm="gap") 2636 2636 [1, 0, 0, 7, 7, 0, 0, 1] … … 2638 2638 [1, 0, 0, 7, 7, 0, 0, 1] 2639 2639 sage: C = HammingCode(3,GF(3)); C 2640 2640 Linear code of length 13, dimension 10 over Finite Field of size 3 2641 sage: C.spectrum() == C.spectrum(algorithm="leon") # requires optional GAP package Guava2641 sage: C.spectrum() == C.spectrum(algorithm="leon") # optional - gap_packages (Guava package) 2642 2642 True 2643 2643 sage: C = HammingCode(2,GF(5)); C 2644 2644 Linear code of length 6, dimension 4 over Finite Field of size 5 2645 sage: C.spectrum() == C.spectrum(algorithm="leon") # requires optional GAP package Guava2645 sage: C.spectrum() == C.spectrum(algorithm="leon") # optional - gap_packages (Guava package) 2646 2646 True 2647 2647 sage: C = HammingCode(2,GF(7)); C 2648 2648 Linear code of length 8, dimension 6 over Finite Field of size 7 2649 sage: C.spectrum() == C.spectrum(algorithm="leon") # requires optional GAP package Guava2649 sage: C.spectrum() == C.spectrum(algorithm="leon") # optional - gap_packages (Guava package) 2650 2650 True 2651 2651 2652 2652 """ … … 2820 2820 sage: C = HammingCode(3,GF(2)) 2821 2821 sage: C.zeta_polynomial() 2822 2822 2/5*T^2 + 2/5*T + 1/5 2823 sage: C = best_known_linear_code(6,3,GF(2)) # requires optional GAP package Guava2824 sage: C.minimum_distance() # requires optional GAP package Guava2823 sage: C = best_known_linear_code(6,3,GF(2)) # optional - gap_packages (Guava package) 2824 sage: C.minimum_distance() # optional - gap_packages (Guava package) 2825 2825 3 2826 sage: C.zeta_polynomial() # requires optional GAP package Guava2826 sage: C.zeta_polynomial() # optional - gap_packages (Guava package) 2827 2827 2/5*T^2 + 2/5*T + 1/5 2828 2828 sage: C = HammingCode(4,GF(2)) 2829 2829 sage: C.zeta_polynomial() -
sage/combinat/designs/block_design.py
diff --git a/sage/combinat/designs/block_design.py b/sage/combinat/designs/block_design.py
a b 89 89 90 90 sage: ProjectiveGeometryDesign(2, 1, GF(2)) 91 91 Incidence structure with 7 points and 7 blocks 92 sage: BD = ProjectiveGeometryDesign(2, 1, GF(2), algorithm="gap") # requires optional gap package 'design'93 sage: BD.is_block_design() # requires optional gap package 'design'92 sage: BD = ProjectiveGeometryDesign(2, 1, GF(2), algorithm="gap") # optional - gap_packages (design package) 93 sage: BD.is_block_design() # optional - gap_packages (design package) 94 94 (True, [2, 7, 3, 1]) 95 95 """ 96 96 q = F.order() … … 183 183 184 184 EXAMPLES:: 185 185 186 sage: BD = WittDesign(9) # requires optional gap package 'design'187 sage: BD.parameters() # requires optional gap package 'design'186 sage: BD = WittDesign(9) # optional - gap_packages (design package) 187 sage: BD.parameters() # optional - gap_packages (design package) 188 188 (2, 9, 3, 1) 189 sage: BD # requires optional gap package 'design'189 sage: BD # optional - gap_packages (design package) 190 190 Incidence structure with 9 points and 12 blocks 191 sage: print BD # requires optional gap package 'design'191 sage: print BD # optional - gap_packages (design package) 192 192 WittDesign<points=[0, 1, 2, 3, 4, 5, 6, 7, 8], blocks=[[0, 1, 7], [0, 2, 5], [0, 3, 4], [0, 6, 8], [1, 2, 6], [1, 3, 5], [1, 4, 8], [2, 3, 8], [2, 4, 7], [3, 6, 7], [4, 5, 6], [5, 7, 8]]> 193 sage: BD = WittDesign(12) # requires optional gap package 'design'194 sage: BD.parameters(t=5) # requires optional gap package 'design'193 sage: BD = WittDesign(12) # optional - gap_packages (design package) 194 sage: BD.parameters(t=5) # optional - gap_packages (design package) 195 195 (5, 12, 6, 1) 196 196 """ 197 197 from sage.interfaces.gap import gap, GapElement -
sage/combinat/designs/covering_design.py
diff --git a/sage/combinat/designs/covering_design.py b/sage/combinat/designs/covering_design.py
a b 443 443 CoveringDesign -- (v,k,t) covering design with smallest number of blocks 444 444 445 445 EXAMPLES: 446 sage: C = best_known_covering_design_www(7, 3, 2) # optional - - requires internet447 sage: print C # optional - - requires internet446 sage: C = best_known_covering_design_www(7, 3, 2) # optional - internet 447 sage: print C # optional - internet 448 448 C(7,3,2) = 7 449 449 Method: lex covering 450 450 Submitted on: 1996-12-01 00:00:00 -
sage/combinat/designs/ext_rep.py
diff --git a/sage/combinat/designs/ext_rep.py b/sage/combinat/designs/ext_rep.py
a b 550 550 sage: os.remove(file_loc) 551 551 552 552 sage: from sage.combinat.designs import ext_rep 553 sage: s = ext_rep.designs_from_XML_url("http://designtheory.org/database/v-b-k/v3-b6-k2.icgsa.txt.bz2") # optional - requiresinternet553 sage: s = ext_rep.designs_from_XML_url("http://designtheory.org/database/v-b-k/v3-b6-k2.icgsa.txt.bz2") # optional - internet 554 554 """ 555 555 556 556 f = urllib2.urlopen(url) … … 1037 1037 sage: os.remove(file_loc) 1038 1038 1039 1039 sage: from sage.combinat.designs import ext_rep 1040 sage: ext_rep.designs_from_XML_url("http://designtheory.org/database/v-b-k/v3-b6-k2.icgsa.txt.bz2") # optional - requiresinternet1040 sage: ext_rep.designs_from_XML_url("http://designtheory.org/database/v-b-k/v3-b6-k2.icgsa.txt.bz2") # optional - internet 1041 1041 [(3, [[0, 1], [0, 1], [0, 1], [0, 1], [0, 1], [0, 2]]), 1042 1042 (3, [[0, 1], [0, 1], [0, 1], [0, 1], [0, 2], [0, 2]]), 1043 1043 (3, [[0, 1], [0, 1], [0, 1], [0, 1], [0, 2], [1, 2]]), -
sage/combinat/designs/incidence_structures.py
diff --git a/sage/combinat/designs/incidence_structures.py b/sage/combinat/designs/incidence_structures.py
a b 503 503 (True, [2, 7, 3, 1]) 504 504 sage: BD.block_design_checker(2, 7, 3, 1) 505 505 True 506 sage: BD = WittDesign(9) # requires optional gap package 'design'507 sage: BD.is_block_design() # requires optional gap package 'design'506 sage: BD = WittDesign(9) # optional - gap_packages (design package) 507 sage: BD.is_block_design() # optional - gap_packages (design package) 508 508 (True, [2, 9, 3, 1]) 509 sage: BD = WittDesign(12) # requires optional gap package 'design'510 sage: BD.is_block_design() # requires optional gap package 'design'509 sage: BD = WittDesign(12) # optional - gap_packages (design package) 510 sage: BD.is_block_design() # optional - gap_packages (design package) 511 511 (True, [5, 12, 6, 1]) 512 512 sage: BD = AffineGeometryDesign(3, 1, GF(2)) 513 513 sage: BD.is_block_design() … … 601 601 602 602 sage: from sage.combinat.designs.block_design import BlockDesign 603 603 sage: BD = BlockDesign(7,[[0,1,2],[0,3,4],[0,5,6],[1,3,5],[1,4,6],[2,3,6],[2,4,5]]) 604 sage: BD.points_from_gap() # requires optional gap package 'design'604 sage: BD.points_from_gap() # optional - gap_packages (design package) 605 605 [1, 2, 3, 4, 5, 6, 7] 606 606 """ 607 607 from sage.interfaces.gap import gap, GapElement -
sage/combinat/matrices/hadamard_matrix.py
diff --git a/sage/combinat/matrices/hadamard_matrix.py b/sage/combinat/matrices/hadamard_matrix.py
a b 176 176 file is printed if it exists. Otherwise nothing is done. 177 177 178 178 EXAMPLES:: 179 sage: hadamard_matrix_www("had.4.txt") # requires internet, optional179 sage: hadamard_matrix_www("had.4.txt") # optional - internet 180 180 [ 1 1 1 1] 181 181 [ 1 -1 1 -1] 182 182 [ 1 1 -1 -1] 183 183 [ 1 -1 -1 1] 184 sage: hadamard_matrix_www("had.16.2.txt",comments=True) # requires internet, optional184 sage: hadamard_matrix_www("had.16.2.txt",comments=True) # optional - internet 185 185 Automorphism group has order = 49152 = 2^14 * 3 186 186 [ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 187 187 [ 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1] -
sage/combinat/sloane_functions.py
diff --git a/sage/combinat/sloane_functions.py b/sage/combinat/sloane_functions.py
a b 49 49 50 50 We agree with the online database:: 51 51 52 sage: for t in sloane.trait_names(): # long time optional, requiresinternet52 sage: for t in sloane.trait_names(): # long time; optional - internet 53 53 ... online_list = sloane_sequence(ZZ(t[1:].lstrip('0')), verbose = False)[2] 54 54 ... L = max(2, len(online_list) // 2) 55 55 ... sage_list = sloane.__getattribute__(t).list(L) … … 360 360 361 361 sage: sloane.A000001._eval(4) 362 362 2 363 sage: sloane.A000001._eval(51) # optional requiresdatabase_gap363 sage: sloane.A000001._eval(51) # optional - database_gap 364 364 """ 365 365 if n <= 50: 366 366 return self._small[n-1] -
sage/combinat/tiling.py
diff --git a/sage/combinat/tiling.py b/sage/combinat/tiling.py
a b 1646 1646 1647 1647 :: 1648 1648 1649 sage: a.show() # optional - requires convert command1649 sage: a.show() # optional -- ImageMagick 1650 1650 1651 1651 The ``show`` function takes arguments to specify the delay between 1652 1652 frames (measured in hundredths of a second, default value 20) and -
sage/combinat/words/paths.py
diff --git a/sage/combinat/words/paths.py b/sage/combinat/words/paths.py
a b 1594 1594 sage: p = P('aaababbb') 1595 1595 sage: a = p.animate(); a 1596 1596 Animation with 9 frames 1597 sage: show(a) # optional -- requires convert command1597 sage: show(a) # optional -- ImageMagick 1598 1598 sage: a.gif(delay=35, iterations=3) # optional 1599 1599 1600 1600 :: -
sage/databases/db_modular_polynomials.py
diff --git a/sage/databases/db_modular_polynomials.py b/sage/databases/db_modular_polynomials.py
a b 64 64 there is no such polynomial in the database. 65 65 66 66 EXAMPLES: 67 sage: DBMP = ClassicalModularPolynomialDatabase() # optional requires database_hohel67 sage: DBMP = ClassicalModularPolynomialDatabase() # optional - database_kohel 68 68 sage: f = DBMP[29] #optional 69 69 sage: f.degree() #optional 70 70 58 -
sage/databases/lincodes.py
diff --git a/sage/databases/lincodes.py b/sage/databases/lincodes.py
a b 58 58 59 59 ## EXAMPLES: 60 60 ## To find lower and upper bounds for values q=7, n=32, k=8, type 61 ## sage: lower, upper, text = linear_code_bound(7, 32, 8) # optional - - needsinternet61 ## sage: lower, upper, text = linear_code_bound(7, 32, 8) # optional - internet 62 62 ## sage: lower # optional 63 63 ## 19 64 64 ## sage: upper # optional … … 67 67 ## 'Lb(32,8) = 19 DG4\n\nUb(32,8) = 21 follows by a one-step Griesmer bound from:\nUb(10,7) = 3 is found by considering shortening to:\nUb(9,6) = 3 is found by construction B:\n[consider deleting the (at most) 6 coordinates of a word in the dual]' 68 68 69 69 ## When bounds are not known the upper and lower returned bounds are -1: 70 ## sage: linear_code_bound(9, 32, 200) # optional - - needsinternet70 ## sage: linear_code_bound(9, 32, 200) # optional - internet 71 71 ## (-1, -1, '(error executing -why-)') 72 72 73 73 ## This function raises an IOError if an error occurs downloading -
sage/geometry/polyhedron/base.py
diff --git a/sage/geometry/polyhedron/base.py b/sage/geometry/polyhedron/base.py
a b 3111 3111 3112 3112 EXAMPLES:: 3113 3113 3114 sage: polytopes.n_cube(3).lrs_volume() # optional, needs lrs package installed3114 sage: polytopes.n_cube(3).lrs_volume() # optional - lrs 3115 3115 8.0 3116 sage: (polytopes.n_cube(3)*2).lrs_volume() # optional, needs lrs package installed3116 sage: (polytopes.n_cube(3)*2).lrs_volume() # optional - lrs 3117 3117 64.0 3118 sage: polytopes.twenty_four_cell().lrs_volume() # optional, needs lrs package installed3118 sage: polytopes.twenty_four_cell().lrs_volume() # optional - lrs 3119 3119 2.0 3120 3120 3121 3121 REFERENCES: -
sage/graphs/dot2tex_utils.py
diff --git a/sage/graphs/dot2tex_utils.py b/sage/graphs/dot2tex_utils.py
a b 18 18 19 19 EXAMPLES:: 20 20 21 sage: sage.graphs.dot2tex_utils.have_dot2tex() # optional - requires dot2tex andgraphviz21 sage: sage.graphs.dot2tex_utils.have_dot2tex() # optional - dot2tex graphviz 22 22 True 23 23 sage: sage.graphs.dot2tex_utils.have_dot2tex() in [True, False] 24 24 True … … 38 38 39 39 EXAMPLES:: 40 40 41 sage: sage.graphs.dot2tex_utils.assert_have_dot2tex() # optional - requires dot2tex andgraphviz41 sage: sage.graphs.dot2tex_utils.assert_have_dot2tex() # optional - dot2tex graphviz 42 42 """ 43 43 check_error_string = """ 44 44 An error occurs while testing the dot2tex installation. -
sage/graphs/graph_latex.py
diff --git a/sage/graphs/graph_latex.py b/sage/graphs/graph_latex.py
a b 216 216 This example illustrates using the optional dot2tex module:: 217 217 218 218 sage: g = graphs.PetersenGraph() 219 sage: g.set_latex_options(format='dot2tex',prog='neato') # optional - requiresdot2tex219 sage: g.set_latex_options(format='dot2tex',prog='neato') # optional - dot2tex 220 220 sage: from sage.graphs.graph_latex import check_tkz_graph 221 221 sage: check_tkz_graph() # random - depends on TeX installation 222 sage: latex(g) # optional - requiresdot2tex222 sage: latex(g) # optional - dot2tex 223 223 \begin{tikzpicture}[>=latex,line join=bevel,] 224 224 ... 225 225 \end{tikzpicture} … … 230 230 231 231 sage: g = graphs.PetersenGraph() 232 232 sage: g.set_latex_options(format="dot2tex", edge_options = lambda (u,v,label): {"color": "red"} if u==0 else {}) 233 sage: latex(g) # optional - requiresdot2tex233 sage: latex(g) # optional - dot2tex 234 234 \begin{tikzpicture}[>=latex,line join=bevel,] 235 235 ... 236 236 \end{tikzpicture} … … 1322 1322 sage: g = digraphs.ButterflyGraph(1) 1323 1323 sage: from sage.graphs.graph_latex import check_tkz_graph 1324 1324 sage: check_tkz_graph() # random - depends on TeX installation 1325 sage: print g.latex_options().dot2tex_picture() # optional - requires dot2tex andgraphviz1325 sage: print g.latex_options().dot2tex_picture() # optional - dot2tex graphviz 1326 1326 \begin{tikzpicture}[>=latex,line join=bevel,] 1327 1327 %% 1328 1328 \node (0+1) at (...bp,...bp) [draw,draw=none] {$\left(\text{0}, 1\right)$}; -
sage/groups/perm_gps/permgroup.py
diff --git a/sage/groups/perm_gps/permgroup.py b/sage/groups/perm_gps/permgroup.py
a b 165 165 sage: foo = hap_decorator(foo) 166 166 sage: foo(None, 3) #optional - gap_packages 167 167 Done 168 sage: foo(None, 3, 0) # optional - gappackages168 sage: foo(None, 3, 0) # optional - gap_packages 169 169 Done 170 sage: foo(None, 3, 5) # optional - gappackages170 sage: foo(None, 3, 5) # optional - gap_packages 171 171 Done 172 172 sage: foo(None, 3, 4) #optional - gap_packages 173 173 Traceback (most recent call last): -
sage/groups/perm_gps/permgroup_named.py
diff --git a/sage/groups/perm_gps/permgroup_named.py b/sage/groups/perm_gps/permgroup_named.py
a b 1471 1471 Transitive group number 1 of degree 0 1472 1472 sage: TransitiveGroup(1,1) 1473 1473 Transitive group number 1 of degree 1 1474 sage: G = TransitiveGroup(5, 2); G # requires optionaldatabase_gap1474 sage: G = TransitiveGroup(5, 2); G # optional - database_gap 1475 1475 Transitive group number 2 of degree 5 1476 sage: G.gens() # requires optionaldatabase_gap1476 sage: G.gens() # optional - database_gap 1477 1477 [(1,2,3,4,5), (1,4)(2,3)] 1478 1478 1479 sage: G.category() # requires optionaldatabase_gap1479 sage: G.category() # optional - database_gap 1480 1480 Category of finite permutation groups 1481 1481 1482 1482 .. warning:: this follows GAP's naming convention of indexing 1483 1483 the transitive groups starting from ``1``:: 1484 1484 1485 sage: TransitiveGroup(5,0) # requires optionaldatabase_gap1485 sage: TransitiveGroup(5,0) # optional - database_gap 1486 1486 Traceback (most recent call last): 1487 1487 ... 1488 1488 ValueError: Index n must be in {1,..,5} … … 1490 1490 .. warning:: only transitive groups of "small" degree are 1491 1491 available in GAP's database:: 1492 1492 1493 sage: TransitiveGroup(31,1) # requires optionaldatabase_gap1493 sage: TransitiveGroup(31,1) # optional - database_gap 1494 1494 Traceback (most recent call last): 1495 1495 ... 1496 1496 NotImplementedError: Only the transitive groups of order less than 30 are available in GAP's database … … 1503 1503 1504 1504 sage: TestSuite(TransitiveGroup(0,1)).run() 1505 1505 sage: TestSuite(TransitiveGroup(1,1)).run() 1506 sage: TestSuite(TransitiveGroup(5,2)).run()# requires optionaldatabase_gap1507 1508 sage: TransitiveGroup(1,5) # requires optionaldatabase_gap1506 sage: TestSuite(TransitiveGroup(5,2)).run()# optional - database_gap 1507 1508 sage: TransitiveGroup(1,5) # optional - database_gap 1509 1509 Traceback (most recent call last): 1510 1510 ... 1511 1511 ValueError: Index n must be in {1,..,1} … … 1564 1564 .. warning:: in practice, the database currently only contains 1565 1565 transitive groups up to degree 30:: 1566 1566 1567 sage: TransitiveGroups(31).cardinality() # requires optionaldatabase_gap1567 sage: TransitiveGroups(31).cardinality() # optional - database_gap 1568 1568 Traceback (most recent call last): 1569 1569 ... 1570 1570 NotImplementedError: Only the transitive groups of order less than 30 are available in GAP's database … … 1591 1591 sage: L.cardinality() 1592 1592 +Infinity 1593 1593 1594 sage: p = L.__iter__() # requires optionaldatabase_gap1595 sage: (p.next(), p.next(), p.next(), p.next(), p.next(), p.next(), p.next(), p.next()) # requires optionaldatabase_gap1594 sage: p = L.__iter__() # optional - database_gap 1595 sage: (p.next(), p.next(), p.next(), p.next(), p.next(), p.next(), p.next(), p.next()) # optional - database_gap 1596 1596 (Transitive group number 1 of degree 0, Transitive group number 1 of degree 1, Transitive group number 1 of degree 2, Transitive group number 1 of degree 3, Transitive group number 2 of degree 3, Transitive group number 1 of degree 4, Transitive group number 2 of degree 4, Transitive group number 3 of degree 4) 1597 1597 1598 1598 TESTS:: 1599 1599 1600 sage: TestSuite(TransitiveGroups()).run() # requires optionaldatabase_gap # long time1600 sage: TestSuite(TransitiveGroups()).run() # optional - database_gap # long time 1601 1601 """ 1602 1602 def __init__(self): 1603 1603 """ 1604 1604 TESTS:: 1605 1605 1606 sage: S = TransitiveGroups() # requires optionaldatabase_gap1607 sage: S.category() # requires optionaldatabase_gap1606 sage: S = TransitiveGroups() # optional - database_gap 1607 sage: S.category() # optional - database_gap 1608 1608 Category of infinite enumerated sets 1609 1609 """ 1610 1610 DisjointUnionEnumeratedSets.__init__(self, Family(NonNegativeIntegers(), lambda i: TransitiveGroups(i)) ) … … 1613 1613 """ 1614 1614 TESTS:: 1615 1615 1616 sage: TransitiveGroups() # requires optionaldatabase_gap # indirect doctest1616 sage: TransitiveGroups() # optional - database_gap # indirect doctest 1617 1617 Transitive Groups 1618 1618 """ 1619 1619 return "Transitive Groups" … … 1622 1622 r""" 1623 1623 EXAMPLES:: 1624 1624 1625 sage: TransitiveGroup(5,2) in TransitiveGroups() # requires optionaldatabase_gap1625 sage: TransitiveGroup(5,2) in TransitiveGroups() # optional - database_gap 1626 1626 True 1627 sage: TransitiveGroup(6,5) in TransitiveGroups() # requires optionaldatabase_gap1627 sage: TransitiveGroup(6,5) in TransitiveGroups() # optional - database_gap 1628 1628 True 1629 sage: 1 in TransitiveGroups() # requires optionaldatabase_gap1629 sage: 1 in TransitiveGroups() # optional - database_gap 1630 1630 False 1631 1631 """ 1632 1632 return isinstance(G,TransitiveGroup) … … 1637 1637 1638 1638 EXAMPLES:: 1639 1639 1640 sage: S = TransitiveGroups(4); S # requires optionaldatabase_gap1640 sage: S = TransitiveGroups(4); S # optional - database_gap 1641 1641 Transitive Groups of degree 4 1642 sage: list(S) # requires optionaldatabase_gap1642 sage: list(S) # optional - database_gap 1643 1643 [Transitive group number 1 of degree 4, Transitive group number 2 of degree 4, Transitive group number 3 of degree 4, Transitive group number 4 of degree 4, Transitive group number 5 of degree 4] 1644 1644 1645 sage: TransitiveGroups(5).an_element() # requires optionaldatabase_gap1645 sage: TransitiveGroups(5).an_element() # optional - database_gap 1646 1646 Transitive group number 1 of degree 5 1647 1647 1648 1648 We write the cardinality of all transitive groups of degree 5:: 1649 1649 1650 sage: for G in TransitiveGroups(5): # requires optionaldatabase_gap1650 sage: for G in TransitiveGroups(5): # optional - database_gap 1651 1651 ... print G.cardinality() 1652 1652 5 1653 1653 10 … … 1657 1657 1658 1658 TESTS:: 1659 1659 1660 sage: TestSuite(TransitiveGroups(3)).run() # requires optionaldatabase_gap1660 sage: TestSuite(TransitiveGroups(3)).run() # optional - database_gap 1661 1661 1662 1662 1663 1663 """ … … 1665 1665 """ 1666 1666 TESTS:: 1667 1667 1668 sage: S = TransitiveGroups(4) # requires optionaldatabase_gap1669 sage: S.category() # requires optionaldatabase_gap1668 sage: S = TransitiveGroups(4) # optional - database_gap 1669 sage: S.category() # optional - database_gap 1670 1670 Category of finite enumerated sets 1671 1671 """ 1672 1672 self._degree = n … … 1676 1676 """ 1677 1677 TESTS:: 1678 1678 1679 sage: TransitiveGroups(6) # requires optionaldatabase_gap1679 sage: TransitiveGroups(6) # optional - database_gap 1680 1680 Transitive Groups of degree 6 1681 1681 """ 1682 1682 return "Transitive Groups of degree %s"%(self._degree) … … 1685 1685 r""" 1686 1686 EXAMPLES:: 1687 1687 1688 sage: TransitiveGroup(6,5) in TransitiveGroups(4) # requires optionaldatabase_gap1688 sage: TransitiveGroup(6,5) in TransitiveGroups(4) # optional - database_gap 1689 1689 False 1690 sage: TransitiveGroup(4,3) in TransitiveGroups(4) # requires optionaldatabase_gap1690 sage: TransitiveGroup(4,3) in TransitiveGroups(4) # optional - database_gap 1691 1691 True 1692 sage: 1 in TransitiveGroups(4) # requires optionaldatabase_gap1692 sage: 1 in TransitiveGroups(4) # optional - database_gap 1693 1693 False 1694 1694 """ 1695 1695 if isinstance(G,TransitiveGroup): … … 1707 1707 1708 1708 EXAMPLES:: 1709 1709 1710 sage: TransitiveGroups(5)[3] # requires optional database_gap#1710 sage: TransitiveGroups(5)[3] # optional - database_gap 1711 1711 Transitive group number 3 of degree 5 1712 1712 1713 1713 .. warning:: this follows GAP's naming convention of indexing 1714 1714 the transitive groups starting from ``1``:: 1715 1715 1716 sage: TransitiveGroups(5)[0] # requires optionaldatabase_gap1716 sage: TransitiveGroups(5)[0] # optional - database_gap 1717 1717 Traceback (most recent call last): 1718 1718 ... 1719 1719 ValueError: Index n must be in {1,..,5} … … 1724 1724 """ 1725 1725 EXAMPLES:: 1726 1726 1727 sage: list(TransitiveGroups(5)) # indirect doctest # requires optionaldatabase_gap1727 sage: list(TransitiveGroups(5)) # indirect doctest # optional - database_gap 1728 1728 [Transitive group number 1 of degree 5, Transitive group number 2 of degree 5, Transitive group number 3 of degree 5, Transitive group number 4 of degree 5, Transitive group number 5 of degree 5] 1729 1729 """ 1730 1730 for n in xrange(1, self.cardinality() + 1): … … 1738 1738 1739 1739 EXAMPLES:: 1740 1740 1741 sage: TransitiveGroups(0).cardinality() # requires optionaldatabase_gap1741 sage: TransitiveGroups(0).cardinality() # optional - database_gap 1742 1742 1 1743 sage: TransitiveGroups(2).cardinality() # requires optionaldatabase_gap1743 sage: TransitiveGroups(2).cardinality() # optional - database_gap 1744 1744 1 1745 sage: TransitiveGroups(7).cardinality() # requires optionaldatabase_gap1745 sage: TransitiveGroups(7).cardinality() # optional - database_gap 1746 1746 7 1747 sage: TransitiveGroups(12).cardinality() # requires optionaldatabase_gap1747 sage: TransitiveGroups(12).cardinality() # optional - database_gap 1748 1748 301 1749 sage: [TransitiveGroups(i).cardinality() for i in range(11)] # requires optionaldatabase_gap1749 sage: [TransitiveGroups(i).cardinality() for i in range(11)] # optional - database_gap 1750 1750 [1, 1, 1, 2, 5, 5, 16, 7, 50, 34, 45] 1751 1751 1752 1752 .. warning:: … … 1754 1754 The database_gap contains all transitive groups 1755 1755 up to degree 30:: 1756 1756 1757 sage: TransitiveGroups(31).cardinality() # requires optionaldatabase_gap1757 sage: TransitiveGroups(31).cardinality() # optional - database_gap 1758 1758 Traceback (most recent call last): 1759 1759 ... 1760 1760 NotImplementedError: Only the transitive groups of order less than 30 are available in GAP's database 1761 1761 1762 1762 TESTS:: 1763 1763 1764 sage: type(TransitiveGroups(12).cardinality()) # requires optionaldatabase_gap1764 sage: type(TransitiveGroups(12).cardinality()) # optional - database_gap 1765 1765 <type 'sage.rings.integer.Integer'> 1766 1766 sage: type(TransitiveGroups(0).cardinality()) 1767 1767 <type 'sage.rings.integer.Integer'> … … 1802 1802 Trivial group 1803 1803 sage: PrimitiveGroup(1,1) 1804 1804 Trivial group 1805 sage: G = PrimitiveGroup(5, 2); G # requires optionaldatabase_gap1805 sage: G = PrimitiveGroup(5, 2); G # optional - database_gap 1806 1806 D(2*5) 1807 sage: G.gens() # requires optionaldatabase_gap1807 sage: G.gens() # optional - database_gap 1808 1808 [(2,4)(3,5), (1,2,3,5,4)] 1809 sage: G.category() # requires optionaldatabase_gap1809 sage: G.category() # optional - database_gap 1810 1810 Category of finite permutation groups 1811 1811 1812 1812 .. warning:: … … 1814 1814 this follows GAP's naming convention of indexing the primitive 1815 1815 groups starting from ``1``:: 1816 1816 1817 sage: PrimitiveGroup(5,0) # requires optionaldatabase_gap1817 sage: PrimitiveGroup(5,0) # optional - database_gap 1818 1818 Traceback (most recent call last): 1819 1819 ... 1820 1820 ValueError: Index n must be in {1,..,5} … … 1822 1822 Only primitive groups of "small" degree are available in GAP's 1823 1823 database:: 1824 1824 1825 sage: PrimitiveGroup(2500,1) # requires optionaldatabase_gap1825 sage: PrimitiveGroup(2500,1) # optional - database_gap 1826 1826 Traceback (most recent call last): 1827 1827 ... 1828 1828 NotImplementedError: Only the primitive groups of degree less … … 1841 1841 1842 1842 sage: TestSuite(PrimitiveGroup(0,1)).run() 1843 1843 sage: TestSuite(PrimitiveGroup(1,1)).run() 1844 sage: TestSuite(PrimitiveGroup(5,2)).run() # requires optionaldatabase_gap1845 sage: PrimitiveGroup(6,5) # requires optionaldatabase_gap1844 sage: TestSuite(PrimitiveGroup(5,2)).run() # optional - database_gap 1845 sage: PrimitiveGroup(6,5) # optional - database_gap 1846 1846 Traceback (most recent call last): 1847 1847 ... 1848 1848 ValueError: Index n must be in {1,..,4} … … 1880 1880 1881 1881 EXAMPLES:: 1882 1882 1883 sage: G = PrimitiveGroup(5,1); G # requires optionaldatabase_gap1883 sage: G = PrimitiveGroup(5,1); G # optional - database_gap 1884 1884 C(5) 1885 1885 """ 1886 1886 return self._pretty_name … … 1897 1897 1898 1898 EXAMPLES:: 1899 1899 1900 sage: G = PrimitiveGroup(5,2); G.group_primitive_id() # requires optionaldatabase_gap1900 sage: G = PrimitiveGroup(5,2); G.group_primitive_id() # optional - database_gap 1901 1901 2 1902 1902 """ 1903 1903 return self._n … … 1936 1936 The database currently only contains primitive groups up to degree 1937 1937 2499:: 1938 1938 1939 sage: PrimitiveGroups(2500).cardinality() # requires optionaldatabase_gap1939 sage: PrimitiveGroups(2500).cardinality() # optional - database_gap 1940 1940 Traceback (most recent call last): 1941 1941 ... 1942 1942 NotImplementedError: Only the primitive groups of degree less … … 1971 1971 sage: L.cardinality() 1972 1972 +Infinity 1973 1973 1974 sage: p = L.__iter__() # requires optionaldatabase_gap1975 sage: (p.next(), p.next(), p.next(), p.next(), # requires optionaldatabase_gap1974 sage: p = L.__iter__() # optional - database_gap 1975 sage: (p.next(), p.next(), p.next(), p.next(), # optional - database_gap 1976 1976 ... p.next(), p.next(), p.next(), p.next()) 1977 1977 (Trivial group, Trivial group, S(2), A(3), S(3), A(4), S(4), C(5)) 1978 1978 1979 1979 TESTS:: 1980 1980 1981 sage: TestSuite(PrimitiveGroups()).run() # requires optionaldatabase_gap # long time1981 sage: TestSuite(PrimitiveGroups()).run() # optional - database_gap # long time 1982 1982 """ 1983 1983 def __init__(self): 1984 1984 """ 1985 1985 TESTS:: 1986 1986 1987 sage: S = PrimitiveGroups() # requires optionaldatabase_gap1988 sage: S.category() # requires optionaldatabase_gap1987 sage: S = PrimitiveGroups() # optional - database_gap 1988 sage: S.category() # optional - database_gap 1989 1989 Category of infinite enumerated sets 1990 1990 """ 1991 1991 DisjointUnionEnumeratedSets.__init__(self, Family(NonNegativeIntegers(), lambda i: PrimitiveGroups(i)) ) … … 2000 2000 2001 2001 TESTS:: 2002 2002 2003 sage: PrimitiveGroups() # requires optionaldatabase_gap # indirect doctest2003 sage: PrimitiveGroups() # optional - database_gap # indirect doctest 2004 2004 Primitive Groups 2005 2005 """ 2006 2006 return "Primitive Groups" … … 2019 2019 2020 2020 EXAMPLES:: 2021 2021 2022 sage: PrimitiveGroup(5,2) in PrimitiveGroups() # requires optionaldatabase_gap2022 sage: PrimitiveGroup(5,2) in PrimitiveGroups() # optional - database_gap 2023 2023 True 2024 sage: PrimitiveGroup(6,4) in PrimitiveGroups() # requires optionaldatabase_gap2024 sage: PrimitiveGroup(6,4) in PrimitiveGroups() # optional - database_gap 2025 2025 True 2026 sage: 1 in PrimitiveGroups() # requires optionaldatabase_gap2026 sage: 1 in PrimitiveGroups() # optional - database_gap 2027 2027 False 2028 2028 """ 2029 2029 return isinstance(G,PrimitiveGroup) … … 2034 2034 2035 2035 EXAMPLES:: 2036 2036 2037 sage: S = PrimitiveGroups(5); S # requires optionaldatabase_gap2037 sage: S = PrimitiveGroups(5); S # optional - database_gap 2038 2038 Primitive Groups of degree 5 2039 sage: S.list() # requires optionaldatabase_gap2039 sage: S.list() # optional - database_gap 2040 2040 [C(5), D(2*5), AGL(1, 5), A(5), S(5)] 2041 sage: S.an_element() # requires optionaldatabase_gap2041 sage: S.an_element() # optional - database_gap 2042 2042 C(5) 2043 2043 2044 2044 We write the cardinality of all primitive groups of degree 5:: 2045 2045 2046 sage: for G in PrimitiveGroups(5): # requires optionaldatabase_gap2046 sage: for G in PrimitiveGroups(5): # optional - database_gap 2047 2047 ... print G.cardinality() 2048 2048 5 2049 2049 10 … … 2053 2053 2054 2054 TESTS:: 2055 2055 2056 sage: TestSuite(PrimitiveGroups(3)).run() # requires optionaldatabase_gap2056 sage: TestSuite(PrimitiveGroups(3)).run() # optional - database_gap 2057 2057 """ 2058 2058 def __init__(self, n): 2059 2059 """ 2060 2060 TESTS:: 2061 2061 2062 sage: S = PrimitiveGroups(4) # requires optionaldatabase_gap2063 sage: S.category() # requires optionaldatabase_gap2062 sage: S = PrimitiveGroups(4) # optional - database_gap 2063 sage: S.category() # optional - database_gap 2064 2064 Category of finite enumerated sets 2065 2065 """ 2066 2066 self._degree = n … … 2076 2076 2077 2077 TESTS:: 2078 2078 2079 sage: PrimitiveGroups(6) # requires optionaldatabase_gap2079 sage: PrimitiveGroups(6) # optional - database_gap 2080 2080 Primitive Groups of degree 6 2081 2081 """ 2082 2082 return "Primitive Groups of degree %s"%(self._degree) … … 2095 2095 2096 2096 EXAMPLES:: 2097 2097 2098 sage: PrimitiveGroup(6,4) in PrimitiveGroups(4) # requires optionaldatabase_gap2098 sage: PrimitiveGroup(6,4) in PrimitiveGroups(4) # optional - database_gap 2099 2099 False 2100 sage: PrimitiveGroup(4,2) in PrimitiveGroups(4) # requires optionaldatabase_gap2100 sage: PrimitiveGroup(4,2) in PrimitiveGroups(4) # optional - database_gap 2101 2101 True 2102 sage: 1 in PrimitiveGroups(4) # requires optionaldatabase_gap2102 sage: 1 in PrimitiveGroups(4) # optional - database_gap 2103 2103 False 2104 2104 """ 2105 2105 if isinstance(G,PrimitiveGroup): … … 2117 2117 2118 2118 EXAMPLES:: 2119 2119 2120 sage: PrimitiveGroups(5)[3] # requires optionaldatabase_gap2120 sage: PrimitiveGroups(5)[3] # optional - database_gap 2121 2121 AGL(1, 5) 2122 2122 2123 2123 .. warning:: … … 2125 2125 this follows GAP's naming convention of indexing the 2126 2126 primitive groups starting from ``1``:: 2127 2127 2128 sage: PrimitiveGroups(5)[0] # requires optionaldatabase_gap2128 sage: PrimitiveGroups(5)[0] # optional - database_gap 2129 2129 Traceback (most recent call last): 2130 2130 ... 2131 2131 ValueError: Index n must be in {1,..,5} … … 2136 2136 """ 2137 2137 EXAMPLES:: 2138 2138 2139 sage: list(PrimitiveGroups(5)) # indirect doctest # requires optionaldatabase_gap2139 sage: list(PrimitiveGroups(5)) # indirect doctest # optional - database_gap 2140 2140 [C(5), D(2*5), AGL(1, 5), A(5), S(5)] 2141 2141 """ 2142 2142 for n in xrange(1, self.cardinality() + 1): … … 2154 2154 2155 2155 EXAMPLES:: 2156 2156 2157 sage: PrimitiveGroups(0).cardinality() # requires optionaldatabase_gap2157 sage: PrimitiveGroups(0).cardinality() # optional - database_gap 2158 2158 1 2159 sage: PrimitiveGroups(2).cardinality() # requires optionaldatabase_gap2159 sage: PrimitiveGroups(2).cardinality() # optional - database_gap 2160 2160 1 2161 sage: PrimitiveGroups(7).cardinality() # requires optionaldatabase_gap2161 sage: PrimitiveGroups(7).cardinality() # optional - database_gap 2162 2162 7 2163 sage: PrimitiveGroups(12).cardinality() # requires optionaldatabase_gap2163 sage: PrimitiveGroups(12).cardinality() # optional - database_gap 2164 2164 6 2165 sage: [PrimitiveGroups(i).cardinality() for i in range(11)] # requires optionaldatabase_gap2165 sage: [PrimitiveGroups(i).cardinality() for i in range(11)] # optional - database_gap 2166 2166 [1, 1, 1, 2, 2, 5, 4, 7, 7, 11, 9] 2167 2167 2168 2168 The database_gap contains all primitive groups up to degree 2169 2169 2499:: 2170 2170 2171 sage: PrimitiveGroups(2500).cardinality() # requires optionaldatabase_gap2171 sage: PrimitiveGroups(2500).cardinality() # optional - database_gap 2172 2172 Traceback (most recent call last): 2173 2173 ... 2174 2174 NotImplementedError: Only the primitive groups of degree less than … … 2176 2176 2177 2177 TESTS:: 2178 2178 2179 sage: type(PrimitiveGroups(12).cardinality()) # requires optionaldatabase_gap2179 sage: type(PrimitiveGroups(12).cardinality()) # optional - database_gap 2180 2180 <type 'sage.rings.integer.Integer'> 2181 2181 sage: type(PrimitiveGroups(0).cardinality()) 2182 2182 <type 'sage.rings.integer.Integer'> -
sage/interfaces/axiom.py
diff --git a/sage/interfaces/axiom.py b/sage/interfaces/axiom.py
a b 257 257 sage: f = open(filename, 'w') 258 258 sage: f.write('xx := 22;\n') 259 259 sage: f.close() 260 sage: axiom.read(filename) # optional -- requires Axiom260 sage: axiom.read(filename) # optional - axiom 261 261 sage: axiom.get('xx') #optional 262 262 '22' 263 263 """ -
sage/interfaces/expect.py
diff --git a/sage/interfaces/expect.py b/sage/interfaces/expect.py
a b 621 621 sage: f = open(filename, 'w') 622 622 sage: f.write('x = 2\n') 623 623 sage: f.close() 624 sage: octave.read(filename) # optional -- requires Octave624 sage: octave.read(filename) # optional - octave 625 625 sage: octave.get('x') #optional 626 626 ' 2' 627 627 sage: import os -
sage/interfaces/giac.py
diff --git a/sage/interfaces/giac.py b/sage/interfaces/giac.py
a b 672 672 sage: giac._equality_symbol() # optional - giac 673 673 '==' 674 674 675 sage: giac(2) == giac(2) # optional - - requiresgiac675 sage: giac(2) == giac(2) # optional - giac 676 676 True 677 677 """ 678 678 return '==' … … 1029 1029 1030 1030 EXAMPLE:: 1031 1031 1032 sage: m = giac('x^2 + 5*y') # optional - requiresgiac1033 sage: m.sage() # optional - requiresgiac1032 sage: m = giac('x^2 + 5*y') # optional - giac 1033 sage: m.sage() # optional - giac 1034 1034 x^2 + 5*y 1035 1035 1036 1036 :: 1037 1037 1038 sage: m = giac('sin(2*sqrt(1-x^2)) * (1 - cos(1/x))^2') # optional - requiresgiac1039 sage: m.trigexpand().sage() # optional - requiresgiac1038 sage: m = giac('sin(2*sqrt(1-x^2)) * (1 - cos(1/x))^2') # optional - giac 1039 sage: m.trigexpand().sage() # optional - giac 1040 1040 2*(cos(1/x) - 1)^2*sin(sqrt(-x^2 + 1))*cos(sqrt(-x^2 + 1)) 1041 1041 1042 1042 """ -
sage/interfaces/gnuplot.py
diff --git a/sage/interfaces/gnuplot.py b/sage/interfaces/gnuplot.py
a b 154 154 155 155 EXAMPLES:: 156 156 157 sage: gnuplot.plot3d_parametric('v^2*sin(u), v*cos(u), v*(1-v)') # optional - - requiresgnuplot (not tested, since something pops up).157 sage: gnuplot.plot3d_parametric('v^2*sin(u), v*cos(u), v*(1-v)') # optional - gnuplot (not tested, since something pops up). 158 158 """ 159 159 if title is None: 160 160 title = str(f) -
sage/interfaces/interface.py
diff --git a/sage/interfaces/interface.py b/sage/interfaces/interface.py
a b 114 114 sage: f = open(filename, 'w') 115 115 sage: f.write('x = 2\n') 116 116 sage: f.close() 117 sage: octave.read(filename) # optional -- requires Octave117 sage: octave.read(filename) # optional - octave 118 118 sage: octave.get('x') #optional 119 119 ' 2' 120 120 sage: import os -
sage/interfaces/kash.py
diff --git a/sage/interfaces/kash.py b/sage/interfaces/kash.py
a b 122 122 123 123 Use ``a.name()`` to get the name of the KASH variable:: 124 124 125 sage: a.name() # somewhat random andoptional - kash125 sage: a.name() # somewhat random; optional - kash 126 126 'sage0' 127 127 sage: kash(a.name()) # optional -- kash 128 128 32233 … … 558 558 ## Return help on KASH commands. 559 559 560 560 ## EXAMPLES: 561 ## sage: X = kash.help('IntegerRing') # needs optional kash package561 ## sage: X = kash.help('IntegerRing') # optional - kash 562 562 563 563 ## """ 564 564 ## if name is None: -
sage/interfaces/maple.py
diff --git a/sage/interfaces/maple.py b/sage/interfaces/maple.py
a b 652 652 sage: maple._equality_symbol() 653 653 '=' 654 654 655 sage: maple(2) == maple(2) # optional - - requiresmaple655 sage: maple(2) == maple(2) # optional - maple 656 656 True 657 657 """ 658 658 return '=' … … 776 776 :: 777 777 778 778 sage: maple.quit() # optional -- to reset maple. 779 sage: maple('partition(10)') # optional - - requiresmaple779 sage: maple('partition(10)') # optional - maple 780 780 partition(10) 781 sage: maple('bell(10)') # optional - - requiresmaple781 sage: maple('bell(10)') # optional - maple 782 782 bell(10) 783 sage: maple.with_package('combinat') # optional - - requiresmaple784 sage: maple('partition(10)') # optional - - requiresmaple783 sage: maple.with_package('combinat') # optional - maple 784 sage: maple('partition(10)') # optional - maple 785 785 [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 2], [1, 1, 1, 1, 1, 1, 2, 2], [1, 1, 1, 1, 2, 2, 2], [1, 1, 2, 2, 2, 2], [2, 2, 2, 2, 2], [1, 1, 1, 1, 1, 1, 1, 3], [1, 1, 1, 1, 1, 2, 3], [1, 1, 1, 2, 2, 3], [1, 2, 2, 2, 3], [1, 1, 1, 1, 3, 3], [1, 1, 2, 3, 3], [2, 2, 3, 3], [1, 3, 3, 3], [1, 1, 1, 1, 1, 1, 4], [1, 1, 1, 1, 2, 4], [1, 1, 2, 2, 4], [2, 2, 2, 4], [1, 1, 1, 3, 4], [1, 2, 3, 4], [3, 3, 4], [1, 1, 4, 4], [2, 4, 4], [1, 1, 1, 1, 1, 5], [1, 1, 1, 2, 5], [1, 2, 2, 5], [1, 1, 3, 5], [2, 3, 5], [1, 4, 5], [5, 5], [1, 1, 1, 1, 6], [1, 1, 2, 6], [2, 2, 6], [1, 3, 6], [4, 6], [1, 1, 1, 7], [1, 2, 7], [3, 7], [1, 1, 8], [2, 8], [1, 9], [10]] 786 sage: maple('bell(10)') # optional - - requiresmaple786 sage: maple('bell(10)') # optional - maple 787 787 115975 788 sage: maple('fibonacci(10)') # optional - - requiresmaple788 sage: maple('fibonacci(10)') # optional - maple 789 789 55 790 790 """ 791 791 self.eval('with(%s)'%package) … … 956 956 TESTS:: 957 957 958 958 sage: x = var('x') 959 sage: t = maple((x+1)^2) # optional - - requiresmaple960 sage: u = maple(x^2+2*x+1) # optional - - requiresmaple959 sage: t = maple((x+1)^2) # optional - maple 960 sage: u = maple(x^2+2*x+1) # optional - maple 961 961 sage: u == t # todo: not implemented 962 962 True # returns False, should use 'testeq' in maple 963 963 sage: maple.eval('testeq(%s = %s)'%(t.name(),u.name())) # optional - maple … … 1061 1061 1062 1062 EXAMPLES:: 1063 1063 1064 sage: print latex(maple('(x^4 - y)/(y^2-3*x)')) # optional - - requiresmaple1064 sage: print latex(maple('(x^4 - y)/(y^2-3*x)')) # optional - maple 1065 1065 {\frac {{x}^{4}-y}{{y}^{2}-3\,x}} 1066 sage: print latex(maple(pi - e^3)) # optional - - requiresmaple1066 sage: print latex(maple(pi - e^3)) # optional - maple 1067 1067 \pi - \left( {e^{1}} \right) ^{3} 1068 1068 1069 1069 .. note:: … … 1082 1082 1083 1083 EXAMPLE:: 1084 1084 1085 sage: m = maple('x^2 + 5*y') # optional - requiresmaple1086 sage: m.sage() # optional - requiresmaple1085 sage: m = maple('x^2 + 5*y') # optional - maple 1086 sage: m.sage() # optional - maple 1087 1087 x^2 + 5*y 1088 1088 1089 1089 :: 1090 1090 1091 sage: m = maple('sin(sqrt(1-x^2)) * (1 - cos(1/x))^2') # optional - requiresmaple1092 sage: m.sage() # optional - requiresmaple1091 sage: m = maple('sin(sqrt(1-x^2)) * (1 - cos(1/x))^2') # optional - maple 1092 sage: m.sage() # optional - maple 1093 1093 (cos(1/x) - 1)^2*sin(sqrt(-x^2 + 1)) 1094 1094 1095 1095 """ -
sage/interfaces/matlab.py
diff --git a/sage/interfaces/matlab.py b/sage/interfaces/matlab.py
a b 256 256 257 257 EXAMPLES:: 258 258 259 sage: s = matlab.eval('a = 2') # optional - requiresmatlab259 sage: s = matlab.eval('a = 2') # optional - matlab 260 260 sage: matlab.get('a') #optional 261 261 ' 2' 262 262 """ … … 308 308 309 309 sage: M33 = MatrixSpace(QQ,3,3) 310 310 sage: A = M33([1,2,3,4,5,6,7,8,0]) 311 sage: matlab.sage2matlab_matrix_string(A) # requires optionalmatlab311 sage: matlab.sage2matlab_matrix_string(A) # optional - matlab 312 312 '[1, 2, 3; 4, 5, 6; 7, 8, 0]' 313 313 314 314 AUTHOR: … … 331 331 332 332 EXAMPLES:: 333 333 334 sage: A = matlab('[1,2;3,4]') # optional matlab package334 sage: A = matlab('[1,2;3,4]') # optional - matlab 335 335 sage: matrix(ZZ, A) # optional 336 336 [1 2] 337 337 [3 4] 338 sage: A = matlab('[1,2;3,4.5]') # optional matlab package338 sage: A = matlab('[1,2;3,4.5]') # optional - matlab 339 339 sage: matrix(RR, A) # optional 340 340 [1.00000000000000 2.00000000000000] 341 341 [3.00000000000000 4.50000000000000] 342 342 343 sage: a = matlab('eye(50)') # optional - requiresmatlab344 sage: matrix(RR, a) # optional - requiresmatlab343 sage: a = matlab('eye(50)') # optional - matlab 344 sage: matrix(RR, a) # optional - matlab 345 345 50 x 50 dense matrix over Real Field with 53 bits of precision 346 346 347 347 """ … … 374 374 375 375 EXAMPLES:: 376 376 377 sage: matlab_console() # optional andnot tested377 sage: matlab_console() # optional; not tested 378 378 < M A T L A B > 379 379 Copyright 1984-2006 The MathWorks, Inc. 380 380 ... … … 399 399 400 400 EXAMPLES:: 401 401 402 sage: matlab_version() # random optional matlab package402 sage: matlab_version() # random; optional - matlab 403 403 '7.2.0.283 (R2006a)' 404 404 """ 405 405 return str(matlab('version')).strip() -
sage/interfaces/mupad.py
diff --git a/sage/interfaces/mupad.py b/sage/interfaces/mupad.py
a b 160 160 sage: f = open(filename, 'w') 161 161 sage: f.write('x := 2;\n') 162 162 sage: f.close() 163 sage: mupad.read(filename) # optional -- requiresMuPAD163 sage: mupad.read(filename) # optional - MuPAD 164 164 sage: mupad.get('x').strip() # optional - mupad 165 165 '2' 166 166 … … 279 279 def cputime(self, t=None): 280 280 """ 281 281 EXAMPLES: 282 sage: t = mupad.cputime() #random, optional - - requiresMuPAD282 sage: t = mupad.cputime() #random, optional - MuPAD 283 283 0.11600000000000001 284 284 """ 285 285 if t is None: -
sage/interfaces/octave.py
diff --git a/sage/interfaces/octave.py b/sage/interfaces/octave.py
a b 12 12 13 13 EXAMPLES:: 14 14 15 sage: octave.eval('2+2') # optional - - requires Octave15 sage: octave.eval('2+2') # optional - octave 16 16 'ans = 4' 17 17 18 sage: a = octave(10) # optional - - requires Octave19 sage: a**10 # optional - - requires Octave18 sage: a = octave(10) # optional - octave 19 sage: a**10 # optional - octave 20 20 1e+10 21 21 22 22 LOG: - creation (William Stein) - ? (David Joyner, 2005-12-18) - … … 60 60 61 61 :: 62 62 63 sage: octave("airy(3,2)") # optional - - requires Octave63 sage: octave("airy(3,2)") # optional - octave 64 64 4.10068 65 sage: octave("beta(2,2)") # optional - - requires Octave65 sage: octave("beta(2,2)") # optional - octave 66 66 0.166667 67 sage: octave("betainc(0.2,2,2)") # optional - - requires Octave67 sage: octave("betainc(0.2,2,2)") # optional - octave 68 68 0.104 69 sage: octave("besselh(0,2)") # optional - - requires Octave69 sage: octave("besselh(0,2)") # optional - octave 70 70 (0.223891,0.510376) 71 sage: octave("besselh(0,1)") # optional - - requires Octave71 sage: octave("besselh(0,1)") # optional - octave 72 72 (0.765198,0.088257) 73 sage: octave("besseli(1,2)") # optional - - requires Octave73 sage: octave("besseli(1,2)") # optional - octave 74 74 1.59064 75 sage: octave("besselj(1,2)") # optional - - requires Octave75 sage: octave("besselj(1,2)") # optional - octave 76 76 0.576725 77 sage: octave("besselk(1,2)") # optional - - requires Octave77 sage: octave("besselk(1,2)") # optional - octave 78 78 0.139866 79 sage: octave("erf(0)") # optional - - requires Octave79 sage: octave("erf(0)") # optional - octave 80 80 0 81 sage: octave("erf(1)") # optional - - requires Octave81 sage: octave("erf(1)") # optional - octave 82 82 0.842701 83 sage: octave("erfinv(0.842)") # optional - - requires Octave83 sage: octave("erfinv(0.842)") # optional - octave 84 84 0.998315 85 sage: octave("gamma(1.5)") # optional - - requires Octave85 sage: octave("gamma(1.5)") # optional - octave 86 86 0.886227 87 sage: octave("gammainc(1.5,1)") # optional - - requires Octave87 sage: octave("gammainc(1.5,1)") # optional - octave 88 88 0.77687 89 89 90 90 The Octave interface reads in even very long input (using files) in 91 91 a robust manner:: 92 92 93 93 sage: t = '"%s"'%10^10000 # ten thousand character string. 94 sage: a = octave.eval(t + ';') # optional - - requires Octave, < 1/100th of a second95 sage: a = octave(t) # optional - - requires Octave94 sage: a = octave.eval(t + ';') # optional - octave, < 1/100th of a second 95 sage: a = octave(t) # optional - octave 96 96 97 97 Note that actually reading a back out takes forever. This *must* 98 98 be fixed ASAP - see … … 103 103 104 104 EXAMPLES:: 105 105 106 sage: octave('4+10') # optional - - requires Octave106 sage: octave('4+10') # optional - octave 107 107 14 108 sage: octave('date') # optional - - requires Octave; random output108 sage: octave('date') # optional - octave; random output 109 109 18-Oct-2007 110 sage: octave('5*10 + 6') # optional - - requires Octave110 sage: octave('5*10 + 6') # optional - octave 111 111 56 112 sage: octave('(6+6)/3') # optional - - requires Octave112 sage: octave('(6+6)/3') # optional - octave 113 113 4 114 sage: octave('9')^2 # optional - - requires Octave114 sage: octave('9')^2 # optional - octave 115 115 81 116 sage: a = octave(10); b = octave(20); c = octave(30) # optional - - requires Octave117 sage: avg = (a+b+c)/3 # optional - - requires Octave118 sage: avg # optional - - requires Octave116 sage: a = octave(10); b = octave(20); c = octave(30) # optional - octave 117 sage: avg = (a+b+c)/3 # optional - octave 118 sage: avg # optional - octave 119 119 20 120 sage: parent(avg) # optional - - requires Octave120 sage: parent(avg) # optional - octave 121 121 Octave 122 122 123 123 :: 124 124 125 sage: my_scalar = octave('3.1415') # optional - - requires Octave126 sage: my_scalar # optional - - requires Octave125 sage: my_scalar = octave('3.1415') # optional - octave 126 sage: my_scalar # optional - octave 127 127 3.1415 128 sage: my_vector1 = octave('[1,5,7]') # optional - - requires Octave129 sage: my_vector1 # optional - - requires Octave128 sage: my_vector1 = octave('[1,5,7]') # optional - octave 129 sage: my_vector1 # optional - octave 130 130 1 5 7 131 sage: my_vector2 = octave('[1;5;7]') # optional - - requires Octave132 sage: my_vector2 # optional - - requires Octave131 sage: my_vector2 = octave('[1;5;7]') # optional - octave 132 sage: my_vector2 # optional - octave 133 133 1 134 134 5 135 135 7 136 sage: my_vector1 * my_vector2 # optional - - requires Octave136 sage: my_vector1 * my_vector2 # optional - octave 137 137 75 138 138 """ 139 139 … … 163 163 164 164 EXAMPLES:: 165 165 166 sage: octave.eval("a = [ 1, 1, 2; 3, 5, 8; 13, 21, 33 ]") # optional - - requires Octave166 sage: octave.eval("a = [ 1, 1, 2; 3, 5, 8; 13, 21, 33 ]") # optional - octave 167 167 'a =\n\n 1 1 2\n 3 5 8\n 13 21 33\n\n' 168 sage: octave.eval("b = [ 1; 3; 13]") # optional - - requires Octave168 sage: octave.eval("b = [ 1; 3; 13]") # optional - octave 169 169 'b =\n\n 1\n 3\n 13\n\n' 170 sage: octave.eval("c=a \\ b") # solves linear equation: a*c = b # optional - - requires Octave; random output170 sage: octave.eval("c=a \\ b") # solves linear equation: a*c = b # optional - octave; random output 171 171 'c =\n\n 1\n 7.21645e-16\n -7.21645e-16\n\n' 172 sage: octave.eval("c") # optional - - requires Octave; random output172 sage: octave.eval("c") # optional - octave; random output 173 173 'c =\n\n 1\n 7.21645e-16\n -7.21645e-16\n\n' 174 174 """ 175 175 def __init__(self, maxread=100, script_subdirectory="", logfile=None, server=None, server_tmpdir=None): … … 256 256 EXAMPLES:: 257 257 258 258 sage: o = Octave() 259 sage: o._start() # optional -- requires Octave260 sage: o.quit(True) # optional -- requires Octave259 sage: o._start() # optional - octave 260 sage: o.quit(True) # optional - octave 261 261 Exiting spawned Octave process. 262 262 """ 263 263 # Don't bother, since it just hangs in some cases, and it … … 274 274 275 275 EXAMPLES:: 276 276 277 sage: o = Octave() # optional -- requires Octave278 sage: o.is_running() # optional -- requires Octave277 sage: o = Octave() # optional - octave 278 sage: o.is_running() # optional - octave 279 279 False 280 sage: o._start() # optional -- requires Octave281 sage: o.is_running() # optional -- requires Octave280 sage: o._start() # optional - octave 281 sage: o.is_running() # optional - octave 282 282 True 283 283 """ 284 284 Expect._start(self) … … 291 291 292 292 EXAMPLES:: 293 293 294 sage: octave.set('x', '2') # optional -- requires Octave295 sage: octave.get('x') # optional -- requires Octave294 sage: octave.set('x', '2') # optional - octave 295 sage: octave.get('x') # optional - octave 296 296 ' 2' 297 297 """ 298 298 cmd = '%s=%s;'%(var,value) … … 306 306 307 307 EXAMPLES:: 308 308 309 sage: octave.set('x', '2') # optional -- requires Octave310 sage: octave.get('x') # optional -- requires Octave309 sage: octave.set('x', '2') # optional - octave 310 sage: octave.get('x') # optional - octave 311 311 ' 2' 312 312 """ 313 313 s = self.eval('%s'%var) … … 320 320 321 321 EXAMPLES:: 322 322 323 sage: octave.set('x', '2') # optional -- requires Octave324 sage: octave.clear('x') # optional -- requires Octave325 sage: octave.get('x') # optional -- requires Octave323 sage: octave.set('x', '2') # optional - octave 324 sage: octave.clear('x') # optional - octave 325 sage: octave.get('x') # optional - octave 326 326 "error: `x' undefined near line ... column 1" 327 327 """ 328 328 self.eval('clear %s'%var) … … 358 358 359 359 EXAMPLES:: 360 360 361 sage: octave.version() # optional - - requires Octave; random output depending on version361 sage: octave.version() # optional - octave; random output depending on version 362 362 '2.1.73' 363 363 """ 364 364 return octave_version() … … 383 383 sage: A = M33([1,2,3,4,5,6,7,8,0]) 384 384 sage: V3 = VectorSpace(QQ,3) 385 385 sage: b = V3([1,2,3]) 386 sage: octave.solve_linear_system(A,b) # optional - - requires Octave (and output is slightly random in low order bits)386 sage: octave.solve_linear_system(A,b) # optional - octave (and output is slightly random in low order bits) 387 387 [-0.33333299999999999, 0.66666700000000001, -3.5236600000000002e-18] 388 388 389 389 AUTHORS: … … 422 422 423 423 sage: M33 = MatrixSpace(QQ,3,3) 424 424 sage: A = M33([1,2,3,4,5,6,7,8,0]) 425 sage: octave.sage2octave_matrix_string(A) # optional - - requires Octave425 sage: octave.sage2octave_matrix_string(A) # optional - octave 426 426 '[1, 2, 3; 4, 5, 6; 7, 8, 0]' 427 427 428 428 AUTHORS: … … 492 492 493 493 EXAMPLES:: 494 494 495 sage: A = octave('[1,2;3,4]') # optional - - requires Octave496 sage: matrix(ZZ, A) # optional - - requires Octave495 sage: A = octave('[1,2;3,4]') # optional - octave 496 sage: matrix(ZZ, A) # optional - octave 497 497 [1 2] 498 498 [3 4] 499 sage: A = octave('[1,2;3,4.5]') # optional - - requires Octave500 sage: matrix(RR, A) # optional - - requires Octave499 sage: A = octave('[1,2;3,4.5]') # optional - octave 500 sage: matrix(RR, A) # optional - octave 501 501 [1.00000000000000 2.00000000000000] 502 502 [3.00000000000000 4.50000000000000] 503 503 """ … … 558 558 559 559 EXAMPLES:: 560 560 561 sage: octave_version() # optional - - requires Octave; and output is random561 sage: octave_version() # optional - octave; and output is random 562 562 '2.9.12' 563 563 """ 564 564 return str(octave('version')).strip() -
sage/interfaces/qsieve.py
diff --git a/sage/interfaces/qsieve.py b/sage/interfaces/qsieve.py
a b 63 63 sage: v, t = qsieve(n, time=True) # uses the sieve (optional: time doesn't work on cygwin) 64 64 sage: v # optional 65 65 [10000000000000000051, 100000000000000000039] 66 sage: t # random andoptional66 sage: t # random; optional 67 67 '0.36 real 0.19 user 0.00 sys' 68 68 """ 69 69 Z = sage.rings.integer.Integer … … 140 140 still use Sage in parallel: 141 141 142 142 sage: k = 19; n = next_prime(10^k)*next_prime(10^(k+1)) 143 sage: q = qsieve(n, block=False, time=True) # optional - - requires time command143 sage: q = qsieve(n, block=False, time=True) # optional - time 144 144 sage: q # random output # optional 145 145 Proper factors so far: [] 146 146 sage: q # random output # optional -
sage/interfaces/r.py
diff --git a/sage/interfaces/r.py b/sage/interfaces/r.py
a b 399 399 400 400 EXAMPLES:: 401 401 402 sage: r.install_packages('aaMI') # optional requiresinternet402 sage: r.install_packages('aaMI') # optional - internet 403 403 ... 404 404 R is free software and comes with ABSOLUTELY NO WARRANTY. 405 405 You are welcome to redistribute it under certain conditions. … … 617 617 618 618 EXAMPLES:: 619 619 620 sage: ap = r.available_packages() # optional requires internet connection620 sage: ap = r.available_packages() # optional - internet 621 621 sage: len(ap) > 20 #optional 622 622 True 623 623 """ … … 1030 1030 NULL 1031 1031 sage: r.library("lattice") 1032 1032 sage: r("print(histogram(~wt | cyl, data=mtcars))") # plot should appear; optional -- rgraphics 1033 sage: import os; os.unlink(filename) # We remove the file for doctesting, not needed in notebook; 1033 sage: import os; os.unlink(filename) # We remove the file for doctesting, not needed in notebook; optional -- rgraphics 1034 1034 """ 1035 1035 # We have to define this to override the plot function defined in the 1036 1036 # superclass. … … 1840 1840 1841 1841 EXAMPLES:: 1842 1842 1843 sage: latex(r(2)) # optional requires theHmisc R package1843 sage: latex(r(2)) # optional - Hmisc R package 1844 1844 2 1845 1845 """ 1846 1846 from sage.misc.latex import LatexExpr -
sage/interfaces/scilab.py
diff --git a/sage/interfaces/scilab.py b/sage/interfaces/scilab.py
a b 329 329 Starts Scilab console. 330 330 331 331 EXAMPLES: 332 sage: scilab.console() # optional - scilab andnot tested332 sage: scilab.console() # optional - scilab; not tested 333 333 334 334 """ 335 335 scilab_console() … … 471 471 472 472 EXAMPLES: 473 473 sage: from sage.interfaces.scilab import scilab_console # optional - scilab 474 sage: scilab_console() # optional - scilab andnot tested474 sage: scilab_console() # optional - scilab; not tested 475 475 ___________________________________________ 476 476 scilab-5.0.3 477 477 -
sage/lfunctions/sympow.py
diff --git a/sage/lfunctions/sympow.py b/sage/lfunctions/sympow.py
a b 126 126 127 127 sage: a = sympow.L(EllipticCurve('11a'), 2, 16); a # optional 128 128 '1.057599244590958E+00' 129 sage: RR(a) # optional - - requiresprecomputations129 sage: RR(a) # optional - precomputations 130 130 1.05759924459096 131 131 """ 132 132 if n % 2 == 1: -
sage/libs/fes.pyx
diff --git a/sage/libs/fes.pyx b/sage/libs/fes.pyx
a b 22 22 23 23 Random Degree-2 System:: 24 24 25 sage: from sage.libs.fes import exhaustive_search # optional - needsFES26 sage: n = 16 # optional - needsFES27 sage: R = BooleanPolynomialRing(n, 'x') # optional - needsFES28 sage: solution = dict(zip(R.gens(), VectorSpace(GF(2), n).random_element())) # optional - needsFES25 sage: from sage.libs.fes import exhaustive_search # optional - FES 26 sage: n = 16 # optional - FES 27 sage: R = BooleanPolynomialRing(n, 'x') # optional - FES 28 sage: solution = dict(zip(R.gens(), VectorSpace(GF(2), n).random_element())) # optional - FES 29 29 30 sage: F = [ R.random_element() for i in range(n+10) ] # optional - needsFES31 sage: G = [ f + f.subs(solution) for f in F] # optional - needsFES32 sage: sols = exhaustive_search(G) # optional - needsFES33 sage: solution in sols # optional - needsFES30 sage: F = [ R.random_element() for i in range(n+10) ] # optional - FES 31 sage: G = [ f + f.subs(solution) for f in F] # optional - FES 32 sage: sols = exhaustive_search(G) # optional - FES 33 sage: solution in sols # optional - FES 34 34 True 35 sage: len(sols) # optional - needsFES35 sage: len(sols) # optional - FES 36 36 1 37 37 38 38 Cylic benchmark:: 39 39 40 sage: from sage.rings.ideal import Cyclic # optional - needsFES41 sage: from sage.libs.fes import exhaustive_search # optional - needsFES42 sage: n = 10 # optional - needsFES43 sage: R = BooleanPolynomialRing(n, 'x') # optional - needsFES44 sage: sols = exhaustive_search( Cyclic(R) ) # optional - needsFES45 sage: len(sols) # optional - needsFES40 sage: from sage.rings.ideal import Cyclic # optional - FES 41 sage: from sage.libs.fes import exhaustive_search # optional - FES 42 sage: n = 10 # optional - FES 43 sage: R = BooleanPolynomialRing(n, 'x') # optional - FES 44 sage: sols = exhaustive_search( Cyclic(R) ) # optional - FES 45 sage: len(sols) # optional - FES 46 46 1 47 sage: set(sols[0]) == set(R.gens()) # optional - needsFES47 sage: set(sols[0]) == set(R.gens()) # optional - FES 48 48 True 49 49 50 50 REFERENCES: … … 137 137 138 138 A very simple example:: 139 139 140 sage: from sage.libs.fes import exhaustive_search # optional - needsFES141 sage: R.<x,y,z> = BooleanPolynomialRing() # optional - needsFES142 sage: exhaustive_search( [x*y + z + y + 1, x+y+z, x*y + y*z] ) # optional - needsFES140 sage: from sage.libs.fes import exhaustive_search # optional - FES 141 sage: R.<x,y,z> = BooleanPolynomialRing() # optional - FES 142 sage: exhaustive_search( [x*y + z + y + 1, x+y+z, x*y + y*z] ) # optional - FES 143 143 [{y: 0, z: 1, x: 1}] 144 144 145 145 Another very simple example:: 146 146 147 sage: R.<x,y,z,t,w> = BooleanPolynomialRing() # optional - needsFES148 sage: f = x*y*z + z + y + 1 # optional - needsFES149 sage: sorted( exhaustive_search( [f, x+y+z, x*y + y*z] ) ) # optional - needsFES147 sage: R.<x,y,z,t,w> = BooleanPolynomialRing() # optional - FES 148 sage: f = x*y*z + z + y + 1 # optional - FES 149 sage: sorted( exhaustive_search( [f, x+y+z, x*y + y*z] ) ) # optional - FES 150 150 [{w: 0, t: 0, y: 0, z: 1, x: 1}, {w: 0, t: 1, y: 0, z: 1, x: 1}, {w: 1, t: 0, y: 0, z: 1, x: 1}, {w: 1, t: 1, y: 0, z: 1, x: 1}] 151 151 152 152 An example with several solutions:: 153 153 154 sage: R.<x,y,z, t> = BooleanPolynomialRing() # optional - needsFES155 sage: eqs = [x*z + y*t + 1, x*y + y*z + z*t + t*x , x+y+z+1] # optional - needsFES156 sage: sorted( exhaustive_search( eqs ) ) # optional - needsFES154 sage: R.<x,y,z, t> = BooleanPolynomialRing() # optional - FES 155 sage: eqs = [x*z + y*t + 1, x*y + y*z + z*t + t*x , x+y+z+1] # optional - FES 156 sage: sorted( exhaustive_search( eqs ) ) # optional - FES 157 157 [{t: 0, y: 1, z: 1, x: 1}, {t: 1, y: 1, z: 0, x: 0}] 158 158 159 159 We voluntarily limit the number of solutions returned by the library:: 160 160 161 sage: eqs = [x*z + y*t + 1, x*y + y*z + z*t + t*x , x+y+z+1] # optional - needsFES162 sage: exhaustive_search(eqs, max_sols=1 ) # optional - needsFES161 sage: eqs = [x*z + y*t + 1, x*y + y*z + z*t + t*x , x+y+z+1] # optional - FES 162 sage: exhaustive_search(eqs, max_sols=1 ) # optional - FES 163 163 [{t: 0, y: 1, z: 1, x: 1}] 164 164 165 165 .. SEEALSO:: … … 254 254 255 255 Testing that the function works:: 256 256 257 sage: from sage.libs.fes import find_coordinate_change # optional - needsFES258 sage: n = 40 # optional - needsFES259 sage: K = GF(2) # optional - needsFES260 sage: R = BooleanPolynomialRing(n, 'x') # optional - needsFES261 sage: foo = [ MatrixSpace(GF(2), n, n).random_element() ] # optional - needsFES262 sage: f = [ M + M.T for M in foo ] # optional - needsFES263 sage: S = find_coordinate_change( f ) # optional - needsFES264 sage: g = [ S.T*M*S for M in f ] # optional - needsFES265 sage: vector ([ M[0,1] for M in g[:32]]).is_zero() # optional - needsFES257 sage: from sage.libs.fes import find_coordinate_change # optional - FES 258 sage: n = 40 # optional - FES 259 sage: K = GF(2) # optional - FES 260 sage: R = BooleanPolynomialRing(n, 'x') # optional - FES 261 sage: foo = [ MatrixSpace(GF(2), n, n).random_element() ] # optional - FES 262 sage: f = [ M + M.T for M in foo ] # optional - FES 263 sage: S = find_coordinate_change( f ) # optional - FES 264 sage: g = [ S.T*M*S for M in f ] # optional - FES 265 sage: vector ([ M[0,1] for M in g[:32]]).is_zero() # optional - FES 266 266 True 267 267 """ 268 268 n = As[0].nrows() … … 303 303 304 304 We check that the function does what it is supposed to do:: 305 305 306 sage: from sage.libs.fes import prepare_polynomials # optional - needsFES307 sage: n = 35 # optional - needsFES308 sage: K = GF(2) # optional - needsFES309 sage: R = BooleanPolynomialRing(n, 'x') # optional - needsFES306 sage: from sage.libs.fes import prepare_polynomials # optional - FES 307 sage: n = 35 # optional - FES 308 sage: K = GF(2) # optional - FES 309 sage: R = BooleanPolynomialRing(n, 'x') # optional - FES 310 310 sage: f = [ sum( [K.random_element() * R.gen(i) * R.gen(j) for i in range(n) for j in range(i)] ) \ 311 311 + sum( [K.random_element() * R.gen(i) for i in range(n) ] ) \ 312 312 + K.random_element() for l in range(n) ] #optional - needs FES 313 sage: g = prepare_polynomials(f) # optional - needsFES314 sage: map(lambda x:x.lm(), g) # optional - needsFES, random313 sage: g = prepare_polynomials(f) # optional - FES 314 sage: map(lambda x:x.lm(), g) # optional - FES, random 315 315 0 316 316 """ 317 317 if f == []: -
sage/misc/dev_tools.py
diff --git a/sage/misc/dev_tools.py b/sage/misc/dev_tools.py
a b 18 18 19 19 EXAMPLES:: 20 20 21 sage: runsnake("list(SymmetricGroup(3))") # optional - r equires runsnake21 sage: runsnake("list(SymmetricGroup(3))") # optional - runsnake 22 22 23 23 ``command`` is first preparsed (see :func:`preparse`):: 24 24 25 sage: runsnake('for x in range(1,4): print x^2') # optional - r equires runsnake25 sage: runsnake('for x in range(1,4): print x^2') # optional - runsnake 26 26 1 27 27 4 28 28 9 -
sage/misc/functional.py
diff --git a/sage/misc/functional.py b/sage/misc/functional.py
a b 630 630 631 631 This summation only Mathematica can perform:: 632 632 633 sage: sum(1/(1+k^2), k, -oo, oo, algorithm = 'mathematica') # optional -- requiresmathematica633 sage: sum(1/(1+k^2), k, -oo, oo, algorithm = 'mathematica') # optional - mathematica 634 634 pi*coth(pi) 635 635 636 636 Use Maple as a backend for summation:: 637 637 638 sage: sum(binomial(n,k)*x^k, k, 0, n, algorithm = 'maple') # optional -- requiresmaple638 sage: sum(binomial(n,k)*x^k, k, 0, n, algorithm = 'maple') # optional - maple 639 639 (x + 1)^n 640 640 641 641 Python ints should work as limits of summation (trac #9393):: -
sage/misc/latex.py
diff --git a/sage/misc/latex.py b/sage/misc/latex.py
a b 1096 1096 # This would generate a file named "/path/to/test.png" 1097 1097 sage: latex.eval("\\ZZ[x]", locals(), filename="/path/to/test") # not tested 1098 1098 '' 1099 sage: latex.eval("\ThisIsAnInvalidCommand", {}) # optional - requires 'convert'1099 sage: latex.eval("\ThisIsAnInvalidCommand", {}) # optional -- ImageMagick 1100 1100 An error 1101 1101 ... 1102 1102 No pages of output. -
sage/misc/remote_file.py
diff --git a/sage/misc/remote_file.py b/sage/misc/remote_file.py
a b 12 12 absolute path to that file. 13 13 14 14 EXAMPLES: 15 sage: g = get_remote_file("http://sagemath.org/ack.html", verbose=False) # optional - - requires theinternet16 sage: len(open(g).read()) # optional andrandomly growing.15 sage: g = get_remote_file("http://sagemath.org/ack.html", verbose=False) # optional - internet 16 sage: len(open(g).read()) # optional; randomly growing. 17 17 10198 18 18 """ 19 19 if verbose: -
sage/modular/ssmod/ssmod.py
diff --git a/sage/modular/ssmod/ssmod.py b/sage/modular/ssmod/ssmod.py
a b 568 568 Observe that in this example the j-invariant is not defined over 569 569 the prime field:: 570 570 571 sage: supersingular_j(GF(15073^2,'a')) # optional - - requiresdatabase571 sage: supersingular_j(GF(15073^2,'a')) # optional - database 572 572 10630*a + 6033 573 573 574 574 sage: supersingular_j(GF(83401^2, 'a')) -
sage/modules/free_module_element.pyx
diff --git a/sage/modules/free_module_element.pyx b/sage/modules/free_module_element.pyx
a b 3027 3027 3028 3028 sage: vector((1,2,3), QQ)._mathematica_init_() 3029 3029 '{1/1, 2/1, 3/1}' 3030 sage: mathematica(vector((1,2,3), QQ)) # optional -- requiresmathematica3030 sage: mathematica(vector((1,2,3), QQ)) # optional - mathematica 3031 3031 {1, 2, 3} 3032 3032 sage: a = vector(SR, 5, [1, x, x^2, sin(x), pi]); a 3033 3033 (1, x, x^2, sin(x), pi) -
sage/rings/number_field/galois_group.py
diff --git a/sage/rings/number_field/galois_group.py b/sage/rings/number_field/galois_group.py
a b 109 109 sage: G = NumberField(x^3 + 2*x + 2, 'theta').galois_group(type="pari") 110 110 sage: H = G.group(); H 111 111 PARI group [6, -1, 2, "S3"] of degree 3 112 sage: P = H.permutation_group(); P # optional - - requires Gap optional databases112 sage: P = H.permutation_group(); P # optional - database_gap 113 113 Transitive group number 2 of degree 3 114 114 sage: list(P) # optional 115 115 [(), (2,3), (1,2), (1,2,3), (1,3,2), (1,3)] -
sage/rings/polynomial/multi_polynomial_element.py
diff --git a/sage/rings/polynomial/multi_polynomial_element.py b/sage/rings/polynomial/multi_polynomial_element.py
a b 317 317 # sage: R.<x,y> = ZZ[] 318 318 # sage: f = (x^3 + 2*y^2*x)^7; f 319 319 # x^21 + 14*x^19*y^2 + 84*x^17*y^4 + 280*x^15*y^6 + 560*x^13*y^8 + 672*x^11*y^10 + 448*x^9*y^12 + 128*x^7*y^14 320 # sage: macaulay2(R) # optional , requiresM2320 # sage: macaulay2(R) # optional - M2 321 321 # ZZ [x, y, MonomialOrder => GRevLex, MonomialSize => 16] 322 322 # sage: h = f._macaulay2_() # optional 323 323 # sage: R(h) # optional -
sage/rings/polynomial/multi_polynomial_ideal.py
diff --git a/sage/rings/polynomial/multi_polynomial_ideal.py b/sage/rings/polynomial/multi_polynomial_ideal.py
a b 938 938 939 939 sage: R.<x,y,z> = PolynomialRing(QQ,3) 940 940 sage: I = R.ideal([y^2 + x^2*(1/4) - z]) 941 sage: I.plot() # a cone 941 sage: I.plot() # a cone; optional - surf 942 942 sage: I = R.ideal([y^2 + z^2*(1/4) - x]) 943 sage: I.plot() # same code, from a different angle 943 sage: I.plot() # same code, from a different angle; optional - surf 944 944 sage: I = R.ideal([x^2*y^2+x^2*z^2+y^2*z^2-16*x*y*z]) 945 sage: I.plot() # Steiner surface 945 sage: I.plot() # Steiner surface; optional - surf 946 946 947 947 AUTHORS: 948 948 -
sage/rings/polynomial/multi_polynomial_libsingular.pyx
diff --git a/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/sage/rings/polynomial/multi_polynomial_libsingular.pyx
a b 1111 1111 EXAMPLES:: 1112 1112 1113 1113 sage: P.<x,y> = PolynomialRing(QQ) 1114 sage: M2 = P._macaulay2_set_ring() # optional , requiresM21114 sage: M2 = P._macaulay2_set_ring() # optional - M2 1115 1115 """ 1116 1116 if not self.__m2_set_ring_cache is None: 1117 1117 base_str, gens, order = self.__m2_set_ring_cache -
sage/symbolic/expression.pyx
diff --git a/sage/symbolic/expression.pyx b/sage/symbolic/expression.pyx
a b 3905 3905 3906 3906 sage: f.subs_expr(x^2 + y^2 == t) 3907 3907 (x, y, t) |--> x^2 + y^2 + t + sin(y) + cos(x) 3908 sage: maple.eval('subs(x^2 + y^2 = t, cos(x) + sin(y) + x^2 + y^2 + t)') # optional requiresmaple3908 sage: maple.eval('subs(x^2 + y^2 = t, cos(x) + sin(y) + x^2 + y^2 + t)') # optional - maple 3909 3909 'cos(x)+sin(y)+x^2+y^2+t' 3910 3910 sage: maxima.quit() 3911 3911 sage: maxima.eval('cos(x) + sin(y) + x^2 + y^2 + t, x^2 + y^2 = t') … … 3913 3913 3914 3914 Actually Mathematica does something that makes more sense:: 3915 3915 3916 sage: mathematica.eval('Cos[x] + Sin[y] + x^2 + y^2 + t /. x^2 + y^2 -> t') # optional - - requiresmathematica3916 sage: mathematica.eval('Cos[x] + Sin[y] + x^2 + y^2 + t /. x^2 + y^2 -> t') # optional - mathematica 3917 3917 2 t + Cos[x] + Sin[y] 3918 3918 """ 3919 3919 if isinstance(equations[0], dict): … … 9214 9214 9215 9215 This summation only Mathematica can perform:: 9216 9216 9217 sage: (1/(1+k^2)).sum(k, -oo, oo, algorithm = 'mathematica') # optional -- requiresmathematica9217 sage: (1/(1+k^2)).sum(k, -oo, oo, algorithm = 'mathematica') # optional - mathematica 9218 9218 pi*coth(pi) 9219 9219 9220 9220 Use Giac to perform this summation:: 9221 9221 9222 sage: (sum(1/(1+k^2), k, -oo, oo, algorithm = 'giac')).factor() # optional -- requiresgiac9222 sage: (sum(1/(1+k^2), k, -oo, oo, algorithm = 'giac')).factor() # optional - giac 9223 9223 (e^(2*pi) + 1)*pi/((e^pi - 1)*(e^pi + 1)) 9224 9224 9225 9225 Use Maple as a backend for summation:: 9226 9226 9227 sage: (binomial(n,k)*x^k).sum(k, 0, n, algorithm = 'maple') # optional -- requiresmaple9227 sage: (binomial(n,k)*x^k).sum(k, 0, n, algorithm = 'maple') # optional - maple 9228 9228 (x + 1)^n 9229 9229 9230 9230 Check that the sum in #10682 is done right:: -
sage/symbolic/integration/external.py
diff --git a/sage/symbolic/integration/external.py b/sage/symbolic/integration/external.py
a b 41 41 def mma_free_integrator(expression, v, a=None, b=None): 42 42 """ 43 43 sage: from sage.symbolic.integration.external import mma_free_integrator 44 sage: mma_free_integrator(sin(x), x) # optional - requiresinternet44 sage: mma_free_integrator(sin(x), x) # optional - internet 45 45 -cos(x) 46 46 """ 47 47 import urllib, re -
sage/symbolic/integration/integral.py
diff --git a/sage/symbolic/integration/integral.py b/sage/symbolic/integration/integral.py
a b 447 447 448 448 sage: _ = var('x, y, z') 449 449 sage: f = sin(x^2) + y^z 450 sage: g = mathematica(f) # optional -- requiresmathematica451 sage: print g # optional - - requiresmathematica450 sage: g = mathematica(f) # optional - mathematica 451 sage: print g # optional - mathematica 452 452 z 2 453 453 y + Sin[x ] 454 sage: print g.Integrate(x) # optional - - requiresmathematica454 sage: print g.Integrate(x) # optional - mathematica 455 455 z Pi 2 456 456 x y + Sqrt[--] FresnelS[Sqrt[--] x] 457 457 2 Pi … … 463 463 464 464 sage: _ = var('x, y, z') 465 465 sage: f = sin(x^2) + y^z 466 sage: f.integrate(algorithm="mathematica_free") # optional - - requiresinternet466 sage: f.integrate(algorithm="mathematica_free") # optional - internet 467 467 sqrt(pi)*sqrt(1/2)*fresnels(sqrt(2)*x/sqrt(pi)) + y^z*x 468 468 469 469 We can also use Sympy:: … … 477 477 478 478 We integrate the above function in maple now:: 479 479 480 sage: g = maple(f); g # optional - - requiresmaple480 sage: g = maple(f); g # optional - maple 481 481 sin(x^2)+y^z 482 sage: g.integrate(x) # optional - - requiresmaple482 sage: g.integrate(x) # optional - maple 483 483 1/2*2^(1/2)*Pi^(1/2)*FresnelS(2^(1/2)/Pi^(1/2)*x)+y^z*x 484 484 485 485 We next integrate a function with no closed form integral. Notice -
sage/tests/benchmark.py
diff --git a/sage/tests/benchmark.py b/sage/tests/benchmark.py
a b 329 329 EXAMPLE: 330 330 sage: from sage.tests.benchmark import MPolynomialPower 331 331 sage: B = MPolynomialPower() 332 sage: isinstance(B.maple()[1], float) # optional -- requiresMaple332 sage: isinstance(B.maple()[1], float) # optional - Maple 333 333 True 334 334 335 335 """ … … 426 426 EXAMPLE: 427 427 sage: from sage.tests.benchmark import MPolynomialMult 428 428 sage: B = MPolynomialMult() 429 sage: isinstance(B.maple()[1], float) # optional -- requiresMaple429 sage: isinstance(B.maple()[1], float) # optional - Maple 430 430 True 431 431 432 432 """ … … 621 621 EXAMPLE: 622 622 sage: from sage.tests.benchmark import MPolynomialMult2 623 623 sage: B = MPolynomialMult2() 624 sage: isinstance(B.maple()[1], float) # optional - - requiresmaple624 sage: isinstance(B.maple()[1], float) # optional - maple 625 625 True 626 626 627 627 """ … … 961 961 EXAMPLE: 962 962 sage: from sage.tests.benchmark import SquareInts 963 963 sage: B = SquareInts() 964 sage: isinstance(B.maple()[1], float) # optional - - requiresmaple964 sage: isinstance(B.maple()[1], float) # optional - maple 965 965 True 966 966 967 967 """ … … 1122 1122 EXAMPLE: 1123 1123 sage: from sage.tests.benchmark import Factorial 1124 1124 sage: B = Factorial(10) 1125 sage: isinstance(B.maple()[1], float) # optional - - requiresmaple1125 sage: isinstance(B.maple()[1], float) # optional - maple 1126 1126 True 1127 1127 1128 1128 """