-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slice platform #194
base: main
Are you sure you want to change the base?
Slice platform #194
Conversation
Currently, I'm not aiming to merge this PR as it is, since it's mostly an example to discuss. However, whenever we agree about it, and the function will be made available, we could even enlarge |
Thanks for the proposal @alecandido. The idea sounds good to me. The only issue I see is that production platforms will have different names than the calibration ones, as we cannot have duplication. That would mean that the basic user that wants to execute circuits would have to know that they need to do qibo.set_backend("qibolab", platform="qw11q_13") instead of qibo.set_backend("qibolab", platform="qw11q") which is what one would naively expect, as it is using the same name as the slurm node. An easy fix is to force using a different convention ( We could even implement more automatic solutions where |
My understanding is that the "basic" user will not even use that name, since the cloud will expose chips with even further names (e.g.
Yes, that would have been even my proposal. We could use
We could label all derived platforms, e.g. adding a |
Thanks @alecandido, I tend to agree with @stavros11 in the sense that we should try to avoid to duplicate platforms. How do we select these qubits? If the user should select qubits based on physical calibration parameters such as T1, T2 or gate fidelity. We could let the Here is a prototype. from qibocal.calibration import Calibration, CALIBRATION
from qibolab import Platform
def select_calibrated_qubits(cal: Calibration) -> list[QubitId]:
....
return ["D1", "D2"]
def create():
...
cal = Calibration.load(FOLDER / CALIBRATION)
circuit_qubits = select_calibrated_qubits(cal)
...
return Platform.load(..., circuit_qubits=circuit_qubits) I don't know how the transpiler should be modified exactly but at least in this way we can avoid platform duplication since people who are calibrating are going to play with the platform which will have access to all qubits (calibrated or not), while the more naive user, for example the cloud user, which will run circuits will be able to run only with calibrated qubits. Thoughts? |
Well, it seemed to me that we had an agreement with @stavros11, and there is no duplication...
Eventually, the only information that the user cares about is which qubits could be used, and then that's also the only information the transpiler cares about.
Right now, qubits will have to be selected by the human operator calibrating the platform, deciding which one to expose. Or the human operator executing the circuit (but @scarrazza clarified this can't be the only option). You can then turn your prototype in: from qibolab import Platform
CIRCUIT_QUBITS = ["D1", "D2"]
def create():
...
return Platform.load(..., circuit_qubits=CIRCUIT_QUBITS) which is essentially the same of the proposal above. Only, it would require a change in the The derived platform won't be duplicated: it will mirror exactly the current one. |
There is no duplication in the sense that you have only one platform however, there is duplication in the sense that you will have two platform identifiers for the same platform since one will be used for production and the other one will be used for calibration.
I'm not planning to have a complex calibration-aware mechanism. As in your case I want the transpiler to work only with select qubits, which will not be selected by the transpiler, but by the external function
I would argue that we can rely on automated inspection, also because, people should not run on qubits where we did not run an RB previously at least once. Even if it is sufficient to have the qubits connected that would be easy to check even by looking at the fidelity because there will not be a fidelity, so the qubit will be excluded. Therefore a basic rule would be to check if the gate fidelity is larger than 90%. Also I don't believe that adding the attribute |
Well, not really. There are two platform identifiers, because you will load two different platform objects from them. That could be one - but since it is going to be used in two different ways, it even makes sense that the names are two, since in this way you can address the behavior you desire.
Ok, fine, so much the better :)
Well, an attribute on its own is never too complicated. But the point is that the attribute has to be handled, and to be handled in the transpiler it also has to be propagated. If the transpiler would only receive the selected qubits, we could do this in the
|
I don't think the changes will be so complicated.
Regarding this qibocal is already handling the compilation on its own to run circuits, I believe that we could update it to force it to run on any qubit. |
So, I'm a huge fan of composition, and in principle the only drawback of your My proposal would then be to keep the extra names, slicing, but What instead I disagree about is to replace the extra platform with an extra attribute, because this may generate more special cases, and cascade in further branching to be handled. But we can have the best of both and combine them :)
Well, that's not certainly the goal. And even if Qibocal is doing, if anyone else needs to do something similar, he should not be forced to pass through Qibocal because Qibolab is not enough. And it's not even the goal for Qibocal (if we can unlock compilation for Qibocal again, so much the better, no?) |
This is just a sketch of a proposal.
In this example, I'm taking the current platform for
qw11q
(containing qubits[D1, D2, D3, D4, D5]
), and turning it into a platform with just two qubits ([D1, D3]
), but otherwise identical.This is my idea to provide "production" platforms without duplication.
The full-blown implementation would be a Qibolab function:
such that you can use in place of the current implementation as
and that's it :)
(of course, you could even just type the
NAME
, and it reduces to just two lines)