Skip to content

Commit b75a9a4

Browse files
committed
reviewer comments
1 parent 4a74567 commit b75a9a4

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

src/sage/quadratic_forms/bqf_class_group.py

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,11 @@ def _coerce_map_from_(self, other):
355355
Class of 9*x^2 + 4*x*y + 9*y^2
356356
"""
357357
if not isinstance(other, BQFClassGroup):
358-
return None
358+
return super()._coerce_map_from_(other)
359359
try:
360360
proj = BQFClassGroupQuotientMorphism(other, self)
361361
except (TypeError, ValueError):
362-
return None
362+
return super()._coerce_map_from_(other)
363363
return proj
364364

365365

@@ -651,6 +651,9 @@ def _project_bqf(bqf, q):
651651
:class:`BQFClassGroup_element` of discriminant `D`
652652
in the form class group of discriminant `D/q^2`.
653653
654+
ALGORITHM: Find a class representative with `q^2 \mid a`
655+
(and `q \mid b`) and substitute `x\mapsto x/q`.
656+
654657
EXAMPLES::
655658
656659
sage: from sage.quadratic_forms.bqf_class_group import _project_bqf
@@ -671,9 +674,6 @@ def _project_bqf(bqf, q):
671674
-1 * 2^2 * 101^2
672675
sage: f2.discriminant().factor()
673676
-1 * 2^2
674-
675-
ALGORITHM: Find a class representative with `q^2 \mid a`
676-
(and `q\mid b`) and substitute `x\mapsto x/q`.
677677
"""
678678
q2 = q**2
679679
disc = bqf.discriminant()
@@ -770,23 +770,13 @@ def __init__(self, G, H):
770770
sage: from sage.quadratic_forms.bqf_class_group import BQFClassGroupQuotientMorphism
771771
sage: G = BQFClassGroup(-4*117117)
772772
sage: H = BQFClassGroup(-4*77)
773-
sage: BQFClassGroupQuotientMorphism(G, H)
774-
Generic morphism:
775-
From: Form Class Group of Discriminant -468468
776-
To: Form Class Group of Discriminant -308
773+
sage: f = BQFClassGroupQuotientMorphism(G, H)
774+
sage: TestSuite(f).run(skip='_test_category')
777775
"""
778776
if not isinstance(G, BQFClassGroup):
779-
try:
780-
disc = ZZ(G)
781-
except Exception:
782-
raise TypeError('G needs to be a BQFClassGroup')
783-
G = BQFClassGroup(disc)
777+
raise TypeError('G needs to be a BQFClassGroup')
784778
if not isinstance(H, BQFClassGroup):
785-
try:
786-
disc = ZZ(G)
787-
except Exception:
788-
raise TypeError('H needs to be a BQFClassGroup')
789-
H = BQFClassGroup(disc)
779+
raise TypeError('H needs to be a BQFClassGroup')
790780
try:
791781
self.f = ZZ((G.discriminant() / H.discriminant()).sqrt(extend=False)).factor()
792782
except ValueError:

0 commit comments

Comments
 (0)