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

[Do not merge] Diff after migrating away from jupyter-execute #2403

Closed
wants to merge 1 commit into from
Closed
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
14 changes: 9 additions & 5 deletions docs/api/qiskit-ibm-runtime/dev/fake_provider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,19 @@ circuit.cx(0,1)
circuit.cx(0,2)
circuit.measure_all()
circuit.draw('mpl', style="iqp")
```

![../\_images/fake\_provider-1.png](/images/api/qiskit-ibm-runtime/dev/fake_provider-1.png)

```python
# Transpile the ideal circuit to a circuit that can be directly executed by the backend
transpiled_circuit = transpile(circuit, backend)
transpiled_circuit.draw('mpl', style="iqp")
```

![../\_images/fake\_provider-2.png](/images/api/qiskit-ibm-runtime/dev/fake_provider-2.png)

```python
# Run the transpiled circuit using the simulated fake backend
sampler = SamplerV2(backend)
job = sampler.run([transpiled_circuit])
Expand All @@ -52,11 +60,7 @@ counts = pub_result.data.meas.get_counts()
plot_histogram(counts)
```

![../\_images/fake\_provider-1\_00.png](/images/api/qiskit-ibm-runtime/dev/fake_provider-1_00.png)

![../\_images/fake\_provider-1\_01.png](/images/api/qiskit-ibm-runtime/dev/fake_provider-1_01.png)

![../\_images/fake\_provider-1\_02.png](/images/api/qiskit-ibm-runtime/dev/fake_provider-1_02.png)
![../\_images/fake\_provider-3.png](/images/api/qiskit-ibm-runtime/dev/fake_provider-3.png)

<Admonition title="Important" type="danger">
Please note that the simulation is done using a noise model generated from system snapshots obtained in the past (sometimes a few years ago) and the results are not representative of the latest behaviours of the real quantum system which the fake backend is mimicking. If you want to run noisy simulations to compare with the real quantum system, you should use the `qiskit_aer` library. After installation, you can follow the steps below to generate a simulator that mimics a real quantum system with the latest calibration results.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ python_api_name: qiskit_ibm_runtime.transpiler.passes.scheduling.PadDynamicalDec

# PadDynamicalDecoupling

<Class id="qiskit_ibm_runtime.transpiler.passes.scheduling.PadDynamicalDecoupling" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/transpiler/passes/scheduling/dynamical_decoupling.py#L40-L585" signature="PadDynamicalDecoupling(*args, **kwargs)" modifiers="class">
<Class id="qiskit_ibm_runtime.transpiler.passes.scheduling.PadDynamicalDecoupling" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/transpiler/passes/scheduling/dynamical_decoupling.py#L40-L587" signature="PadDynamicalDecoupling(*args, **kwargs)" modifiers="class">
Bases: [`BlockBasePadder`](qiskit_ibm_runtime.transpiler.passes.scheduling.BlockBasePadder "qiskit_ibm_runtime.transpiler.passes.scheduling.block_base_padder.BlockBasePadder")

Dynamical decoupling insertion pass for IBM dynamic circuit backends.
Expand Down Expand Up @@ -36,52 +36,16 @@ python_api_name: qiskit_ibm_runtime.transpiler.passes.scheduling.PadDynamicalDec
("cx", [1, 2], 200), ("cx", [2, 3], 300),
("x", None, 50), ("measure", None, 1000)]
)
```

```python
# balanced X-X sequence on all qubits
dd_sequence = [XGate(), XGate()]
pm = PassManager([ALAPScheduleAnalysis(durations),
PadDynamicalDecoupling(durations, dd_sequence)])
circ_dd = pm.run(circ)
circ_dd.draw()
circ_dd.draw('mpl', style="iqp")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want these to be text based, we need to save the output in a .. code:: text block. But I think the image is fine. This text is not very readable to a screen-reader, so the image with alt text will be more useful to non-sighted users.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed! I like having an image there rather than the text much more too, but that's nice! TIL

```

