Skip to content

Conversation

S17A05
Copy link
Member

@S17A05 S17A05 commented Mar 6, 2024

Implemented the computation of the (local) Hilbert symbol at a place of a global function field of odd characteristic following formula 12.4.10 in John Voight's "Quaternion Algebras" (in preparation of extending some quaternion algebra functionality to these global function fields).

The global Hilbert symbol will be implemented via a call to .is_matrix_ring() of the appropriate quaternion algebra once the latter method has been extended using an extension of PR #37173, which will be done once both this PR and the referenced PR have been merged.

Amends: Changed some documentation, adapted characteristic check to check ==2 instead of <= 2
@S17A05 S17A05 force-pushed the fun_field_hilbert branch from 54611e1 to be7c5f1 Compare March 6, 2024 14:02
Amend: Added missing multiline continuation markers
@S17A05 S17A05 force-pushed the fun_field_hilbert branch from cb29b63 to c12a9de Compare March 8, 2024 06:24
S17A05 added 3 commits March 8, 2024 08:38
- Simplified return command, removed `ZZ` from import again
- Return `0` instead of an error for zero inputs
S17A05 added 3 commits March 26, 2024 13:23
- Fixed errors caused by unexpected behavior of reduction map
- Added examples for bimultiplicativity
- Corrected docstring
Amend: Fixed weird spacing
@S17A05 S17A05 force-pushed the fun_field_hilbert branch from 7d7bcdd to 894a6b4 Compare March 26, 2024 12:59
- Fixed Lint issue
- Implemented reviewer feedback
- Added checks for symmetry
@kwankyu
Copy link
Collaborator

kwankyu commented Mar 27, 2024

I fixed typos and refined the docstring. If you pardon me, please consider:

diff --git a/src/sage/rings/function_field/function_field.py b/src/sage/rings/function_field/function_field.py
index d1652873c71..4f91e51c111 100644
--- a/src/sage/rings/function_field/function_field.py
+++ b/src/sage/rings/function_field/function_field.py
@@ -1229,23 +1229,10 @@ class FunctionField(Field):
 
     def hilbert_symbol(self, a, b, P):
         r"""
-        Return the Hilbert symbol `(a,b)_{F_P}` (where `F_P` is the
-        completion of this function field at the place `P`).
+        Return the Hilbert symbol `(a,b)_{F_P}` for the local field `F_P`.
 
-        The Hilbert symbol `(a,b)_{F_P}` is `0` if one of `a` or `b` is
-        zero. Otherwise it takes the value `1` if  the quaternion algebra
-        defined by `(a,b)` over `F_P` is split, and `-1` if it is division.
-
-        For the valuation `\nu` belonging to the completion of the function
-        field at `P`, we compute the valuations `\nu(a)` and `\nu(b)` as well
-        as elements `a_0` and `b_0` such that, for a uniformizer `\pi` of
-        `\nu`, the elememts `a*\pi^{-\nu(a))}` and `a_0` respectively the
-        elements `b*\pi^{-\nu(b)}` and `b_0` are congruent modulo `\pi`.
-        Motivated by formula 12.4.10 in [Voi2021]_.
-
-        Currently only tested for function fields separable over their base
-        since places are not fully supported for other function fields. Only
-        implemented for global function fields of odd characteristic.
+        The local field `F_P` is the completion of this function field `F` at
+        the place `P`.
 
         INPUT:
 
@@ -1253,6 +1240,23 @@ class FunctionField(Field):
 
         - ``P`` -- a place of this function field
 
+        The Hilbert symbol `(a,b)_{F_P}` is `0` if `a` or `b` is zero.
+        Otherwise it takes the value `1` if  the quaternion algebra defined by
+        `(a,b)` over `F_P` is split, and `-1` if it is a division ring.
+
+        ALGORITHM:
+
+        For the valuation `\nu = \nu_P` of `F`, we compute the valuations
+        `\nu(a)` and `\nu(b)` as well as elements `a_0` and `b_0` of the
+        residue field such that for a uniformizer `\pi` at `P`,
+        `a\pi^{-\nu(a)}` and `a_0` respectively `b\pi^{-\nu(b)}` and `b_0` are
+        congruent modulo `\pi`.  Then the Hilbert symbol is computed by the
+        formula 12.4.10 in [Voi2021]_.
+
+        Currently only implemented for global function fields of odd
+        characteristic since places are not fully supported for other function
+        fields.
+
         EXAMPLES::

@S17A05
Copy link
Member Author

S17A05 commented Mar 27, 2024

I fixed typos and refined the docstring. If you pardon me, please consider:

diff --git a/src/sage/rings/function_field/function_field.py b/src/sage/rings/function_field/function_field.py
index d1652873c71..4f91e51c111 100644
--- a/src/sage/rings/function_field/function_field.py
+++ b/src/sage/rings/function_field/function_field.py
@@ -1229,23 +1229,10 @@ class FunctionField(Field):
 
     def hilbert_symbol(self, a, b, P):
         r"""
