qrisp.QuantumCircuit.add_qubit#

QuantumCircuit.add_qubit(qubit=None)[source]#

Adds a Qubit to the QuantumCircuit.

Parameters:
qubitQubit, optional

The Qubit to be added. If given none, a new Qubit will be generated.

Returns:
Qubit

The added Qubit.

Examples

>>> from qrisp import QuantumCircuit
>>> qc = QuantumCircuit()
>>> qc.add_qubit()
>>> qc.qubits
[qb_0]