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
Add adjoint differentiation method #1032
Add adjoint differentiation method #1032
Changes from 9 commits
9fc4301
994a732
f402118
a426cca
0c62766
ccd080b
d823c52
8cccca8
89a78fa
5b2e094
902514f
1ee5eeb
fe35a8b
91c75ad
ef67430
9ad2026
8982090
55afc93
2f728bf
a66ee08
ad2728b
1e6033c
2073a85
dfb6afa
e0a9d85
6c0daa6
e975cef
21ba5c7
4cf10fc
523997e
ad042a1
ce7865f
d1e24b5
ff5123c
d098434
8235ca6
46daf2a
0501bf2
561b473
6f9d1d8
83c47ae
c431279
f5f20b7
e585da5
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.
Just double checking, but we can't do the following:
because here we are applying hermitian matrices to the statevector, which the tape/device won't understand how to do without going low level?
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.
The
new_tape
for a specificobs
would look like:I don't see a problem if it's
PauliX
but for an arbitraryHermitian
this wouldn't (?) work. Maybe we could hack it in to work though, but we'd lose the state being normalized.I also feel like the "many-tapes" approach might be inefficient, e.g., to make lots of tapes and then do device execution (which includes lots of postprocessing), when we just need to evolve the state by one gate.
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.
How come this became a dictionary?
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 allows us to specify more than one option, for example,
adjoint
is:{"method": "device", "jacobian_method": "adjoint_jacobian"}
while another device-based Jacobian would be{"method": "device"}
. We could feasibly have other gradient methods that live on the device in future (if there's a reason to)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.
What's the difference between
method
andjacobian_method
and why would both be 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.
Hmm, imho it was originally meant to describe that a device could have several device jacobians defined, so
method
would indicate that we'd like to use a jacobian defined by the device and then we could select the specific type withjacobian_method
.However, the question is still great, would we actually need a separate
jacobian_method
, or could we just go with:method="device"
method="device_adjoint"
?Guess it comes down to how complex the use case is, i.e., would we expect to see (many) devices that are different in their default
device
diff method> If it turns out that the use cases are more complex, then it can be worth having these two entries.