Ticket #17254: Sage_crash_report.txt

File Sage_crash_report.txt, 37.7 KB (added by dimpase, 3 years ago)
Line 
1***************************************************************************
2
3IPython post-mortem report
4
5{'commit_hash': u'f8362a9',
6 'commit_source': 'installation',
7 'default_encoding': 'UTF-8',
8 'ipython_path': '/home/dima/Sage/sage/local/lib/python2.7/site-packages/IPython',
9 'ipython_version': '5.0.0',
10 'os_name': 'posix',
11 'platform': 'Linux-4.7.1-1-ARCH-x86_64-with-glibc2.2.5',
12 'sys_executable': '/home/dima/Sage/sage/local/bin/python',
13 'sys_platform': 'linux2',
14 'sys_version': '2.7.10 (default, Sep  2 2016, 12:06:53) \n[GCC 6.1.1 20160802]'}
15
16***************************************************************************
17
18
19
20***************************************************************************
21
22Crash traceback:
23
24---------------------------------------------------------------------------
25---------------------------------------------------------------------------
26ImportError            Python 2.7.10: /home/dima/Sage/sage/local/bin/python
27                                                   Fri Sep  2 13:05:45 2016
28A problem occurred executing Python code.  Here is the sequence of function
29calls leading up to the error, with the most recent (innermost) call last.
30/home/dima/Sage/sage/src/bin/sage-ipython in <module>()
31      1 #!/usr/bin/env python
32      2 # -*- coding: utf-8 -*-
33      3 """
34      4 Sage IPython startup script.
35      5 """
36      6
37      7 # Install extra readline commands before IPython initialization
38      8 from sage.repl.readline_extra_commands import *
39      9
40     10 from sage.repl.interpreter import SageTerminalApp
41     11
42     12 app = SageTerminalApp.instance()
43---> 13 app.initialize()
44        global app.initialize = <bound method SageTerminalApp.initialize of <sage.repl.interpreter.SageTerminalApp object at 0x7f89bf2cab50>>
45     14 app.start()
46
47<decorator-gen-109> in initialize(self=<sage.repl.interpreter.SageTerminalApp object>, argv=None)
48
49/home/dima/Sage/sage/local/lib/python2.7/site-packages/traitlets/config/application.py in catch_config_error(method=<function initialize>, app=<sage.repl.interpreter.SageTerminalApp object>, *args=(None,), **kwargs={})
50     59
51     60 #-----------------------------------------------------------------------------
52     61 # Application class
53     62 #-----------------------------------------------------------------------------
54     63
55     64 @decorator
56     65 def catch_config_error(method, app, *args, **kwargs):
57     66     """Method decorator for catching invalid config (Trait/ArgumentErrors) during init.
58     67
59     68     On a TraitError (generally caused by bad config), this will print the trait's
60     69     message, and exit the app.
61     70     
62     71     For use on init methods, to prevent invoking excepthook on invalid input.
63     72     """
64     73     try:
65---> 74         return method(app, *args, **kwargs)
66        method = <function initialize at 0x7f89b81450c8>
67        app = <sage.repl.interpreter.SageTerminalApp object at 0x7f89bf2cab50>
68        args = (None,)
69        kwargs = {}
70     75     except (TraitError, ArgumentError) as e:
71     76         app.print_help()
72     77         app.log.fatal("Bad config encountered during initialization:")
73     78         app.log.fatal(str(e))
74     79         app.log.debug("Config at the time: %s", app.config)
75     80         app.exit(1)
76     81
77     82
78     83 class ApplicationError(Exception):
79     84     pass
80     85
81     86
82     87 class LevelFormatter(logging.Formatter):
83     88     """Formatter with additional `highlevel` record
84     89     
85
86/home/dima/Sage/sage/local/lib/python2.7/site-packages/IPython/terminal/ipapp.py in initialize(self=<sage.repl.interpreter.SageTerminalApp object>, argv=None)
87    294
88    295         return super(TerminalIPythonApp, self).parse_command_line(argv)
89    296     
90    297     @catch_config_error
91    298     def initialize(self, argv=None):
92    299         """Do actions after construct, but before starting the app."""
93    300         super(TerminalIPythonApp, self).initialize(argv)
94    301         if self.subapp is not None:
95    302             # don't bother initializing further, starting subapp
96    303             return
97    304         # print self.extra_args
98    305         if self.extra_args and not self.something_to_run:
99    306             self.file_to_run = self.extra_args[0]
100    307         self.init_path()
101    308         # create the shell
102--> 309         self.init_shell()
103        self.init_shell = <bound method SageTerminalApp.init_shell of <sage.repl.interpreter.SageTerminalApp object at 0x7f89bf2cab50>>
104    310         # and draw the banner
105    311         self.init_banner()
106    312         # Now a variety of things that happen after the banner is printed.
107    313         self.init_gui_pylab()
108    314         self.init_extensions()
109    315         self.init_code()
110    316
111    317     def init_shell(self):
112    318         """initialize the InteractiveShell instance"""
113    319         # Create an InteractiveShell instance.
114    320         # shell.display_banner should always be False for the terminal
115    321         # based app, because we call shell.show_banner() by hand below
116    322         # so the banner shows *before* all extension loading stuff.
117    323         self.shell = TerminalInteractiveShell.instance(parent=self,
118    324                         profile_dir=self.profile_dir,
119
120/home/dima/Sage/sage/local/lib/python2.7/site-packages/sage/repl/interpreter.py in init_shell(self=<sage.repl.interpreter.SageTerminalApp object>)
121    750         self.shell.has_sage_extensions = SAGE_EXTENSION in self.extensions
122    751
123    752         # Load the %lprun extension if available
124    753         try:
125    754             import line_profiler
126    755         except ImportError:
127    756             pass
128    757         else:
129    758             self.extensions.append('line_profiler')
130    759
131    760         if self.shell.has_sage_extensions:
132    761             self.extensions.remove(SAGE_EXTENSION)
133    762
134    763             # load sage extension here to get a crash if
135    764             # something is wrong with the sage library
136--> 765             self.shell.extension_manager.load_extension(SAGE_EXTENSION)
137        self.shell.extension_manager.load_extension = <bound method ExtensionManager.load_extension of <IPython.core.extensions.ExtensionManager object at 0x7f89b6fe46d0>>
138        global SAGE_EXTENSION = 'sage'
139    766
140    767
141
142/home/dima/Sage/sage/local/lib/python2.7/site-packages/IPython/core/extensions.py in load_extension(self=<IPython.core.extensions.ExtensionManager object>, module_str='sage')
143     70
144     71         Returns the string "already loaded" if the extension is already loaded,
145     72         "no load function" if the module doesn't have a load_ipython_extension
146     73         function, or None if it succeeded.
147     74         """
148     75         if module_str in self.loaded:
149     76             return "already loaded"
150     77         
151     78         from IPython.utils.syspathcontext import prepended_to_syspath
152     79         
153     80         with self.shell.builtin_trap:
154     81             if module_str not in sys.modules:
155     82                 with prepended_to_syspath(self.ipython_extension_dir):
156     83                     __import__(module_str)
157     84             mod = sys.modules[module_str]
158---> 85             if self._call_load_ipython_extension(mod):
159        self._call_load_ipython_extension = <bound method ExtensionManager._call_load_ipython_extension of <IPython.core.extensions.ExtensionManager object at 0x7f89b6fe46d0>>
160        mod = <module 'sage' from '/home/dima/Sage/sage/local/lib/python2.7/site-packages/sage/__init__.py'>
161     86                 self.loaded.add(module_str)
162     87             else:
163     88                 return "no load function"
164     89
165     90     def unload_extension(self, module_str):
166     91         """Unload an IPython extension by its module name.
167     92
168     93         This function looks up the extension's name in ``sys.modules`` and
169     94         simply calls ``mod.unload_ipython_extension(self)``.
170     95         
171     96         Returns the string "no unload function" if the extension doesn't define
172     97         a function to unload itself, "not loaded" if the extension isn't loaded,
173     98         otherwise None.
174     99         """
175    100         if module_str not in self.loaded:
176
177/home/dima/Sage/sage/local/lib/python2.7/site-packages/IPython/core/extensions.py in _call_load_ipython_extension(self=<IPython.core.extensions.ExtensionManager object>, mod=<module 'sage' from '/home/dima/Sage/sage/local/lib/python2.7/site-packages/sage/__init__.py'>)
178    117         """
179    118         from IPython.utils.syspathcontext import prepended_to_syspath
180    119
181    120         if (module_str in self.loaded) and (module_str in sys.modules):
182    121             self.unload_extension(module_str)
183    122             mod = sys.modules[module_str]
184    123             with prepended_to_syspath(self.ipython_extension_dir):
185    124                 reload(mod)
186    125             if self._call_load_ipython_extension(mod):
187    126                 self.loaded.add(module_str)
188    127         else:
189    128             self.load_extension(module_str)
190    129
191    130     def _call_load_ipython_extension(self, mod):
192    131         if hasattr(mod, 'load_ipython_extension'):
193--> 132             mod.load_ipython_extension(self.shell)
194        mod.load_ipython_extension = <function load_ipython_extension at 0x7f89bf2e3de8>
195        self.shell = <sage.repl.interpreter.SageTerminalInteractiveShell object at 0x7f89b7da5510>
196    133             return True
197    134
198    135     def _call_unload_ipython_extension(self, mod):
199    136         if hasattr(mod, 'unload_ipython_extension'):
200    137             mod.unload_ipython_extension(self.shell)
201    138             return True
202    139
203    140     def install_extension(self, url, filename=None):
204    141         """Download and install an IPython extension.
205    142
206    143         If filename is given, the file will be so named (inside the extension
207    144         directory). Otherwise, the name from the URL will be used. The file must
208    145         have a .py or .zip extension; otherwise, a ValueError will be raised.
209    146
210    147         Returns the full path to the installed file.
211
212/home/dima/Sage/sage/local/lib/python2.7/site-packages/sage/__init__.py in load_ipython_extension(*args=(<sage.repl.interpreter.SageTerminalInteractiveShell object>,))
213      1 __all__ = ['all']
214      2
215      3 # IPython calls this when starting up
216      4 def load_ipython_extension(*args):
217      5     import sage.repl.ipython_extension
218----> 6     sage.repl.ipython_extension.load_ipython_extension(*args)
219        sage.repl.ipython_extension.load_ipython_extension = <function load_ipython_extension at 0x7f89b64f5398>
220        args = (<sage.repl.interpreter.SageTerminalInteractiveShell object at 0x7f89b7da5510>,)
221
222/home/dima/Sage/sage/local/lib/python2.7/site-packages/sage/repl/ipython_extension.py in wrapper(*args=(<sage.repl.interpreter.SageTerminalInteractiveShell object>,), **kwargs={})
223    459         ....:     if work:
224    460         ....:         return 'foo worked'
225    461         ....:     raise RuntimeError("foo didn't work")
226    462         sage: foo(False)
227    463         Traceback (most recent call last):
228    464         ...
229    465         RuntimeError: foo didn't work
230    466         sage: foo(True)
231    467         'foo worked'
232    468         sage: foo(False)
233    469         sage: foo(True)
234    470     """
235    471     @wraps(func)
236    472     def wrapper(*args, **kwargs):
237    473         if not wrapper.has_run:
238--> 474             result = func(*args, **kwargs)
239        result = undefined
240        global func = undefined
241        args = (<sage.repl.interpreter.SageTerminalInteractiveShell object at 0x7f89b7da5510>,)
242        kwargs = {}
243    475             wrapper.has_run = True
244    476             return result
245    477     wrapper.has_run = False
246    478     return wrapper
247    479
248    480
249    481 @run_once
250    482 def load_ipython_extension(ip):
251    483     """
252    484     Load the extension in IPython.
253    485     """
254    486     # this modifies ip
255    487     SageCustomizations(shell=ip)
256
257/home/dima/Sage/sage/local/lib/python2.7/site-packages/sage/repl/ipython_extension.py in load_ipython_extension(ip=<sage.repl.interpreter.SageTerminalInteractiveShell object>)
258    472     def wrapper(*args, **kwargs):
259    473         if not wrapper.has_run:
260    474             result = func(*args, **kwargs)
261    475             wrapper.has_run = True
262    476             return result
263    477     wrapper.has_run = False
264    478     return wrapper
265    479
266    480
267    481 @run_once
268    482 def load_ipython_extension(ip):
269    483     """
270    484     Load the extension in IPython.
271    485     """
272    486     # this modifies ip
273--> 487     SageCustomizations(shell=ip)
274        global SageCustomizations = <class 'sage.repl.ipython_extension.SageCustomizations'>
275        global shell = undefined
276        ip = <sage.repl.interpreter.SageTerminalInteractiveShell object at 0x7f89b7da5510>
277
278/home/dima/Sage/sage/local/lib/python2.7/site-packages/sage/repl/ipython_extension.py in __init__(self=<sage.repl.ipython_extension.SageCustomizations object>, shell=<sage.repl.interpreter.SageTerminalInteractiveShell object>)
279    362     def __init__(self, shell=None):
280    363         """
281    364         Initialize the Sage plugin.
282    365         """
283    366         self.shell = shell
284    367
285    368         self.auto_magics = SageMagics(shell)
286    369         self.shell.register_magics(self.auto_magics)
287    370
288    371         import sage.misc.edit_module as edit_module
289    372         self.shell.set_hook('editor', edit_module.edit_devel)
290    373
291    374         self.init_inspector()
292    375         self.init_line_transforms()
293    376
294--> 377         import sage.all # until sage's import hell is fixed
295        sage.all = undefined
296    378
297    379         self.shell.verbose_quit = True
298    380         self.set_quit_hook()
299    381
300    382         self.register_interface_magics()
301    383
302    384         if SAGE_IMPORTALL == 'yes':
303    385             self.init_environment()
304    386
305    387     def register_interface_magics(self):
306    388         """
307    389         Register magics for each of the Sage interfaces
308    390         """
309    391         from sage.repl.interface_magic import InterfaceMagic
310    392         InterfaceMagic.register_all(self.shell)
311
312/home/dima/Sage/sage/local/lib/python2.7/site-packages/sage/all.py in <module>()
313     88
314     89 from time                import sleep
315     90
316     91 import sage.misc.lazy_import
317     92 from sage.misc.all       import *         # takes a while
318     93 from sage.typeset.all    import *
319     94 from sage.repl.all       import *
320     95
321     96 from sage.misc.sh import sh
322     97
323     98 from sage.libs.all       import *
324     99 from sage.data_structures.all import *
325    100 from sage.doctest.all    import *
326    101
327    102 from sage.structure.all  import *
328--> 103 from sage.rings.all      import *
329        global sage.rings.all = undefined
330    104 from sage.arith.all      import *
331    105 from sage.matrix.all     import *
332    106
333    107 # This must come before Calculus -- it initializes the Pynac library.
334    108 import sage.symbolic.pynac
335    109
336    110 from sage.modules.all    import *
337    111 from sage.monoids.all    import *
338    112 from sage.algebras.all   import *
339    113 from sage.modular.all    import *
340    114 from sage.sat.all        import *
341    115 from sage.schemes.all    import *
342    116 from sage.graphs.all     import *
343    117 from sage.groups.all     import *
344    118 from sage.databases.all  import *
345
346/home/dima/Sage/sage/local/lib/python2.7/site-packages/sage/rings/all.py in <module>()
347     39
348     40 # Rational numbers
349     41 from .rational_field import RationalField, QQ
350     42 from .rational import Rational
351     43 Rationals = RationalField
352     44
353     45 # Integers modulo n.
354     46 from sage.rings.finite_rings.integer_mod_ring import IntegerModRing, Zmod
355     47 from sage.rings.finite_rings.integer_mod import IntegerMod, Mod, mod
356     48 Integers = IntegerModRing
357     49
358     50 # Finite fields
359     51 from .finite_rings.all import *
360     52
361     53 # Number field
362---> 54 from .number_field.all import *
363        global number_field.all = undefined
364     55
365     56 # Function field
366     57 from .function_field.all import *
367     58
368     59 # Finite residue fields
369     60 from .finite_rings.residue_field import ResidueField
370     61
371     62 # p-adic field
372     63 from .padics.all import *
373     64 from .padics.padic_printing import _printer_defaults as padic_printing
374     65
375     66 # Semirings
376     67 from .semirings.all import *
377     68
378     69 # Real numbers
379
380/home/dima/Sage/sage/local/lib/python2.7/site-packages/sage/rings/number_field/all.py in <module>()
381      1 from __future__ import absolute_import
382      2
383      3 from .number_field import (NumberField, NumberFieldTower, CyclotomicField, QuadraticField,
384      4                           is_fundamental_discriminant)
385      5 from .number_field_element import NumberFieldElement
386      6
387      7 from .order import EquationOrder, GaussianIntegers, EisensteinIntegers
388      8
389----> 9 from .totallyreal import enumerate_totallyreal_fields_prim
390        global totallyreal = undefined
391        global enumerate_totallyreal_fields_prim = undefined
392     10 from .totallyreal_data import hermite_constant
393     11 from .totallyreal_rel import enumerate_totallyreal_fields_all, enumerate_totallyreal_fields_rel
394     12
395     13 from .unit_group import UnitGroup
396
397/home/dima/Sage/sage/local/lib/python2.7/site-packages/sage/rings/number_field/totallyreal_data.pxd in init sage.rings.number_field.totallyreal (/home/dima/Sage/sage/src/build/cythonized/sage/rings/number_field/totallyreal.c:12101)()
398      1 cdef double eval_seq_as_poly(int *f, int n, double x)
399      2 cdef double newton(int *f, int *df, int n, double x0, double eps)
400      3 cdef void newton_in_intervals(int *f, int *df, int n, double *beta, double eps, double *rts)
401      4 cpdef lagrange_degree_3(int n, int an1, int an2, int an3)
402      5
403      6 cimport sage.rings.integer
404      7
405      8 cdef int eval_seq_as_poly_int(int *f, int n, int x)
406      9
407     10 cdef int easy_is_irreducible(int *a, int n)
408     11
409---> 12 cdef class tr_data:
410        global cdef = undefined
411        global tr_data = undefined
412     13
413     14     cdef int n, k
414     15     cdef double B
415     16     cdef double b_lower, b_upper, gamma
416     17
417     18     cdef int *a
418     19     cdef int *amax
419     20     cdef double *beta
420     21     cdef int *gnk
421     22
422     23     cdef int *df
423     24
424     25     cdef void incr(self, int *f_out, int verbose, int haltk, int phc)
425     26
426
427/home/dima/Sage/sage/src/sage/rings/number_field/totallyreal_data.pyx in init sage.rings.number_field.totallyreal_data (/home/dima/Sage/sage/src/build/cythonized/sage/rings/number_field/totallyreal_data.c:12852)()
428     24 #*****************************************************************************
429     25 from __future__ import print_function
430     26
431     27 include "sage/ext/cdefs.pxi"
432     28 include "cysignals/memory.pxi"
433     29
434     30 from sage.arith.all import binomial, gcd
435     31 from sage.rings.rational_field import RationalField
436     32 from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
437     33 from sage.rings.real_mpfi import RealIntervalField
438     34 from sage.rings.real_mpfr import RealField
439     35 from sage.rings.integer_ring import ZZ
440     36 from sage.rings.integer cimport Integer
441     37
442     38 # Other global variables
443---> 39 ZZx = PolynomialRing(ZZ, 'x')
444        global ZZx = undefined
445        global PolynomialRing = <function PolynomialRing at 0x7f88ad0cd9b0>
446        global ZZ = Integer Ring
447     40
448     41 from libc.math cimport lrint, floor, ceil, fabs, round
449     42
450     43
451     44 #*********************************************************************
452     45 # Auxiliary routine
453     46 # Hermite constant, naive Newton-Raphson, and a specialized Lagrange
454     47 # multiplier solver.
455     48 #*********************************************************************
456     49
457     50 def hermite_constant(n):
458     51     r"""
459     52     This function returns the nth Hermite constant
460     53
461     54     The nth Hermite constant (typically denoted `\gamma_n`), is defined
462
463/home/dima/Sage/sage/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py in PolynomialRing(base_ring=Integer Ring, arg1='x', arg2=None, sparse=False, order='degrevlex', names=None, name='x', var_array=None, implementation=None)
464    446         arg2 = [str(x) for x in arg2]
465    447     if isinstance(arg2, (int, long, Integer)):
466    448         # 3. PolynomialRing(base_ring, names, n, order='degrevlex'):
467    449         if not isinstance(arg1, (list, tuple, str)):
468    450             raise TypeError("You *must* specify the names of the variables.")
469    451         n = int(arg2)
470    452         names = arg1
471    453         R = _multi_variate(base_ring, names, n, sparse, order, implementation)
472    454
473    455     elif isinstance(arg1, str) or (isinstance(arg1, (list,tuple)) and len(arg1) == 1):
474    456         if not ',' in arg1:
475    457             # 1. PolynomialRing(base_ring, name, sparse=False):
476    458             if not arg2 is None:
477    459                 raise TypeError("if second arguments is a string with no commas, then there must be no other non-optional arguments")
478    460             name = arg1
479--> 461             R = _single_variate(base_ring, name, sparse, implementation)
480        R = None
481        global _single_variate = <function _single_variate at 0x7f88ad0cdc08>
482        base_ring = Integer Ring
483        name = 'x'
484        sparse = False
485        implementation = None
486    462         else:
487    463             # 2-4. PolynomialRing(base_ring, names, order='degrevlex'):
488    464             if not arg2 is None:
489    465                 raise TypeError("invalid input to PolynomialRing function; please see the docstring for that function")
490    466             names = arg1.split(',')
491    467             R = _multi_variate(base_ring, names, -1, sparse, order, implementation)
492    468     elif isinstance(arg1, (list, tuple)):
493    469             # PolynomialRing(base_ring, names (list or tuple), order='degrevlex'):
494    470             names = arg1
495    471             R = _multi_variate(base_ring, names, -1, sparse, order, implementation)
496    472
497    473     if arg1 is None and arg2 is None:
498    474         raise TypeError("you *must* specify the indeterminates (as not None).")
499    475     if R is None:
500    476         raise TypeError("invalid input (%s, %s, %s) to PolynomialRing function; please see the docstring for that function"%(
501
502/home/dima/Sage/sage/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py in _single_variate(base_ring=Integer Ring, name=('x',), sparse=False, implementation=None)
503    524             R = m.PolynomialRing_dense_padic_ring_capped_absolute(base_ring, name)
504    525
505    526         elif isinstance(base_ring, padic_base_leaves.pAdicRingFixedMod):
506    527             R = m.PolynomialRing_dense_padic_ring_fixed_mod(base_ring, name)
507    528
508    529         elif base_ring in _CompleteDiscreteValuationRings:
509    530             R = m.PolynomialRing_cdvr(base_ring, name, sparse)
510    531
511    532         elif base_ring in _CompleteDiscreteValuationFields:
512    533             R = m.PolynomialRing_cdvf(base_ring, name, sparse)
513    534
514    535         elif base_ring.is_field(proof = False):
515    536             R = m.PolynomialRing_field(base_ring, name, sparse)
516    537
517    538         elif base_ring.is_integral_domain(proof = False):
518--> 539             R = m.PolynomialRing_integral_domain(base_ring, name, sparse, implementation)
519        R = None
520        m.PolynomialRing_integral_domain = <class 'sage.rings.polynomial.polynomial_ring.PolynomialRing_integral_domain'>
521        base_ring = Integer Ring
522        name = ('x',)
523        sparse = False
524        implementation = None
525    540         else:
526    541             R = m.PolynomialRing_commutative(base_ring, name, sparse)
527    542     else:
528    543         R = m.PolynomialRing_general(base_ring, name, sparse)
529    544
530    545     if hasattr(R, '_implementation_names'):
531    546         for name in R._implementation_names:
532    547             real_key = key[0:3] + (name,)
533    548             _save_in_cache(real_key, R)
534    549     else:
535    550         _save_in_cache(key, R)
536    551     return R
537    552
538    553 def _multi_variate(base_ring, names, n, sparse, order, implementation):
539    554 #    if not sparse:
540
541/home/dima/Sage/sage/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring.py in __init__(self=Univariate Polynomial Ring in x over Integer Ring, base_ring=Integer Ring, name=('x',), sparse=False, implementation=None, element_class=<type 'sage.rings.polynomial.polynomial_integer_dense_flint.Polynomial_integer_dense_flint'>, category=None)
542   1531             if is_IntegerRing(base_ring) and not sparse:
543   1532                 if implementation == 'NTL':
544   1533                     from sage.rings.polynomial.polynomial_integer_dense_ntl \
545   1534                             import Polynomial_integer_dense_ntl
546   1535                     element_class = Polynomial_integer_dense_ntl
547   1536                     self._implementation_names = ('NTL',)
548   1537                     self._implementation_repr = ' (using NTL)'
549   1538                 elif implementation == 'FLINT' or implementation is None:
550   1539                     from sage.rings.polynomial.polynomial_integer_dense_flint \
551   1540                             import Polynomial_integer_dense_flint
552   1541                     element_class = Polynomial_integer_dense_flint
553   1542                     self._implementation_names = (None, 'FLINT')
554   1543                 else:
555   1544                     raise ValueError("Unknown implementation %s for ZZ[x]"%implementation)
556   1545         PolynomialRing_commutative.__init__(self, base_ring, name=name,
557-> 1546                 sparse=sparse, element_class=element_class, category=category)
558        sparse = False
559        element_class = <type 'sage.rings.polynomial.polynomial_integer_dense_flint.Polynomial_integer_dense_flint'>
560        category = None
561   1547
562   1548     def _repr_(self):
563   1549         """
564   1550         TESTS::
565   1551
566   1552             sage: from sage.rings.polynomial.polynomial_ring import PolynomialRing_integral_domain as PRing
567   1553             sage: R = PRing(ZZ, 'x', implementation='NTL'); R
568   1554             Univariate Polynomial Ring in x over Integer Ring (using NTL)
569   1555         """
570   1556         s = PolynomialRing_commutative._repr_(self)
571   1557         return s + self._implementation_repr
572   1558
573   1559
574   1560 class PolynomialRing_field(PolynomialRing_integral_domain,
575   1561                            PolynomialRing_singular_repr,
576
577/home/dima/Sage/sage/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring.py in __init__(self=Univariate Polynomial Ring in x over Integer Ring, base_ring=Integer Ring, name=('x',), sparse=False, element_class=<type 'sage.rings.polynomial.polynomial_integer_dense_flint.Polynomial_integer_dense_flint'>, category=Join of Category of unique factorization domains...s and infinite enumerated sets and metric spaces))
578   1438         if max_degree is not None and of_degree is None:
579   1439             return self._monics_max( max_degree )
580   1440         raise ValueError("you should pass exactly one of of_degree and max_degree")
581   1441
582   1442 class PolynomialRing_commutative(PolynomialRing_general, commutative_algebra.CommutativeAlgebra):
583   1443     """
584   1444     Univariate polynomial ring over a commutative ring.
585   1445     """
586   1446     def __init__(self, base_ring, name=None, sparse=False, element_class=None, category=None):
587   1447         if base_ring not in _CommutativeRings:
588   1448             raise TypeError("Base ring %s must be a commutative ring."%repr(base_ring))
589   1449         # We trust that, if a category is given, that it is useful.
590   1450         if category is None:
591   1451             category = polynomial_default_category(base_ring.category(),False)
592   1452         PolynomialRing_general.__init__(self, base_ring, name=name,
593-> 1453                 sparse=sparse, element_class=element_class, category=category)
594        sparse = False
595        element_class = <type 'sage.rings.polynomial.polynomial_integer_dense_flint.Polynomial_integer_dense_flint'>
596        category = Join of Category of unique factorization domains and Category of commutative algebras over (euclidean domains and infinite enumerated sets and metric spaces)
597   1454
598   1455     def quotient_by_principal_ideal(self, f, names=None):
599   1456         """
600   1457         Return the quotient of this polynomial ring by the principal
601   1458         ideal (generated by) `f`.
602   1459
603   1460         INPUT:
604   1461
605   1462         - ``f`` - either a polynomial in ``self``, or a principal
606   1463           ideal of ``self``.
607   1464
608   1465         EXAMPLES::
609   1466
610   1467             sage: R.<x> = QQ[]
611   1468             sage: I = (x^2-1)*R
612
613/home/dima/Sage/sage/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring.py in __init__(self=Univariate Polynomial Ring in x over Integer Ring, base_ring=Integer Ring, name=('x',), sparse=False, element_class=<type 'sage.rings.polynomial.polynomial_integer_dense_flint.Polynomial_integer_dense_flint'>, category=Join of Category of unique factorization domains...s and infinite enumerated sets and metric spaces))
614    274         self._has_singular = False
615    275         # Algebra.__init__ also calls __init_extra__ of Algebras(...).parent_class, which
616    276         # tries to provide a conversion from the base ring, if it does not exist.
617    277         # This is for algebras that only do the generic stuff in their initialisation.
618    278         # But the attribute _no_generic_basering_coercion prevents that from happening,
619    279         # since we want to use PolynomialBaseringInjection.
620    280         sage.algebras.algebra.Algebra.__init__(self, base_ring, names=name, normalize=True, category=category)
621    281         self.__generator = self.element_class(self, [0,1], is_gen=True)
622    282         self._populate_coercion_lists_(
623    283                 #coerce_list = [base_inject],
624    284                 #convert_list = [list, base_inject],
625    285                 convert_method_name = '_polynomial_')
626    286         if is_PolynomialRing(base_ring):
627    287             self._Karatsuba_threshold = 0
628    288         else:
629--> 289             from sage.matrix.matrix_space import MatrixSpace
630        global sage.matrix.matrix_space = undefined
631        MatrixSpace = undefined
632    290             if isinstance(base_ring, MatrixSpace):
633    291                 self._Karatsuba_threshold = 0
634    292             else:
635    293                 self._Karatsuba_threshold = 8
636    294
637    295     def __reduce__(self):
638    296         import sage.rings.polynomial.polynomial_ring_constructor
639    297         return (sage.rings.polynomial.polynomial_ring_constructor.PolynomialRing,
640    298                 (self.base_ring(), self.variable_name(), None, self.is_sparse()))
641    299
642    300
643    301     def _element_constructor_(self, x=None, check=True, is_gen = False, construct=False, **kwds):
644    302         r"""
645    303         Convert ``x`` into this univariate polynomial ring,
646    304         possibly non-canonically.
647
648/home/dima/Sage/sage/local/lib/python2.7/site-packages/sage/matrix/matrix_space.py in <module>()
649     43 from . import matrix
650     44 from . import matrix_generic_dense
651     45 from . import matrix_generic_sparse
652     46
653     47 from . import matrix_modn_sparse
654     48
655     49 from . import matrix_mod2_dense
656     50 from . import matrix_gf2e_dense
657     51
658     52 from . import matrix_integer_dense
659     53 from . import matrix_integer_sparse
660     54
661     55 from . import matrix_rational_dense
662     56 from . import matrix_rational_sparse
663     57
664---> 58 from . import matrix_mpolynomial_dense
665        global matrix_mpolynomial_dense = undefined
666     59
667     60 # Sage imports
668     61 from sage.misc.superseded import deprecation
669     62 import sage.structure.coerce
670     63 import sage.structure.parent_gens as parent_gens
671     64 from sage.structure.unique_representation import UniqueRepresentation
672     65 import sage.rings.integer as integer
673     66 import sage.rings.number_field.all
674     67 import sage.rings.finite_rings.integer_mod_ring
675     68 import sage.rings.finite_rings.finite_field_constructor
676     69 import sage.rings.polynomial.multi_polynomial_ring_generic
677     70 import sage.misc.latex as latex
678     71 import sage.modules.free_module
679     72 from sage.structure.sequence import Sequence
680     73
681
682/home/dima/Sage/sage/local/lib/python2.7/site-packages/sage/rings/polynomial/multi_polynomial_libsingular.pxd in init sage.matrix.matrix_mpolynomial_dense (/home/dima/Sage/sage/src/build/cythonized/sage/matrix/matrix_mpolynomial_dense.cpp:9213)()
683      1 from sage.libs.singular.decl cimport poly, ring
684      2
685      3 from sage.rings.polynomial.multi_polynomial cimport MPolynomial
686      4 from sage.rings.polynomial.multi_polynomial_ring_generic cimport MPolynomialRing_generic
687      5
688----> 6 cdef class MPolynomialRing_libsingular
689        global cdef = undefined
690        global MPolynomialRing_libsingular = undefined
691      7
692      8 cdef class MPolynomial_libsingular(MPolynomial):
693      9     cdef poly *_poly
694     10     cdef ring *_parent_ring
695     11     cpdef _repr_short_(self)
696     12     cpdef is_constant(self)
697     13     cpdef _homogenize(self, int var)
698     14     cpdef MPolynomial_libsingular _new_constant_poly(self, x, MPolynomialRing_libsingular P)
699     15
700     16 cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
701     17     cdef object __singular
702     18     cdef object __macaulay2
703     19     cdef object __m2_set_ring_cache
704     20     cdef object __minpoly
705     21     cdef poly *_one_element_poly
706     22     cdef ring *_ring
707     23
708     24 # new polynomials
709     25 cdef MPolynomial_libsingular new_MP(MPolynomialRing_libsingular parent, poly *p)
710
711/home/dima/Sage/sage/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx in init sage.rings.polynomial.multi_polynomial_libsingular (/home/dima/Sage/sage/src/build/cythonized/sage/rings/polynomial/multi_polynomial_libsingular.cpp:48339)()
712----> 1 r"""
713      2 Multivariate Polynomials via libSINGULAR
714      3
715      4 This module implements specialized and optimized implementations for
716      5 multivariate polynomials over many coefficient rings, via a shared library
717      6 interface to SINGULAR. In particular, the following coefficient rings are
718      7 supported by this implementation:
719      8
720      9 - the rational numbers `\QQ`,
721     10
722     11 - the ring of integers `\ZZ`,
723     12
724     13 - `\ZZ/n\ZZ` for any integer `n`,
725     14
726     15 - finite fields `\GF{p^n}` for `p` prime and `n > 0`,
727     16
728     17 - and absolute number fields `\QQ(a)`.
729     18
730     19 AUTHORS:
731     20
732     21 The libSINGULAR interface was implemented by
733     22
734     23 - Martin Albrecht (2007-01): initial implementation
735     24
736     25 - Joel Mohler (2008-01): misc improvements, polishing
737     26
738     27 - Martin Albrecht (2008-08): added `\QQ(a)` and `\ZZ` support
739     28
740     29 - Simon King (2009-04): improved coercion
741     30
742     31 - Martin Albrecht (2009-05): added `\ZZ/n\ZZ` support, refactoring
743
744/home/dima/Sage/sage/src/sage/libs/singular/singular.pyx in init sage.libs.singular.singular (/home/dima/Sage/sage/src/build/cythonized/sage/libs/singular/singular.cpp:10720)()
745    788     singular_options = singular_options | Sy_bit(OPT_REDSB) | Sy_bit(OPT_INTSTRATEGY) | Sy_bit(OPT_REDTAIL) | Sy_bit(OPT_REDTHROUGH)
746    789     global _saved_options
747    790     global _saved_verbose_options
748    791     _saved_options = (int(singular_options), 0, 0)
749    792     _saved_verbose_options = int(singular_verbose_options)
750    793
751    794     #On(SW_USE_NTL)
752    795     On(SW_USE_EZGCD)
753    796     Off(SW_USE_NTL_SORT)
754    797
755    798     WerrorS_callback = libsingular_error_callback
756    799
757    800     error_messages = []
758    801
759    802 # call the init routine
760--> 803 init_libsingular()
761        global init_libsingular = undefined
762    804
763    805 cdef void libsingular_error_callback(const_char_ptr s):
764    806     _s = s
765    807     error_messages.append(_s)
766
767/home/dima/Sage/sage/src/sage/libs/singular/singular.pyx in sage.libs.singular.singular.init_libsingular (/home/dima/Sage/sage/src/build/cythonized/sage/libs/singular/singular.cpp:8515)()
768    765     cdef void *handle = NULL
769    766
770    767     libSingularFound = False
771    768
772    769     for extension in ["so", "dylib", "dll"]:
773    770         lib = os.environ['SAGE_LOCAL']+"/lib/libsingular."+extension
774    771         if os.path.exists(lib):
775    772             handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY)
776    773             if not handle:
777    774                 err = dlerror()
778    775                 if err:
779    776                     print(err)
780    777             break
781    778
782    779     if handle == NULL:
783--> 780         raise ImportError("cannot load libSINGULAR library")
784        global ImportError = undefined
785    781
786    782     # load SINGULAR
787    783     siInit(lib)
788    784
789    785     dlclose(handle)
790    786
791    787     # we set and save some global Singular options
792    788     singular_options = singular_options | Sy_bit(OPT_REDSB) | Sy_bit(OPT_INTSTRATEGY) | Sy_bit(OPT_REDTAIL) | Sy_bit(OPT_REDTHROUGH)
793    789     global _saved_options
794    790     global _saved_verbose_options
795    791     _saved_options = (int(singular_options), 0, 0)
796    792     _saved_verbose_options = int(singular_verbose_options)
797    793
798    794     #On(SW_USE_NTL)
799    795     On(SW_USE_EZGCD)
800
801ImportError: cannot load libSINGULAR library
802
803***************************************************************************
804
805History of session input:
806*** Last line of input (may not be in above history):