qiskit-documentation/docs/api/qiskit/1.2/qiskit.providers.models.Gat...

85 lines
4.5 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: GateConfig (v1.2)
description: API reference for qiskit.providers.models.GateConfig in qiskit v1.2
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.providers.models.GateConfig
---
# GateConfig
<Class id="qiskit.providers.models.GateConfig" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/providers/models/backendconfiguration.py#L32-L143" signature="qiskit.providers.models.GateConfig(name, parameters, qasm_def, coupling_map=None, latency_map=None, conditional=None, description=None)" modifiers="class">
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.13)")
Class representing a Gate Configuration
### name
<Attribute id="qiskit.providers.models.GateConfig.name">
the gate name as it will be referred to in OpenQASM.
</Attribute>
### parameters
<Attribute id="qiskit.providers.models.GateConfig.parameters">
variable names for the gate parameters (if any).
</Attribute>
### qasm\_def
<Attribute id="qiskit.providers.models.GateConfig.qasm_def">
definition of this gate in terms of OpenQASM 2 primitives U and CX.
</Attribute>
Initialize a GateConfig object
<Admonition title="Deprecated since version 1.2" type="danger">
The class `qiskit.providers.models.backendconfiguration.GateConfig` is deprecated as of qiskit 1.2. It will be removed in the 2.0 release. The models in `qiskit.providers.models` are part of the deprecated BackendV1 workflow and no longer necessary for BackendV2. If a user workflow requires these representations it likely relies on deprecated functionality and should be updated to use BackendV2.
</Admonition>
**Parameters**
* **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")) the gate name as it will be referred to in OpenQASM.
* **parameters** ([*list*](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)")) variable names for the gate parameters (if any) as a list of strings.
* **qasm\_def** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")) definition of this gate in terms of OpenQASM 2 primitives U and CX.
* **coupling\_map** ([*list*](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)")) An optional coupling map for the gate. In the form of a list of lists of integers representing the qubit groupings which are coupled by this gate.
* **latency\_map** ([*list*](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)")) An optional map of latency for the gate. In the the form of a list of lists of integers of either 0 or 1 representing an array of dimension len(coupling\_map) X n\_registers that specifies the register latency (1: fast, 0: slow) conditional operations on the gate
* **conditional** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")) Optionally specify whether this gate supports conditional operations (true/false). If this is not specified, then the gate inherits the conditional property of the backend.
* **description** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")) Description of the gate operation
## Methods
### from\_dict
<Function id="qiskit.providers.models.GateConfig.from_dict" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/providers/models/backendconfiguration.py#L96-L108" signature="from_dict(data)" modifiers="classmethod">
Create a new GateConfig object from a dictionary.
**Parameters**
**data** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.13)")) A dictionary representing the GateConfig to create. It will be in the same format as output by [`to_dict()`](#qiskit.providers.models.GateConfig.to_dict "qiskit.providers.models.GateConfig.to_dict").
**Returns**
The GateConfig from the input dictionary.
**Return type**
[GateConfig](#qiskit.providers.models.GateConfig "qiskit.providers.models.GateConfig")
</Function>
### to\_dict
<Function id="qiskit.providers.models.GateConfig.to_dict" github="https://github.com/Qiskit/qiskit/tree/stable/1.2/qiskit/providers/models/backendconfiguration.py#L110-L129" signature="to_dict()">
Return a dictionary format representation of the GateConfig.
**Returns**
The dictionary form of the GateConfig.
**Return type**
[dict](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.13)")
</Function>
</Class>