Skip to content

Commit a937a04

Browse files
author
Matthias Koeppe
committed
src/sage/quadratic_forms: Use \cdot for multiplication
1 parent 33899aa commit a937a04

11 files changed

+75
-75
lines changed

src/sage/quadratic_forms/qfsolve.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ def qfparam(G, sol):
8989
- ``G`` -- a `3 \times 3`-matrix over `\QQ`
9090
9191
- ``sol`` -- a triple of rational numbers providing a solution
92-
to sol*G*sol^t = 0
92+
to `x\cdot G\cdot x^t = 0`
9393
9494
OUTPUT:
9595
9696
A triple of polynomials that parametrizes all solutions of
97-
`x*G*x^t = 0` up to scaling.
97+
`x\cdot G\cdot x^t = 0` up to scaling.
9898
9999
ALGORITHM:
100100

src/sage/quadratic_forms/quadratic_form.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def quadratic_form_from_invariants(F, rk, det, P, sminus):
105105
Quadratic form in 2 variables over Rational Field with coefficients:
106106
[ 5 0 ]
107107
[ * -3 ]
108-
sage: all(q.hasse_invariant(p)==-1 for p in P)
108+
sage: all(q.hasse_invariant(p) == -1 for p in P)
109109
True
110110
111111
TESTS:
@@ -768,8 +768,8 @@ def _latex_(self):
768768
return out_str
769769

