From bba28b82290863d4b3677f9bc5bbed40d94ad756 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Fri, 1 Mar 2024 10:13:26 -0500 Subject: [PATCH] Update circuit construction benchmarks (#11924) The circuit construction benchmarks had all bit rotted a fair amount and were using syntax and functionality that no longer exists. This commit updates the benchmarks to work with current qiskit. Longer term we should add a CI job to ensure all the benchmarks work. --- test/benchmarks/circuit_construction.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/benchmarks/circuit_construction.py b/test/benchmarks/circuit_construction.py index d4497ed3a04..71c079476cd 100644 --- a/test/benchmarks/circuit_construction.py +++ b/test/benchmarks/circuit_construction.py @@ -45,7 +45,7 @@ def time_circuit_construction(self, width, gates): build_circuit(width, gates) def time_circuit_extend(self, _, __): - self.empty_circuit.extend(self.sample_circuit) + self.empty_circuit.compose(self.sample_circuit, inplace=True) def time_circuit_copy(self, _, __): self.sample_circuit.copy() @@ -61,7 +61,7 @@ def build_parameterized_circuit(width, gates, param_count): while len(qc) < gates: for k in range(width): param = next(param_iter) - qc.u2(0, param, qr[k]) + qc.r(0, param, qr[k]) for k in range(width - 1): param = next(param_iter) qc.crx(param, qr[k], qr[k + 1])