Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transform.merge produces incorrect output for non-orientation-preserving transformations #24

Open
switzel opened this issue Aug 29, 2023 · 2 comments

Comments

@switzel
Copy link

switzel commented Aug 29, 2023

Something goes wrong when Transform.merge() is applied to transformations that are not all orientation-preserving. Below is a (not quite) minimal example illustrating the problem. The second and third output point should be equal and should be the first one with the second coordinated negated. However, the second one is not.

import math
import hyperbolic.poincare as pc

half_to_disk = pc.Transform.half_to_disk()
infty = pc.Ideal.from_degree(90)
p = half_to_disk.apply_to_tuple((.5,math.sqrt(3)/2))
q = half_to_disk.apply_to_tuple((0,1))
rot_q = pc.Transform.rotation(deg=-90)
rot_p = pc.Transform.merge(pc.Transform.shift_origin(p),pc.Transform.rotation(deg=-60),pc.Transform.shift_origin(p).inverted())
refl = pc.Transform.mirror()
par = pc.Transform.merge(rot_p,rot_p,rot_q,rot_q)
t = pc.Transform.merge(par,par,refl)
print(t.apply_to_point(infty),pc.Transform.merge(refl,t).apply_to_point(infty),refl.apply_to_point(t.apply_to_point(infty)))
@cduck
Copy link
Owner

cduck commented Aug 31, 2023

Thanks for opening the issue. Looking at the last line of your example, if I switch t and refl in merge(t,refl) it's output matches the last output.

Does this match your understanding? The arguments of merge are applied in the other order?

@switzel
Copy link
Author

switzel commented Aug 31, 2023

I think the problem is this: the matrices act (apply_to_tuple) from the left and if a transformation conjugates, it does so before multiplying the matrix. So when multiplying (merge) conjugation should be applied to the entries of the product to the right, not to the left. I attempted a fix in my fork (branch semidirect_product), but at the moment there's still something wrong. I'll have a closer look when I find time.

Btw. a smaller illustration is to compare merge(rot_q, refl).apply_to_point(infty) to rot_q.apply_to_point(refl.apply_to_point(infty)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants