-
Notifications
You must be signed in to change notification settings - Fork 66
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
Add support for pulser-diff backend #686
Conversation
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 think you had some changes that I ended up doing but they got applied anyway. I'll let you decided which ones actually make sense to keep
…coordinates are differentiable with pulser-diff
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.
New changes are looking 👌
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.
Last comment and we can merge, great job!
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.
Perfect, let's merge! Thanks a lot for your efforts
* works with basic features of pulser-diff * Fixed phase attribute setting; removed debugging code; reverted unnecessary changes * Modified register creation code to work with AbstractArray; register coordinates are differentiable with pulser-diff * Fixed type hints * Minor fixes and refactoring * Modified ParamObj code to work with quantum model training in pulser-diff * Minor refactoring; add possibility to ensure 0D AbstractArray is reshaped into 1D * Force array only for scalars
* works with basic features of pulser-diff * Fixed phase attribute setting; removed debugging code; reverted unnecessary changes * Modified register creation code to work with AbstractArray; register coordinates are differentiable with pulser-diff * Fixed type hints * Minor fixes and refactoring * Modified ParamObj code to work with quantum model training in pulser-diff * Minor refactoring; add possibility to ensure 0D AbstractArray is reshaped into 1D * Force array only for scalars
* works with basic features of pulser-diff * Fixed phase attribute setting; removed debugging code; reverted unnecessary changes * Modified register creation code to work with AbstractArray; register coordinates are differentiable with pulser-diff * Fixed type hints * Minor fixes and refactoring * Modified ParamObj code to work with quantum model training in pulser-diff * Minor refactoring; add possibility to ensure 0D AbstractArray is reshaped into 1D * Force array only for scalars
* works with basic features of pulser-diff * Fixed phase attribute setting; removed debugging code; reverted unnecessary changes * Modified register creation code to work with AbstractArray; register coordinates are differentiable with pulser-diff * Fixed type hints * Minor fixes and refactoring * Modified ParamObj code to work with quantum model training in pulser-diff * Minor refactoring; add possibility to ensure 0D AbstractArray is reshaped into 1D * Force array only for scalars
* Defining pulser.math and AbstractArray * POC: Differentiable constant pulse amp Typing is still failing * Fix typing in waveforms * Fix all typing errors in POC * Pass all existing UTs * Pass all UTs without array support * Fix typing * All tests pass with torch installed * Add support for pulser-diff backend (#686) * works with basic features of pulser-diff * Fixed phase attribute setting; removed debugging code; reverted unnecessary changes * Modified register creation code to work with AbstractArray; register coordinates are differentiable with pulser-diff * Fixed type hints * Minor fixes and refactoring * Modified ParamObj code to work with quantum model training in pulser-diff * Minor refactoring; add possibility to ensure 0D AbstractArray is reshaped into 1D * Force array only for scalars * Fix UTs after pulser-diff changes * Avoid using AbstractArrayLike outside of pulser.math * Preserve gradient in EOM mode * Add torch as an optional requirement * Support waveform multiplication with abstract array * Explicitly marking the differentiable parameters * Remove __array_wrap__ * Pass relevant UTs without array support * Support new features * Using pm.Differentiable whenever possible * Simplifying Waveform.__getitem__() type hint * UTs for new features outside of pulser.math * Write torch UTs for registers * Write UTs for waveforms * UTs for pulse * UTs for EOM * UTs on internal functionality * UTs for Sequence with autograd * Implicitly cover math functions * Removing AbstractArray.__hash__() and differentiable phase shifts * Finish unit tests * Update CI to run tests with and without torch * Fix CI errors * Fix failing no-torch UT * Minor corrections * Include pulser[torch] installation in the README * Fix warning in UT after merge * Incorporating the latest changes * Fix typing * Addressing review comments * Including `detach()` in Differentiable protocol * Differentiable -> TensorLike * Tentatively allow waveform division by array * Full coverage --------- Co-authored-by: Vytautas Abramavicius <145791635+vytautas-a@users.noreply.github.com>
Modify
pulser-core
to support all current features of differentiabletorch
backend.