Shortcuts

qiskit.visualization.plot_circuit_layout

plot_circuit_layout(circuit, backend, view='virtual')[소스]

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

매개변수
  • circuit (QuantumCircuit) – Input quantum circuit.

  • backend (BaseBackend) – Target backend.

  • view (str) – Layout view: either 〈virtual〉 or 〈physical〉.

반환값

A matplotlib figure showing layout.

반환 형식

Figure

예외
  • QiskitError – Invalid view type given.

  • VisualizationError – Circuit has no layout attribute.

예제

import numpy as np
from qiskit import QuantumCircuit, IBMQ, transpile
from qiskit.visualization import plot_histogram, plot_gate_map, plot_circuit_layout
from qiskit.tools.monitor import job_monitor
import matplotlib.pyplot as plt
%matplotlib inline

IBMQ.load_account()

ghz = QuantumCircuit(3, 3)
ghz.h(0)
for idx in range(1,3):
    ghz.cx(0,idx)
ghz.measure(range(3), range(3))

provider = IBMQ.get_provider(hub='ibm-q')
backend = provider.get_backend('ibmq_vigo')
new_circ_lv3 = transpile(ghz, backend=backend, optimization_level=3)
plot_circuit_layout(new_circ_lv3, backend)
../_images/qiskit.visualization.plot_circuit_layout_1_0.png
당신은 다음 언어로 문서를 보고 있다 lang: Korean
언어
English
Japanese
German
Korean