59 lines
2.3 KiB
Plaintext
59 lines
2.3 KiB
Plaintext
---
|
||
title: plot_gate_map
|
||
description: API reference for qiskit.visualization.plot_gate_map
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: function
|
||
python_api_name: qiskit.visualization.plot_gate_map
|
||
---
|
||
|
||
# qiskit.visualization.plot\_gate\_map
|
||
|
||
<Function id="qiskit.visualization.plot_gate_map" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.19/qiskit/visualization/gate_map.py" signature="plot_gate_map(backend, figsize=None, plot_directed=False, label_qubits=True, qubit_size=None, line_width=4, font_size=None, qubit_color=None, qubit_labels=None, line_color=None, font_color='w', ax=None, filename=None)">
|
||
Plots the gate map of a device.
|
||
|
||
**Parameters**
|
||
|
||
* **backend** ([*BaseBackend*](qiskit.providers.BaseBackend "qiskit.providers.BaseBackend")) – The backend instance that will be used to plot the device gate map.
|
||
* **figsize** (*tuple*) – Output figure size (wxh) in inches.
|
||
* **plot\_directed** (*bool*) – Plot directed coupling map.
|
||
* **label\_qubits** (*bool*) – Label the qubits.
|
||
* **qubit\_size** (*float*) – Size of qubit marker.
|
||
* **line\_width** (*float*) – Width of lines.
|
||
* **font\_size** (*int*) – Font size of qubit labels.
|
||
* **qubit\_color** (*list*) – A list of colors for the qubits
|
||
* **qubit\_labels** (*list*) – A list of qubit labels
|
||
* **line\_color** (*list*) – A list of colors for each line from coupling\_map.
|
||
* **font\_color** (*str*) – The font color for the qubit labels.
|
||
* **ax** (*Axes*) – A Matplotlib axes instance.
|
||
* **filename** (*str*) – file path to save image to.
|
||
|
||
**Returns**
|
||
|
||
A Matplotlib figure instance.
|
||
|
||
**Return type**
|
||
|
||
Figure
|
||
|
||
**Raises**
|
||
|
||
* **QiskitError** – if tried to pass a simulator, or if the backend is None, but one of num\_qubits, mpl\_data, or cmap is None.
|
||
* **MissingOptionalLibraryError** – if matplotlib not installed.
|
||
|
||
**Example**
|
||
|
||
```python
|
||
from qiskit import QuantumCircuit, execute, IBMQ
|
||
from qiskit.visualization import plot_gate_map
|
||
%matplotlib inline
|
||
|
||
provider = IBMQ.load_account()
|
||
accountProvider = IBMQ.get_provider(hub='ibm-q')
|
||
backend = accountProvider.get_backend('ibmq_vigo')
|
||
plot_gate_map(backend)
|
||
```
|
||
|
||

|
||
</Function>
|
||
|