-        Return the Hilbert symbol `(a,b)_{F_P}` (where `F_P` is the
-        completion of this function field at the place `P`).
+        Return the Hilbert symbol `(a,b)_{F_P}` for the local field `F_P`.
 
-        The Hilbert symbol `(a,b)_{F_P}` is `0` if one of `a` or `b` is
-        zero. Otherwise it takes the value `1` if  the quaternion algebra
-        defined by `(a,b)` over `F_P` is split, and `-1` if it is division.
-
-        For the valuation `\nu` belonging to the completion of the function
-        field at `P`, we compute the valuations `\nu(a)` and `\nu(b)` as well
-        as elements `a_0` and `b_0` such that, for a uniformizer `\pi` of
-        `\nu`, the elememts `a*\pi^{-\nu(a))}` and `a_0` respectively the
-        elements `b*\pi^{-\nu(b)}` and `b_0` are congruent modulo `\pi`.
-        Motivated by formula 12.4.10 in [Voi2021]_.
-
-        Currently only tested for function fields separable over their base
-        since places are not fully supported for other function fields. Only
-        implemented for global function fields of odd characteristic.
+        The local field `F_P` is the completion of this function field `F` at
+        the place `P`.
 
         INPUT:
 
@@ -1253,6 +1240,23 @@ class FunctionField(Field):
 
         - ``P`` -- a place of this function field
 
+        The Hilbert symbol `(a,b)_{F_P}` is `0` if `a` or `b` is zero.
+        Otherwise it takes the value `1` if  the quaternion algebra defined by
+        `(a,b)` over `F_P` is split, and `-1` if it is a division ring.
+
+        ALGORITHM:
+
+        For the valuation `\nu = \nu_P` of `F`, we compute the valuations
+        `\nu(a)` and `\nu(b)` as well as elements `a_0` and `b_0` of the
+        residue field such that for a uniformizer `\pi` at `P`,
+        `a\pi^{-\nu(a)}` and `a_0` respectively `b\pi^{-\nu(b)}` and `b_0` are
+        congruent modulo `\pi`.  Then the Hilbert symbol is computed by the
+        formula 12.4.10 in [Voi2021]_.
+
+        Currently only implemented for global function fields of odd
+        characteristic since places are not fully supported for other function
+        fields.
+
         EXAMPLES::

Thanks, I'll integrate your changes. Just one small thing: Technically speaking there is a difference to formula 12.4.10 in [Voi2021]_, because the element $a_0$ computed in the code is only congruent modulo $\pi$ to $a \pi^{-\nu(a)}$ (which is the $a_0$ defined in the book) - effectively, this of course doesn't make a difference. Should I still keep the last sentence of the first ALGORITHM paragpraph as you wrote it?

@kwankyu
Copy link
Collaborator

kwankyu commented Mar 27, 2024

Anyone reading the paragraph and the formula will understand that. Not a big deal. Also you explained the point.

S17A05 and others added 3 commits March 28, 2024 02:54
- Rewrote docstring accordings to suggestions
- Fixed typo in comment
@S17A05
Copy link
Member Author

S17A05 commented Mar 28, 2024

I implemented a slightly modified version of your suggested docstring, mainly because I wanted to emphasize that $a_0$ and $b_0$ are elements of the residue field here, rather than of the discrete valuation ring.

Copy link

Documentation preview for this PR (built with commit 4f1e025; changes) is ready! 🎉

Copy link
Collaborator

@kwankyu kwankyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. LGTM.

@vbraun vbraun merged commit 7ef5465 into sagemath:develop Mar 31, 2024
@S17A05 S17A05 deleted the fun_field_hilbert branch April 1, 2024 21:50
vbraun pushed a commit to vbraun/sage that referenced this pull request Feb 18, 2025
sagemathgh-37173: Implemented `.ramified_places` and modified further methods to extend quaternion algebra functionality to number fields
    
