-
Notifications
You must be signed in to change notification settings - Fork 25
Fix x-axis during superrest rotation and minor changes #104
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this.
The first definition of
qis the (smallest) rotation that takeszdirectly ontochi_f. This should behave well, in the sense of making a very small change toxandy, whenchi_fis close toz— that is, there is no coordinate singularity there. It should behave badly ifchi_fis close to-z, and fail ifchi_f=-z, but I think that's intrinsic to what you're trying to do. So I think that part is entirely natural.But I don't see what the rest of it is doing. You do have the freedom to prepend any rotation about the
zaxis and still rotatezontochi_ref. But why this phase? It's impossible to actually fix thexaxis for generalchi_ref. I can imagine trying to confine it to the x-y or x-z plane, for example, but this doesn't do that. What's the goal?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well this makes it so that
chi_fis always point strictly alongz, and the addition of lines 420 - 422 make it so that the originalxvector, after the rotation, has no component in theydirection. So I thought this was confining thex-vector to be in thex-z- plane, and certainly from my tests this seems to be the case.Do you disagree?
I found this to be useful when trying to preserve phase information while mapping to the remnant frame and extracting QNMs, as it makes the QNM phases more consistent as a function of progenitors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a simple test case:
Which results in
-0.7071067811865475, so it's definitely not in the x-z plane. I'm sure there's a simple fix to make this work, but I don't have the time or brainpower right now to think about this.Also, I'm not convinced this is a good idea. When you impose artificial conditions like that on a rotation, you often get terrible numerical behavior. I guess it would be a small effect anyway when
chi_fstarts out close toz, which would be fine. But when you're gettingchi_fcloser to the diagonals betweenxandy, this starts introducing rotations of 90°, and then you'll start getting sign flips. So I'm very concerned about the robustness of this sort of thing.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, don't you have your
qandq.inverse()mixed up? If you replacequaternion.xin(q * quaternion.x * q.inverse()).ywithchi_fyou don't getz. If you do(q.inverse() * quaternion.x * q).ythen it works.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. Now I'm confused about what this function is supposed to return. The return statement identifies
qas aframe_rotation, which is defined here. The input system is decomposed in a frame(x, y, z), but its spin charge is off in some different directionchi_f; we want to transform to a new frame wherez' = chi_f, so that definition says thatwhich is what you get with this
q(both before and after the new stuff).Of course, the docstring does seem more consistent with the opposite interpretation. But in that case, I would have thought the return statement should use
frame_rotation=q.inverse().components.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's suppose to return the rotation (as a
BMSTransformation) such thatabd.transform(BMSTransformation.frame_rotation.components)yields anabdobject whose spin vector is pointing along thezaxis (which is what the code certainly does as of now). Is this confusion just stemming from how thetransformfunction does a passive rather than an active transformation?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where that last
zis reallyz_prime, right? Meaning that if you dothen
chi_prime[0]andchi_prime[1]are both approximately 0.0, right? If so, that's consistent with my interpretation.So the transformation will take the field and decompose it in a new coordinate system, the basis vectors of which are related to the basis vectors of the coordinate system of the original
abd(which are the same as those used inrotation_from_spin_charge) byand
But
x_prime.yis not zero.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok I understand now; I was using the inverted transformation formula when working this out, so in reality I was adjusting the quaternion such that
y_prime.xwas zero. If I just change the new code to bethen it will really make
x_prime.ybe zero. But it sounds like you don't want to do this anyways? So should I make this change or do you just want to just scrap this all together?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, that makes sense. If you and/or Aniket still like it, I have no objection to making this an option, with the default being the old behavior.
But could you also update the docstring with our understanding of what's supposed to be returned, including the statements that
and if the option is
True, thenThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok sounds good! Just pushed an update.