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
10 changes: 7 additions & 3 deletions qiskit/transpiler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@
at the output.

In order to highlight this, we run a GHZ circuit 100 times, using a "bad" (disconnected)
`initial_layout`:
``initial_layout`` in a heavy hex coupling map:

.. plot::

Expand All @@ -816,18 +816,22 @@
import matplotlib.pyplot as plt
from qiskit import QuantumCircuit, transpile
from qiskit.providers.fake_provider import GenericBackendV2
backend = GenericBackendV2(16)
from qiskit.transpiler import CouplingMap

coupling_map = CouplingMap.from_heavy_hex(3)
backend = GenericBackendV2(coupling_map.size(), coupling_map=coupling_map)

ghz = QuantumCircuit(15)
ghz.h(0)
ghz.cx(0, range(1, 15))

depths = []
for _ in range(100):
for i in range(100):
depths.append(
transpile(
ghz,
backend,
seed_transpiler=i,
layout_method='trivial' # Fixed layout mapped in circuit order
).depth()
)
Expand Down