Changeset 7000:ffd7bb358653
- Timestamp:
- 10/20/07 04:41:00 (6 years ago)
- Branch:
- default
- Children:
- 7001:59e56080034d, 7004:df2b7fdd6ec4
- Location:
- sage
- Files:
-
- 1 deleted
- 40 edited
-
graphs/graph_fast.pyx (modified) (1 diff)
-
groups/group.pyx (modified) (1 diff)
-
groups/perm_gps/cubegroup.py (modified) (2 diffs)
-
gsl/interpolation.pyx (modified) (1 diff)
-
gsl/ode.pyx (modified) (4 diffs)
-
interfaces/matlab.py (modified) (1 diff)
-
interfaces/maxima.py (modified) (8 diffs)
-
interfaces/octave.py (modified) (2 diffs)
-
interfaces/phc.py (modified) (8 diffs)
-
interfaces/psage.py (modified) (3 diffs)
-
interfaces/qsieve.py (modified) (2 diffs)
-
interfaces/singular.py (modified) (1 diff)
-
lfunctions/sympow.py (modified) (2 diffs)
-
libs/hanke/hanke.pyx (modified) (1 diff)
-
libs/mwrank/mwrank.pyx (modified) (2 diffs)
-
libs/ntl/ntl_mat_ZZ.pyx (modified) (1 diff)
-
libs/pari/_py_pari_orig.pyx (deleted)
-
modular/hecke/submodule.py (modified) (1 diff)
-
modular/modform/ambient.py (modified) (2 diffs)
-
modules/free_module.py (modified) (1 diff)
-
plot/plot3dsoya_wrap.py (modified) (1 diff)
-
rings/integer.pyx (modified) (2 diffs)
-
rings/padics/factory.py (modified) (2 diffs)
-
rings/padics/tutorial.py (modified) (1 diff)
-
rings/polynomial/groebner_fan.py (modified) (2 diffs)
-
rings/polynomial/multi_polynomial_ideal.py (modified) (1 diff)
-
rings/polynomial/multi_polynomial_ring.py (modified) (1 diff)
-
rings/polynomial/padics/polynomial_padic_capped_relative_dense.py (modified) (1 diff)
-
rings/polynomial/polynomial_element_generic.py (modified) (2 diffs)
-
rings/power_series_ring.py (modified) (1 diff)
-
rings/ring.pyx (modified) (1 diff)
-
schemes/elliptic_curves/constructor.py (modified) (1 diff)
-
schemes/elliptic_curves/ell_rational_field.py (modified) (1 diff)
-
schemes/elliptic_curves/lseries_ell.py (modified) (3 diffs)
-
schemes/elliptic_curves/sha.py (modified) (3 diffs)
-
schemes/hyperelliptic_curves/hyperelliptic_finite_field.py (modified) (1 diff)
-
schemes/plane_curves/affine_curve.py (modified) (1 diff)
-
server/notebook/sagetex.py (modified) (1 diff)
-
server/notebook/test_notebook.py (modified) (3 diffs)
-
server/notebook/tutorial.py (modified) (1 diff)
-
structure/sage_object.pyx (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sage/graphs/graph_fast.pyx
r5700 r7000 232 232 """ 233 233 A quick python int to binary string conversion. 234 235 sage.: timeit sage.graphs.graph_fast.binary(389) 236 100000 loops, best of 3: 11.4 [micro]s per loop 237 sage.: timeit Integer(389).binary() 238 10000 loops, best of 3: 16.8 [micro]s per loop 239 234 240 235 EXAMPLE: 241 sage: sage.graphs.graph_fast.binary(2007) 242 '11111010111' 236 sage: sage.graphs.graph_fast.binary(389) 237 '110000101' 238 sage: Integer(389).binary() 239 '110000101' 240 sage: sage.graphs.graph_fast.binary(2007) 241 '11111010111' 243 242 """ 244 243 cdef mpz_t i -
sage/groups/group.pyx
r5724 r7000 138 138 sage: G = D4.cayley_graph() 139 139 140 sage .: show(G, color_by_label=True, edge_labels=True) # todo -- we must test this, but must not have "sage -t" popping up windows.140 sage: show(G, color_by_label=True, edge_labels=True) # todo -- we must test this, but must not have "sage -t" popping up windows. 141 141 142 142 sage: A5 = AlternatingGroup(5); A5 143 143 Alternating group of order 5!/2 as a permutation group 144 144 sage: G = A5.cayley_graph() 145 sage .: G.show3d(color_by_label=True, arc_size=0.01, arc_size2=0.02, vertex_size=0.03)146 sage .: G.show3d(vertex_size=0.03, arc_size=0.01, arc_size2=0.02, vertex_colors={(1,1,1):x.vertices()}, bgcolor=(0,0,0), color_by_label=True, xres=700, yres=700, iterations=200) # long time145 sage: G.show3d(color_by_label=True, edge_size=0.01, edge_size2=0.02, vertex_size=0.03) 146 sage: G.show3d(vertex_size=0.03, edge_size=0.01, edge_size2=0.02, vertex_colors={(1,1,1):x.vertices()}, bgcolor=(0,0,0), color_by_label=True, xres=700, yres=700, iterations=200) # long time 147 147 148 148 AUTHOR: -
sage/groups/perm_gps/cubegroup.py
r6218 r7000 1116 1116 """ 1117 1117 sage: C = RubiksCube().move("R U R'") 1118 sage .: C.show3d()1118 sage: C.show3d() 1119 1119 1120 1120 sage: C = RubiksCube("R*L"); C … … 1132 1132 | 35 47 24 | 1133 1133 +--------------+ 1134 sage .: C.show()1134 sage: C.show() 1135 1135 sage: C.solve(algorithm='gap') # long time 1136 1136 'L*R' -
sage/gsl/interpolation.pyx
r1928 r7000 21 21 sage: v = [(i + sin(i)/2, i+cos(i^2)) for i in range(10)] 22 22 sage: s = spline(v) 23 sage .: show(point(v) + plot(s,0,11, hue=.8))23 sage: show(point(v) + plot(s,0,11, hue=.8)) 24 24 """ 25 25 def __init__(self, v=[]): -
sage/gsl/ode.pyx
r6996 r7000 119 119 In code, 120 120 121 sage: f = lambda t,y:[y[1],-y[0]]122 sage: T.function=f121 sage: f = lambda t,y:[y[1],-y[0]] 122 sage: T.function=f 123 123 124 124 For some algorithms the jacobian must be supplied as well, 125 the form of this should be a function return a list of lists of the form 125 the form of this should be a function return a list of lists 126 of the form 127 126 128 [ [df_1/dy_1,...,df_1/dy_n], ..., [df_n/dy_1,...,df_n,dy_n], 127 [df_1/dt,...,df_n/dt] ]. There are examples below, if your jacobian was the function my_jacobian 128 you would do. 129 130 sage.: T.jacobian = my_jacobian 129 [df_1/dt,...,df_n/dt] ]. 130 131 There are examples below, if your jacobian was the function 132 my_jacobian you would do. 133 134 sage: T.jacobian = my_jacobian # not tested, since it doesn't make sense to test this 131 135 132 136 … … 144 148 The default algorithm if rkf45. If you instead wanted to use bsimp you would do 145 149 146 sage: T.algorithm="bsimp"150 sage: T.algorithm="bsimp" 147 151 148 152 The user should supply initial conditions in y_0. For example 149 153 if your initial conditions are y_0=1,y_1=1, do 150 154 151 sage: T.y_0=[1,1]155 sage: T.y_0=[1,1] 152 156 153 157 The actual solver is invoked by the method ode_solve. … … 182 186 This data is stored in the variable solutions 183 187 184 sage.: T.solution188 sage: T.solution # not tested 185 189 186 190 Examples: … … 265 269 return GSL_SUCCESS 266 270 267 After executing the above block of code you can do the following (WARNING: this is 268 *not* automatically doctested): 269 270 sage.: T=ode_solver() 271 sage.: T.algorithm="bsimp" 272 sage.: vander = van_der_pol() 273 sage.: T.function=vander 274 sage.: T.ode_solve(y_0=[1,0],t_span=[0,2000],num_points=1000) 275 sage.: T.plot_solution(i=0, filename='sage.png') 271 After executing the above block of code you can do the 272 following (WARNING: the following is *not* automatically 273 doctested): 274 275 sage: T = ode_solver() # not tested 276 sage: T.algorithm = "bsimp" # not tested 277 sage: vander = van_der_pol() # not tested 278 sage: T.function=vander # not tested 279 sage: T.ode_solve(y_0 = [1,0], t_span=[0,2000], num_points=1000) # not tested 280 sage: T.plot_solution(i=0, filename=SAGE_TMP + '/test.png') # not tested 276 281 277 282 -
sage/interfaces/matlab.py
r6999 r7000 302 302 303 303 EXAMPLES: 304 sage .: matlab_console() # optional304 sage: matlab_console() # optional and not tested 305 305 < M A T L A B > 306 306 Copyright 1984-2006 The MathWorks, Inc. -
sage/interfaces/maxima.py
r6878 r7000 248 248 You can plot 3d graphs (via gnuplot): 249 249 250 sage .: maxima('plot3d(x^2-y^2, [x,-2,2], [y,-2,2], [grid,12,12])')250 sage: maxima('plot3d(x^2-y^2, [x,-2,2], [y,-2,2], [grid,12,12])') # not tested 251 251 [displays a 3 dimensional graph] 252 252 … … 833 833 834 834 EXAMPLES: 835 sage .: maxima.plot2d('sin(x)','[x,-5,5]')836 sage .: opts = '[gnuplot_term, ps], [gnuplot_out_file, "sin-plot.eps"]'837 sage .: maxima.plot2d('sin(x)','[x,-5,5]',opts)835 sage: maxima.plot2d('sin(x)','[x,-5,5]') # not tested 836 sage: opts = '[gnuplot_term, ps], [gnuplot_out_file, "sin-plot.eps"]' 837 sage: maxima.plot2d('sin(x)','[x,-5,5]',opts) # not tested 838 838 839 839 The eps file is saved in the current directory. … … 853 853 854 854 EXAMPLES: 855 sage .: maxima.plot2d_parametric(["sin(t)","cos(t)"], "t",[-3.1,3.1])856 857 sage .: opts = '[gnuplot_preamble, "set nokey"], [gnuplot_term, ps], [gnuplot_out_file, "circle-plot.eps"]'858 sage .: maxima.plot2d_parametric(["sin(t)","cos(t)"], "t", [-3.1,3.1], options=opts)855 sage: maxima.plot2d_parametric(["sin(t)","cos(t)"], "t",[-3.1,3.1]) # not tested 856 857 sage: opts = '[gnuplot_preamble, "set nokey"], [gnuplot_term, ps], [gnuplot_out_file, "circle-plot.eps"]' 858 sage: maxima.plot2d_parametric(["sin(t)","cos(t)"], "t", [-3.1,3.1], options=opts) # not tested 859 859 860 860 The eps file is saved to the current working directory. 861 861 862 862 Here is another fun plot: 863 sage .: maxima.plot2d_parametric(["sin(5*t)","cos(11*t)"], "t", [0,2*pi()], nticks=400)863 sage: maxima.plot2d_parametric(["sin(5*t)","cos(11*t)"], "t", [0,2*pi()], nticks=400) # not tested 864 864 """ 865 865 tmin = trange[0] … … 884 884 885 885 EXAMPLES: 886 sage .: maxima.plot3d('1 + x^3 - y^2', '[x,-2,2]', '[y,-2,2]', '[grid,12,12]')887 sage .: maxima.plot3d('sin(x)*cos(y)', '[x,-2,2]', '[y,-2,2]', '[grid,30,30]')888 sage .: opts = '[gnuplot_term, ps], [gnuplot_out_file, "sin-plot.eps"]'889 sage .: maxima.plot3d('sin(x+y)', '[x,-5,5]', '[y,-1,1]', opts)886 sage: maxima.plot3d('1 + x^3 - y^2', '[x,-2,2]', '[y,-2,2]', '[grid,12,12]') # not tested 887 sage: maxima.plot3d('sin(x)*cos(y)', '[x,-2,2]', '[y,-2,2]', '[grid,30,30]') # not tested 888 sage: opts = '[gnuplot_term, ps], [gnuplot_out_file, "sin-plot.eps"]' 889 sage: maxima.plot3d('sin(x+y)', '[x,-5,5]', '[y,-1,1]', opts) # not tested 890 890 891 891 The eps file is saved in the current working directory. … … 910 910 911 911 EXAMPLES: 912 sage .: maxima.plot3d_parametric(["v*sin(u)","v*cos(u)","v"], ["u","v"],[-3.2,3.2],[0,3])913 sage .: opts = '[gnuplot_term, ps], [gnuplot_out_file, "sin-cos-plot.eps"]'914 sage .: maxima.plot3d_parametric(["v*sin(u)","v*cos(u)","v"], ["u","v"],[-3.2,3.2],[0,3],opts)912 sage: maxima.plot3d_parametric(["v*sin(u)","v*cos(u)","v"], ["u","v"],[-3.2,3.2],[0,3]) # not tested 913 sage: opts = '[gnuplot_term, ps], [gnuplot_out_file, "sin-cos-plot.eps"]' 914 sage: maxima.plot3d_parametric(["v*sin(u)","v*cos(u)","v"], ["u","v"],[-3.2,3.2],[0,3],opts) # not tested 915 915 916 916 The eps file is saved in the current working directory. … … 918 918 Here is a torus: 919 919 920 sage .: _ = maxima.eval("expr_1: cos(y)*(10.0+6*cos(x)); expr_2: sin(y)*(10.0+6*cos(x)); expr_3: -6*sin(x);") # optional921 sage .: maxima.plot3d_parametric(["expr_1","expr_2","expr_3"], ["x","y"],[0,6],[0,6])920 sage: _ = maxima.eval("expr_1: cos(y)*(10.0+6*cos(x)); expr_2: sin(y)*(10.0+6*cos(x)); expr_3: -6*sin(x);") # optional 921 sage: maxima.plot3d_parametric(["expr_1","expr_2","expr_3"], ["x","y"],[0,6],[0,6]) # not tested 922 922 923 923 Here is a Mobius strip: 924 sage .: x = "cos(u)*(3 + v*cos(u/2))"925 sage .: y = "sin(u)*(3 + v*cos(u/2))"926 sage .: z = "v*sin(u/2)"927 sage .: maxima.plot3d_parametric([x,y,z],["u","v"],[-3.1,3.2],[-1/10,1/10])924 sage: x = "cos(u)*(3 + v*cos(u/2))" 925 sage: y = "sin(u)*(3 + v*cos(u/2))" 926 sage: z = "v*sin(u/2)" 927 sage: maxima.plot3d_parametric([x,y,z],["u","v"],[-3.1,3.2],[-1/10,1/10]) # not tested 928 928 """ 929 929 umin = urange[0] … … 1096 1096 sage: zeta_ptsx = [ (pari(1/2 + i*I/10).zeta().real()).precision(1) for i in range (70,150)] 1097 1097 sage: zeta_ptsy = [ (pari(1/2 + i*I/10).zeta().imag()).precision(1) for i in range (70,150)] 1098 sage .: maxima.plot_list(zeta_ptsx, zeta_ptsy)1099 sage .: opts='[gnuplot_preamble, "set nokey"], [gnuplot_term, ps], [gnuplot_out_file, "zeta.eps"]'1100 sage .: maxima.plot_list(zeta_ptsx, zeta_ptsy, opts)1098 sage: maxima.plot_list(zeta_ptsx, zeta_ptsy) # not tested 1099 sage: opts='[gnuplot_preamble, "set nokey"], [gnuplot_term, ps], [gnuplot_out_file, "zeta.eps"]' 1100 sage: maxima.plot_list(zeta_ptsx, zeta_ptsy, opts) # not tested 1101 1101 """ 1102 1102 cmd = 'plot2d([discrete,%s, %s]'%(ptsx, ptsy) … … 1120 1120 1121 1121 EXAMPLES: 1122 sage .: xx = [ i/10.0 for i in range (-10,10)]1123 sage .: yy = [ i/10.0 for i in range (-10,10)]1124 sage .: x0 = [ 0 for i in range (-10,10)]1125 sage .: y0 = [ 0 for i in range (-10,10)]1126 sage .: zeta_ptsx1 = [ (pari(1/2+i*I/10).zeta().real()).precision(1) for i in range (10)]1127 sage .: zeta_ptsy1 = [ (pari(1/2+i*I/10).zeta().imag()).precision(1) for i in range (10)]1128 sage .: maxima.plot_multilist([[zeta_ptsx1,zeta_ptsy1],[xx,y0],[x0,yy]])1129 sage .: zeta_ptsx1 = [ (pari(1/2+i*I/10).zeta().real()).precision(1) for i in range (10,150)]1130 sage .: zeta_ptsy1 = [ (pari(1/2+i*I/10).zeta().imag()).precision(1) for i in range (10,150)]1131 sage .: maxima.plot_multilist([[zeta_ptsx1,zeta_ptsy1],[xx,y0],[x0,yy]])1132 sage .: opts='[gnuplot_preamble, "set nokey"]'1133 sage .: maxima.plot_multilist([[zeta_ptsx1,zeta_ptsy1],[xx,y0],[x0,yy]],opts)1122 sage: xx = [ i/10.0 for i in range (-10,10)] 1123 sage: yy = [ i/10.0 for i in range (-10,10)] 1124 sage: x0 = [ 0 for i in range (-10,10)] 1125 sage: y0 = [ 0 for i in range (-10,10)] 1126 sage: zeta_ptsx1 = [ (pari(1/2+i*I/10).zeta().real()).precision(1) for i in range (10)] 1127 sage: zeta_ptsy1 = [ (pari(1/2+i*I/10).zeta().imag()).precision(1) for i in range (10)] 1128 sage: maxima.plot_multilist([[zeta_ptsx1,zeta_ptsy1],[xx,y0],[x0,yy]]) # not tested 1129 sage: zeta_ptsx1 = [ (pari(1/2+i*I/10).zeta().real()).precision(1) for i in range (10,150)] 1130 sage: zeta_ptsy1 = [ (pari(1/2+i*I/10).zeta().imag()).precision(1) for i in range (10,150)] 1131 sage: maxima.plot_multilist([[zeta_ptsx1,zeta_ptsy1],[xx,y0],[x0,yy]]) # not tested 1132 sage: opts='[gnuplot_preamble, "set nokey"]' 1133 sage: maxima.plot_multilist([[zeta_ptsx1,zeta_ptsy1],[xx,y0],[x0,yy]],opts) # not tested 1134 1134 """ 1135 1135 n = len(pts_list) -
sage/interfaces/octave.py
r6999 r7000 352 352 353 353 EXAMPLES: 354 sage .: octave.de_system_plot(['x+y','x-y'], [1,-1], [0,2])355 356 This yieldsthe two plots $(t,x(t)), (t,y(t))$ on the same graph354 sage: octave.de_system_plot(['x+y','x-y'], [1,-1], [0,2]) # not tested -- does this actually work (on OS X it fails for me -- William Stein, 2007-10) 355 356 This should yield the two plots $(t,x(t)), (t,y(t))$ on the same graph 357 357 (the $t$-axis is the horizonal axis) of the system of ODEs 358 358 $$ … … 418 418 419 419 EXAMPLES: 420 sage .: octave_console()420 sage: octave_console() # not tested 421 421 GNU Octave, version 2.1.73 (i386-apple-darwin8.5.3). 422 422 Copyright (C) 2006 John W. Eaton. -
sage/interfaces/phc.py
r6980 r7000 1 r""" nodoctest1 r""" 2 2 Interface to PHC. 3 3 … … 16 16 17 17 TODO: 18 This either needs to be able to handle arbitrary PHCpack command options, or have 19 enough special purpose functions added to get the full functionality. One important 20 missing special case is having a root-counting function that could do mixed volumes and 21 structured Bezout counts. 22 Another nice feature to have would be a graphical output of the path-tracking, as has been done for Maple. 18 This either needs to be able to handle arbitrary PHCpack command 19 options, or have enough special purpose functions added to get the 20 full functionality. One important missing special case is having 21 a root-counting function that could do mixed volumes and 22 structured Bezout counts. Another nice feature to have would be a 23 graphical output of the path-tracking, as has been done for Maple. 23 24 """ 24 25 … … 43 44 def get_solution_dicts(output_file_contents, input_ring, get_failures = True): 44 45 ''' 45 Returns a list of dictionaries of variable:value (key:value) pairs. 46 Only used internally; see the solution_dict function in the PHC_Object class definition for details. 46 Returns a list of dictionaries of variable:value (key:value) 47 pairs. Only used internally; see the solution_dict function in 48 the PHC_Object class definition for details. 47 49 ''' 48 50 output_list = output_file_contents.splitlines() … … 84 86 class PHC_Object: 85 87 """ 86 A container for data from the PHCpack program - lists of float solutions, etc. 88 A container for data from the PHCpack program - lists of float 89 solutions, etc. 87 90 """ 88 91 def __init__(self, output_file_contents, input_ring): … … 100 103 101 104 INPUT: 102 self: for access to self_out_file_contents, the string of raw PHCpack output. 103 get_failures (optional): a boolean. The default (False) is to not process failed homotopies. These either lie on positive-dimensional components or at infinity. 104 105 OUTPUT: 106 solution_dicts: a list of dictionaries. Each dictionary element is of the form variable:value, where the variable is an element of the input_ring, and the value is in ComplexField. 105 self -- for access to self_out_file_contents, the string 106 of raw PHCpack output. 107 108 get_failures (optional) -- a boolean. The default (False) 109 is to not process failed homotopies. These either lie on 110 positive-dimensional components or at infinity. 111 112 OUTPUT: 113 114 solution_dicts: a list of dictionaries. Each dictionary 115 element is of the form variable:value, where the variable 116 is an element of the input_ring, and the value is in 117 ComplexField. 107 118 108 119 """ … … 120 131 121 132 INPUT: 122 self: for access to self_out_file_contents, the string of raw PHCpack output. 123 get_failures (optional): a boolean. The default (False) is to not process failed homotopies. These either lie on positive-dimensional components or at infinity. 133 self -- for access to self_out_file_contents, the string 134 of raw PHCpack output. 135 get_failures (optional) -- a boolean. The default (False) 136 is to not process failed homotopies. These either lie on 137 positive-dimensional components or at infinity. 124 138 125 139 OUTPUT: … … 138 152 def variable_list(self): 139 153 """ 140 Returns the variables, as strings, in the order in which PHCpack has processed them. 154 Returns the variables, as strings, in the order in which 155 PHCpack has processed them. 141 156 """ 142 157 try: … … 150 165 class PHC: 151 166 """ 152 A class to interface with PHCpack, for computing numerical homotopies and root counts. 167 A class to interface with PHCpack, for computing numerical 168 homotopies and root counts. 153 169 154 170 EXAMPLES: 155 171 sage: from sage.interfaces.phc import phc 156 sage: R.<x,y> = PolynomialRing( QQ,2)172 sage: R.<x,y> = PolynomialRing(CDF,2) 157 173 sage: testsys = [x^2 + 1, x*y - 1] 158 174 sage: v = phc.blackbox(testsys, R) # optional -- you must have phc install 159 175 sage: v.solutions() 160 [[1.00000000000000*I, -1.00000000000000*I], [-1.00000000000000*I,1.00000000000000*I]]176 [[-1.00000000000000*I, 1.00000000000000*I], [1.00000000000000*I, -1.00000000000000*I]] 161 177 sage: v.solution_dicts() 162 [{y: 1.00000000000000*I, x: -1.00000000000000*I}, {y: -1.00000000000000*I, x:1.00000000000000*I}]163 sage: residuals = [[test_equation. subs(sol) for test_equation in testsys] for sol in v.solution_dicts()]178 [{x: -1.00000000000000*I, y: 1.00000000000000*I}, {x: 1.00000000000000*I, y: -1.00000000000000*I}] 179 sage: residuals = [[test_equation.change_ring(CDF).subs(sol) for test_equation in testsys] for sol in v.solution_dicts()] 164 180 sage: residuals 165 181 [[0, 0], [0, 0]] 166 sage: print v167 2168 x^2+ 1;169 x*y-1;170 <BLANKLINE>171 THE SOLUTIONS :172 <BLANKLINE>173 2 2174 ===========================================================================175 solution 1 : start residual : 1.225E-16 #iterations : 1 success176 t : 0.00000000000000E+00 0.00000000000000E+00177 m : 1178 the solution for t :179 x : 0.00000000000000E+00 -1.00000000000000E+00180 y : 0.00000000000000E+00 1.00000000000000E+00181 == err : 1.225E-16 = rco : 3.333E-01 = res : 0.000E+00 = complex regular ==182 solution 2 : start residual : 1.225E-16 #iterations : 1 success183 t : 0.00000000000000E+00 0.00000000000000E+00184 m : 1185 the solution for t :186 x : 0.00000000000000E+00 1.00000000000000E+00187 y : 0.00000000000000E+00 -1.00000000000000E+00188 == err : 1.225E-16 = rco : 3.333E-01 = res : 0.000E+00 = complex regular ==189 ===========================================================================190 A list of 2 solutions has been refined :191 Number of regular solutions : 2.192 Number of singular solutions : 0.193 Number of real solutions : 0.194 Number of complex solutions : 2.195 Number of clustered solutions : 0.196 Number of failures : 0.197 ===========================================================================198 Frequency tables for correction, residual, condition, and distances :199 FreqCorr : 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 : 2200 FreqResi : 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 : 2201 FreqCond : 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 : 2202 FreqDist : 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 : 2203 Small correction terms and residuals counted to the right.204 Well conditioned and distinct roots counted to the left.205 <BLANKLINE>206 TIMING INFORMATION for Solving the polynomial system207 The elapsed time in seconds was 0.013681000 = 0h 0m 0s 14ms208 User time in seconds was 0.011680000 = 0h 0m 0s 12ms209 System CPU time in seconds was 0.002001000 = 0h 0m 0s 2ms210 Non-I/O page faults was 0211 I/O page faults was 0212 Signals delivered was 0213 Swaps was 0214 Total context switches was 0215 <BLANKLINE>216 ---------------------------------------------------------------------217 | TIMING INFORMATION SUMMARY |218 ---------------------------------------------------------------------219 | root counts | start system | continuation | total time |220 ---------------------------------------------------------------------221 | 0h 0m 0s 0ms | 0h 0m 0s 0ms | 0h 0m 0s 0ms | 0h 0m 0s 12ms |222 ---------------------------------------------------------------------223 PHC ran from 3 July 2007, 11:33:02 till 3 July 2007, 11:33:02.224 The total elapsed time is 0 seconds.225 <BLANKLINE>226 182 """ 227 183 def _input_file(self, polys): -
sage/interfaces/psage.py
r4966 r7000 1 r""" nodoctest1 r""" 2 2 Parallel Interface to the SAGE interpreter 3 3 … … 21 21 Next, request factorization of one random integer in each copy. 22 22 23 sage .: w = [x('factor(2^%s-1)'% randint(250,310)) for x in v]23 sage: w = [x('factor(2^%s-1)'% randint(250,310)) for x in v] 24 24 25 25 Print the status: 26 sage .: w26 sage: w # random output (depends on timing) 27 27 [3 * 11 * 31^2 * 311 * 11161 * 11471 * 73471 * 715827883 * 2147483647 * 4649919401 * 18158209813151 * 5947603221397891 * 29126056043168521, 28 28 <<currently executing code>>, … … 33 33 finished: 34 34 35 sage .: w35 sage: w # random output 36 36 [3 * 11 * 31^2 * 311 * 11161 * 11471 * 73471 * 715827883 * 2147483647 * 4649919401 * 18158209813151 * 5947603221397891 * 29126056043168521, 37 37 23^2 * 47 * 89 * 178481 * 4103188409 * 199957736328435366769577 * 44667711762797798403039426178361, -
sage/interfaces/qsieve.py
r4331 r7000 64 64 sage: v # optional 65 65 [10000000000000000051, 100000000000000000039] 66 sage .: t66 sage: t # random and optional 67 67 '0.36 real 0.19 user 0.00 sys' 68 68 """ … … 142 142 sage: k = 19; n = next_prime(10^k)*next_prime(10^(k+1)) 143 143 sage: q = qsieve(n, block=False, time=True) # optional -- requires time command 144 sage .: q # random output # optional144 sage: q # random output # optional 145 145 Proper factors so far: [] 146 sage .: q # random output # optional146 sage: q # random output # optional 147 147 ([10000000000000000051, 100000000000000000039], '0.21') 148 sage .: q.list() # random output # optional148 sage: q.list() # random output # optional 149 149 [10000000000000000051, 100000000000000000039] 150 sage .: q.time() # random output (optional -- requires time command)150 sage: q.time() # random output (optional -- requires time command) 151 151 '0.21' 152 152 -
sage/interfaces/singular.py
r6952 r7000 199 199 // block 2 : ordering C 200 200 sage: I = singular.ideal('cyclic(6)') 201 sage .: g = singular('groebner(I)')201 sage: g = singular('groebner(I)') 202 202 Traceback (most recent call last): 203 203 ... 204 204 TypeError: Singular error: 205 ? `I` is undefined 206 ? error occurred in standard.lib::groebner line 164: `parameter def i; parameter list #; ` 207 ? leaving standard.lib::groebner 208 skipping text from `;` error at token `)` 209 sage.: g = I.groebner() # not tested since crashes doctest system 210 sage.: g 211 f^48-2554*f^42-15674*f^36+12326*f^30-12326*f^18+15674*f^12+2554*f^6-1, 212 ... 205 ... 206 207 We restart everything and try again, but correctly. 208 sage: singular.quit() 209 sage: singular.lib('poly.lib'); R = singular.ring(32003, '(a,b,c,d,e,f)', 'lp') 210 sage: I = singular.ideal('cyclic(6)') 211 sage: I.groebner() 212 f^48-2554*f^42-15674*f^36+12326*f^30-12326*f^18+15674*f^12+2554*f^6-1, 213 ... 213 214 214 215 It's important to understand why the first attempt at computing a -
sage/lfunctions/sympow.py
r2319 r7000 102 102 103 103 EXAMPLES: 104 sage .: a = sympow.L(EllipticCurve('11a'), 2, 16); a104 sage: a = sympow.L(EllipticCurve('11a'), 2, 16); a # not tested 105 105 '1.057599244590958E+00' 106 sage .: RR(a)106 sage: RR(a) 107 107 1.0575992445909579 108 108 """ … … 143 143 144 144 EXAMPLES: 145 sage .: print sympow.Lderivs(EllipticCurve('11a'), 1, 16, 2)145 sage: print sympow.Lderivs(EllipticCurve('11a'), 1, 16, 2) # not tested 146 146 ... 147 147 1n0: 2.538418608559107E-01 -
sage/libs/hanke/hanke.pyx
r0 r7000 732 732 [ 0, 0, 0, 14 ] 733 733 734 sage .: D.local_constant(3,10)734 sage: D.local_constant(3,10) # not tested 735 735 '15/2' 736 736 737 sage .: D.local_constant(3,30)737 sage: D.local_constant(3,30) # not tested 738 738 '153/20' 739 739 -
sage/libs/mwrank/mwrank.pyx
r1582 r7000 4 4 sage: c = _Curvedata(1,2,3,4,5) 5 5 6 sage .: print c6 sage: print c 7 7 [1,2,3,4,5] 8 8 b2 = 9 b4 = 11 b6 = 29 b8 = 35 … … 109 109 110 110 EXAMPLES: 111 sage.: mwrank_initprimes("PRIMES", True) 112 Computed 78519 primes, largest is 1000253 113 reading primes from file PRIMES 114 read extra prime 10000000019 115 finished reading primes from file PRIMES 116 Extra primes in list: 10000000019 117 sage.: mwrank_initprimes("PRIMES", False) 118 119 sage: mwrank_initprimes("xPRIMES", True) 111 sage: file= SAGE_TMP + '/PRIMES' 112 sage: open(file,'w').write(' '.join([str(p) for p in prime_range(10^6)])) 113 sage: mwrank_initprimes(file, verb=False) 114 sage: mwrank_initprimes("x" + file, True) 120 115 Traceback (most recent call last): 121 116 ... 122 IOError: No such file or directory: xPRIMES117 IOError: No such file or directory: ... 123 118 """ 124 119 if not os.path.exists(filename): -
sage/libs/ntl/ntl_mat_ZZ.pyx
r6990 r7000 382 382 NTL isn't very good compared to MAGMA, unfortunately: 383 383 384 sage.: import ntl 385 sage.: a=MatrixSpace(Q,200).random_element() # -2 to 2 386 sage.: A=ntl.mat_ZZ(200,200) 387 sage.: for i in xrange(a.nrows()): 388 ....: for j in xrange(a.ncols()): 389 ....: A[i,j] = a[i,j] 390 ....: 391 sage.: time d=A.determinant() 392 Time.: 3.89 seconds 393 sage.: time B=A.HNF(d) 394 Time.: 27.59 seconds 384 sage: a = MatrixSpace(ZZ,200).random_element(x=-2, y=2) # -2 to 2 385 sage: A = ntl.mat_ZZ(200,200) 386 sage: for i in xrange(a.nrows()): 387 ... for j in xrange(a.ncols()): 388 ... A[i,j] = a[i,j] 389 ... 390 sage: t = cputime(); d = A.determinant() 391 sage: cputime(t) 392 0.33201999999999998 393 sage: t = cputime(); B = A.HNF(d) 394 sage: cputime(t) 395 6.4924050000000006 395 396 396 397 In comparison, MAGMA does this much more quickly: 397 398 \begin{verbatim} 398 > A := MatrixAlgebra( Z,200)![Random(-2,2) : i in [1..200^2]];399 > A := MatrixAlgebra(IntegerRing(),200)![Random(-2,2) : i in [1..200^2]]; 399 400 > time d := Determinant(A); 400 Time: 0. 710401 Time: 0.140 401 402 > time H := HermiteForm(A); 402 Time: 3.080403 Time: 0.290 403 404 \end{verbatim} 404 405 -
sage/modular/hecke/submodule.py
r5510 r7000 314 314 sage: A.dimension(), B.dimension() 315 315 (2, 3) 316 317 sage.: C = A.intersection(B); C.dimension() 316 sage: C = A.intersection(B); C.dimension() 318 317 1 319 318 """ -
sage/modular/modform/ambient.py
r6992 r7000 382 382 383 383 EXAMPLES: 384 sage .: m = ModularForms(Gamma0(33),2); m384 sage: m = ModularForms(Gamma0(33),2); m # TODO: not tested -- broken 385 385 Modular Forms space of dimension 6 for Congruence Subgroup Gamma0(33) of weight 2 over Rational Field 386 sage .: m.new_submodule()386 sage: m.new_submodule() # not tested -- broken 387 387 Modular Forms subspace of dimension 1 of Modular Forms space of dimension 6 for Congruence Subgroup Gamma0(33) of weight 2 over Rational Field 388 388 389 389 Another example: 390 sage .: M = ModularForms(17,4)391 sage .: N = M.new_subspace(); N390 sage: M = ModularForms(17,4) 391 sage: N = M.new_subspace(); N # not tested -- broken 392 392 Modular Forms subspace of dimension 4 of Modular Forms space of dimension 6 for Congruence Subgroup Gamma0(17) of weight 4 over Rational Field 393 sage .: N.basis()393 sage: N.basis() # not tested -- broken 394 394 [ 395 395 q + 2*q^5 + O(q^6), … … 406 406 407 407 Unfortunately (TODO) -- $p$-new submodules aren't yet implemented: 408 sage .: m.new_submodule(3)408 sage: m.new_submodule(3) # not tested -- broken 409 409 Traceback (most recent call last): 410 410 ... 411 411 NotImplementedError 412 sage .: m.new_submodule(11)412 sage: m.new_submodule(11) # not tested -- broken 413 413 Traceback (most recent call last): 414 414 ... -
sage/modules/free_module.py
r6606 r7000 1227 1227 EXAMPLES: 1228 1228 sage: M = FreeModule(ZZ, 2).span([[1,1]]) 1229 sage: x = M.random_element() 1230 sage.: x 1229 sage: M.random_element() 1231 1230 (1, 1) 1232 sage .: M.random_element()1231 sage: M.random_element() 1233 1232 (-2, -2) 1234 sage .: M.random_element()1233 sage: M.random_element() 1235 1234 (-1, -1) 1236 1235 """ -
sage/plot/plot3dsoya_wrap.py
r1097 r7000 55 55 56 56 A periodic surface: 57 sage .: p = plot3dsoya(lambda x,y : sin(x)+cos(y), (0,0), 10) # optional: requires soya3d57 sage: p = plot3dsoya(lambda x,y : sin(x)+cos(y), (0,0), 10) # optional: requires soya3d; not tested 58 58 59 59 Now use the show command to view the surface: 60 sage .: p.show()60 sage: p.show() # not tested 61 61 62 62 The Riemann Zeta function 63 sage .: p = plot3dsoya(lambda x,y : abs(zeta(x + y*I)), (0.5,5), 10, res=4)63 sage: p = plot3dsoya(lambda x,y : abs(zeta(x + y*I)), (0.5,5), 10, res=4) # not tested 64 64 65 65 """ -
sage/rings/integer.pyx
r6988 r7000 62 62 'sagesagesage' 63 63 64 C oercions:64 COERCIONS: 65 65 Returns version of this integer in the multi-precision floating 66 66 real field R. 67 67 68 sage: n = 939082369 sage: RR = RealField(200)70 sage: RR(n)71 9390823.000000000000000000000000000000000000000000000000000068 sage: n = 9390823 69 sage: RR = RealField(200) 70 sage: RR(n) 71 9390823.0000000000000000000000000000000000000000000000000000 72 72 73 73 """ … … 1983 1983 1984 1984 EXAMPLES: 1985 sage: Integer(64).is_power_of(4)1986 True1987 sage: Integer(64).is_power_of(16)1988 False1985 sage: Integer(64).is_power_of(4) 1986 True 1987 sage: Integer(64).is_power_of(16) 1988 False 1989 1989 1990 1990 TESTS: 1991 sage: Integer(-64).is_power_of(-4) 1992 True 1993 sage: Integer(-32).is_power_of(-2) 1994 True 1995 sage: Integer(1).is_power_of(1) 1996 True 1997 sage: Integer(-1).is_power_of(-1) 1998 True 1999 sage: Integer(0).is_power_of(1) 2000 False 2001 sage: Integer(0).is_power_of(0) 2002 True 2003 sage: Integer(1).is_power_of(0) 2004 True 2005 sage: Integer(1).is_power_of(8) 2006 True 2007 sage: Integer(-8).is_power_of(2) 2008 False 1991 1992 sage: Integer(-64).is_power_of(-4) 1993 True 1994 sage: Integer(-32).is_power_of(-2) 1995 True 1996 sage: Integer(1).is_power_of(1) 1997 True 1998 sage: Integer(-1).is_power_of(-1) 1999 True 2000 sage: Integer(0).is_power_of(1) 2001 False 2002 sage: Integer(0).is_power_of(0) 2003 True 2004 sage: Integer(1).is_power_of(0) 2005 True 2006 sage: Integer(1).is_power_of(8) 2007 True 2008 sage: Integer(-8).is_power_of(2) 2009 False 2009 2010 2010 2011 NOTES: 2011 For large integers self, is_power_of() is faster than is_power(). The following examples gives some indication of how much faster. 2012 sage.: b = lcm(range(1,10000)) 2013 sage.: b.exact_log(2) 2014 14446 2015 sage.: time for a in range(2, 1000): k = b.is_power() 2016 CPU times: user 1.68 s, sys: 0.01 s, total: 1.69 s 2017 Wall time: 1.71 2018 sage.: time for a in range(2, 1000): k = b.is_power_of(2) 2019 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s 2020 Wall time: 0.01 2021 sage.: time for a in range(2, 1000): k = b.is_power_of(3) 2022 CPU times: user 0.05 s, sys: 0.00 s, total: 0.05 s 2023 Wall time: 0.05 2024 2025 sage.: b = lcm(range(1, 1000)) 2026 sage.: b.exact_log(2) 2027 1437 2028 sage.: time for a in range(2, 10000): k = b.is_power() # note that we change the range from the example above 2029 CPU times: user 0.40 s, sys: 0.00 s, total: 0.40 s 2030 Wall time: 0.40 2031 sage.: for a in range(2, 10000): k = b.is_power_of(TWO) 2032 CPU times: user 0.03 s, sys: 0.00 s, total: 0.03 s 2033 Wall time: 0.03 2034 sage.: time for a in range(2, 10000): k = b.is_power_of(3) 2035 CPU times: user 0.11 s, sys: 0.01 s, total: 0.12 s 2036 Wall time: 0.13 2037 sage.: time for a in range(2, 10000): k = b.is_power_of(a) 2038 CPU times: user 0.08 s, sys: 0.01 s, total: 0.09 s 2039 Wall time: 0.10 2012 2013 For large integers self, is_power_of() is faster than is_power(). 2014 The following examples gives some indication of how much faster. 2015 2016 sage: b = lcm(range(1,10000)) 2017 sage: b.exact_log(2) 2018 14446 2019 sage: t=cputime() 2020 sage: for a in range(2, 1000): k = b.is_power() 2021 sage: cputime(t) # random 2022 0.53203299999999976 2023 sage: t=cputime() 2024 sage: for a in range(2, 1000): k = b.is_power_of(2) 2025 sage: cputime(t) # random 2026 0.0 2027 sage: t=cputime() 2028 sage: for a in range(2, 1000): k = b.is_power_of(3) 2029 sage: cputime(t) # random 2030 0.032002000000000308 2031 2032 sage: b = lcm(range(1, 1000)) 2033 sage: b.exact_log(2) 2034 1437 2035 sage: t=cputime() 2036 sage: for a in range(2, 10000): k = b.is_power() # note that we change the range from the example above 2037 sage: cputime(t) # random 2038 0.17201100000000036 2039 sage: t=cputime(); TWO=int(2) 2040 sage: for a in range(2, 10000): k = b.is_power_of(TWO) 2041 sage: cputime(t) # random 2042 0.0040000000000000036 2043 sage: t=cputime() 2044 sage: for a in range(2, 10000): k = b.is_power_of(3) 2045 sage: cputime(t) # random 2046 0.040003000000000011 2047 sage: t=cputime() 2048 sage: for a in range(2, 10000): k = b.is_power_of(a) 2049 sage: cputime(t) # random 2050 0.02800199999999986 2040 2051 """ 2041 2052 if not PY_TYPE_CHECK(n, Integer): -
sage/rings/padics/factory.py
r5872 r7000 224 224 sage: Zp(17, 5)(-1) 225 225 16 + 16*17 + 16*17^2 + 16*17^3 + 16*17^4 + O(17^5) 226 sage .: Zp(next_prime(10^50), 10000)227 100000000000000000000000000000000000000000000000151-adic Ring with capped relative precision 1000 0226 sage: Zp(next_prime(10^50), 1000) 227 100000000000000000000000000000000000000000000000151-adic Ring with capped relative precision 1000 228 228 229 229 We create each type of ring: … … 387 387 raise TypeError, "modulus must be a polynomial" 388 388 if not isinstance(names, str): 389 raise TypeError, "names must be a string" 389 names = str(names) 390 #raise TypeError, "names must be a string" 390 391 if not isinstance(halt, (int, long, Integer)): 391 392 raise TypeError, "halt must be an integer" -
sage/rings/padics/tutorial.py
r4450 r7000 353 353 354 354 355 sage: R.<c> = Zq(125, prec = 20) 356 sage.: R 357 Unramified Extension of 5-adic Ring with capped absolute precision 20 in c 358 defined by (1 + O(5^20))*x^3 + O(5^20)*x^2 + (3 + O(5^20))*x + 3 + O(5^20) 359 360 361 \section{New Versions of the $p$-adics} 362 363 The code for $p$-adics is fairly rapidly changing. If there's a bug 364 you want fixed, let me know and I'll try to fix it. Once I do, you'll 365 need to get the latest version of $p$-adics with the bug fixed. If 366 you don't want to wait for the next version of SAGE to come out, you 367 can do the following to get the most recent version: 368 369 370 sage.: hg_sage.pull() 371 sage.: hg_sage.apply('http://sage.math.washington.edu/home/padicgroup/development-version.hg') 372 sage.: quit 373 localhost:~$ sage 374 sage.: run code that generated bug. 375 376 If you want a slightly more stable but older version, use \verb/semistable-version.hg/ instead. 355 sage: R.<c> = Zq(125, prec = 20); R 356 Unramified Extension of 5-adic Ring with capped absolute precision 20 357 in c defined by (1 + O(5^20))*x^3 + (3 + O(5^20))*x + (3 + O(5^20)) 377 358 """ -
sage/rings/polynomial/groebner_fan.py
r6606 r7000 407 407 sage: R.<x,y> = PolynomialRing(QQ,2) 408 408 sage: G = R.ideal([y^3 - x^2, y^2 - 13*x]).groebner_fan() 409 sage: G.render( 'a.fig')409 sage: G.render(SAGE_TMP + '/test.fig') 410 410 411 411 sage: R.<x,y,z> = PolynomialRing(QQ,3) 412 412 sage: G = R.ideal([x^2*y - z, y^2*z - x, z^2*x - y]).groebner_fan() 413 sage .: G.render('a.fig', show=True, larger=True)413 sage: G.render(SAGE_TMP + '/test.fig', show=False, larger=True) 414 414 """ 415 415 cmd = 'render' … … 584 584 sage: R.<x,y> = PolynomialRing(QQ,2) 585 585 sage: G = R.ideal([y^3 - x^2, y^2 - 13*x]).groebner_fan() 586 sage .: G[0].interactive()586 sage: G[0].interactive() # not tested 587 587 Initializing gfan interactive mode 588 588 ********************************************* -
sage/rings/polynomial/multi_polynomial_ideal.py
r6920 r7000 268 268 sage: R.<x,y> = PolynomialRing(QQ,2) 269 269 sage: I = R.ideal([y^3 - x^2]) 270 sage .: I.plot() # cusp (optional surf)270 sage: I.plot() # cusp (optional surf) 271 271 sage: I = R.ideal([y^2 - x^2 - 1]) 272 sage .: I.plot() # hyperbola (optional surf)272 sage: I.plot() # hyperbola (optional surf) 273 273 sage: I = R.ideal([y^2 + x^2*(1/4) - 1]) 274 sage .: I.plot() # ellipse (optional surf)274 sage: I.plot() # ellipse (optional surf) 275 275 sage: I = R.ideal([y^2-(x^2-1)*(x-2)]) 276 sage .: I.plot() # elliptic curve (optional surf)276 sage: I.plot() # elliptic curve (optional surf) 277 277 278 278 Implicit plotting in 3-d: 279 279 sage: R.<x,y,z> = PolynomialRing(QQ,3) 280 280 sage: I = R.ideal([y^2 + x^2*(1/4) - z]) 281 sage .: I.plot() # a cone (optional surf)281 sage: I.plot() # a cone (optional surf) 282 282 sage: I = R.ideal([y^2 + z^2*(1/4) - x]) 283 sage .: I.plot() # same code, from a different angle (optional surf)283 sage: I.plot() # same code, from a different angle (optional surf) 284 284 sage: I = R.ideal([x^2*y^2+x^2*z^2+y^2*z^2-16*x*y*z]) 285 sage .: I.plot() # Steiner surface (optional surf)285 sage: I.plot() # Steiner surface (optional surf) 286 286 287 287 AUTHOR: -
sage/rings/polynomial/multi_polynomial_ring.py
r6606 r7000 152 152 sage: R = MPolynomialRing(Integers(12), 'x', 5); R 153 153 Multivariate Polynomial Ring in x0, x1, x2, x3, x4 over Ring of integers modulo 12 154 sage .: loads(R.dumps()) == R # TODO -- this currently hangs sometimes (??)154 sage: loads(R.dumps()) == R 155 155 True 156 156 """ -
sage/rings/polynomial/padics/polynomial_padic_capped_relative_dense.py
r6844 r7000 833 833 834 834 EXAMPLES: 835 sage.: K = Zp(13, 5)836 sage.: R.<t> = K[]837 sage.: f = t^3 + K(13, 3) * t838 sage.: f.rescale(2)835 sage: K = Zp(13, 5) 836 sage: R.<t> = K[] 837 sage: f = t^3 + K(13, 3) * t 838 sage: f.rescale(2) # todo: not tested -- in fact, is broken! 839 839 """ 840 840 negval = False -
sage/rings/polynomial/polynomial_element_generic.py
r6990 r7000 875 875 sage: R.<x> = QQ[] 876 876 sage: f = x^3 - 2 877 sage .: f.factor_padic(2)878 (1 + O(2^10))*x^3 + O(2^10)*x^2 + O(2^10)*x + (2 + 2^2 + 2^3 + 2^4 + 2^5 + 2^6 + 2^7 + 2^8 + 2^9 + O(2^10))879 sage .: f.factor_padic(3)880 (1 + O(3^10))*x^3 + O(3^10)*x^2 + O(3^10)*x + (1 + 2*3 + 2*3^2 + 2*3^3 + 2*3^4 + 2*3^5 + 2*3^6 + 2*3^7 + 2*3^8 + 2*3^9 + O(3^10))881 sage .: f.factor_padic(5)877 sage: f.factor_padic(2) 878 (1 + O(2^10))*x^3 + (O(2^10))*x^2 + (O(2^10))*x + (2 + 2^2 + 2^3 + 2^4 + 2^5 + 2^6 + 2^7 + 2^8 + 2^9 + O(2^10)) 879 sage: f.factor_padic(3) 880 (1 + O(3^10))*x^3 + (O(3^10))*x^2 + (O(3^10))*x + (1 + 2*3 + 2*3^2 + 2*3^3 + 2*3^4 + 2*3^5 + 2*3^6 + 2*3^7 + 2*3^8 + 2*3^9 + O(3^10)) 881 sage: f.factor_padic(5) 882 882 ((1 + O(5^10))*x + (2 + 4*5 + 2*5^2 + 2*5^3 + 5^4 + 3*5^5 + 4*5^7 + 2*5^8 + 5^9 + O(5^10))) * ((1 + O(5^10))*x^2 + (3 + 2*5^2 + 2*5^3 + 3*5^4 + 5^5 + 4*5^6 + 2*5^8 + 3*5^9 + O(5^10))*x + (4 + 5 + 2*5^2 + 4*5^3 + 4*5^4 + 3*5^5 + 3*5^6 + 4*5^7 + 4*5^9 + O(5^10))) 883 883 """ … … 891 891 K = Qp(p, prec, type='capped-rel') 892 892 R = sage.rings.polynomial.polynomial_ring.PolynomialRing(K, names=self.parent().variable_name()) 893 return R(self).factor( absprec = prec)893 return R(self).factor() # absprec = prec) 894 894 895 895 def list(self): -
sage/rings/power_series_ring.py
r5590 r7000 279 279 sage: latex(R) 280 280 \mathbf{F}_{17}[[y]] 281 sage.: view(R) # display typeset form 282 """ 283 281 """ 284 282 return "%s[[%s]]"%(latex.latex(self.base_ring()), self.variable_name()) 285 283 -
sage/rings/ring.pyx
r6990 r7000 1480 1480 1481 1481 EXAMPLES: 1482 sage .: k = GF(2^10, 'a')1483 sage .: k.random_element()1482 sage: k = GF(2^10, 'a') 1483 sage: k.random_element() 1484 1484 a^9 + a 1485 1485 """ -
sage/schemes/elliptic_curves/constructor.py
r6606 r7000 182 182 curve with Cremona label 27a1: 183 183 184 sage .: E = EllipticCurve_from_cubic('x^3 + y^3 + z^3', [1,-1,0])185 sage .: print E184 sage: E = EllipticCurve_from_cubic('x^3 + y^3 + z^3', [1,-1,0]) # optional -- requires magma 185 sage: E # optional 186 186 Elliptic Curve defined by y^2 + y = x^3 - 7 over Rational Field 187 sage .: E.cremona_label()187 sage: E.cremona_label() # optional 188 188 '27a1' 189 189 190 190 Next we find the minimal model and conductor of the Jacobian 191 191 of the Selmer curve. 192 sage .: E = EllipticCurve_from_cubic('x^3 + y^3 + 60*z^3', [1,-1,0])193 sage .: print E192 sage: E = EllipticCurve_from_cubic('x^3 + y^3 + 60*z^3', [1,-1,0]) # optional 193 sage: E # optional 194 194 Elliptic Curve defined by y^2 = x^3 - 24300 over Rational Field 195 sage .: E.conductor()195 sage: E.conductor() # optional 196 196 24300 197 197 -
sage/schemes/elliptic_curves/ell_rational_field.py
r6778 r7000 1936 1936 ... LL.append(G) 1937 1937 ... 1938 sage .: graphs_list.show_graphs(LL)1938 sage: graphs_list.show_graphs(LL) 1939 1939 1940 1940 sage: E = EllipticCurve('195a') -
sage/schemes/elliptic_curves/lseries_ell.py
r6940 r7000 102 102 sage: L(2) 103 103 0.381575408260711 104 sage .: L = E.Lseries().dokchitser(algorithm='magma') # optional (not auto tested)105 sage .: L.Evaluate(2) # optional (not auto tested)104 sage: L = E.Lseries().dokchitser(algorithm='magma') # optional 105 sage: L.Evaluate(2) # optional 106 106 0.38157540826071121129371040958008663667709753398892116 107 107 """ … … 157 157 '2.492262044273650E+00' 158 158 sage: RR(a) # optional 159 2.4922620442736 498159 2.49226204427365 160 160 """ 161 161 from sage.lfunctions.sympow import sympow … … 182 182 EXAMPLES: 183 183 sage: E = EllipticCurve('37a') 184 sage: E.Lseries().sympow_derivs(1,16,2) # optional -- requires precomputing "sympow('-new_data 2')" 185 ... 186 1n0: 3.837774351482055E-01 187 1w0: 3.777214305638848E-01 188 1n1: 3.059997738340522E-01 189 1w1: 3.059997738340524E-01 190 1n2: 1.519054910249753E-01 191 1w2: 1.545605024269432E-01 184 sage: print E.Lseries().sympow_derivs(1,16,2) # optional -- requires precomputing "sympow('-new_data 2')" 185 sympow 1.018 RELEASE (c) Mark Watkins --- see README and COPYING for details 186 Minimal model of curve is [0,0,1,-1,0] 187 At 37: Inertia Group is C1 MULTIPLICATIVE REDUCTION 188 Conductor is 37 189 sp 1: Conductor at 37 is 1+0, root number is 1 190 sp 1: Euler factor at 37 is 1+1*x 191 1st sym power conductor is 37, global root number is -1 192 NT 1d0: 35 193 NT 1d1: 32 194 NT 1d2: 28 195 Maximal number of terms is 35 196 Done with small primes 1049 197 Computed: 1d0 1d1 1d2 198 Checked out: 1d1 199 1n0: 3.837774351482055E-01 200 1w0: 3.777214305638848E-01 201 1n1: 3.059997738340522E-01 202 1w1: 3.059997738340524E-01 203 1n2: 1.519054910249753E-01 204 1w2: 1.545605024269432E-01 192 205 """ 193 206 from sage.lfunctions.sympow import sympow -
sage/schemes/elliptic_curves/sha.py
r6775 r7000 55 55 56 56 A rank 5 curve: 57 sage .: EllipticCurve([0, 0, 1, -79, 342]).sha().an_numerical(prec=10, proof=False) # long time -- about 1 minute!58 1.057 sage: EllipticCurve([0, 0, 1, -79, 342]).sha().an_numerical(prec=4, proof=False) # long time -- about 30 seconds. 58 1.0 59 59 """ 60 60 try: … … 241 241 trac #635, this strangely switched sign to become 40 + O(41). 242 242 I'm not sure whether this indicates a bug, possibly a normalisation issue. 243 sage .: EllipticCurve('123a1').sha().an_padic(41) #rank 1 (long time)243 sage: EllipticCurve('123a1').sha().an_padic(41) #rank 1 (long time) 244 244 1 + O(41) 245 245 sage: EllipticCurve('817a1').sha().an_padic(43) #rank 2 (long time) … … 250 250 sage: EllipticCurve('34a1').sha().an_padic(5) # rank 0 (long time) 251 251 1 + O(5^3) 252 sage .: EllipticCurve('43a1').sha().an_padic(7) # rank 1 (very long time -- not tested)252 sage: EllipticCurve('43a1').sha().an_padic(7) # rank 1 (very long time -- nearly a minute) 253 253 1 + O(7) 254 254 sage: EllipticCurve('1483a1').sha().an_padic(5) # rank 2 (long time) -
sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py
r5451 r7000 51 51 sage: C._points_fast_sqrt() 52 52 [(0 : 1 : 0), (0 : 5 : 1), (0 : 8 : 1), (1 : 1 : 1), (1 : 12 : 1), (3 : 3 : 1), (3 : 10 : 1), (4 : 1 : 1), (4 : 12 : 1), (6 : 2 : 1), (6 : 11 : 1), (7 : 1 : 1), (7 : 12 : 1), (8 : 4 : 1), (8 : 9 : 1), (9 : 4 : 1), (9 : 9 : 1), (12 : 5 : 1), (12 : 8 : 1)] 53 sage .: set(C._points_fast_sqrt()) == set(C._points_cache_sqrt()) # TODO -- fix this.53 sage: set(C._points_fast_sqrt()) == set(C._points_cache_sqrt()) 54 54 True 55 55 """ -
sage/schemes/plane_curves/affine_curve.py
r5176 r7000 288 288 [(0, 1), (1, 2), (2, 3), (3, 4), (4, 0)] 289 289 290 This next example crashes Singular with an out of memory error291 when run from doctests (so it is currently not run), though it292 works fine from the command line. (TODO)293 294 290 sage: x, y = (GF(17)['x,y']).gens() 295 291 sage: C = Curve(x^2 + y^5 + x*y - 19) 296 sage .: v = C.rational_points(algorithm='bn')297 sage .: w = C.rational_points(algorithm='enum')298 sage .: len(v)292 sage: v = C.rational_points(algorithm='bn') 293 sage: w = C.rational_points(algorithm='enum') 294 sage: len(v) 299 295 20 300 sage .: v == w296 sage: v == w 301 297 True 302 298 """ -
sage/server/notebook/sagetex.py
r6790 r7000 10 10 11 11 EXAMPLES: 12 sage .: sagetex('foo.tex')13 pops up web browser with live version of foo.tex.12 sage: sagetex('foo.tex') # not tested 13 [pops up web browser with live version of foo.tex.] 14 14 """ 15 15 if not os.path.exists(filename): -
sage/server/notebook/test_notebook.py
r5208 r7000 1 1 r"""nodoctest 2 3 THIS IS NOT USED ANYMORE -- should be deleted -- refers to very old version of notebook. 4 2 5 Test the notebook to analyze how it is behaving 3 6 after making some changes to it. … … 6 9 run with the below command: 7 10 8 sage.: notebook(log_server=True) 11 sage: notebook(log_server=True) # not tested 9 12 10 13 we then take the resulting 'server_log' and: … … 90 93 notebook that had been run in the following way: 91 94 92 sage.: notebook(log_server=True) 95 EXAMPLES: 96 sage: notebook(log_server=True) # not tested 93 97 """ 94 98 #get the test notebooks log -
sage/server/notebook/tutorial.py
r6541 r7000 26 26 beautiful antialised images. To try it out immediately, do this: 27 27 28 sage .: notebook(open_viewer=True)28 sage: notebook(open_viewer=True) # not tested 29 29 the sage notebook starts... 30 30 -
sage/structure/sage_object.pyx
r6178 r7000 128 128 129 129 EXAMPLES: 130 sage .: f = x^3 + 5131 sage .: f.save('file')132 sage .: load('file')130 sage: f = x^3 + 5 131 sage: f.save(SAGE_TMP + '/file') 132 sage: load(SAGE_TMP + '/file.sobj') 133 133 x^3 + 5 134 134 """ … … 404 404 NOTE: There is also a special SAGE command (that is not 405 405 available in Python) called load that you use by typing 406 sage.: load filename.sage 406 407 sage: load filename.sage # not tested 408 407 409 The documentation below is not for that command. The documentation 408 410 for load is almost identical to that for attach. Type attach? for
Note: See TracChangeset
for help on using the changeset viewer.
