Skip to content
Merged
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
8 changes: 3 additions & 5 deletions test/test_t2star.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
from qiskit_experiments.characterization import T2StarExperiment


# Fix seed for simulations
SEED = 9000


class T2starBackend(BaseBackend):
"""
A simple and primitive backend, to be run by the T2Star tests
Expand Down Expand Up @@ -63,6 +59,7 @@ def __init__(
self._readout0to1 = readout0to1
self._readout1to0 = readout1to0
self._dt_factor = dt_factor
self._rng = np.random.default_rng(0)
super().__init__(configuration)

# pylint: disable = arguments-differ
Expand Down Expand Up @@ -115,7 +112,7 @@ def run(self, qobj):

if op.name == "measure":
# we measure in |+> basis which is the same as measuring |0>
meas_res = np.random.binomial(
meas_res = self._rng.binomial(
1,
(1 - prob_plus[qubit]) * (1 - ro10[qubit])
+ prob_plus[qubit] * ro01[qubit],
Expand Down Expand Up @@ -149,6 +146,7 @@ def test_t2star_run_end2end(self):
Run the T2 backend on all possible units
"""
# For some reason, 'ps' was not precise enough - need to check this

for unit in ["s", "ms", "us", "ns", "dt"]:
if unit in ("s", "dt"):
dt_factor = 1
Expand Down