braket.registers.qubit module

class braket.registers.qubit.Qubit(index: int)[source]

Bases: int

A quantum bit index. The index of this qubit is locally scoped towards the contained circuit. This may not be the exact qubit index on the quantum device.

Creates a new Qubit.

Parameters:

index (int) – Index of the qubit.

Raises:

ValueError – If index is less than zero.

Returns:

Qubit – Returns a new Qubit object.

Examples

>>> Qubit(0)
>>> Qubit(1)
static new(qubit: Qubit | int) Qubit[source]

Helper constructor - if input is a Qubit it returns the same value, else a new Qubit is constructed.

Parameters:

qubit (QubitInput) – Qubit index. If type == Qubit then the qubit is returned.

Returns:

Qubit – The qubit.