qiboteam / qibolab

Quantum hardware module and drivers for Qibo.
https://qibo.science
Apache License 2.0
41 stars 12 forks source link

Frozen objects #747

Open stavros11 opened 8 months ago

stavros11 commented 8 months ago

In particular, I would always replace, and make QubitPair frozen.

_Originally posted by @AleCandido in https://github.com/qiboteam/qibolab/pull/737#discussion_r1448494654_

Also for other objects: Pulse could be immutable if start is removed. QubitPair can be immutable if we replace Qubit with the qubit names.

For Qubit I am not so sure, because:

alecandido commented 8 months ago

For Qubit I am not so sure, because:

* it contains channels that we are setting during platform creation,
* it contains characterization parameters that qibocal is updating.

Indeed, we even discussed this briefly with @hay-k.

The current Qubit object is taking a lot of responsibilities, so it is a big deal everywhere it's used.

In my opinion, it would fit better for the second purpose (containing the characterization parameters, and potentially other relevant info, if ever), but avoiding taking action through the Qubit itself (which instead I'd delegate to just Channels and Ports, where especially the second already contains device specific information).