770770
def __getitem__(self, ij):
771-
"""
772-
Return the coefficient `a_{ij}` of `x_i * x_j`.
771+
r"""
772+
Return the coefficient `a_{ij}` of `x_i\cdot x_j`.
773773
774774
EXAMPLES::
775775
@@ -794,8 +794,8 @@ def __getitem__(self, ij):
794794
return self.__coeffs[i*self.__n - i*(i-1)//2 + j - i]
795795

796796
def __setitem__(self, ij, coeff):
797-
"""
798-
Set the coefficient `a_{ij}` in front of `x_i * x_j`.
797+
r"""
798+
Set the coefficient `a_{ij}` in front of `x_i\cdot x_j`.
799799
800800
EXAMPLES::
801801
@@ -968,15 +968,15 @@ def sum_by_coefficients_with(self, right):
968968
# =========================================================================================================================
969969

970970
def __call__(self, v):
971-
"""
971+
r"""
972972
Evaluate this quadratic form `Q` on a vector or matrix of elements
973973
coercible to the base ring of the quadratic form. If a vector
974974
is given then the output will be the ring element `Q(v)`, but if a
975975
matrix is given then the output will be the quadratic form `Q'`
976976
which in matrix notation is given by:
977977
978978
.. MATH::
979-
Q' = v^t * Q * v.
979+
Q' = v^t\cdot Q\cdot v.
980980
981981
982982
EXAMPLES:
@@ -1147,8 +1147,8 @@ def _is_even_symmetric_matrix_(self, A, R=None):
11471147
# =====================================================================================================
11481148

11491149
def matrix(self):
1150-
"""
1151-
Return the Hessian matrix `A` for which `Q(X) = (1/2) * X^t * A * X`.
1150+
r"""
1151+
Return the Hessian matrix `A` for which `Q(X) = (1/2) X^t\cdot A\cdot X`.
11521152
11531153
EXAMPLES::
11541154
@@ -1162,8 +1162,8 @@ def matrix(self):
11621162
return self.Hessian_matrix()
11631163

11641164
def Hessian_matrix(self):
1165-
"""
1166-
Return the Hessian matrix `A` for which `Q(X) = (1/2) * X^t * A * X`.
1165+
r"""
1166+
Return the Hessian matrix `A` for which `Q(X) = (1/2) X^t\cdot A\cdot X`.
11671167
11681168
EXAMPLES::
11691169
@@ -1189,13 +1189,13 @@ def Hessian_matrix(self):
11891189
return matrix(self.base_ring(), self.dim(), self.dim(), mat_entries)
11901190

11911191
def Gram_matrix_rational(self):
1192-
"""
1192+
r"""
11931193
Return a (symmetric) Gram matrix `A` for the quadratic form `Q`,
11941194
meaning that
11951195
11961196
.. MATH::
11971197
1198-
Q(x) = x^t * A * x,
1198+
Q(x) = x^t\cdot A\cdot x,
11991199
12001200
defined over the fraction field of the base ring.
12011201
@@ -1214,13 +1214,13 @@ def Gram_matrix_rational(self):
12141214
return (ZZ(1) / ZZ(2)) * self.matrix()
12151215

12161216
def Gram_matrix(self):
1217-
"""
1217+
r"""
12181218
Return a (symmetric) Gram matrix `A` for the quadratic form `Q`,
12191219
meaning that
12201220
12211221
.. MATH::
12221222
1223-
Q(x) = x^t * A * x,
1223+
Q(x) = x^t\cdot A\cdot x,
12241224
12251225
defined over the base ring of `Q`. If this is not possible,
12261226
then a :class:`TypeError` is raised.
@@ -1251,7 +1251,7 @@ def Gram_matrix(self):
12511251
raise TypeError("this form does not have an integral Gram matrix")
12521252

12531253
def has_integral_Gram_matrix(self):
1254-
"""
1254+
r"""
12551255
Return whether the quadratic form has an integral Gram matrix (with respect to its base ring).
12561256
12571257
A warning is issued if the form is defined over a field, since in that case the return is trivially true.
@@ -1484,7 +1484,7 @@ def base_ring(self):
14841484
return self.__base_ring
14851485

14861486
def coefficients(self):
1487-
"""
1487+
r"""
14881488
Return the matrix of upper triangular coefficients,
14891489
by reading across the rows from the main diagonal.
14901490
@@ -1497,8 +1497,8 @@ def coefficients(self):
14971497
return self.__coeffs
14981498

14991499
def det(self):
1500-
"""
1501-
Return the determinant of the Gram matrix of `2*Q`, or
1500+
r"""
1501+
Return the determinant of the Gram matrix of `2\cdot Q`, or
15021502
equivalently the determinant of the Hessian matrix of `Q`.
15031503
15041504
.. NOTE:
@@ -1525,7 +1525,7 @@ def det(self):
15251525
return new_det
15261526

15271527
def Gram_det(self):
1528-
"""
1528+
r"""
15291529
Return the determinant of the Gram matrix of `Q`.
15301530
15311531
.. NOTE::
@@ -1590,8 +1590,8 @@ def change_ring(self, R):
15901590
def level(self):
15911591
r"""
15921592
Determines the level of the quadratic form over a PID, which is a
1593-
generator for the smallest ideal `N` of `R` such that N * (the matrix of
1594-
2*Q)^(-1) is in `R` with diagonal in `2R`.
1593+
generator for the smallest ideal `N` of `R` such that `N\cdot (` the matrix of
1594+
`2*Q` `)^{(-1)}` is in `R` with diagonal in `2R`.
15951595
15961596
Over `\ZZ` this returns a non-negative number.
15971597
@@ -1658,9 +1658,9 @@ def level(self):
16581658
return lvl
16591659

16601660
def level_ideal(self):
1661-
"""
1662-
Determines the level of the quadratic form (over `R`), which is the
1663-
smallest ideal `N` of `R` such that N * (the matrix of 2*Q)^(-1) is
1661+
r"""
1662+
Determine the level of the quadratic form (over `R`), which is the
1663+
smallest ideal `N` of `R` such that `N \cdot (` the matrix of `2Q` `)^{(-1)}` is
16641664
in `R` with diagonal in `2R`.
16651665
(Caveat: This always returns the principal ideal when working over a field!)
16661666

src/sage/quadratic_forms/quadratic_form__evaluate.pyx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
def QFEvaluateVector(Q, v):
5-
"""
5+
r"""
66
Evaluate this quadratic form `Q` on a vector or matrix of elements
77
coercible to the base ring of the quadratic form. If a vector
88
is given, then the output will be the ring element `Q(v)`, but if a
@@ -11,7 +11,7 @@ def QFEvaluateVector(Q, v):
1111
1212
.. MATH::
1313
14-
Q' = v^t * Q * v.
14+
Q' = v^t\cdot Q\cdot v.
1515
1616
.. NOTE::
1717
@@ -45,7 +45,7 @@ def QFEvaluateVector(Q, v):
4545

4646

4747
cdef QFEvaluateVector_cdef(Q, v):
48-
"""
48+
r"""
4949
Routine to quickly evaluate a quadratic form `Q` on a vector `v`. See
5050
the Python wrapper function :meth:`QFEvaluate` above for details.
5151
@@ -72,7 +72,7 @@ def QFEvaluateMatrix(Q, M, Q2):
7272
7373
.. MATH::
7474
75-
Q_2 = M^t * Q * M.
75+
Q_2 = M^t\cdot Q\cdot M.
7676
7777
.. NOTE::
7878
@@ -113,7 +113,7 @@ def QFEvaluateMatrix(Q, M, Q2):
113113

114114

115115
cdef QFEvaluateMatrix_cdef(Q, M, Q2):
116-
"""
116+
r"""
117117
Routine to quickly evaluate a quadratic form `Q` on a matrix `M`. See
118118
the Python wrapper function :func:`QFEvaluateMatrix` above for details.
119119

src/sage/quadratic_forms/quadratic_form__genus.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def local_genus_symbol(self, p):
5959
This is defined (in the class
6060
:class:`~sage.quadratic_forms.genera.genus.Genus_Symbol_p_adic_ring`)
6161
to be a list of tuples (one for each Jordan component
62-
`p^m*A` at `p`, where `A` is a unimodular symmetric matrix with
62+
`p^m\cdot A` at `p`, where `A` is a unimodular symmetric matrix with
6363
coefficients the `p`-adic integers) of the following form:
6464
6565
- If `p>2`, then return triples of the form [`m`, `n`, `d`] where
@@ -68,15 +68,15 @@ def local_genus_symbol(self, p):
6868
6969
- `n` = rank of `A`
7070
71-
- `d` = det(`A`) in {1,`u`} for normalized quadratic non-residue `u`.
71+
- `d` = det(`A`) in {1, `u`} for normalized quadratic non-residue `u`.
7272
7373
- If `p=2`, then return quintuples of the form [`m`, `n`, `s`, `d`, `o`] where
7474
7575
- `m` = valuation of the component
7676
7777
- `n` = rank of `A`
7878
79-
- `d` = det(`A`) in {1,3,5,7}
79+
- `d` = det(`A`) in {1, 3, 5, 7}
8080
8181
- `s` = 0 (or 1) if `A` is even (or odd)
8282

src/sage/quadratic_forms/quadratic_form__local_field_invariants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ def hasse_invariant__OMeara(self, p):
470470
471471
.. MATH::
472472
473-
c_p = \prod_{i <= j} (a_i, a_j)_p
473+
c_p = \prod_{i \leq j} (a_i, a_j)_p
474474
475475
where `(a,b)_p` is the Hilbert symbol at `p`.
476476

src/sage/quadratic_forms/quadratic_form__local_representation_conditions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ def local_representation_conditions(self, recompute_flag=False, silent_flag=Fals
622622
unless `p=2`). The first element is always the prime `p` where the
623623
local obstruction occurs, and the next 8 (or 4) entries represent
624624
square-classes in the `p`-adic integers `\ZZ_p`, and are labeled by the
625-
`\QQ_p` square-classes `t*(\QQ_p)^2` with `t` given as follows:
625+
`\QQ_p` square-classes `t\cdot (\QQ_p)^2` with `t` given as follows:
626626
627627
- for `p > 2`, ``[ * 1 u p u p * * * * ]``,
628628
@@ -632,18 +632,18 @@ def local_representation_conditions(self, recompute_flag=False, silent_flag=Fals
632632
number needs to be in that square-class in order to be locally
633633
represented by `Q`. A negative number indicates that the entire `\QQ_p`
634634
square-class is not represented, while a positive number `x` indicates
635-
that `t*p^{(2*x)} (\ZZ_p)^2` is locally represented but `t*p^{(2*(x-1))}`
635+
that `t\cdot p^{(2\cdot x)} (\ZZ_p)^2` is locally represented but `t\cdot p^{(2\cdot (x-1))}`
636636
`(\ZZ_p)^2` is not.
637637
638638
As an example, the vector ``[2 3 0 0 0 0 2 0 infinity]``
639639
tells us that all positive integers are locally represented at `p=2`
640640
except those of the forms:
641641
642-
- `2^6 * u * r^2` with `u = 1` (mod 8)
642+
- `2^6\cdot u\cdot r^2` with `u = 1` (mod 8)
643643
644-
- `2^5 * u * r^2` with `u = 3` (mod 8)
644+
- `2^5\cdot u\cdot r^2` with `u = 3` (mod 8)
645645
646-
- `2 * u * r^2` with `u = 7` (mod 8)
646+
- `2\cdot u\cdot r^2` with `u = 7` (mod 8)
647647
648648
At the real numbers, the vector which looks like ``[infinity, 0, infinity, None, None, None, None, None, None]``
649649
means that `Q` is negative definite (i.e., the 0 tells us all

src/sage/quadratic_forms/quadratic_form__reduction_theory.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ def minkowski_reduction(self):
140140
141141
.. MATH::
142142
143-
Q(v_k) \leq Q(s_1 * v_1 + ... + s_n * v_n)
143+
Q(v_k) \leq Q(s_1\cdot v_1 + ... + s_n\cdot v_n)
144144
145-
for all `s_i` where GCD`(s_k, ... s_n) = 1`.
145+
for all `s_i` where `\gcd(s_k, ... s_n) = 1`.
146146
147147
.. NOTE::
148148
@@ -270,7 +270,7 @@ def minkowski_reduction_for_4vars__SP(self):
270270
271271
.. MATH::
272272
273-
Q(v_k) \leq Q(s_1 * v_1 + ... + s_n * v_n)
273+
Q(v_k) \leq Q(s_1\cdot v_1 + ... + s_n\cdot v_n)
274274
275275
for all `s_i` where GCD(`s_k, ... s_n`) = 1.
276276

src/sage/quadratic_forms/quadratic_form__split_local_covering.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ def split_local_cover(self):
364364
365365
.. MATH::
366366
367-
d*x^2 + T(y,z,w)
367+
d\cdot x^2 + T(y,z,w)
368368
369369
where `d > 0` is as small as possible.
370370

src/sage/quadratic_forms/quadratic_form__ternary_Tornaria.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def is_adjoint(self) -> bool:
187187

188188

189189
def reciprocal(self):
190-
"""
190+
r"""
191191
This gives the reciprocal quadratic form associated to the given form.
192192
This is defined as the multiple of the primitive adjoint with the same
193193
content as the given form.
@@ -213,7 +213,7 @@ def reciprocal(self):
213213

214214

215215
def omega(self):
216-
"""
216+
r"""
217217
This is the content of the adjoint of the primitive associated quadratic form.
218218
219219
Ref: See Dickson's "Studies in Number Theory".
@@ -229,7 +229,7 @@ def omega(self):
229229

230230

231231
def delta(self):
232-
"""
232+
r"""
233233
This is the omega of the adjoint form,
234234
which is the same as the omega of the reciprocal form.
235235
@@ -243,14 +243,14 @@ def delta(self):
243243

244244

245245
def level__Tornaria(self):
246-
"""
246+
r"""
247247
Return the level of the quadratic form,
248248
defined as
249249
250-
- level(B) for even dimension,
251-
- level(B)/4 for odd dimension,
250+
- level(`B`) for even dimension,
251+
- level(`B`)/4 for odd dimension,
252252
253-
where `2Q(x) = x^t * B * x`.
253+
where `2Q(x) = x^t\cdot B\cdot x`.
254254
255255
This agrees with the usual level for even dimension...
256256
@@ -269,7 +269,7 @@ def level__Tornaria(self):
269269

270270

271271
def discrec(self):
272-
"""
272+
r"""
273273
Return the discriminant of the reciprocal form.
274274
275275
EXAMPLES::

0 commit comments

Comments
 (0)