From 6357a2cb7662c796fee1977b8f641b336ff3c68b Mon Sep 17 00:00:00 2001 From: Naohito Nakazawa <117684192+Naohnakazawa@users.noreply.github.com> Date: Sat, 10 Feb 2024 23:07:43 +0900 Subject: [PATCH] LocalReadoutError update (Qiskit-Extensions#1238) --- .../characterization/local_readout_error.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/qiskit_experiments/library/characterization/local_readout_error.py b/qiskit_experiments/library/characterization/local_readout_error.py index dfc893e7ba..8426d68d2b 100644 --- a/qiskit_experiments/library/characterization/local_readout_error.py +++ b/qiskit_experiments/library/characterization/local_readout_error.py @@ -62,6 +62,29 @@ class LocalReadoutError(BaseExperiment): # section: analysis_ref :class:`LocalReadoutErrorAnalysis` + # section: example + .. jupyter-execute:: + :hide-code: + + # backend + from qiskit_aer import AerSimulator + from qiskit.providers.fake_provider import FakePerth + backend = AerSimulator.from_backend(FakePerth()) + + .. jupyter-execute:: + + from qiskit_experiments.library import LocalReadoutError + + qubits = list(range(4)) + exp = LocalReadoutError(physical_qubits=qubits, backend=backend) + exp.analysis.set_options(plot=True) + exp.set_run_options(shots=10000) + + result = exp.run() + mitigator = result.analysis_results(0).value + + result.figure(0) + # section: manual :doc:`/manuals/measurement/readout_mitigation`