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.
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
[Bugfix]
qml.BasisRotation
is not jax compatible #6019base: master
Are you sure you want to change the base?
[Bugfix]
qml.BasisRotation
is not jax compatible #6019Changes from 43 commits
76abf63
c17cf83
cb663d3
cb4d1f7
11a4b27
d811833
7edc75a
d47d601
ca95f7a
eb77772
7d6c223
38e3e68
07816df
cd76203
75e4f1e
8bfba22
34d4257
379b630
96028a2
bc34c6f
2ccc9ab
57bfc8a
650379c
a563754
e33bf03
43686b9
2b107c1
75edef1
2c7fffd
2b789cc
a8c2d99
182b173
7ef90fb
e8351dd
5cfabaf
b825617
9010de1
5541c89
62c4c23
9fb4d26
8b4eef5
545be3e
eec5149
4064fa6
be3df11
a512ae3
7914f53
8ebfebe
7da2f88
db61a73
1c752a1
200481d
af011ac
24d13c7
def0979
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
qml.math.copy
is not general enough for all interfaces?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.
No, it is not. 😅
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.
Nothing in
qml.math
can make this block general enough to work with any interface?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.
.at
and.set
is unique to JAX array since those are immutable and do not support item assignments. I did try making it work viaqml.math
but couldn't.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.
So the closest thing I could find in
qml.math
was this, but it doesn't completely capture our purpose and might cause performance degradation due tojax
array re-initializing. So, I have separated the index setting out to a separate private method.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.
Not a blocker for this PR, but it seems that
BasisRotation
is not included in the Templates doc here.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 is present 🤔
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.
Why this check is needed?
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.
This prevents the below
unitary
check, which would be incompatible in a JIT-environment.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.
Is this for checking both
jax
andautograd
at the same time? Seems to me thatassert qml.math.allclose
should be enough?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.
yes,
qml.math.allclose
should be sufficient for both. I usejnp.allclose
in the first one as I know bothres
andres2
must be JAX-arrays.