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
Speed up default.qubit by using permutations to apply some gates #772
Speed up default.qubit by using permutations to apply some gates #772
Changes from all commits
e20d5fb
eae685d
e2c6a27
ff96b9d
351cb1e
4dcccf3
7910140
badb356
56c295c
9c70204
945f48a
be23c65
9f0fc29
022794c
65866d9
a2e14e7
8009cf6
d4ca1f2
06f4620
88db003
0c74f19
aac86a7
4630ba3
9efce28
555d48b
e895635
0d5edb4
1355e97
b8f6285
9571c0c
4c8178d
c19c9c6
82fc011
ee99223
a933f35
9efdbd5
789a724
b055136
26e9ab3
7059c50
3ceaada
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.
Could be worth adding an example, would also help understanding the exact role of each argument.
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.
Also, in the quantum sense, is it fair to say that this is a
_get_subsystem
function? If so and didn't miss anything, might be worth a renaming, just because that it might make it more intuitive when reading how the operations are being appliedThere 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.
Thanks, have added an example: 9efdbd5.
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's slightly different. In a quantum sense, suppose we have a three qubit system with state tensor having shape
(2, 2, 2)
. Then_get_slice(1, 1, 3)
gives us all of the amplitudes that correspond to having a |1> state in qubit 1. Likewise,_get_slice(1, 2, 3)
would be all the amplitudes with a |1> state in qubit 2, while_get_slice(0, 1, 3)
would be all the amplitudes with a |0> state in qubit 1. So really what_get_slice()
allows you to do is to slice into the state so that your selecting |0> or |1> for a given qubit. This is relevant when, for example, we want to do control or when we want to apply a phase on the |1> state.Unfortunately, I'm not sure of the best name 😆
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.
Might be worth elaborating on why this is equivalent to applying a PauliX
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.
Thanks, I tried to add an explanation, but I have to admit these things are hard to explain!
789a724
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.
🚀
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 is to give better benchmarks?
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 😅
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 so? 😄 Edit: saw the benchmark files. Might be worth leaving a comment here describing that a poorer performance was observed for this gates.
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.
Added: 26e9ab3