90 lines
4.9 KiB
Plaintext
90 lines
4.9 KiB
Plaintext
---
|
||
title: DAGNode
|
||
description: API reference for qiskit.dagcircuit.DAGNode
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit.dagcircuit.DAGNode
|
||
---
|
||
|
||
# qiskit.dagcircuit.DAGNode
|
||
|
||
<Class id="qiskit.dagcircuit.DAGNode" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.17/qiskit/dagcircuit/dagnode.py" signature="DAGNode(type=None, op=None, name=None, qargs=None, cargs=None, wire=None, nid=- 1)" modifiers="class">
|
||
Object to represent the information at a node in the DAGCircuit.
|
||
|
||
It is used as the return value from \*\_nodes() functions and can be supplied to functions that take a node.
|
||
|
||
Create a node
|
||
|
||
### \_\_init\_\_
|
||
|
||
<Function id="qiskit.dagcircuit.DAGNode.__init__" signature="__init__(type=None, op=None, name=None, qargs=None, cargs=None, wire=None, nid=- 1)">
|
||
Create a node
|
||
</Function>
|
||
|
||
## Methods
|
||
|
||
| | |
|
||
| ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|
||
| [`__init__`](#qiskit.dagcircuit.DAGNode.__init__ "qiskit.dagcircuit.DAGNode.__init__")(\[type, op, name, qargs, cargs, …]) | Create a node |
|
||
| [`semantic_eq`](#qiskit.dagcircuit.DAGNode.semantic_eq "qiskit.dagcircuit.DAGNode.semantic_eq")(node1, node2\[, bit\_indices1, …]) | Check if DAG nodes are considered equivalent, e.g., as a node\_match for nx.is\_isomorphic. |
|
||
|
||
## Attributes
|
||
|
||
| | |
|
||
| ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
|
||
| `cargs` | |
|
||
| [`condition`](#qiskit.dagcircuit.DAGNode.condition "qiskit.dagcircuit.DAGNode.condition") | Returns the condition of the node.op |
|
||
| `name` | |
|
||
| [`op`](#qiskit.dagcircuit.DAGNode.op "qiskit.dagcircuit.DAGNode.op") | Returns the Instruction object corresponding to the op for the node, else None |
|
||
| [`qargs`](#qiskit.dagcircuit.DAGNode.qargs "qiskit.dagcircuit.DAGNode.qargs") | Returns list of Qubit, else an empty list. |
|
||
| `sort_key` | |
|
||
| `type` | |
|
||
| [`wire`](#qiskit.dagcircuit.DAGNode.wire "qiskit.dagcircuit.DAGNode.wire") | Returns the Bit object, else None. |
|
||
|
||
### condition
|
||
|
||
<Attribute id="qiskit.dagcircuit.DAGNode.condition">
|
||
Returns the condition of the node.op
|
||
</Attribute>
|
||
|
||
### op
|
||
|
||
<Attribute id="qiskit.dagcircuit.DAGNode.op">
|
||
Returns the Instruction object corresponding to the op for the node, else None
|
||
</Attribute>
|
||
|
||
### qargs
|
||
|
||
<Attribute id="qiskit.dagcircuit.DAGNode.qargs">
|
||
Returns list of Qubit, else an empty list.
|
||
</Attribute>
|
||
|
||
### semantic\_eq
|
||
|
||
<Function id="qiskit.dagcircuit.DAGNode.semantic_eq" signature="semantic_eq(node1, node2, bit_indices1=None, bit_indices2=None)" modifiers="static">
|
||
Check if DAG nodes are considered equivalent, e.g., as a node\_match for nx.is\_isomorphic.
|
||
|
||
**Parameters**
|
||
|
||
* **node1** ([*DAGNode*](#qiskit.dagcircuit.DAGNode "qiskit.dagcircuit.DAGNode")) – A node to compare.
|
||
* **node2** ([*DAGNode*](#qiskit.dagcircuit.DAGNode "qiskit.dagcircuit.DAGNode")) – The other node to compare.
|
||
* **bit\_indices1** (*dict*) – Dictionary mapping Bit instances to their index within the circuit containing node1
|
||
* **bit\_indices2** (*dict*) – Dictionary mapping Bit instances to their index within the circuit containing node2
|
||
|
||
**Returns**
|
||
|
||
If node1 == node2
|
||
|
||
**Return type**
|
||
|
||
Bool
|
||
</Function>
|
||
|
||
### wire
|
||
|
||
<Attribute id="qiskit.dagcircuit.DAGNode.wire">
|
||
Returns the Bit object, else None.
|
||
</Attribute>
|
||
</Class>
|
||
|