```python
┌───┐ ┌───────────────┐ ┌───┐ »
q_0: ──────┤ H ├─────────■──┤ Delay(96[dt]) ├──────┤ X ├──────»
┌─────┴───┴─────┐ ┌─┴─┐└───────────────┘┌─────┴───┴─────┐»
q_1: ┤ Delay(50[dt]) ├─┤ X ├────────■────────┤ Delay(48[dt]) ├»
├───────────────┴┐└───┘ ┌─┴─┐ └───────────────┘»
q_2: ┤ Delay(750[dt]) ├───────────┤ X ├──────────────■────────»
├────────────────┤ └───┘ ┌─┴─┐ »
q_3: ┤ Delay(950[dt]) ├────────────────────────────┤ X ├──────»
└────────────────┘ └───┘ »
meas: 4/═════════════════════════════════════════════════════════»
»
« ┌────────────────┐ ┌───┐ ┌───────────────┐ »
« q_0: ┤ Delay(208[dt]) ├──────┤ X ├──────┤ Delay(96[dt]) ├─────────────────»
« └─────┬───┬──────┘┌─────┴───┴─────┐└─────┬───┬─────┘┌───────────────┐»
« q_1: ──────┤ X ├───────┤ Delay(96[dt]) ├──────┤ X ├──────┤ Delay(56[dt]) ├»
« └───┘ └───────────────┘ └───┘ └───────────────┘»
« q_2: ─────────────────────────────────────────────────────────────────────»
« »
« q_3: ─────────────────────────────────────────────────────────────────────»
« »
«meas: 4/═════════════════════════════════════════════════════════════════════»
« »
« ░ ┌─┐
« q_0: ─░─┤M├─────────
« ░ └╥┘┌─┐
« q_1: ─░──╫─┤M├──────
« ░ ║ └╥┘┌─┐
« q_2: ─░──╫──╫─┤M├───
« ░ ║ ║ └╥┘┌─┐
« q_3: ─░──╫──╫──╫─┤M├
« ░ ║ ║ ║ └╥┘
«meas: 4/════╩══╩══╩══╩═
« 0 1 2 3
```
![../\_images/qiskit\_ibm\_runtime-transpiler-passes-scheduling-PadDynamicalDecoupling-1.png](/images/api/qiskit-ibm-runtime/dev/qiskit_ibm_runtime-transpiler-passes-scheduling-PadDynamicalDecoupling-1.png)

```python
# Uhrig sequence on qubit 0
Expand All @@ -100,33 +64,10 @@ python_api_name: qiskit_ibm_runtime.transpiler.passes.scheduling.PadDynamicalDec
]
)
circ_dd = pm.run(circ)
circ_dd.draw()
circ_dd.draw('mpl', style="iqp")
```

```python
┌───┐ ┌────────────────┐ ░ ┌─┐ »
q_0: ──────┤ H ├─────────■──┤ Delay(500[dt]) ├───────────────────░─┤M├──────»
┌─────┴───┴─────┐ ┌─┴─┐└────────────────┘┌────────────────┐ ░ └╥┘┌─┐ »
q_1: ┤ Delay(50[dt]) ├─┤ X ├────────■─────────┤ Delay(300[dt]) ├─░──╫─┤M├───»
├───────────────┴┐└───┘ ┌─┴─┐ └────────────────┘ ░ ║ └╥┘┌─┐»
q_2: ┤ Delay(750[dt]) ├───────────┤ X ├───────────────■──────────░──╫──╫─┤M├»
├────────────────┤ └───┘ ┌─┴─┐ ░ ║ ║ └╥┘»
q_3: ┤ Delay(950[dt]) ├─────────────────────────────┤ X ├────────░──╫──╫──╫─»
└────────────────┘ └───┘ ░ ║ ║ ║ »
meas: 4/═══════════════════════════════════════════════════════════════╩══╩══╩═»
0 1 2 »
«
« q_0: ───
«
« q_1: ───
«
« q_2: ───
« ┌─┐
« q_3: ┤M├
« └╥┘
«meas: 4/═╩═
« 3
```
![../\_images/qiskit\_ibm\_runtime-transpiler-passes-scheduling-PadDynamicalDecoupling-2.png](/images/api/qiskit-ibm-runtime/dev/qiskit_ibm_runtime-transpiler-passes-scheduling-PadDynamicalDecoupling-2.png)

<Admonition title="Note" type="note">
You need to call [`ALAPScheduleAnalysis`](qiskit_ibm_runtime.transpiler.passes.scheduling.ALAPScheduleAnalysis "qiskit_ibm_runtime.transpiler.passes.scheduling.ALAPScheduleAnalysis") before running dynamical decoupling to guarantee your circuit satisfies acquisition alignment constraints for dynamic circuit backends.
Expand Down
Loading