-
Notifications
You must be signed in to change notification settings - Fork 0
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
Measurement gate #30
Comments
Given these points, an alternative solution that does not require adding measurement gates to the measure(register_name: str, collapse: bool) I haven't thought this thoroughly but the main motivation is that currently adding measurements is slightly different than adding other gates anyway, since it is returning a reference to the corresponding result (to be replaced by some id?) that can be used to control other gates. Therefore it may be cleaner to have a separate interface altogether. |
To add to this, I’d suggest removing the bit flip method entirely and
forcing the user to use the ReadoutError channel
…On Thu, 13 Jun 2024 at 17:32, Stavros Efthymiou ***@***.***> wrote:
Currently measurement is a gate, but has some additional attributes and
arguments compared to other gates, in particular:
- register_name: @alecandido <https://github.com/alecandido> I believe
we have not discussed what to do with that, which is relevant for the
creation of results. One potential solution would be to lift to the circuit
and keep a map {measurement_gid: register_name}.
- collapse: can be handled as a separate measurement gate (MC) in
qibo-core.
- basis: will be left at high-level (not qibo-core) since it is only
used to prepend other gates and does not affect execution.
- bitflip probabilities (p0, p1): only affect the state post-execution
by introducing bitflips, so it is not needed in qibo-core.
- result: used to condition other gates on measurement outcomes. Will
be decoupled from the gate and handled by the circuit.
- pulses: most likely legacy and will be dropped.
—
Reply to this email directly, view it on GitHub
<#30>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABH5QVSC7PACP7V3RAEVDVTZHGNOHAVCNFSM6AAAAABJINN7AGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGM2TCMJXGAZTCNY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Good point, thanks. I forgot to mention here, but indeed, for mid-circuit measurements noise should be added using channels. From the qibo-core point of view there isn't much to do on this other than properly supporting channels (#27). As for removing bitflip, I am fine with that, but should be done on the qibo side. |
I wonder whether we even need the map inside the Since the map would be an interface feature, I'd consider keeping it in the Qibo |
What you're proposing is sensible, but if we keep using the But if the |
I agree with this.
Indeed, if we drop |
I have been thinking how to implement this but ended up discovering a few further issues/open questions, mainly related to the results and not the measurement gate itself. In summary these are the following:
More details: For 1: Related, but not entirely relevant to measurements, is whether we want to support something like If we do not support registers in qibo-core, it is sufficient to introduce the measurement as a single-qubit gate under the For 2: What are these objects currently:
What are their relationships:
Why we need both relationships:
In practice, now qibo-core/crates/py/qibo_core/result.py Lines 333 to 335 in a5e0ac9
and relationship 2 in qibo-core/crates/py/qibo_core/result.py Lines 364 to 366 in a5e0ac9
so MeasurementOutcomes is essentially mutating its MeasurementResult s.
The main issue with this approach is that samples are duplicated. I believe it is preferrable to have them in a single place and treat the other as a view, however I am not sure which should be the single place (basically multiple 1D-arrays vs single 2D-array). In hardware execution we will receive the data as 1D arrays from the instrument at some point (I think there is no way around that), but we can still concatenate to 2D and forget the original arrays. Another point is that currently |
Ok, I will now reply to 1., and then read thoroughly 2. after.
Registers are not disappearing at all, it's just the aliases that are not supported any longer.
That's fully a Qibo problem, and we have all the tools to solve that in Qibo. The library could maintain an alias map, and this could be done in the Though, I have the feeling I might be missing your point. Because I really don't see registers as substantially disappearing.
Answered above.
It would not be a problem in any case. I'm planning to drop |
Ok, about 2. I believe there is only one complex point, everything else is "easily" solved: let's use a single 2D-array, and let's make it an array. At least in About the Qibo interface, I would worry at a second stage, and it's always possible to fix it: if
To be fair, this is more is not even that much related to |
Currently measurement is a gate, but has some additional attributes and arguments compared to other gates, in particular:
{measurement_gid: register_name}
.MC
) in qibo-core.The text was updated successfully, but these errors were encountered: