qiskit-documentation/docs/api/qiskit/0.33/qiskit.circuit.library.Barr...

108 lines
2.7 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: Barrier
description: API reference for qiskit.circuit.library.Barrier
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.19/qiskit/circuit/barrier.py" signature="Barrier(num_qubits)" modifiers="class">
Bases: `qiskit.circuit.instruction.Instruction`
Barrier instruction.
Create new barrier instruction.
## Methods Defined Here
### 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>
### c\_if
<Function id="qiskit.circuit.library.Barrier.c_if" signature="Barrier.c_if(classical, val)">
Set a classical equality condition on this instruction between the register or cbit `classical` and value `val`.
<Admonition title="Note" type="note">
This is a setter method, not an additive one. Calling this multiple times will silently override any previously set condition; it does not stack.
</Admonition>
</Function>
### inverse
<Function id="qiskit.circuit.library.Barrier.inverse" signature="Barrier.inverse()">
Special case. Return self.
</Function>
## Attributes
### condition\_bits
<Attribute id="qiskit.circuit.library.Barrier.condition_bits">
Get Clbits in condition.
**Return type**
`List`\[`Clbit`]
</Attribute>
### 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>