Skip to content

Commit

Permalink
updated composite experiment and docstring (#1043)
Browse files Browse the repository at this point in the history
  • Loading branch information
coruscating authored Feb 13, 2023
1 parent 1520bbf commit c0cc88c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from abc import abstractmethod
import warnings
from qiskit.providers.backend import Backend
from qiskit_experiments.warnings import deprecate_arguments
from qiskit_experiments.exceptions import QiskitError
from qiskit_experiments.framework import BaseExperiment
from .composite_analysis import CompositeAnalysis
Expand All @@ -25,10 +26,11 @@
class CompositeExperiment(BaseExperiment):
"""Composite Experiment base class"""

@deprecate_arguments({"qubits": "physical_qubits"}, "0.5")
def __init__(
self,
experiments: List[BaseExperiment],
qubits: Sequence[int],
physical_qubits: Sequence[int],
backend: Optional[Backend] = None,
experiment_type: Optional[str] = None,
flatten_results: bool = False,
Expand All @@ -38,7 +40,7 @@ def __init__(
Args:
experiments: a list of experiment objects.
qubits: list of physical qubits for the experiment.
physical_qubits: list of physical qubits for the experiment.
backend: Optional, the backend to run the experiment on.
experiment_type: Optional, composite experiment subclass name.
flatten_results: If True flatten all component experiment results
Expand All @@ -62,7 +64,7 @@ def __init__(
[exp.analysis for exp in self._experiments], flatten_results=flatten_results
)
super().__init__(
qubits,
physical_qubits,
analysis=analysis,
backend=backend,
experiment_type=experiment_type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def __init__(
for readout error. If None all qubits on the provided backend
will be characterized.
backend: Optional, the backend to characterize.
qubits: DEPRECATED, equivalent to ``physical_qubits``.
Raises:
QiskitError: if args are not valid.
Expand Down
6 changes: 4 additions & 2 deletions test/framework/test_composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,9 +742,11 @@ class SimpleExperiment(BaseExperiment):
transpiled circuit) to a coupling map with distance 3 between qubits 0 and 3.
"""

def __init__(self, qubits, backend=None):
def __init__(self, physical_qubits, backend=None):
super().__init__(
qubits, analysis=TestBatchTranspileOptions.SimpleAnalysis(), backend=backend
physical_qubits,
analysis=TestBatchTranspileOptions.SimpleAnalysis(),
backend=backend,
)

def circuits(self):
Expand Down

0 comments on commit c0cc88c

Please sign in to comment.