spacepaste

  1.  
  2. ***************************************************************************
  3. IPython post-mortem report
  4. {'commit_hash': u'c963f6b',
  5. 'commit_source': 'installation',
  6. 'default_encoding': 'UTF-8',
  7. 'ipython_path': '/usr/lib64/python2.7/site-packages/IPython',
  8. 'ipython_version': '4.2.0',
  9. 'os_name': 'posix',
  10. 'platform': 'Linux-4.7.5-gentoo-x86_64-Mobile_AMD_Sempron-tm-_Processor_3800+-with-gentoo-2.3',
  11. 'sys_executable': '/usr/bin/python2.7',
  12. 'sys_platform': 'linux2',
  13. 'sys_version': '2.7.12 (default, Sep 28 2016, 11:37:31) \n[GCC 5.4.0]'}
  14. ***************************************************************************
  15. ***************************************************************************
  16. Crash traceback:
  17. ---------------------------------------------------------------------------
  18. ---------------------------------------------------------------------------
  19. ImportError Python 2.7.12: /usr/bin/python2.7
  20. Tue Oct 11 14:26:08 2016
  21. A problem occurred executing Python code. Here is the sequence of function
  22. calls leading up to the error, with the most recent (innermost) call last.
  23. /usr/lib/python-exec/python2.7/sage-ipython in <module>()
  24. 1 #!/usr/bin/env python2.7
  25. 2 # -*- coding: utf-8 -*-
  26. 3 """
  27. 4 Sage IPython startup script.
  28. 5 """
  29. 6
  30. 7 # Install extra readline commands before IPython initialization
  31. 8 from sage.repl.readline_extra_commands import *
  32. 9
  33. 10 from sage.repl.interpreter import SageTerminalApp
  34. 11
  35. 12 app = SageTerminalApp.instance()
  36. ---> 13 app.initialize()
  37. global app.initialize = <bound method SageTerminalApp.initialize of <sage.repl.interpreter.SageTerminalApp object at 0x7f2c139b62d0>>
  38. 14 app.start()
  39. <decorator-gen-111> in initialize(self=<sage.repl.interpreter.SageTerminalApp object>, argv=None)
  40. /usr/lib64/python2.7/site-packages/traitlets/config/application.pyc in catch_config_error(method=<function initialize>, app=<sage.repl.interpreter.SageTerminalApp object>, *args=(None,), **kwargs={})
  41. 72 TRAITLETS_APPLICATION_RAISE_CONFIG_FILE_ERROR = False
  42. 73 else:
  43. 74 raise ValueError("Unsupported value for environment variable: 'TRAITLETS_APPLICATION_RAISE_CONFIG_FILE_ERROR' is set to '%s' which is none of {'0', '1', 'false', 'true', ''}."% _envvar )
  44. 75
  45. 76
  46. 77 @decorator
  47. 78 def catch_config_error(method, app, *args, **kwargs):
  48. 79 """Method decorator for catching invalid config (Trait/ArgumentErrors) during init.
  49. 80
  50. 81 On a TraitError (generally caused by bad config), this will print the trait's
  51. 82 message, and exit the app.
  52. 83
  53. 84 For use on init methods, to prevent invoking excepthook on invalid input.
  54. 85 """
  55. 86 try:
  56. ---> 87 return method(app, *args, **kwargs)
  57. method = <function initialize at 0x7f2c0c9c80c8>
  58. app = <sage.repl.interpreter.SageTerminalApp object at 0x7f2c139b62d0>
  59. args = (None,)
  60. kwargs = {}
  61. 88 except (TraitError, ArgumentError) as e:
  62. 89 app.print_help()
  63. 90 app.log.fatal("Bad config encountered during initialization:")
  64. 91 app.log.fatal(str(e))
  65. 92 app.log.debug("Config at the time: %s", app.config)
  66. 93 app.exit(1)
  67. 94
  68. 95
  69. 96 class ApplicationError(Exception):
  70. 97 pass
  71. 98
  72. 99
  73. 100 class LevelFormatter(logging.Formatter):
  74. 101 """Formatter with additional `highlevel` record
  75. 102
  76. /usr/lib64/python2.7/site-packages/IPython/terminal/ipapp.pyc in initialize(self=<sage.repl.interpreter.SageTerminalApp object>, argv=None)
  77. 290
  78. 291 return super(TerminalIPythonApp, self).parse_command_line(argv)
  79. 292
  80. 293 @catch_config_error
  81. 294 def initialize(self, argv=None):
  82. 295 """Do actions after construct, but before starting the app."""
  83. 296 super(TerminalIPythonApp, self).initialize(argv)
  84. 297 if self.subapp is not None:
  85. 298 # don't bother initializing further, starting subapp
  86. 299 return
  87. 300 # print self.extra_args
  88. 301 if self.extra_args and not self.something_to_run:
  89. 302 self.file_to_run = self.extra_args[0]
  90. 303 self.init_path()
  91. 304 # create the shell
  92. --> 305 self.init_shell()
  93. self.init_shell = <bound method SageTerminalApp.init_shell of <sage.repl.interpreter.SageTerminalApp object at 0x7f2c139b62d0>>
  94. 306 # and draw the banner
  95. 307 self.init_banner()
  96. 308 # Now a variety of things that happen after the banner is printed.
  97. 309 self.init_gui_pylab()
  98. 310 self.init_extensions()
  99. 311 self.init_code()
  100. 312
  101. 313 def init_shell(self):
  102. 314 """initialize the InteractiveShell instance"""
  103. 315 # Create an InteractiveShell instance.
  104. 316 # shell.display_banner should always be False for the terminal
  105. 317 # based app, because we call shell.show_banner() by hand below
  106. 318 # so the banner shows *before* all extension loading stuff.
  107. 319 self.shell = TerminalInteractiveShell.instance(parent=self,
  108. 320 display_banner=False, profile_dir=self.profile_dir,
  109. /usr/lib64/python2.7/site-packages/sage/repl/interpreter.pyc in init_shell(self=<sage.repl.interpreter.SageTerminalApp object>)
  110. 783 self.shell.has_sage_extensions = SAGE_EXTENSION in self.extensions
  111. 784
  112. 785 # Load the %lprun extension if available
  113. 786 try:
  114. 787 import line_profiler
  115. 788 except ImportError:
  116. 789 pass
  117. 790 else:
  118. 791 self.extensions.append('line_profiler')
  119. 792
  120. 793 if self.shell.has_sage_extensions:
  121. 794 self.extensions.remove(SAGE_EXTENSION)
  122. 795
  123. 796 # load sage extension here to get a crash if
  124. 797 # something is wrong with the sage library
  125. --> 798 self.shell.extension_manager.load_extension(SAGE_EXTENSION)
  126. self.shell.extension_manager.load_extension = <bound method ExtensionManager.load_extension of <IPython.core.extensions.ExtensionManager object at 0x7f2c0c0db050>>
  127. global SAGE_EXTENSION = 'sage'
  128. 799
  129. 800
  130. /usr/lib64/python2.7/site-packages/IPython/core/extensions.pyc in load_extension(self=<IPython.core.extensions.ExtensionManager object>, module_str='sage')
  131. 71
  132. 72 Returns the string "already loaded" if the extension is already loaded,
  133. 73 "no load function" if the module doesn't have a load_ipython_extension
  134. 74 function, or None if it succeeded.
  135. 75 """
  136. 76 if module_str in self.loaded:
  137. 77 return "already loaded"
  138. 78
  139. 79 from IPython.utils.syspathcontext import prepended_to_syspath
  140. 80
  141. 81 with self.shell.builtin_trap:
  142. 82 if module_str not in sys.modules:
  143. 83 with prepended_to_syspath(self.ipython_extension_dir):
  144. 84 __import__(module_str)
  145. 85 mod = sys.modules[module_str]
  146. ---> 86 if self._call_load_ipython_extension(mod):
  147. self._call_load_ipython_extension = <bound method ExtensionManager._call_load_ipython_extension of <IPython.core.extensions.ExtensionManager object at 0x7f2c0c0db050>>
  148. mod = <module 'sage' from '/usr/lib64/python2.7/site-packages/sage/__init__.pyc'>
  149. 87 self.loaded.add(module_str)
  150. 88 else:
  151. 89 return "no load function"
  152. 90
  153. 91 def unload_extension(self, module_str):
  154. 92 """Unload an IPython extension by its module name.
  155. 93
  156. 94 This function looks up the extension's name in ``sys.modules`` and
  157. 95 simply calls ``mod.unload_ipython_extension(self)``.
  158. 96
  159. 97 Returns the string "no unload function" if the extension doesn't define
  160. 98 a function to unload itself, "not loaded" if the extension isn't loaded,
  161. 99 otherwise None.
  162. 100 """
  163. 101 if module_str not in self.loaded:
  164. /usr/lib64/python2.7/site-packages/IPython/core/extensions.pyc in _call_load_ipython_extension(self=<IPython.core.extensions.ExtensionManager object>, mod=<module 'sage' from '/usr/lib64/python2.7/site-packages/sage/__init__.pyc'>)
  165. 118 """
  166. 119 from IPython.utils.syspathcontext import prepended_to_syspath
  167. 120
  168. 121 if (module_str in self.loaded) and (module_str in sys.modules):
  169. 122 self.unload_extension(module_str)
  170. 123 mod = sys.modules[module_str]
  171. 124 with prepended_to_syspath(self.ipython_extension_dir):
  172. 125 reload(mod)
  173. 126 if self._call_load_ipython_extension(mod):
  174. 127 self.loaded.add(module_str)
  175. 128 else:
  176. 129 self.load_extension(module_str)
  177. 130
  178. 131 def _call_load_ipython_extension(self, mod):
  179. 132 if hasattr(mod, 'load_ipython_extension'):
  180. --> 133 mod.load_ipython_extension(self.shell)
  181. mod.load_ipython_extension = <function load_ipython_extension at 0x7f2c139a98c0>
  182. self.shell = <sage.repl.interpreter.SageTerminalInteractiveShell object at 0x7f2c0c9d8510>
  183. 134 return True
  184. 135
  185. 136 def _call_unload_ipython_extension(self, mod):
  186. 137 if hasattr(mod, 'unload_ipython_extension'):
  187. 138 mod.unload_ipython_extension(self.shell)
  188. 139 return True
  189. 140
  190. 141 def install_extension(self, url, filename=None):
  191. 142 """Download and install an IPython extension.
  192. 143
  193. 144 If filename is given, the file will be so named (inside the extension
  194. 145 directory). Otherwise, the name from the URL will be used. The file must
  195. 146 have a .py or .zip extension; otherwise, a ValueError will be raised.
  196. 147
  197. 148 Returns the full path to the installed file.
  198. /usr/lib64/python2.7/site-packages/sage/__init__.pyc in load_ipython_extension(*args=(<sage.repl.interpreter.SageTerminalInteractiveShell object>,))
  199. 1 __all__ = ['all']
  200. 2
  201. 3 # IPython calls this when starting up
  202. 4 def load_ipython_extension(*args):
  203. 5 import sage.repl.ipython_extension
  204. ----> 6 sage.repl.ipython_extension.load_ipython_extension(*args)
  205. sage.repl.ipython_extension.load_ipython_extension = <function load_ipython_extension at 0x7f2c0c071b18>
  206. args = (<sage.repl.interpreter.SageTerminalInteractiveShell object at 0x7f2c0c9d8510>,)
  207. /usr/lib64/python2.7/site-packages/sage/repl/ipython_extension.pyc in wrapper(*args=(<sage.repl.interpreter.SageTerminalInteractiveShell object>,), **kwargs={})
  208. 459 ....: if work:
  209. 460 ....: return 'foo worked'
  210. 461 ....: raise RuntimeError("foo didn't work")
  211. 462 sage: foo(False)
  212. 463 Traceback (most recent call last):
  213. 464 ...
  214. 465 RuntimeError: foo didn't work
  215. 466 sage: foo(True)
  216. 467 'foo worked'
  217. 468 sage: foo(False)
  218. 469 sage: foo(True)
  219. 470 """
  220. 471 @wraps(func)
  221. 472 def wrapper(*args, **kwargs):
  222. 473 if not wrapper.has_run:
  223. --> 474 result = func(*args, **kwargs)
  224. result = undefined
  225. global func = undefined
  226. args = (<sage.repl.interpreter.SageTerminalInteractiveShell object at 0x7f2c0c9d8510>,)
  227. kwargs = {}
  228. 475 wrapper.has_run = True
  229. 476 return result
  230. 477 wrapper.has_run = False
  231. 478 return wrapper
  232. 479
  233. 480
  234. 481 @run_once
  235. 482 def load_ipython_extension(ip):
  236. 483 """
  237. 484 Load the extension in IPython.
  238. 485 """
  239. 486 # this modifies ip
  240. 487 SageCustomizations(shell=ip)
  241. /usr/lib64/python2.7/site-packages/sage/repl/ipython_extension.pyc in load_ipython_extension(ip=<sage.repl.interpreter.SageTerminalInteractiveShell object>)
  242. 472 def wrapper(*args, **kwargs):
  243. 473 if not wrapper.has_run:
  244. 474 result = func(*args, **kwargs)
  245. 475 wrapper.has_run = True
  246. 476 return result
  247. 477 wrapper.has_run = False
  248. 478 return wrapper
  249. 479
  250. 480
  251. 481 @run_once
  252. 482 def load_ipython_extension(ip):
  253. 483 """
  254. 484 Load the extension in IPython.
  255. 485 """
  256. 486 # this modifies ip
  257. --> 487 SageCustomizations(shell=ip)
  258. global SageCustomizations = <class 'sage.repl.ipython_extension.SageCustomizations'>
  259. global shell = undefined
  260. ip = <sage.repl.interpreter.SageTerminalInteractiveShell object at 0x7f2c0c9d8510>
  261. /usr/lib64/python2.7/site-packages/sage/repl/ipython_extension.pyc in __init__(self=<sage.repl.ipython_extension.SageCustomizations object>, shell=<sage.repl.interpreter.SageTerminalInteractiveShell object>)
  262. 362 def __init__(self, shell=None):
  263. 363 """
  264. 364 Initialize the Sage plugin.
  265. 365 """
  266. 366 self.shell = shell
  267. 367
  268. 368 self.auto_magics = SageMagics(shell)
  269. 369 self.shell.register_magics(self.auto_magics)
  270. 370
  271. 371 import sage.misc.edit_module as edit_module
  272. 372 self.shell.set_hook('editor', edit_module.edit_devel)
  273. 373
  274. 374 self.init_inspector()
  275. 375 self.init_line_transforms()
  276. 376
  277. --> 377 import sage.all # until sage's import hell is fixed
  278. sage.all = undefined
  279. 378
  280. 379 self.shell.verbose_quit = True
  281. 380 self.set_quit_hook()
  282. 381
  283. 382 self.register_interface_magics()
  284. 383
  285. 384 if SAGE_IMPORTALL == 'yes':
  286. 385 self.init_environment()
  287. 386
  288. 387 def register_interface_magics(self):
  289. 388 """
  290. 389 Register magics for each of the Sage interfaces
  291. 390 """
  292. 391 from sage.repl.interface_magic import InterfaceMagic
  293. 392 InterfaceMagic.register_all(self.shell)
  294. /usr/lib64/python2.7/site-packages/sage/all.py in <module>()
  295. 88
  296. 89 from time import sleep
  297. 90
  298. 91 import sage.misc.lazy_import
  299. 92 from sage.misc.all import * # takes a while
  300. 93 from sage.typeset.all import *
  301. 94 from sage.repl.all import *
  302. 95
  303. 96 from sage.misc.sh import sh
  304. 97
  305. 98 from sage.libs.all import *
  306. 99 from sage.data_structures.all import *
  307. 100 from sage.doctest.all import *
  308. 101
  309. 102 from sage.structure.all import *
  310. --> 103 from sage.rings.all import *
  311. global sage.rings.all = undefined
  312. 104 from sage.arith.all import *
  313. 105 from sage.matrix.all import *
  314. 106
  315. 107 # This must come before Calculus -- it initializes the Pynac library.
  316. 108 import sage.symbolic.pynac
  317. 109
  318. 110 from sage.modules.all import *
  319. 111 from sage.monoids.all import *
  320. 112 from sage.algebras.all import *
  321. 113 from sage.modular.all import *
  322. 114 from sage.sat.all import *
  323. 115 from sage.schemes.all import *
  324. 116 from sage.graphs.all import *
  325. 117 from sage.groups.all import *
  326. 118 from sage.databases.all import *
  327. /usr/lib64/python2.7/site-packages/sage/rings/all.py in <module>()
  328. 39
  329. 40 # Rational numbers
  330. 41 from .rational_field import RationalField, QQ
  331. 42 from .rational import Rational
  332. 43 Rationals = RationalField
  333. 44
  334. 45 # Integers modulo n.
  335. 46 from sage.rings.finite_rings.integer_mod_ring import IntegerModRing, Zmod
  336. 47 from sage.rings.finite_rings.integer_mod import IntegerMod, Mod, mod
  337. 48 Integers = IntegerModRing
  338. 49
  339. 50 # Finite fields
  340. 51 from .finite_rings.all import *
  341. 52
  342. 53 # Number field
  343. ---> 54 from .number_field.all import *
  344. global number_field.all = undefined
  345. 55
  346. 56 # Function field
  347. 57 from .function_field.all import *
  348. 58
  349. 59 # Finite residue fields
  350. 60 from .finite_rings.residue_field import ResidueField
  351. 61
  352. 62 # p-adic field
  353. 63 from .padics.all import *
  354. 64 from .padics.padic_printing import _printer_defaults as padic_printing
  355. 65
  356. 66 # Semirings
  357. 67 from .semirings.all import *
  358. 68
  359. 69 # Real numbers
  360. /usr/lib64/python2.7/site-packages/sage/rings/number_field/all.py in <module>()
  361. 1 from __future__ import absolute_import
  362. 2
  363. 3 from .number_field import (NumberField, NumberFieldTower, CyclotomicField, QuadraticField,
  364. 4 is_fundamental_discriminant)
  365. 5 from .number_field_element import NumberFieldElement
  366. 6
  367. 7 from .order import EquationOrder, GaussianIntegers, EisensteinIntegers
  368. 8
  369. ----> 9 from .totallyreal import enumerate_totallyreal_fields_prim
  370. global totallyreal = undefined
  371. global enumerate_totallyreal_fields_prim = undefined
  372. 10 from .totallyreal_data import hermite_constant
  373. 11 from .totallyreal_rel import enumerate_totallyreal_fields_all, enumerate_totallyreal_fields_rel
  374. 12
  375. 13 from .unit_group import UnitGroup
  376. /usr/lib64/python2.7/site-packages/sage/rings/number_field/totallyreal_data.pxd in init sage.rings.number_field.totallyreal (/var/tmp/portage/sci-mathematics/sage-7.3/work/sage-7.3/src-python2_7/build/cythonized/sage/rings/number_field/totallyreal.c:11602)()
  377. 1 cdef double eval_seq_as_poly(int *f, int n, double x)
  378. 2 cdef double newton(int *f, int *df, int n, double x0, double eps)
  379. 3 cdef void newton_in_intervals(int *f, int *df, int n, double *beta, double eps, double *rts)
  380. 4 cpdef lagrange_degree_3(int n, int an1, int an2, int an3)
  381. 5
  382. 6 cimport sage.rings.integer
  383. 7
  384. 8 cdef int eval_seq_as_poly_int(int *f, int n, int x)
  385. 9
  386. 10 cdef int easy_is_irreducible(int *a, int n)
  387. 11
  388. ---> 12 cdef class tr_data:
  389. global cdef = undefined
  390. global tr_data = undefined
  391. 13
  392. 14 cdef int n, k
  393. 15 cdef double B
  394. 16 cdef double b_lower, b_upper, gamma
  395. 17
  396. 18 cdef int *a
  397. 19 cdef int *amax
  398. 20 cdef double *beta
  399. 21 cdef int *gnk
  400. 22
  401. 23 cdef int *df
  402. 24
  403. 25 cdef void incr(self, int *f_out, int verbose, int haltk, int phc)
  404. 26
  405. /usr/lib64/python2.7/site-packages/sage/rings/number_field/totallyreal_data.pyx in init sage.rings.number_field.totallyreal_data (/var/tmp/portage/sci-mathematics/sage-7.3/work/sage-7.3/src-python2_7/build/cythonized/sage/rings/number_field/totallyreal_data.c:12297)()
  406. 24 #*****************************************************************************
  407. 25 from __future__ import print_function
  408. 26
  409. 27 include "sage/ext/cdefs.pxi"
  410. 28 include "cysignals/memory.pxi"
  411. 29
  412. 30 from sage.arith.all import binomial, gcd
  413. 31 from sage.rings.rational_field import RationalField
  414. 32 from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
  415. 33 from sage.rings.real_mpfi import RealIntervalField
  416. 34 from sage.rings.real_mpfr import RealField
  417. 35 from sage.rings.integer_ring import ZZ
  418. 36 from sage.rings.integer cimport Integer
  419. 37
  420. 38 # Other global variables
  421. ---> 39 ZZx = PolynomialRing(ZZ, 'x')
  422. global ZZx = undefined
  423. global PolynomialRing = <function PolynomialRing at 0x7f2bc6ad3140>
  424. global ZZ = Integer Ring
  425. 40
  426. 41 from libc.math cimport lrint, floor, ceil, fabs, round
  427. 42
  428. 43
  429. 44 #*********************************************************************
  430. 45 # Auxiliary routine
  431. 46 # Hermite constant, naive Newton-Raphson, and a specialized Lagrange
  432. 47 # multiplier solver.
  433. 48 #*********************************************************************
  434. 49
  435. 50 def hermite_constant(n):
  436. 51 r"""
  437. 52 This function returns the nth Hermite constant
  438. 53
  439. 54 The nth Hermite constant (typically denoted `\gamma_n`), is defined
  440. /usr/lib64/python2.7/site-packages/sage/rings/polynomial/polynomial_ring_constructor.pyc in PolynomialRing(base_ring=Integer Ring, arg1='x', arg2=None, sparse=False, order='degrevlex', names=None, name='x', var_array=None, implementation=None)
  441. 446 arg2 = [str(x) for x in arg2]
  442. 447 if isinstance(arg2, (int, long, Integer)):
  443. 448 # 3. PolynomialRing(base_ring, names, n, order='degrevlex'):
  444. 449 if not isinstance(arg1, (list, tuple, str)):
  445. 450 raise TypeError("You *must* specify the names of the variables.")
  446. 451 n = int(arg2)
  447. 452 names = arg1
  448. 453 R = _multi_variate(base_ring, names, n, sparse, order, implementation)
  449. 454
  450. 455 elif isinstance(arg1, str) or (isinstance(arg1, (list,tuple)) and len(arg1) == 1):
  451. 456 if not ',' in arg1:
  452. 457 # 1. PolynomialRing(base_ring, name, sparse=False):
  453. 458 if not arg2 is None:
  454. 459 raise TypeError("if second arguments is a string with no commas, then there must be no other non-optional arguments")
  455. 460 name = arg1
  456. --> 461 R = _single_variate(base_ring, name, sparse, implementation)
  457. R = None
  458. global _single_variate = <function _single_variate at 0x7f2bc6ad3398>
  459. base_ring = Integer Ring
  460. name = 'x'
  461. sparse = False
  462. implementation = None
  463. 462 else:
  464. 463 # 2-4. PolynomialRing(base_ring, names, order='degrevlex'):
  465. 464 if not arg2 is None:
  466. 465 raise TypeError("invalid input to PolynomialRing function; please see the docstring for that function")
  467. 466 names = arg1.split(',')
  468. 467 R = _multi_variate(base_ring, names, -1, sparse, order, implementation)
  469. 468 elif isinstance(arg1, (list, tuple)):
  470. 469 # PolynomialRing(base_ring, names (list or tuple), order='degrevlex'):
  471. 470 names = arg1
  472. 471 R = _multi_variate(base_ring, names, -1, sparse, order, implementation)
  473. 472
  474. 473 if arg1 is None and arg2 is None:
  475. 474 raise TypeError("you *must* specify the indeterminates (as not None).")
  476. 475 if R is None:
  477. 476 raise TypeError("invalid input (%s, %s, %s) to PolynomialRing function; please see the docstring for that function"%(
  478. /usr/lib64/python2.7/site-packages/sage/rings/polynomial/polynomial_ring_constructor.pyc in _single_variate(base_ring=Integer Ring, name=('x',), sparse=False, implementation=None)
  479. 524 R = m.PolynomialRing_dense_padic_ring_capped_absolute(base_ring, name)
  480. 525
  481. 526 elif isinstance(base_ring, padic_base_leaves.pAdicRingFixedMod):
  482. 527 R = m.PolynomialRing_dense_padic_ring_fixed_mod(base_ring, name)
  483. 528
  484. 529 elif base_ring in _CompleteDiscreteValuationRings:
  485. 530 R = m.PolynomialRing_cdvr(base_ring, name, sparse)
  486. 531
  487. 532 elif base_ring in _CompleteDiscreteValuationFields:
  488. 533 R = m.PolynomialRing_cdvf(base_ring, name, sparse)
  489. 534
  490. 535 elif base_ring.is_field(proof = False):
  491. 536 R = m.PolynomialRing_field(base_ring, name, sparse)
  492. 537
  493. 538 elif base_ring.is_integral_domain(proof = False):
  494. --> 539 R = m.PolynomialRing_integral_domain(base_ring, name, sparse, implementation)
  495. R = None
  496. m.PolynomialRing_integral_domain = <class 'sage.rings.polynomial.polynomial_ring.PolynomialRing_integral_domain'>
  497. base_ring = Integer Ring
  498. name = ('x',)
  499. sparse = False
  500. implementation = None
  501. 540 else:
  502. 541 R = m.PolynomialRing_commutative(base_ring, name, sparse)
  503. 542 else:
  504. 543 R = m.PolynomialRing_general(base_ring, name, sparse)
  505. 544
  506. 545 if hasattr(R, '_implementation_names'):
  507. 546 for name in R._implementation_names:
  508. 547 real_key = key[0:3] + (name,)
  509. 548 _save_in_cache(real_key, R)
  510. 549 else:
  511. 550 _save_in_cache(key, R)
  512. 551 return R
  513. 552
  514. 553 def _multi_variate(base_ring, names, n, sparse, order, implementation):
  515. 554 # if not sparse:
  516. /usr/lib64/python2.7/site-packages/sage/rings/polynomial/polynomial_ring.pyc 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)
  517. 1518 if is_IntegerRing(base_ring) and not sparse:
  518. 1519 if implementation == 'NTL':
  519. 1520 from sage.rings.polynomial.polynomial_integer_dense_ntl \
  520. 1521 import Polynomial_integer_dense_ntl
  521. 1522 element_class = Polynomial_integer_dense_ntl
  522. 1523 self._implementation_names = ('NTL',)
  523. 1524 self._implementation_repr = ' (using NTL)'
  524. 1525 elif implementation == 'FLINT' or implementation is None:
  525. 1526 from sage.rings.polynomial.polynomial_integer_dense_flint \
  526. 1527 import Polynomial_integer_dense_flint
  527. 1528 element_class = Polynomial_integer_dense_flint
  528. 1529 self._implementation_names = (None, 'FLINT')
  529. 1530 else:
  530. 1531 raise ValueError("Unknown implementation %s for ZZ[x]"%implementation)
  531. 1532 PolynomialRing_commutative.__init__(self, base_ring, name=name,
  532. -> 1533 sparse=sparse, element_class=element_class, category=category)
  533. sparse = False
  534. element_class = <type 'sage.rings.polynomial.polynomial_integer_dense_flint.Polynomial_integer_dense_flint'>
  535. category = None
  536. 1534
  537. 1535 def _repr_(self):
  538. 1536 """
  539. 1537 TESTS::
  540. 1538
  541. 1539 sage: from sage.rings.polynomial.polynomial_ring import PolynomialRing_integral_domain as PRing
  542. 1540 sage: R = PRing(ZZ, 'x', implementation='NTL'); R
  543. 1541 Univariate Polynomial Ring in x over Integer Ring (using NTL)
  544. 1542 """
  545. 1543 s = PolynomialRing_commutative._repr_(self)
  546. 1544 return s + self._implementation_repr
  547. 1545
  548. 1546
  549. 1547 class PolynomialRing_field(PolynomialRing_integral_domain,
  550. 1548 PolynomialRing_singular_repr,
  551. /usr/lib64/python2.7/site-packages/sage/rings/polynomial/polynomial_ring.pyc 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))
  552. 1425 if max_degree is not None and of_degree is None:
  553. 1426 return self._monics_max( max_degree )
  554. 1427 raise ValueError("you should pass exactly one of of_degree and max_degree")
  555. 1428
  556. 1429 class PolynomialRing_commutative(PolynomialRing_general, commutative_algebra.CommutativeAlgebra):
  557. 1430 """
  558. 1431 Univariate polynomial ring over a commutative ring.
  559. 1432 """
  560. 1433 def __init__(self, base_ring, name=None, sparse=False, element_class=None, category=None):
  561. 1434 if base_ring not in _CommutativeRings:
  562. 1435 raise TypeError("Base ring %s must be a commutative ring."%repr(base_ring))
  563. 1436 # We trust that, if a category is given, that it is useful.
  564. 1437 if category is None:
  565. 1438 category = polynomial_default_category(base_ring.category(),False)
  566. 1439 PolynomialRing_general.__init__(self, base_ring, name=name,
  567. -> 1440 sparse=sparse, element_class=element_class, category=category)
  568. sparse = False
  569. element_class = <type 'sage.rings.polynomial.polynomial_integer_dense_flint.Polynomial_integer_dense_flint'>
  570. category = Join of Category of unique factorization domains and Category of commutative algebras over (euclidean domains and infinite enumerated sets and metric spaces)
  571. 1441
  572. 1442 def quotient_by_principal_ideal(self, f, names=None):
  573. 1443 """
  574. 1444 Return the quotient of this polynomial ring by the principal
  575. 1445 ideal (generated by) `f`.
  576. 1446
  577. 1447 INPUT:
  578. 1448
  579. 1449 - ``f`` - either a polynomial in ``self``, or a principal
  580. 1450 ideal of ``self``.
  581. 1451
  582. 1452 EXAMPLES::
  583. 1453
  584. 1454 sage: R.<x> = QQ[]
  585. 1455 sage: I = (x^2-1)*R
  586. /usr/lib64/python2.7/site-packages/sage/rings/polynomial/polynomial_ring.pyc 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))
  587. 274 self._has_singular = False
  588. 275 # Algebra.__init__ also calls __init_extra__ of Algebras(...).parent_class, which
  589. 276 # tries to provide a conversion from the base ring, if it does not exist.
  590. 277 # This is for algebras that only do the generic stuff in their initialisation.
  591. 278 # But the attribute _no_generic_basering_coercion prevents that from happening,
  592. 279 # since we want to use PolynomialBaseringInjection.
  593. 280 sage.algebras.algebra.Algebra.__init__(self, base_ring, names=name, normalize=True, category=category)
  594. 281 self.__generator = self.element_class(self, [0,1], is_gen=True)
  595. 282 self._populate_coercion_lists_(
  596. 283 #coerce_list = [base_inject],
  597. 284 #convert_list = [list, base_inject],
  598. 285 convert_method_name = '_polynomial_')
  599. 286 if is_PolynomialRing(base_ring):
  600. 287 self._Karatsuba_threshold = 0
  601. 288 else:
  602. --> 289 from sage.matrix.matrix_space import is_MatrixSpace
  603. global sage.matrix.matrix_space = undefined
  604. is_MatrixSpace = undefined
  605. 290 if is_MatrixSpace(base_ring):
  606. 291 self._Karatsuba_threshold = 0
  607. 292 else:
  608. 293 self._Karatsuba_threshold = 8
  609. 294
  610. 295 def __reduce__(self):
  611. 296 import sage.rings.polynomial.polynomial_ring_constructor
  612. 297 return (sage.rings.polynomial.polynomial_ring_constructor.PolynomialRing,
  613. 298 (self.base_ring(), self.variable_name(), None, self.is_sparse()))
  614. 299
  615. 300
  616. 301 def _element_constructor_(self, x=None, check=True, is_gen = False, construct=False, **kwds):
  617. 302 r"""
  618. 303 Convert ``x`` into this univariate polynomial ring,
  619. 304 possibly non-canonically.
  620. /usr/lib64/python2.7/site-packages/sage/matrix/matrix_space.pyc in <module>()
  621. 32 # http://www.gnu.org/licenses/
  622. 33 #*****************************************************************************
  623. 34 from __future__ import print_function
  624. 35 from __future__ import absolute_import
  625. 36
  626. 37 # System imports
  627. 38 import sys
  628. 39 import types
  629. 40 import operator
  630. 41
  631. 42 # Sage matrix imports
  632. 43 from . import matrix
  633. 44 from . import matrix_generic_dense
  634. 45 from . import matrix_generic_sparse
  635. 46
  636. ---> 47 from . import matrix_modn_sparse
  637. global matrix_modn_sparse = undefined
  638. 48
  639. 49 from . import matrix_mod2_dense
  640. 50 from . import matrix_gf2e_dense
  641. 51
  642. 52 from . import matrix_integer_dense
  643. 53 from . import matrix_integer_sparse
  644. 54
  645. 55 from . import matrix_rational_dense
  646. 56 from . import matrix_rational_sparse
  647. 57
  648. 58 from . import matrix_mpolynomial_dense
  649. 59
  650. 60 # Sage imports
  651. 61 from sage.misc.superseded import deprecation
  652. 62 import sage.structure.coerce
  653. /usr/lib64/python2.7/site-packages/sage/matrix/matrix_integer_dense.pxd in init sage.matrix.matrix_modn_sparse (/var/tmp/portage/sci-mathematics/sage-7.3/work/sage-7.3/src-python2_7/build/cythonized/sage/matrix/matrix_modn_sparse.c:19852)()
  654. 1 from sage.libs.gmp.types cimport *
  655. 2 from sage.libs.flint.fmpz cimport *
  656. 3 from sage.libs.flint.fmpz_mat cimport *
  657. 4
  658. 5 from .matrix_dense cimport Matrix_dense
  659. 6 from sage.rings.integer cimport Integer
  660. 7 from sage.ext.mod_int cimport *
  661. 8
  662. 9 ctypedef long* GEN
  663. 10
  664. ---> 11 cdef class Matrix_integer_dense(Matrix_dense):
  665. global cdef = undefined
  666. global Matrix_integer_dense = undefined
  667. global Matrix_dense = undefined
  668. 12 cdef fmpz_mat_t _matrix # Always initialized in __cinit__
  669. 13 cdef bint _initialized_mpz
  670. 14 cdef mpz_t * _entries # Only used if _initialized_mpz
  671. 15 cdef mpz_t ** _rows # Only used if _initialized_mpz
  672. 16 cdef object _pivots
  673. 17 cdef int mpz_height(self, mpz_t height) except -1
  674. 18 cdef _mod_int_c(self, mod_int modulus)
  675. 19 cdef _mod_two(self)
  676. 20 cdef _pickle_version0(self)
  677. 21 cdef _unpickle_version0(self, data)
  678. 22 cpdef _export_as_string(self, int base=?)
  679. 23 cdef inline int _init_mpz(self) except -1
  680. 24 cdef int _init_mpz_impl(self) except -1
  681. 25 cdef inline int _init_linbox(self) except -1
  682. 26 cdef void _dealloc_mpz(self)
  683. 27 cdef void set_unsafe_mpz(self, Py_ssize_t i, Py_ssize_t j, const mpz_t value)
  684. 28 cdef void set_unsafe_si(self, Py_ssize_t i, Py_ssize_t j, long value)
  685. 29 cdef void set_unsafe_double(self, Py_ssize_t i, Py_ssize_t j, double value)
  686. 30 cdef inline void get_unsafe_mpz(self, Py_ssize_t i, Py_ssize_t j, mpz_t value)
  687. 31 cdef inline double get_unsafe_double(self, Py_ssize_t i, Py_ssize_t j)
  688. /usr/lib64/python2.7/site-packages/sage/matrix/matrix_modn_dense_template_header.pxi in init sage.matrix.matrix_integer_dense (/var/tmp/portage/sci-mathematics/sage-7.3/work/sage-7.3/src-python2_7/build/cythonized/sage/matrix/matrix_integer_dense.cpp:53038)()
  689. 1 """
  690. 2 Dense Matrix Template for C/C++ Library Interfaces
  691. 3 """
  692. 4
  693. 5 from sage.ext.mod_int cimport *
  694. 6 from sage.matrix.matrix_dense cimport Matrix_dense
  695. 7
  696. ----> 8 cdef class Matrix_modn_dense_template(Matrix_dense):
  697. global cdef = undefined
  698. global Matrix_modn_dense_template = undefined
  699. global Matrix_dense = undefined
  700. 9 cdef celement **_matrix
  701. 10 cdef celement *_entries
  702. 11 cdef mod_int p
  703. 12 cdef xgcd_eliminate (self, celement * row1, celement* row2, Py_ssize_t start_col)
  704. 13 cdef set_unsafe_int(self, Py_ssize_t i, Py_ssize_t j, int value)
  705. 14 cpdef _export_as_string(self)
  706. 15 cdef int _copy_row_to_mod_int_array(self, mod_int *to, Py_ssize_t i)
  707. ImportError: /usr/lib64/python2.7/site-packages/sage/matrix/matrix_modn_dense_float.so: undefined symbol: cblas_dger
  708. ***************************************************************************
  709. History of session input:
  710. *** Last line of input (may not be in above history):
  711.