Add performance benchmarks for single qubit randomized benchmarking#5866
Merged
Add performance benchmarks for single qubit randomized benchmarking#5866
Conversation
Collaborator
Author
Contributor
|
Automerge cancelled: A status check is failing. |
Contributor
|
Automerge cancelled: A status check is failing. |
dstrain115
reviewed
Sep 20, 2022
Collaborator
Author
|
@dstrain115 Addressed your comments. PTAL. |
maffoo
approved these changes
Sep 21, 2022
Contributor
maffoo
left a comment
There was a problem hiding this comment.
minor comments, then LGTM
|
|
||
| def setup(self, *_): | ||
| self.sq_xz_matrices = np.array( | ||
| [dot(*[cirq.unitary(c) for c in group]) for group in _single_qubit_cliffords().c1_in_xz] |
Contributor
There was a problem hiding this comment.
Need to multiply matrices in the reverse order of how the gates appear in "circuit order".
Suggested change
| [dot(*[cirq.unitary(c) for c in group]) for group in _single_qubit_cliffords().c1_in_xz] | |
| [dot(*(cirq.unitary(c) for c in reversed(group))) for group in _single_qubit_cliffords().c1_in_xz] |
| def _get_op_grid(self, qubits: List[cirq.Qid], depth: int) -> List[List[cirq.Operation]]: | ||
| op_grid: List[List[cirq.Operation]] = [] | ||
| for q in qubits: | ||
| gate_ids = list(np.random.choice(len(self.sq_xz_cliffords), depth)) |
Contributor
There was a problem hiding this comment.
why convert to list here? Can this be left as a numpy array?
| op_grid: List[List[cirq.Operation]] = [] | ||
| for q in qubits: | ||
| gate_ids = list(np.random.choice(len(self.sq_xz_cliffords), depth)) | ||
| idx = _find_inv_matrix(dot(*self.sq_xz_matrices[gate_ids]), self.sq_xz_matrices) |
Contributor
There was a problem hiding this comment.
here, too, need to multiply matrices in verse order compared to gates in the circuit.
Collaborator
Author
CirqBot
pushed a commit
that referenced
this pull request
Sep 21, 2022
rht
pushed a commit
to rht/Cirq
that referenced
this pull request
May 1, 2023
…uantumlib#5866) Adds circuit construction benchmarks for single qubit randomized benchmarking for 100 qubits and upto depth 1000. Part of quantumlib#3840 cc https://github.com/qh-lab/pyle/issues/29309 The output of the benchmarks is: ``` [ 25.00%] ··· randomized_benchmarking.SingleQubitRandomizedBenchmarking.time_rb_circuit_construction ok [ 25.00%] ··· ======= ========== -- num_qubits / num_circuits ------- ---------- depth 100 / 20 ======= ========== 1 119±0ms 10 236±0ms 50 776±0ms 100 1.41±0s 250 3.43±0s 500 6.64±0s 1000 12.9±0s ======= ========== [ 50.00%] ··· randomized_benchmarking.SingleQubitRandomizedBenchmarking.time_rb_op_grid_generation ok [ 50.00%] ··· ======= ========== -- num_qubits / num_circuits ------- ---------- depth 100 / 20 ======= ========== 1 96.8±0ms 10 162±0ms 50 427±0ms 100 762±0ms 250 1.74±0s 500 3.29±0s 1000 6.28±0s ======= ========== ```
rht
pushed a commit
to rht/Cirq
that referenced
this pull request
May 1, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds circuit construction benchmarks for single qubit randomized benchmarking for 100 qubits and upto depth 1000.
Part of #3840
cc https://github.com/qh-lab/pyle/issues/29309
The output of the benchmarks is: