30
30
from sage .matrix .matrix_space import MatrixSpace
31
31
from sage .misc .functional import denominator , is_even
32
32
from sage .misc .lazy_import import lazy_import
33
- from sage .misc .superseded import deprecated_function_alias , deprecation
33
+ from sage .misc .superseded import deprecated_function_alias
34
34
from sage .modules .free_module_element import vector
35
35
from sage .quadratic_forms .quadratic_form__evaluate import (
36
36
QFEvaluateMatrix ,
46
46
from sage .structure .sage_object import SageObject
47
47
48
48
49
- def is_QuadraticForm (Q ):
50
- """
51
- Determine if the object ``Q`` is an element of the :class:`QuadraticForm` class.
52
-
53
- This function is deprecated.
54
-
55
- EXAMPLES::
56
-
57
- sage: Q = QuadraticForm(ZZ, 2, [1,2,3])
58
- sage: from sage.quadratic_forms.quadratic_form import is_QuadraticForm
59
- sage: is_QuadraticForm(Q)
60
- doctest:...: DeprecationWarning: the function is_QuadraticForm is deprecated;
61
- use isinstance(x, sage.quadratic_forms.quadratic_form.QuadraticForm) instead...
62
- True
63
- sage: is_QuadraticForm(2)
64
- False
65
- """
66
- deprecation (35305 ,
67
- "the function is_QuadraticForm is deprecated; use "
68
- "isinstance(x, sage.quadratic_forms.quadratic_form.QuadraticForm) instead" )
69
- return isinstance (Q , QuadraticForm )
70
-
71
-
72
49
def quadratic_form_from_invariants (F , rk , det , P , sminus ):
73
50
r"""
74
51
Return a rational quadratic form with given invariants.
@@ -521,7 +498,7 @@ def __init__(
521
498
unsafe_initialization = False ,
522
499
number_of_automorphisms = None ,
523
500
determinant = None ,
524
- ):
501
+ ) -> None :
525
502
"""
526
503
EXAMPLES::
527
504
@@ -721,7 +698,7 @@ def __pari__(self):
721
698
"""
722
699
return self .matrix ().__pari__ ()
723
700
724
- def _pari_init_ (self ):
701
+ def _pari_init_ (self ) -> str :
725
702
"""
726
703
Return a PARI-formatted Hessian matrix for Q, as string.
727
704
@@ -733,7 +710,7 @@ def _pari_init_(self):
733
710
"""
734
711
return self .matrix ()._pari_init_ ()
735
712
736
- def _repr_ (self ):
713
+ def _repr_ (self ) -> str :
737
714
"""
738
715
Give a text representation for the quadratic form given as an upper-triangular matrix of coefficients.
739
716
@@ -758,7 +735,7 @@ def _repr_(self):
758
735
out_str += "]"
759
736
return out_str
760
737
761
- def _latex_ (self ):
738
+ def _latex_ (self ) -> str :
762
739
"""
763
740
Give a LaTeX representation for the quadratic form given as an upper-triangular matrix of coefficients.
764
741
@@ -847,7 +824,7 @@ def __setitem__(self, ij, coeff):
847
824
except Exception :
848
825
raise RuntimeError ("this coefficient cannot be coerced to an element of the base ring for the quadratic form" )
849
826
850
- def __hash__ (self ):
827
+ def __hash__ (self ) -> int :
851
828
r"""
852
829
TESTS::
853
830
@@ -861,7 +838,7 @@ def __hash__(self):
861
838
"""
862
839
return hash (self .__base_ring ) ^ hash (tuple (self .__coeffs ))
863
840
864
- def __eq__ (self , right ):
841
+ def __eq__ (self , right ) -> bool :
865
842
"""
866
843
Determines if two quadratic forms are equal.
867
844
0 commit comments