Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.

Bit

class Bit(register=None, index=None)

GitHub

Bases: object

Implement a generic bit.

Note

This class should not be instantiated directly. This is just a superclass for Clbit and Qubit.

Create a new generic bit.


Attributes

index

Get the index of an old-style bit in the register that owns it.

In modern Qiskit Terra (version 0.17+), bits are the fundamental object and registers are aliases to collections of bits. A bit can be in many registers depending on the circuit, so a single containing register is no longer a property of a bit. It is an error to access this attribute on bits that were not constructed as “owned” by a register.

Deprecated since version 0.17

The property qiskit.circuit.bit.Bit.index is deprecated as of qiskit-terra 0.17. It will be removed no earlier than 3 months after the release date. Instead, use find_bit() to find all the containing registers within a circuit and the index of the bit within the circuit.

register

Get the register of an old-style bit.

In modern Qiskit Terra (version 0.17+), bits are the fundamental object and registers are aliases to collections of bits. A bit can be in many registers depending on the circuit, so a single containing register is no longer a property of a bit. It is an error to access this attribute on bits that were not constructed as “owned” by a register.

Deprecated since version 0.17

The property qiskit.circuit.bit.Bit.register is deprecated as of qiskit-terra 0.17. It will be removed no earlier than 3 months after the release date. Instead, use find_bit() to find all the containing registers within a circuit and the index of the bit within the circuit.

Was this page helpful?
Report a bug or request content on GitHub.