Skip to content

Commit

Permalink
Update circuit construction benchmarks (#11924)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mtreinish committed Mar 1, 2024
1 parent c566b3f commit bba28b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/benchmarks/circuit_construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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])
Expand Down

0 comments on commit bba28b8

Please sign in to comment.