-
Notifications
You must be signed in to change notification settings - Fork 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 performance benchmarks for single qubit randomized benchmarking #5866
Conversation
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
Automerge cancelled: A status check is failing. |
Automerge cancelled: A status check is failing. |
@dstrain115 Addressed your comments. PTAL. |
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
|
||
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] |
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.
Need to multiply matrices in the reverse order of how the gates appear in "circuit order".
[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)) |
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 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) |
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.
here, too, need to multiply matrices in verse order compared to gates in the circuit.
…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 ======= ========== ```
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: