-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 parallel randomized benchmarking #6382
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6382 +/- ##
=======================================
Coverage 97.81% 97.81%
=======================================
Files 1111 1111
Lines 96951 97037 +86
=======================================
+ Hits 94828 94914 +86
Misses 2123 2123 ☔ View full report in Codecov by Sentry. |
@@ -230,6 +230,70 @@ def single_qubit_randomized_benchmarking( | |||
return RandomizedBenchMarkResult(num_clifford_range, gnd_probs) | |||
|
|||
|
|||
def parallel_single_qubit_randomized_benchmarking( | |||
sampler: 'cirq.Sampler', | |||
use_xy_basis: bool = True, |
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 there a reason this is before the kwargs cut-off?
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 was following the same format as in single_qubit_randomized_benchmarking()
in the same file, but I can change it.
Thanks for the code reviews, @NoureldinYosri @dstrain115, and @maffoo! |
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.
LGTM. pending review from @dstrain115 and @maffoo
@@ -230,6 +230,63 @@ def single_qubit_randomized_benchmarking( | |||
return RandomizedBenchMarkResult(num_clifford_range, gnd_probs) | |||
|
|||
|
|||
def parallel_single_qubit_randomized_benchmarking( |
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.
OOC, would it be possible to put this in the existing single_qubit_randomized_benchmarking
module? Seems like it's basically the same thing and there could be opportunities for code reuse. The fact that one is running in parallel on multiple qubits is a minor details (the existing single-qubit code could just become a special case of the parallel code).
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.
Ok, I changed it so that single_qubit_randomized_benchmarking
is now a wrapper for parallel_single_qubit_randomized_benchmarking
. What do you think?
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.
Minor comments, then LGTM
for num_cfds in num_clifford_range: | ||
excited_probs_l = [] | ||
# create circuits | ||
circuits_all = [] |
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.
nit: call this circuits
and add a type annotation
circuits_all = [] | |
circuits: list[`cirq.AbstractCircuit`] = [] |
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 don't think I should call this circuits
because earlier in the file, there is from cirq import circuits
.
No description provided.