I'm running 5.11 (built from source-code). I went into the file quadratic_form__local_field_invariants.py and added the line
from sage.rings.number_field.number_field import primes_above Now when I try to run sage I get a crash message. I've attached the full crash report. If I remove that line and rebuild sage it runs fine. Any ideas why this would be? Outdated python or something? I appreciate any help. Thanks! Anna -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/groups/opt_out.
*************************************************************************** IPython post-mortem report {'commit_hash': '177894e', 'commit_source': 'installation', 'default_encoding': 'UTF-8', 'ipython_path': '/Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/IPython', 'ipython_version': '0.13.1', 'os_name': 'posix', 'platform': 'Darwin-12.5.0-x86_64-i386-64bit', 'sys_executable': '/Users/DrHanesch/sage-5.11/local/bin/python', 'sys_platform': 'darwin', 'sys_version': '2.7.5 (default, Aug 25 2013, 15:10:13) \n[GCC 4.7.3]'} *************************************************************************** *************************************************************************** Crash traceback: --------------------------------------------------------------------------- ImportError Python 2.7.5: /Users/DrHanesch/sage-5.11/local/bin/python Thu Nov 14 15:23:11 2013 A problem occured executing Python code. Here is the sequence of function calls leading up to the error, with the most recent (innermost) call last. /Users/DrHanesch/sage-5.11/local/bin/sage-ipython in <module>() 2 # -*- coding: utf-8 -*- 3 """ 4 Sage IPython startup script. 5 """ 6 from sage.misc.interpreter import SageTerminalApp 7 8 # installs the extra readline commands before the IPython initialization begins. 9 from sage.misc.readline_extra_commands import * 10 11 # Make sure we're using the Sage profile if one isn't specified. 12 import sys 13 if '--profile' not in sys.argv: 14 sys.argv.extend(['--profile', 'sage']) 15 16 app = SageTerminalApp.instance() ---> 17 app.initialize() global app.initialize = <bound method SageTerminalApp.initialize of <sage.misc.interpreter.SageTerminalApp object at 0x1087fc550>> 18 app.start() /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/IPython/frontend/terminal/ipapp.pyc in initialize(self=<sage.misc.interpreter.SageTerminalApp object>, argv=None) /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/IPython/config/application.pyc in catch_config_error(method=<function initialize>, app=<sage.misc.interpreter.SageTerminalApp object>, *args=(None,), **kwargs={}) 69 70 #----------------------------------------------------------------------------- 71 # Application class 72 #----------------------------------------------------------------------------- 73 74 @decorator 75 def catch_config_error(method, app, *args, **kwargs): 76 """Method decorator for catching invalid config (Trait/ArgumentErrors) during init. 77 78 On a TraitError (generally caused by bad config), this will print the trait's 79 message, and exit the app. 80 81 For use on init methods, to prevent invoking excepthook on invalid input. 82 """ 83 try: ---> 84 return method(app, *args, **kwargs) method = <function initialize at 0x109b36140> app = <sage.misc.interpreter.SageTerminalApp object at 0x1087fc550> args = (None,) kwargs = {} 85 except (TraitError, ArgumentError) as e: 86 app.print_description() 87 app.print_help() 88 app.print_examples() 89 app.log.fatal("Bad config encountered during initialization:") 90 app.log.fatal(str(e)) 91 app.log.debug("Config at the time: %s", app.config) 92 app.exit(1) 93 94 95 class ApplicationError(Exception): 96 pass 97 98 99 class Application(SingletonConfigurable): /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/IPython/frontend/terminal/ipapp.pyc in initialize(self=<sage.misc.interpreter.SageTerminalApp object>, argv=None) 309 310 @catch_config_error 311 def initialize(self, argv=None): 312 """Do actions after construct, but before starting the app.""" 313 super(TerminalIPythonApp, self).initialize(argv) 314 if self.subapp is not None: 315 # don't bother initializing further, starting subapp 316 return 317 if not self.ignore_old_config: 318 check_for_old_config(self.ipython_dir) 319 # print self.extra_args 320 if self.extra_args and not self.something_to_run: 321 self.file_to_run = self.extra_args[0] 322 self.init_path() 323 # create the shell --> 324 self.init_shell() self.init_shell = <bound method SageTerminalApp.init_shell of <sage.misc.interpreter.SageTerminalApp object at 0x1087fc550>> 325 # and draw the banner 326 self.init_banner() 327 # Now a variety of things that happen after the banner is printed. 328 self.init_gui_pylab() 329 self.init_extensions() 330 self.init_code() 331 332 def init_shell(self): 333 """initialize the InteractiveShell instance""" 334 # Create an InteractiveShell instance. 335 # shell.display_banner should always be False for the terminal 336 # based app, because we call shell.show_banner() by hand below 337 # so the banner shows *before* all extension loading stuff. 338 self.shell = TerminalInteractiveShell.instance(config=self.config, 339 display_banner=False, profile_dir=self.profile_dir, /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/sage/misc/interpreter.pyc in init_shell(self=<sage.misc.interpreter.SageTerminalApp object>) 720 sage: from sage.misc.interpreter import SageTerminalApp, DEFAULT_SAGE_CONFIG 721 sage: app = SageTerminalApp(config=DEFAULT_SAGE_CONFIG) 722 sage: app.initialize(argv=[]) # indirect doctest 723 sage: app.shell 724 <sage.misc.interpreter.SageInteractiveShell object at 0x...> 725 """ 726 # We need verbose crashes for the Sage crash handler. We set it here 727 # so that we don't overwrite the traitlet attribute 728 self.verbose_crash = True 729 730 # Shell initialization 731 self.shell = SageInteractiveShell.instance(config=self.config, 732 display_banner=False, profile_dir=self.profile_dir, 733 ipython_dir=self.ipython_dir) 734 self.shell.configurables.append(self) --> 735 self.shell.extension_manager.load_extension('sage.misc.sage_extension') self.shell.extension_manager.load_extension = <bound method ExtensionManager.load_extension of <IPython.core.extensions.ExtensionManager object at 0x109fd6710>> /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/IPython/core/extensions.pyc in load_extension(self=<IPython.core.extensions.ExtensionManager object>, module_str='sage.misc.sage_extension') 75 76 def _on_ipython_dir_changed(self): 77 if not os.path.isdir(self.ipython_extension_dir): 78 os.makedirs(self.ipython_extension_dir, mode = 0777) 79 80 def load_extension(self, module_str): 81 """Load an IPython extension by its module name. 82 83 If :func:`load_ipython_extension` returns anything, this function 84 will return that object. 85 """ 86 from IPython.utils.syspathcontext import prepended_to_syspath 87 88 if module_str not in sys.modules: 89 with prepended_to_syspath(self.ipython_extension_dir): ---> 90 __import__(module_str) global __import__ = undefined module_str = 'sage.misc.sage_extension' 91 mod = sys.modules[module_str] 92 return self._call_load_ipython_extension(mod) 93 94 def unload_extension(self, module_str): 95 """Unload an IPython extension by its module name. 96 97 This function looks up the extension's name in ``sys.modules`` and 98 simply calls ``mod.unload_ipython_extension(self)``. 99 """ 100 if module_str in sys.modules: 101 mod = sys.modules[module_str] 102 self._call_unload_ipython_extension(mod) 103 104 def reload_extension(self, module_str): 105 """Reload an IPython extension by calling reload. /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/sage/misc/sage_extension.py in <module>() 35 2 36 37 In contrast, input to the ``%time`` magic command is preparsed:: 38 39 sage: shell.run_cell('%time 594.factor()') 40 CPU times: user ... 41 Wall time: ... 42 2 * 3^3 * 11 43 """ 44 45 from IPython.core.hooks import TryNext 46 from IPython.core.magic import Magics, magics_class, line_magic 47 import os 48 import sys 49 import sage ---> 50 import sage.all global sage.all = undefined 51 from sage.misc.interpreter import preparser 52 from sage.misc.preparser import preparse 53 54 @magics_class 55 class SageMagics(Magics): 56 57 @line_magic 58 def runfile(self, s): 59 r""" 60 Loads the code contained in the file ``s``. This is designed 61 to be used from the command line as ``%runfile /path/to/file``. 62 63 :param s: file to be loaded 64 :type s: string 65 /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/sage/all.py in <module>() 84 from sage.misc.sh import sh 85 86 from sage.libs.all import * 87 from sage.doctest.all import * 88 89 from sage.rings.all import * 90 from sage.matrix.all import * 91 92 # This must come before Calculus -- it initializes the Pynac library. 93 import sage.symbolic.pynac 94 95 from sage.modules.all import * 96 from sage.monoids.all import * 97 from sage.algebras.all import * 98 from sage.modular.all import * ---> 99 from sage.schemes.all import * global sage.schemes.all = undefined 100 from sage.graphs.all import * 101 from sage.groups.all import * 102 from sage.databases.all import * 103 from sage.structure.all import * 104 from sage.categories.all import * 105 from sage.sets.all import * 106 from sage.probability.all import * 107 from sage.interfaces.all import * 108 109 from sage.symbolic.all import * 110 111 from sage.functions.all import * 112 from sage.calculus.all import * 113 114 from sage.server.all import * /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/sage/schemes/all.py in <module>() 10 # 11 # Distributed under the terms of the GNU General Public License (GPL) 12 # 13 # This code is distributed in the hope that it will be useful, 14 # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 # General Public License for more details. 17 # 18 # The full text of the GPL is available at: 19 # 20 # http://www.gnu.org/licenses/ 21 #***************************************************************************** 22 23 from jacobians.all import * 24 ---> 25 from hyperelliptic_curves.all import * global hyperelliptic_curves.all = undefined 26 27 from plane_curves.all import * 28 29 from plane_conics.all import * 30 31 from elliptic_curves.all import * 32 33 from plane_quartics.all import * 34 35 from generic.all import * 36 37 from toric.all import * 38 39 from affine.all import * 40 /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/sage/schemes/hyperelliptic_curves/__init__.py in <module>() ----> 1 import all global all = undefined /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/sage/schemes/hyperelliptic_curves/all.py in <module>() ----> 1 from constructor import HyperellipticCurve global constructor = undefined global HyperellipticCurve = undefined 2 from hyperelliptic_generic import is_HyperellipticCurve 3 from kummer_surface import KummerSurface 4 from invariants import (igusa_clebsch_invariants, 5 absolute_igusa_invariants_kohel, 6 absolute_igusa_invariants_wamelen, 7 clebsch_invariants) /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/sage/schemes/hyperelliptic_curves/constructor.py in <module>() 1 """ 2 Hyperelliptic curve constructor 3 """ 4 5 #***************************************************************************** 6 # Copyright (C) 2006 David Kohel <ko...@maths.usyd.edu> 7 # Distributed under the terms of the GNU General Public License (GPL) 8 # http://www.gnu.org/licenses/ 9 #***************************************************************************** 10 11 from sage.schemes.projective.projective_space import ProjectiveSpace 12 ---> 13 from hyperelliptic_generic import HyperellipticCurve_generic global hyperelliptic_generic = undefined global HyperellipticCurve_generic = undefined 14 from hyperelliptic_finite_field import HyperellipticCurve_finite_field 15 from hyperelliptic_rational_field import HyperellipticCurve_rational_field 16 from hyperelliptic_padic_field import HyperellipticCurve_padic_field 17 from hyperelliptic_g2_generic import HyperellipticCurve_g2_generic 18 from hyperelliptic_g2_finite_field import HyperellipticCurve_g2_finite_field 19 from hyperelliptic_g2_rational_field import HyperellipticCurve_g2_rational_field 20 from hyperelliptic_g2_padic_field import HyperellipticCurve_g2_padic_field 21 22 from sage.rings.all import is_FiniteField, is_RationalField, is_Polynomial, is_pAdicField 23 24 def HyperellipticCurve(f, h=None, names=None, PP=None, check_squarefree=True): 25 r""" 26 Returns the hyperelliptic curve `y^2 + h y = f`, for 27 univariate polynomials `h` and `f`. If `h` 28 is not given, then it defaults to 0. 29 30 INPUT: 31 /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/sage/schemes/hyperelliptic_curves/hyperelliptic_generic.py in <module>() 19 20 sage: D = C.affine_patch(0) 21 sage: D.defining_polynomials()[0].parent() 22 Multivariate Polynomial Ring in x0, x1 over Rational Field 23 """ 24 25 #***************************************************************************** 26 # Copyright (C) 2006 David Kohel <ko...@maths.usyd.edu> 27 # Distributed under the terms of the GNU General Public License (GPL) 28 # http://www.gnu.org/licenses/ 29 #***************************************************************************** 30 31 from sage.rings.all import PolynomialRing, RR, PowerSeriesRing, LaurentSeriesRing, O 32 from sage.functions.all import log 33 ---> 34 import sage.schemes.plane_curves.projective_curve as plane_curve global sage.schemes.plane_curves.projective_curve = undefined global plane_curve = undefined 35 36 def is_HyperellipticCurve(C): 37 """ 38 EXAMPLES:: 39 40 sage: R.<x> = QQ[]; C = HyperellipticCurve(x^3 + x - 1); C 41 Hyperelliptic Curve over Rational Field defined by y^2 = x^3 + x - 1 42 sage: sage.schemes.hyperelliptic_curves.hyperelliptic_generic.is_HyperellipticCurve(C) 43 True 44 """ 45 return isinstance(C,HyperellipticCurve_generic) 46 47 class HyperellipticCurve_generic(plane_curve.ProjectiveCurve_generic): 48 def __init__(self, PP, f, h=None, names=None, genus=None): 49 x, y, z = PP.gens() /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/sage/schemes/plane_curves/__init__.py in <module>() ----> 1 import all global all = undefined /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/sage/schemes/plane_curves/all.py in <module>() 8 # 9 # Copyright (C) 2005 William Stein <w...@math.harvard.edu> 10 # 11 # Distributed under the terms of the GNU General Public License (GPL) 12 # 13 # This code is distributed in the hope that it will be useful, 14 # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 # General Public License for more details. 17 # 18 # The full text of the GPL is available at: 19 # 20 # http://www.gnu.org/licenses/ 21 #***************************************************************************** 22 ---> 23 from constructor import Curve global constructor = undefined global Curve = undefined 24 25 from projective_curve import Hasse_bounds 26 /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/sage/schemes/plane_curves/constructor.py in <module>() 32 from sage.schemes.affine.all import AffineSpace 33 34 from sage.schemes.projective.all import ProjectiveSpace 35 36 37 from projective_curve import (ProjectiveCurve_generic, 38 ProjectiveSpaceCurve_generic, 39 ProjectiveCurve_finite_field, 40 ProjectiveCurve_prime_finite_field) 41 42 from affine_curve import (AffineCurve_generic, 43 AffineSpaceCurve_generic, 44 AffineCurve_finite_field, 45 AffineCurve_prime_finite_field) 46 ---> 47 from sage.schemes.plane_conics.constructor import Conic global sage.schemes.plane_conics.constructor = undefined global Conic = undefined 48 49 def Curve(F): 50 """ 51 Return the plane or space curve defined by `F`, where 52 `F` can be either a multivariate polynomial, a list or 53 tuple of polynomials, or an algebraic scheme. 54 55 If `F` is in two variables the curve is affine, and if it 56 is homogenous in `3` variables, then the curve is 57 projective. 58 59 EXAMPLE: A projective plane curve 60 61 :: 62 /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/sage/schemes/plane_conics/__init__.py in <module>() ----> 1 import all global all = undefined /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/sage/schemes/plane_conics/all.py in <module>() 8 # 9 # Copyright (C) 2005 William Stein <w...@math.harvard.edu> 10 # 11 # Distributed under the terms of the GNU General Public License (GPL) 12 # 13 # This code is distributed in the hope that it will be useful, 14 # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 # General Public License for more details. 17 # 18 # The full text of the GPL is available at: 19 # 20 # http://www.gnu.org/licenses/ 21 #***************************************************************************** 22 ---> 23 from constructor import Conic global constructor = undefined global Conic = undefined 24 25 /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/sage/schemes/plane_conics/constructor.py in <module>() 14 # 15 # Distributed under the terms of the GNU General Public License (GPL) 16 # 17 # This code is distributed in the hope that it will be useful, 18 # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 # General Public License for more details. 21 # 22 # The full text of the GPL is available at: 23 # 24 # http://www.gnu.org/licenses/ 25 #***************************************************************************** 26 27 from sage.matrix.constructor import Matrix 28 from sage.modules.free_module_element import vector ---> 29 from sage.quadratic_forms.all import is_QuadraticForm global sage.quadratic_forms.all = undefined global is_QuadraticForm = undefined 30 from sage.rings.all import (is_MPolynomial, PolynomialRing, 31 is_IntegralDomain, is_FiniteField, 32 is_PrimeFiniteField, 33 is_RationalField) 34 from sage.rings.number_field.number_field import is_NumberField 35 from sage.schemes.projective.projective_space import ProjectiveSpace 36 from sage.schemes.projective.projective_point import SchemeMorphism_point_projective_field 37 from sage.schemes.affine.affine_point import SchemeMorphism_point_affine 38 from sage.structure.all import Sequence 39 from sage.structure.element import is_Matrix 40 41 from con_field import ProjectiveConic_field 42 from con_finite_field import ProjectiveConic_finite_field 43 from con_prime_finite_field import ProjectiveConic_prime_finite_field 44 from con_number_field import ProjectiveConic_number_field /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/sage/quadratic_forms/__init__.py in <module>() ----> 1 import all global all = undefined /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/sage/quadratic_forms/all.py in <module>() 1 from binary_qf import BinaryQF, BinaryQF_reduced_representatives 2 ----> 3 from ternary_qf import TernaryQF, find_all_ternary_qf_by_level_disc, find_a_ternary_qf_by_level_disc global ternary_qf = undefined global TernaryQF = undefined global find_all_ternary_qf_by_level_disc = undefined global find_a_ternary_qf_by_level_disc = undefined 4 5 from quadratic_form import QuadraticForm, DiagonalQuadraticForm, is_QuadraticForm 6 7 from random_quadraticform import random_quadraticform, random_quadraticform_with_conditions, random_ternaryqf, random_ternaryqf_with_conditions 8 9 from extras import least_quadratic_nonresidue, extend_to_primitive, is_triangular_number 10 11 from special_values import gamma__exact, zeta__exact, QuadraticBernoulliNumber, \ 12 quadratic_L_function__exact, quadratic_L_function__numerical 13 14 from genera.genus import is_GlobalGenus, is_2_adic_genus 15 #is_trivial_symbol 16 17 from constructions import BezoutianQuadraticForm, HyperbolicPlane_quadratic_form 18 /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/sage/quadratic_forms/ternary_qf.py in <module>() 18 # 19 # This code is distributed in the hope that it will be useful, 20 # but WITHOUT ANY WARRANTY; without even the implied warranty of 21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 22 # General Public License for more details. 23 # 24 # The full text of the GPL is available at: 25 # 26 # http://www.gnu.org/licenses/ 27 #***************************************************************************** 28 29 30 from sage.structure.sage_object import SageObject 31 from sage.rings.all import ZZ 32 from sage.rings.arith import gcd, inverse_mod, kronecker_symbol ---> 33 from sage.quadratic_forms.quadratic_form import QuadraticForm global sage.quadratic_forms.quadratic_form = undefined global QuadraticForm = undefined 34 from sage.matrix.constructor import matrix, identity_matrix 35 from sage.matrix.matrix import Matrix, is_Matrix 36 from sage.structure.element import is_Vector 37 from sage.quadratic_forms.ternary import _reduced_ternary_form_eisenstein_with_matrix 38 from sage.quadratic_forms.ternary import _reduced_ternary_form_eisenstein_without_matrix, _find_zeros_mod_p_odd, _find_zeros_mod_p_2, _find_p_neighbor_from_vec, _basic_lemma 39 from sage.quadratic_forms.ternary import _find_all_ternary_qf_by_level_disc, _find_a_ternary_qf_by_level_disc 40 from sage.misc.prandom import randint 41 from sage.rings.finite_rings.integer_mod import mod 42 from sage.modules.free_module_element import vector 43 from sage.rings.ring import is_Ring 44 from sage.rings.rational_field import QQ 45 from sage.rings.polynomial.polynomial_ring import polygen, polygens 46 47 class TernaryQF(SageObject): 48 """ /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/sage/quadratic_forms/quadratic_form.py in <module>() 68 Determines if the object Q is an element of the QuadraticForm class. 69 70 EXAMPLES:: 71 72 sage: Q = QuadraticForm(ZZ, 2, [1,2,3]) 73 sage: is_QuadraticForm(Q) ##random -- deprecated 74 True 75 sage: is_QuadraticForm(2) ##random -- deprecated 76 False 77 78 """ 79 return isinstance(Q, QuadraticForm) 80 81 82 ---> 83 class QuadraticForm(SageObject): global QuadraticForm = undefined global SageObject = None 84 r""" 85 The ``QuadraticForm`` class represents a quadratic form in n variables with 86 coefficients in the ring R. 87 88 INPUT: 89 90 The constructor may be called in any of the following ways. 91 92 #. ``QuadraticForm(R, n, entries)``, where 93 94 - `R` -- ring for which the quadratic form is defined 95 - `n` -- an integer >= 0 96 - ``entries`` -- a list of `n(n+1)/2` coefficients of the quadratic form 97 in `R` (given lexographically, or equivalently, by rows of the matrix) 98 /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/sage/quadratic_forms/quadratic_form.py in QuadraticForm() 198 local_normal_form, \ 199 jordan_blocks_by_scale_and_unimodular, \ 200 jordan_blocks_in_unimodular_list_by_scale_power 201 202 ## Routines to perform elementary variable substitutions 203 from sage.quadratic_forms.quadratic_form__variable_substitutions import \ 204 swap_variables, \ 205 multiply_variable, \ 206 divide_variable, \ 207 scale_by_factor, \ 208 extract_variables, \ 209 elementary_substitution, \ 210 add_symmetric 211 212 ## Routines to compute p-adic field invariants --> 213 from sage.quadratic_forms.quadratic_form__local_field_invariants import \ global sage.quadratic_forms.quadratic_form__local_field_invariants = undefined global rational_diagonal_form = undefined global signature_vector = undefined global signature = undefined global hasse_invariant = undefined global hasse_invariant__OMeara = undefined global hasse_invariant__numfield = undefined global is_hyperbolic = undefined global is_anisotropic = undefined global is_isotropic = undefined global anisotropic_primes = undefined global compute_definiteness = undefined global compute_definiteness_string_by_determinants = undefined global is_positive_definite = undefined global is_negative_definite = undefined global is_indefinite = undefined global is_definite = undefined 214 rational_diagonal_form, \ 215 signature_vector, \ 216 signature, \ 217 hasse_invariant, \ 218 hasse_invariant__OMeara, \ 219 hasse_invariant__numfield, \ 220 is_hyperbolic, \ 221 is_anisotropic, \ 222 is_isotropic, \ 223 anisotropic_primes, \ 224 compute_definiteness, \ 225 compute_definiteness_string_by_determinants, \ 226 is_positive_definite, \ 227 is_negative_definite, \ 228 is_indefinite, \ /Users/DrHanesch/sage-5.11/local/lib/python2.7/site-packages/sage/quadratic_forms/quadratic_form__local_field_invariants.py in <module>() 16 # http://www.gnu.org/licenses/ 17 #***************************************************************************** 18 19 20 ########################################################################### 21 ## TO DO: Add routines for hasse invariants at all places, anisotropic 22 ## places, is_semi_definite, and support for number fields. 23 ########################################################################### 24 25 26 import copy 27 28 from sage.rings.integer_ring import ZZ 29 from sage.rings.rational_field import QQ 30 from sage.rings.real_mpfr import RR ---> 31 from sage.rings.number_field.number_field import primes_above global sage.rings.number_field.number_field = undefined global primes_above = undefined 32 from sage.rings.arith import prime_divisors, hilbert_symbol 33 from sage.functions.all import sgn 34 from sage.rings.fraction_field import FractionField 35 from sage.matrix.matrix_space import MatrixSpace 36 37 38 ## Routines to compute local (p-adic) invariants of a quadratic form Q: 39 ## (Note: Here Q is the matrix so that Q(x) = x^t * Q * x.) 40 ## -------------------------------------------------------------------- 41 42 def rational_diagonal_form(self, return_matrix=False): 43 """ 44 Returns a diagonal form equivalent to Q over the fraction field of 45 its defining ring. If the return_matrix is True, then we return 46 the transformation matrix performing the diagonalization as the ImportError: cannot import name primes_above *************************************************************************** History of session input: *** Last line of input (may not be in above history):