Skip to content
Open
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
6 changes: 1 addition & 5 deletions qiskit_device_benchmarking/bench_code/mrb/mirror_qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
"""
Mirror QA Experiment class.
"""
from typing import Union, Iterable, Optional, List, Sequence

Check failure on line 15 in qiskit_device_benchmarking/bench_code/mrb/mirror_qa.py

View workflow job for this annotation

GitHub Actions / build

ruff (F401)

qiskit_device_benchmarking/bench_code/mrb/mirror_qa.py:15:47: F401 `typing.List` imported but unused help: Remove unused import: `typing.List`
import itertools
import numpy as np
from numpy import pi
from numpy.random import Generator, BitGenerator, SeedSequence
from scipy.stats import entropy
from uncertainties import unumpy as unp
from scipy.spatial.distance import hamming

Check failure on line 22 in qiskit_device_benchmarking/bench_code/mrb/mirror_qa.py

View workflow job for this annotation

GitHub Actions / build

ruff (F401)

qiskit_device_benchmarking/bench_code/mrb/mirror_qa.py:22:36: F401 `scipy.spatial.distance.hamming` imported but unused help: Remove unused import: `scipy.spatial.distance.hamming`

from qiskit.circuit import Instruction

Check failure on line 24 in qiskit_device_benchmarking/bench_code/mrb/mirror_qa.py

View workflow job for this annotation

GitHub Actions / build

ruff (F401)

qiskit_device_benchmarking/bench_code/mrb/mirror_qa.py:24:28: F401 `qiskit.circuit.Instruction` imported but unused help: Remove unused import: `qiskit.circuit.Instruction`
from qiskit.providers.backend import Backend
from qiskit.circuit.library import CXGate

Check failure on line 26 in qiskit_device_benchmarking/bench_code/mrb/mirror_qa.py

View workflow job for this annotation

GitHub Actions / build

ruff (F401)

qiskit_device_benchmarking/bench_code/mrb/mirror_qa.py:26:36: F401 `qiskit.circuit.library.CXGate` imported but unused help: Remove unused import: `qiskit.circuit.library.CXGate`

from qiskit_experiments.framework import ExperimentData
from qiskit_experiments.data_processing import DataProcessor
Expand Down Expand Up @@ -77,15 +77,13 @@
pauli_randomize: bool = True,
sampling_algorithm: str = "edge_grab",
two_qubit_gate_density: float = 0.25,
two_qubit_gate: Instruction = CXGate(),
num_samples: int = 3,
sampler_opts: Optional[dict] = {},
backend: Optional[Backend] = None,
seed: Optional[Union[int, SeedSequence, BitGenerator, Generator]] = None,
inverting_pauli_layer: bool = False,
initial_entangling_angle: float = pi/2,
final_entangling_angle: float = 0,
analyzed_quantity: str = "Effective Polarization",
):
"""Initialize a mirror quantum awesomeness experiment.

Expand All @@ -94,8 +92,6 @@
lengths: A list of RB sequences lengths.
sampling_algorithm: The sampling algorithm to use for generating
circuit layers. Defaults to "edge_grab" which uses :class:`.EdgeGrabSampler`.
start_end_clifford: If True, begin the circuit with uniformly random 1-qubit
Cliffords and end the circuit with their inverses.
pauli_randomize: If True, surround each sampled circuit layer with layers of
uniformly random 1-qubit Paulis.
two_qubit_gate_density: Expected proportion of qubit sites with two-qubit
Expand Down Expand Up @@ -128,13 +124,13 @@
backend=backend,
pauli_randomize=pauli_randomize,
sampling_algorithm=sampling_algorithm,
start_end_clifford=False,
two_qubit_gate_density=two_qubit_gate_density,
num_samples=num_samples,
sampler_opts=sampler_opts,
seed=seed,
inverting_pauli_layer=inverting_pauli_layer,
full_sampling=False,
start_end_clifford=False,
initial_entangling_angle = initial_entangling_angle,
final_entangling_angle = final_entangling_angle,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def __init__(
self._analyzed_quantity = analyzed_quantity
self._target_bs = target_bs

def _rewrite_string(string, index):
def _rewrite_string(self, string, index):
'''Returns string unchanged. Will be overwritten for Mirror QA'''
return string

Expand Down
Loading