-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
Currently we have a Python space Qubit
and Clbit
class which is the source of truth of bits in a circuit. We also have a rust space Qubit
and Clbit
struct which are indices representing the order of qubits in the circuit but those indices map back to a Qubit
python space object which is used from python to address the bits in the circuit. But this relationship is backwards from a performance perspective because it means we always need to create a python object to handle bits, even when creating a circuit in rust. This leads to a significant performance overhead for things like synthesis functions that are generating circuits where the overhead to create bit objects and map them to indices so we have a rust native bit object to use. We should invert this relationship so we have the pure rust bit as the source of truth and the python space object serves as a reference to that.