100 lines
2.4 KiB
Plaintext
100 lines
2.4 KiB
Plaintext
---
|
||
title: Barrier (v0.31)
|
||
description: API reference for qiskit.circuit.library.Barrier in qiskit v0.31
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit.circuit.library.Barrier
|
||
---
|
||
|
||
# Barrier
|
||
|
||
<Class id="qiskit.circuit.library.Barrier" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.18/qiskit/circuit/barrier.py" signature="Barrier(num_qubits)" modifiers="class">
|
||
Bases: `qiskit.circuit.instruction.Instruction`
|
||
|
||
Barrier instruction.
|
||
|
||
Create new barrier instruction.
|
||
|
||
## Methods Defined Here
|
||
|
||
<span id="qiskit-circuit-library-barrier-broadcast-arguments" />
|
||
|
||
### broadcast\_arguments
|
||
|
||
<Function id="qiskit.circuit.library.Barrier.broadcast_arguments" signature="Barrier.broadcast_arguments(qargs, cargs)">
|
||
Validation of the arguments.
|
||
|
||
**Parameters**
|
||
|
||
* **qargs** (*List*) – List of quantum bit arguments.
|
||
* **cargs** (*List*) – List of classical bit arguments.
|
||
|
||
**Yields**
|
||
|
||
*Tuple(List, List)* – A tuple with single arguments.
|
||
|
||
**Raises**
|
||
|
||
**CircuitError** – If the input is not valid. For example, the number of arguments does not match the gate expectation.
|
||
</Function>
|
||
|
||
<span id="qiskit-circuit-library-barrier-c-if" />
|
||
|
||
### c\_if
|
||
|
||
<Function id="qiskit.circuit.library.Barrier.c_if" signature="Barrier.c_if(classical, val)">
|
||
Add classical condition on register or cbit classical and value val.
|
||
</Function>
|
||
|
||
<span id="qiskit-circuit-library-barrier-inverse" />
|
||
|
||
### inverse
|
||
|
||
<Function id="qiskit.circuit.library.Barrier.inverse" signature="Barrier.inverse()">
|
||
Special case. Return self.
|
||
</Function>
|
||
|
||
## Attributes
|
||
|
||
### decompositions
|
||
|
||
<Attribute id="qiskit.circuit.library.Barrier.decompositions">
|
||
Get the decompositions of the instruction from the SessionEquivalenceLibrary.
|
||
</Attribute>
|
||
|
||
### definition
|
||
|
||
<Attribute id="qiskit.circuit.library.Barrier.definition">
|
||
Return definition in terms of other basic gates.
|
||
</Attribute>
|
||
|
||
### duration
|
||
|
||
<Attribute id="qiskit.circuit.library.Barrier.duration">
|
||
Get the duration.
|
||
</Attribute>
|
||
|
||
### label
|
||
|
||
<Attribute id="qiskit.circuit.library.Barrier.label">
|
||
Return instruction label
|
||
|
||
**Return type**
|
||
|
||
`str`
|
||
</Attribute>
|
||
|
||
### params
|
||
|
||
<Attribute id="qiskit.circuit.library.Barrier.params">
|
||
return instruction params.
|
||
</Attribute>
|
||
|
||
### unit
|
||
|
||
<Attribute id="qiskit.circuit.library.Barrier.unit">
|
||
Get the time unit of duration.
|
||
</Attribute>
|
||
</Class>
|
||
|