Skip to content

Commit

Permalink
Add circuit_order argument in InverleavedRB constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
itoko committed Jun 1, 2023
1 parent fcb75df commit 9af8062
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def __init__(
num_samples: int = 3,
seed: Optional[Union[int, SeedSequence, BitGenerator, Generator]] = None,
full_sampling: bool = False,
circuit_order: str = "RIRIRI",
):
"""Initialize an interleaved randomized benchmarking experiment.
Expand All @@ -92,6 +93,9 @@ def __init__(
all lengths. If False for sample of lengths longer
sequences are constructed by appending additional
Clifford samples to shorter sequences.
circuit_order: How to order the reference and the interleaved circuits.
``"RIRIRI"`` (default) - Alternate a reference and an interleaved circuit. Or
``"RRRIII"`` - Push all reference circuits first, then all interleaved ones.
Raises:
QiskitError: When interleaved_element has different number of qubits
Expand Down Expand Up @@ -158,6 +162,7 @@ def __init__(
self._interleaved_cliff = interleaved_clifford.to_circuit()
self._interleaved_element = interleaved_element # Original interleaved element
self._interleaved_op = None # Transpiled interleaved element for speed
self.set_experiment_options(circuit_order=circuit_order)
self.analysis = InterleavedRBAnalysis()
self.analysis.set_options(outcome="0" * self.num_qubits)

Expand All @@ -167,8 +172,8 @@ def _default_experiment_options(cls) -> Options:
Experiment Options:
circuit_order (str): How to order the reference and the interleaved circuits.
* ``"RIRIRI"``(default): Alternate a reference and an interleaved circuit.
* ``"RRRIII"``: Push all reference circuits first, then all interleaved ones.
``"RIRIRI"`` (alternate a reference and an interleaved circuit) or
``"RRRIII"`` (push all reference circuits first, then all interleaved ones).
"""
options = super()._default_experiment_options()
options.update_options(
Expand Down

0 comments on commit 9af8062

Please sign in to comment.