@@ -355,11 +355,11 @@ def _coerce_map_from_(self, other):
355
355
Class of 9*x^2 + 4*x*y + 9*y^2
356
356
"""
357
357
if not isinstance (other , BQFClassGroup ):
358
- return None
358
+ return super (). _coerce_map_from_ ( other )
359
359
try :
360
360
proj = BQFClassGroupQuotientMorphism (other , self )
361
361
except (TypeError , ValueError ):
362
- return None
362
+ return super (). _coerce_map_from_ ( other )
363
363
return proj
364
364
365
365
@@ -651,6 +651,9 @@ def _project_bqf(bqf, q):
651
651
:class:`BQFClassGroup_element` of discriminant `D`
652
652
in the form class group of discriminant `D/q^2`.
653
653
654
+ ALGORITHM: Find a class representative with `q^2 \mid a`
655
+ (and `q \mid b`) and substitute `x\mapsto x/q`.
656
+
654
657
EXAMPLES::
655
658
656
659
sage: from sage.quadratic_forms.bqf_class_group import _project_bqf
@@ -671,9 +674,6 @@ def _project_bqf(bqf, q):
671
674
-1 * 2^2 * 101^2
672
675
sage: f2.discriminant().factor()
673
676
-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`.
677
677
"""
678
678
q2 = q ** 2
679
679
disc = bqf .discriminant ()
@@ -770,23 +770,13 @@ def __init__(self, G, H):
770
770
sage: from sage.quadratic_forms.bqf_class_group import BQFClassGroupQuotientMorphism
771
771
sage: G = BQFClassGroup(-4*117117)
772
772
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')
777
775
"""
778
776
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' )
784
778
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' )
790
780
try :
791
781
self .f = ZZ ((G .discriminant () / H .discriminant ()).sqrt (extend = False )).factor ()
792
782
except ValueError :
0 commit comments