Skip to content
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

Composite experiments qubits deprecation #1043

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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