@@ -85,7 +85,7 @@ def geodesic_circle(alpha, beta, return_equation=True):
85
85
assert C .imag ().abs () < 10 ** - 10 , C
86
86
try :
87
87
r2 = (alpha - C ).norm ()
88
- except AttributError :
88
+ except AttributeError :
89
89
r2 = (alpha - C ) ** 2
90
90
x , y = PolynomialRing (C .parent (), 2 , names = "x,y" ).gens ()
91
91
return (
@@ -284,12 +284,12 @@ def get_embgquats_twisted(self, P=None):
284
284
if P is None :
285
285
CC = ComplexField (800 )
286
286
P = CC (90 ) / CC (100 ) * CC .gen ()
287
- embgquats = self .embgquats
288
287
Pconj = P .conjugate ()
289
288
m = Matrix ([[Pconj , - P ], [1 , - 1 ]])
290
289
madj = m .adjugate ()
291
290
return [None ] + [tuple ((madj * o * m ).list ()) for o in self .embgquats [1 :]]
292
291
292
+
293
293
def get_word_rep (self , delta , P = None ): # fuchsian generic
294
294
while True :
295
295
try :
@@ -390,7 +390,7 @@ def magma_word_problem(self, Gm, x):
390
390
def draw_mat_list (self , x0 , g1 , mlist , color = "blue" ):
391
391
phi = self .get_archimedean_embedding (1000 )
392
392
P = hyperbolic_arc (x0 , act_flt (phi (g1 .quaternion_rep ), x0 ), color = "red" )
393
- vlist = G . _fundamental_domain
393
+ vlist = self . fundamental_domain ()
394
394
for g in mlist :
395
395
new_polygon = [act_flt (phi (g ), v ) for v in vlist ]
396
396
P += hyperbolic_polygon (new_polygon , color = color )
@@ -401,19 +401,18 @@ def mat_list(self, x1, x2, check_fundom=True): # generic
401
401
Returns a list S of matrices such that the geodesic (x1, x2) is contained in the union
402
402
of the translates s*D (with s in S) of the standard fundamental domain D.
403
403
"""
404
+ CC = x1 .parent ()
405
+ emb = self .get_archimedean_embedding (CC .precision ())
404
406
verbose ("Calling mat_list with x1 = %s and x2 = %s" % (x1 , x2 ))
405
- x1_orig = x1
406
- x2_orig = x2
407
407
n = 0
408
408
g = 1
409
409
if check_fundom and not self .is_in_fundom (x1 ):
410
410
t0 , g = self .find_fundom_rep (x1 )
411
- x1 , x2 = t0 , self (g ** - 1 ) * x2
411
+ x1 , x2 = t0 , act_flt ( emb ( self (g ** - 1 ). quaternion_rep ), x2 )
412
412
413
413
# Here we can assume that x1 is in the fundamental domain
414
414
ans = [self (g )]
415
415
while not self .is_in_fundom (x2 ):
416
- found = False
417
416
intersection_candidates = []
418
417
for i , (v1 , v2 ) in enumerate (self .fundamental_domain_data ()):
419
418
z = intersect_geodesic_arcs (v1 , v2 , x1 , x2 )
@@ -423,29 +422,22 @@ def mat_list(self, x1, x2, check_fundom=True): # generic
423
422
z1 , z2 = perturb_point_on_arc (x1 , x2 , z , eps )
424
423
if not self .is_in_fundom (z1 ):
425
424
z1 , z2 = z2 , z1
426
- try :
427
- assert self .is_in_fundom (
428
- z1
429
- ), "z1 and z2 are both outside of fundom!"
430
- assert not self .is_in_fundom (
431
- z2
432
- ), "z1 and z2 are both inside of fundom!"
425
+ if self .is_in_fundom (z1 ) and not self .is_in_fundom (z2 ):
433
426
intersection_candidates .append (((z1 , z2 ), i , (v1 , v2 )))
434
- except AssertionError :
435
- pass
436
427
assert len (intersection_candidates ) > 0 , "No intersection candidates!!"
437
428
if len (intersection_candidates ) > 1 :
438
429
verbose (intersection_candidates )
439
430
z1 , z2 = intersection_candidates [
440
431
ZZ .random_element (len (intersection_candidates ))
441
432
][0 ]
433
+ found = False
442
434
for g in self .gquats [1 :]:
443
- t0 = self (g ) ** - 1 * z2
435
+ t0 = act_flt ( emb (( self (g ) ** - 1 ). quaternion_rep ), z2 )
444
436
if self .is_in_fundom (t0 ):
445
437
assert not found , "Found more than one!"
446
438
found = True
447
439
x1 = t0
448
- x2 = self (g ) ** - 1 * x2
440
+ x2 = act_flt ( emb (( self (g ) ** - 1 ). quaternion_rep ), x2 )
449
441
verbose ("x1 = %s, x2 = %s" % (x1 , x2 ))
450
442
ans .append (ans [- 1 ] * self (g ))
451
443
break # DEBUG
@@ -472,7 +464,7 @@ def _fix_sign(self, x, N):
472
464
return x
473
465
474
466
def find_fundom_rep (
475
- self , z0_H , v0 = None , return_alternative = False , max_iters = 100
467
+ self , z0_H , v0 = None , return_alternative = False , max_iters = 100
476
468
): # generic -- Take z0 to the fundamental domain
477
469
r"""
478
470
Returns t0 and g such that g * t0 = z0_H, and t0 is in the fundamental domain
@@ -541,8 +533,8 @@ def find_fundom_rep(
541
533
oldji , oldgg = ji , gg
542
534
wd .append (gg )
543
535
verbose ("New g = %s\t delta = %s\t z0=%s" % (gg , delta , z0 ))
544
- t0 = self (delta ) * z0_H
545
- t1 = self (wd [- 1 ] ** - 1 * delta ) * z0_H
536
+ t0 = act_flt ( emb ( self (delta ). quaternion_rep ), z0_H )
537
+ t1 = act_flt ( emb ( self (wd [- 1 ] ** - 1 * delta ). quaternion_rep ), z0_H )
546
538
delta_inv = delta ** - 1
547
539
if return_alternative :
548
540
return (t0 , delta_inv ), (t1 , delta_inv * wd [- 1 ])
@@ -1288,17 +1280,17 @@ def mat_list(
1288
1280
of the translates s*D (with s in S) of the standard fundamental domain D.
1289
1281
"""
1290
1282
CC = x1 .parent ()
1291
- x1 += CC .random_element (10 ** - 1 ) * x1 .imag () ** 2
1292
- x2 += CC .random_element (10 ** - 1 ) * x2 .imag () ** 2
1283
+ x1 += CC .random_element (0. 1 ) * x1 .imag () ** 2
1284
+ x2 += CC .random_element (0. 1 ) * x2 .imag () ** 2
1293
1285
if debug :
1294
1286
from sage .repl .rich_output .pretty_print import show
1295
1287
1296
1288
self ._debug_plot = hyperbolic_polygon (
1297
1289
[
1298
- CC (- 0.5 , 10 ^ 2 ),
1290
+ CC (- 0.5 , 10 ** 2 ),
1299
1291
self .fundamental_domain ()[1 ],
1300
1292
self .fundamental_domain ()[2 ],
1301
- CC (0.5 , 10 ^ 2 ),
1293
+ CC (0.5 , 10 ** 2 ),
1302
1294
]
1303
1295
)
1304
1296
if v0 is None :
0 commit comments