Skip to main contentIBM Quantum Documentation
You are viewing the API reference for an old version of Qiskit SDK. Switch to latest version


plot_circuit_layout(circuit, backend, view='virtual', qubit_coordinates=None)

GitHub(opens in a new tab)

Plot the layout of a circuit transpiled for a given target backend.


  • circuit (QuantumCircuit) – Input quantum circuit.
  • backend (Backend) – Target backend.
  • view (str) – Layout view: either ‘virtual’ or ‘physical’.
  • qubit_coordinates (Sequence) – An optional sequence input (list or array being the most common) of 2d coordinates for each qubit. The length of the sequence much mast the number of qubits on the backend. The sequence should be the planar coordinates in a 0-based square grid where each qubit is located.


A matplotlib figure showing layout.

Return type



  • QiskitError – Invalid view type given.
  • VisualizationError – Circuit has no layout attribute.


import numpy as np
from qiskit import QuantumCircuit, transpile
from qiskit.providers.fake_provider import FakeVigoV2
from qiskit.visualization import plot_circuit_layout
from import job_monitor
from qiskit.providers.fake_provider import FakeVigoV2
import matplotlib.pyplot as plt
ghz = QuantumCircuit(3, 3)
for idx in range(1,3):,idx)
ghz.measure(range(3), range(3))
backend = FakeVigoV2()
new_circ_lv3 = transpile(ghz, backend=backend, optimization_level=3)
plot_circuit_layout(new_circ_lv3, backend)

(Source code, png, hires.png, pdf)

Was this page helpful?
Report a bug or request content on GitHub.