qrisp.barrier#
- barrier(qubits)[source]#
A visual marker for structuring the QuantumCircuit.
- Parameters:
- qubitsQubit or list[Qubit] or QuantumVariable
The Qubit to apply the barrier to.
Examples
>>> from qrisp import QuantumVariable, x, y, barrier >>> qv = QuantumVariable(5) >>> x(qv) >>> barrier(qv) >>> y(qv) >>> print(qv.qs)
QuantumCircuit: -------------- ┌───┐ ░ ┌───┐ qv.0: ┤ X ├─░─┤ Y ├ ├───┤ ░ ├───┤ qv.1: ┤ X ├─░─┤ Y ├ ├───┤ ░ ├───┤ qv.2: ┤ X ├─░─┤ Y ├ ├───┤ ░ ├───┤ qv.3: ┤ X ├─░─┤ Y ├ ├───┤ ░ ├───┤ qv.4: ┤ X ├─░─┤ Y ├ └───┘ ░ └───┘ Live QuantumVariables: --------------------- QuantumVariable qv