A singleton qubit type that does not have a qudit variant.

Inherits From: Qid

This is useful for testing code that wraps qubits as qudits.

dimension Returns the dimension or the number of quantum levels this qid has. E.g. 2 for a qubit, 3 for a qutrit, etc.



View source

Raises an exception if dimension is not positive.

ValueError dimension is not positive.


View source

Returns a new qid with a different dimension.

Child classes can override. Wraps the qubit object by default.

dimension The new dimension or number of levels.


View source

Return self==value.


View source

Return self>=value.


View source

Return self>value.


View source

Return self<=value.


View source

Return self<value.


View source

Return self!=value.