Skip to content

Commit c79dcfc

Browse files
author
Release Manager
committed
gh-40473: Handling the automorphism group of the trivial sublattice <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes #12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes #12345". --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. I have also raised the NotImplementedError for indefinite lattices earlier to avoid an indentation block for the core of the method URL: #40473 Reported by: Edgar Costa Reviewer(s): Edgar Costa, Travis Scrimshaw
2 parents 2dea3c8 + 5bc99e8 commit c79dcfc

File tree

1 file changed

+32
-21
lines changed

1 file changed

+32
-21
lines changed

src/sage/modules/free_quadratic_module_integer_symmetric.py

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,34 +1265,45 @@ def orthogonal_group(self, gens=None, is_finite=None):
12651265
[1 0]
12661266
[0 1]
12671267
)
1268+
1269+
We can handle the trivial sublattice::
1270+
1271+
sage: A1 = IntegralLattice("A1")
1272+
sage: L = A1.sublattice([])
1273+
sage: L.orthogonal_group()
1274+
Group of isometries with 1 generator ([1],)
12681275
"""
12691276
from sage.categories.groups import Groups
12701277
from sage.groups.matrix_gps.isometries import GroupOfIsometries
1271-
sig = self.signature_pair()
1272-
if gens is None:
1278+
1279+
if gens is None and self.rank() == 0: # trivial lattice
12731280
gens = []
1274-
if sig[1] == 0 or sig[0] == 0: # definite
1275-
from sage.quadratic_forms.quadratic_form import QuadraticForm
1276-
is_finite = True
1277-
# Compute transformation matrix to the ambient module.
1278-
L = self.overlattice(self.ambient_module().gens())
1279-
Orthogonal = L.orthogonal_complement(self)
1280-
B = self.basis_matrix().stack(Orthogonal.basis_matrix())
1281-
if sig[0] == 0: # negative definite
1282-
q = QuadraticForm(ZZ, -2*self.gram_matrix())
1283-
else: # positive definite
1284-
q = QuadraticForm(ZZ, 2*self.gram_matrix())
1285-
identity = matrix.identity(Orthogonal.rank())
1286-
for g in q.automorphism_group().gens():
1287-
g = g.matrix().T
1288-
# We continue g as identity on the orthogonal complement.
1289-
g = matrix.block_diagonal([g, identity])
1290-
g = B.inverse()*g*B
1291-
gens.append(g)
1292-
else: # indefinite
1281+
is_finite = True
1282+
if gens is None:
1283+
sig = self.signature_pair()
1284+
if not (sig[1] == 0 or sig[0] == 0): # indefinite
12931285
raise NotImplementedError(
12941286
"currently, we can only compute generators "
12951287
"for orthogonal groups over definite lattices.")
1288+
1289+
# definite
1290+
from sage.quadratic_forms.quadratic_form import QuadraticForm
1291+
is_finite = True
1292+
# Compute transformation matrix to the ambient module.
1293+
L = self.overlattice(self.ambient_module().gens())
1294+
Orthogonal = L.orthogonal_complement(self)
1295+
direct_sum_basis = self.basis_matrix().stack(Orthogonal.basis_matrix())
1296+
if sig[0] == 0: # negative definite
1297+
q = QuadraticForm(ZZ, -2*self.gram_matrix())
1298+
else: # positive definite
1299+
q = QuadraticForm(ZZ, 2*self.gram_matrix())
1300+
identity = matrix.identity(Orthogonal.rank())
1301+
gens = []
1302+
for g in q.automorphism_group().gens():
1303+
# We lift the automorphism by living the orthogonal complement invariant
1304+
g_directsum = matrix.block_diagonal([g.matrix().T, identity])
1305+
g_on_L = direct_sum_basis.inverse()*g_directsum*direct_sum_basis
1306+
gens.append(g_on_L)
12961307
deg = self.degree()
12971308
base = self.ambient_vector_space().base_ring()
12981309
inv_bil = self.inner_product_matrix()

0 commit comments

Comments
 (0)