Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new Frame class for handling relativistic reference frame transformations, including creating rest frames, constructing a frame from a Lorentz vector, and computing the center-of-mass frame. It also adds corresponding tests, updates documentation, and provides examples to illustrate these new features.
- Adds a new Frame class with methods rest(), from_lvec(), and center_of_mass().
- Implements transformation methods (to_frame and transform_frame) in LVec.
- Updates tests, examples, and docs to demonstrate the new reference frame functionality.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| lvec/tests/test_frame.py | New tests validating proper Frame behavior and transformations |
| lvec/lvec.py | Updated boost method and added to_frame and transform_frame methods |
| lvec/frame.py | New Frame class implementation |
| lvec/init.py | Exports Frame class |
| examples/README.md | Updated example index to include reference frame usage |
| examples/10_reference_frames.py | New example demonstrating reference frame creation and transformation |
| docs/README.md | Documentation updated to include a section on reference frames |
| README.md | Main documentation updated with code examples for Frame usage |
Because I just forgot to reverse this Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR introduce a new
Frameclass providing a comprehensive framework for relativistic reference frame transformations.This will introduce the following methods for constructing frames
Frame.rest(): Create a stationary reference frameFrame.from_lvec(): Create a frame in which a specified Lorentz vector is at restFrame.center_of_mass(): Create a center-of-mass frame from a collection of particlesAnd the following methods for frames transformations
LVec.to_frame(): Transform a vector directly to a specified reference frameLVec.transform_frame(): Transform a vector between two explicit reference framesAnd updating the docs to include the new frame with example about how it can be used.