Skip to content
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.

Commit

Permalink
Add assemble_circuit benchmark.
Browse files Browse the repository at this point in the history
  • Loading branch information
kdk committed Oct 24, 2019
1 parent 0ad730a commit b14d240
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/benchmarks/assembler.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-

# This code is part of Qiskit.
#
# (C) Copyright IBM 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

# pylint: disable=no-member,invalid-name,missing-docstring,no-name-in-module
# pylint: disable=attribute-defined-outside-init,unsubscriptable-object

from qiskit import assemble

from .utils import random_circuit


class AssemblerBenchmarks:
params = ([1, 2, 5, 8],
[8, 128, 1024, 2048, 4096])
param_names = ['n_qubits', 'depth']
timeout = 600

def setup(self, n_qubits, depth):
seed = 42
self.circuit = random_circuit(n_qubits, depth, measure=True,
conditional=True, seed=seed)

def time_assemble_circuit(self, _, __):
assemble(self.circuit)

0 comments on commit b14d240

Please sign in to comment.