1. Implemented method `.ramified_places` for quaternion algebras over
number fields. Integrated `.ramified_primes()` into it in the process.
2. Modified `.is_division_algebra()`, `.is_matrix_ring()` and
`.is_isomorphic` to use `.ramified_places` instead of `.discriminant()`,
thus extending them to base number fields.
3. Rerouted `.discriminant()` through `.ramified_places` since the
original call to `.hilbert_conductor` also computed all finite ramified
places.
4. Added `.is_totally_definite()` and moved `is_definite()`.

Some more detail:
1. The new method `.ramified_places` returns all places at which the
quaternion algebra `self` ramifies; this includes the infinite places by
default, but can be reduced to only the finite places with the optional
parameter `inf`. The old version of `.ramified_primes()` from sagemath#37164 has
been integrated into `.ramified_places`, thus setting the former up for
possible future deprecation; currently it calls
`self.ramified_places(inf=False)` for backwards compatibility.

2. `.is_division_algebra()` and `.is_matrix_ring()` now instead check
whether the list of ramified places (finite and infinite) is trivial.
`.is_isomorphic` now compares the set of finite ramified places and,
unless working over $\mathbb{Q}$, the list of infinite ramified places
of both algebras. The latter can be compared as lists since the real
embeddings of the number field are sorted independently of each
algebras' invariants, but the former (probably) need to be compared as
sets since the order of the list depends on the primes above the
respective invariants. The docstring of `.is_isomorphic` (as well as
some of the other docstrings) now includes an example of a non-split
quaternion algebra with trivial discriminant, namely the algebra with
invariants $(-1,-1)$ over the quadratic field $\mathbb{Q}(\sqrt{5})$.

Possible future work:
- Extend functionality to all global fields (of characteristic not equal
to $2$) [UPDATE: Will be done once both this PR and sagemath#37554 have been
merged]
    
URL: sagemath#37173
Reported by: Sebastian A. Spindler
Reviewer(s): AurelPage, Frédéric Chapoton, grhkm21, Matthias Köppe, Sebastian A. Spindler
vbraun pushed a commit to vbraun/sage that referenced this pull request Feb 21, 2025
sagemathgh-37173: Implemented `.ramified_places` and modified further methods to extend quaternion algebra functionality to number fields
    
1. Implemented method `.ramified_places` for quaternion algebras over
number fields. Integrated `.ramified_primes()` into it in the process.
2. Modified `.is_division_algebra()`, `.is_matrix_ring()` and
`.is_isomorphic` to use `.ramified_places` instead of `.discriminant()`,
thus extending them to base number fields.
3. Rerouted `.discriminant()` through `.ramified_places` since the
original call to `.hilbert_conductor` also computed all finite ramified
places.
4. Added `.is_totally_definite()` and moved `is_definite()`.

Some more detail:
1. The new method `.ramified_places` returns all places at which the
quaternion algebra `self` ramifies; this includes the infinite places by
default, but can be reduced to only the finite places with the optional
parameter `inf`. The old version of `.ramified_primes()` from sagemath#37164 has
been integrated into `.ramified_places`, thus setting the former up for
possible future deprecation; currently it calls
`self.ramified_places(inf=False)` for backwards compatibility.

2. `.is_division_algebra()` and `.is_matrix_ring()` now instead check
whether the list of ramified places (finite and infinite) is trivial.
`.is_isomorphic` now compares the set of finite ramified places and,
unless working over $\mathbb{Q}$, the list of infinite ramified places
of both algebras. The latter can be compared as lists since the real
embeddings of the number field are sorted independently of each
algebras' invariants, but the former (probably) need to be compared as
sets since the order of the list depends on the primes above the
respective invariants. The docstring of `.is_isomorphic` (as well as
some of the other docstrings) now includes an example of a non-split
quaternion algebra with trivial discriminant, namely the algebra with
invariants $(-1,-1)$ over the quadratic field $\mathbb{Q}(\sqrt{5})$.

Possible future work:
- Extend functionality to all global fields (of characteristic not equal
to $2$) [UPDATE: Will be done once both this PR and sagemath#37554 have been
merged]
    
URL: sagemath#37173
Reported by: Sebastian A. Spindler
Reviewer(s): AurelPage, Frédéric Chapoton, grhkm21, Matthias Köppe, Sebastian A. Spindler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants