qiskit-documentation/docs/api/qiskit/0.26/qiskit.circuit.InstructionS...

54 lines
2.4 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: InstructionSet
description: API reference for qiskit.circuit.InstructionSet
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.circuit.InstructionSet
---
# qiskit.circuit.InstructionSet
<Class id="qiskit.circuit.InstructionSet" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.17/qiskit/circuit/instructionset.py" signature="InstructionSet" modifiers="class">
Instruction collection, and their contexts.
New collection of instructions.
The context (qargs and cargs that each instruction is attached to) is also stored separately for each instruction.
### \_\_init\_\_
<Function id="qiskit.circuit.InstructionSet.__init__" signature="__init__()">
New collection of instructions.
The context (qargs and cargs that each instruction is attached to) is also stored separately for each instruction.
</Function>
## Methods
| | |
| --------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| [`__init__`](#qiskit.circuit.InstructionSet.__init__ "qiskit.circuit.InstructionSet.__init__")() | New collection of instructions. |
| [`add`](#qiskit.circuit.InstructionSet.add "qiskit.circuit.InstructionSet.add")(gate, qargs, cargs) | Add an instruction and its context (where it is attached). |
| [`c_if`](#qiskit.circuit.InstructionSet.c_if "qiskit.circuit.InstructionSet.c_if")(classical, val) | Add condition on classical register to all instructions. |
| [`inverse`](#qiskit.circuit.InstructionSet.inverse "qiskit.circuit.InstructionSet.inverse")() | Invert all instructions. |
### add
<Function id="qiskit.circuit.InstructionSet.add" signature="add(gate, qargs, cargs)">
Add an instruction and its context (where it is attached).
</Function>
### c\_if
<Function id="qiskit.circuit.InstructionSet.c_if" signature="c_if(classical, val)">
Add condition on classical register to all instructions.
</Function>
### inverse
<Function id="qiskit.circuit.InstructionSet.inverse" signature="inverse()">
Invert all instructions.
</Function>
</Class>