Skip to content
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

Resonator depletion measurement #822

Merged
merged 13 commits into from
May 20, 2024
Merged

Resonator depletion measurement #822

merged 13 commits into from
May 20, 2024

Conversation

Jacfomg
Copy link
Contributor

@Jacfomg Jacfomg commented May 3, 2024

Following https://arxiv.org/abs/1604.00916. Just to measure the resonator depletion time.
Another route would be a simpler Ramsey with a pre-measurament pulse as QM does https://github.com/qua-platform/qua-libs/blob/main/Quantum-Control-Applications/Superconducting/Single-Flux-Tunable-Transmon/09b_resonator_depletion_time.py#L124

For fitting reason I have the impression QM way would be easier to fit but the AllXY gives more information and possible ways of calibrating a depletion pulse I think.

Checklist:

  • Reviewers confirm new code works as expected.
  • Tests are passing.
  • Coverage does not decrease.
  • Documentation is updated.
  • Compatibility with Qibo modules (Please edit this section if the current pull request is not compatible with the following branches).
    • Qibo: master
    • Qibolab: main
    • Qibolab_platforms_qrc: main

@Jacfomg Jacfomg requested a review from igres26 May 3, 2024 13:56
@andrea-pasquale andrea-pasquale changed the title Resonator depletion measuremant Resonator depletion measurement May 6, 2024
Copy link

codecov bot commented May 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.25%. Comparing base (37d0605) to head (6e28237).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #822      +/-   ##
==========================================
+ Coverage   97.24%   97.25%   +0.01%     
==========================================
  Files         107      108       +1     
  Lines        7915     7982      +67     
==========================================
+ Hits         7697     7763      +66     
- Misses        218      219       +1     
Flag Coverage Δ
unittests 97.25% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/qibocal/protocols/__init__.py 100.00% <100.00%> (ø)
src/qibocal/protocols/allxy/allxy.py 96.00% <100.00%> (-4.00%) ⬇️
...rotocols/allxy/allxy_resonator_depletion_tuning.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

src/qibocal/protocols/characterization/allxy/allxy.py Outdated Show resolved Hide resolved
src/qibocal/protocols/characterization/allxy/allxy.py Outdated Show resolved Hide resolved
sequence_delay=int(
delay_param
), # We need conversion to int due to devices for now
readout_delay=996, # because we already add a +4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would avoid hardcoding numbers

Copy link
Contributor Author

@Jacfomg Jacfomg May 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's what they do in the paper, they wait 1ms before reading. I am not sure why, so I don't know if it would be okay to change or just remove it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In any case please remove the hardcoded number

@andrea-pasquale
Copy link
Contributor

Shouldn't the protocol also have an update function where it writes the depletion_time on the platform?

@Jacfomg
Copy link
Contributor Author

Jacfomg commented May 8, 2024

Shouldn't the protocol also have an update function where it writes the depletion_time on the platform?

How would you fit it ?

@andrea-pasquale
Copy link
Contributor

Shouldn't the protocol also have an update function where it writes the depletion_time on the platform?

How would you fit it ?

I am not familiar with the experiment. I was just asking if this protocol is supposed to measure the depletion time.
If not forget it.

@Jacfomg
Copy link
Contributor Author

Jacfomg commented May 8, 2024

Shouldn't the protocol also have an update function where it writes the depletion_time on the platform?

How would you fit it ?

I am not familiar with the experiment. I was just asking if this protocol is supposed to measure the depletion time. If not forget it.

It would involve comparing two allxy plots, the one coming from this routines and the one coming from the regular allxy and getting the smaller delay when they look similar enough I guess.

@andrea-pasquale
Copy link
Contributor

It would involve comparing two allxy plots, the one coming from this routines and the one coming from the regular allxy and getting the smaller delay when they look similar enough I guess.

Then we should implement a protocol that does exactly this, right? (Outside this PR)

@Jacfomg
Copy link
Contributor Author

Jacfomg commented May 8, 2024

It would involve comparing two allxy plots, the one coming from this routines and the one coming from the regular allxy and getting the smaller delay when they look similar enough I guess.

Then we should implement a protocol that does exactly this, right? (Outside this PR)

Either that or we go for the QM way of getting this for the fit.

@sorewachigauyo
Copy link

The use of reset schemes should also reduce the delay between shots (relaxation_time runcard parameter), no? It would be good to also have this new time somewhere.

@Jacfomg
Copy link
Contributor Author

Jacfomg commented May 9, 2024

The use of reset schemes should also reduce the delay between shots (relaxation_time runcard parameter), no? It would be good to also have this new time somewhere.

Yes, the active reset schemes will lower the relaxation time, but they will be somewhat limited by this resonator depletion time as you could not adress the qubit properly until the photons are depleted (They are also another schemes to active deplete the resonator to make all this faster). For now, I made this to store it in qibolab qiboteam/qibolab#895.

@sorewachigauyo
Copy link

sorewachigauyo commented May 9, 2024

I see. I thought this was a reset scheme, my bad.

@alecandido Should probably take note of this when conditional logic is implemented in Qibolab pulse sequencing, which is probably a necessary feature to add eventually, since QM and Zurich already supports this (and probably can have an initial implementation with fast_reset in ExecutionParameters).

@Jacfomg Have you tested the depletion time with the active reset, if it improves the fidelity?

@alecandido
Copy link
Member

alecandido commented May 9, 2024

@sorewachigauyo Yes, conditioning pulses on measurement outcomes is currently unsupported.

Interface-wise, it shouldn't be a too complex addition. Though it is not well-fitting the idea of a pulse sequence, and it would make it closer to a program. So, it is simple only as a patch.
I have the feeling that going towards full-fledged support for flow control, it would make us rebuilding QUA (or anything like the other DSLs), since that will resemble more a program with a processor/interpreter (i.e. the sequencer), rather than a pre-compiled sequence.

@Jacfomg
Copy link
Contributor Author

Jacfomg commented May 9, 2024

@alecandido Should probably take note of this when conditional logic is implemented in Qibolab pulse sequencing, which is probably a necessary feature to add eventually, since QM and Zurich already supports this (and probably can have an initial implementation with fast_reset in ExecutionParameters).

@Jacfomg Have you tested the depletion time with the active reset, if it improves the fidelity?

Let's just say that for now it is not supported anymore for the Zurich driver (I made a crappy implementation to try to overcome qibolab limitations a while ago, that we removed now). I tested active reset with Zurich before being aware of this so results were bad, I expect better performance after waiting the resonator relaxation time. Still, we would need to understand first how to optimize the QND of the readout as right now 1/10 states 1 measurered, when I tested this with QM, were then measured again and were 0s, so they didn't keep the state after measurement for a effective active reset scheme.

(Sorry I edited your comment instead of replying, I edited it back)

@Jacfomg
Copy link
Contributor Author

Jacfomg commented May 9, 2024

@sorewachigauyo Yes, conditioning pulses on measurement outcomes is currently unsupported.

Interface-wise, it shouldn't be a too complex addition. Though it is not well-fitting the idea of a pulse sequence, and it would make it closer to a program. So, it is simple only as a patch. I have the feeling that going towards full-fledged support for flow control, it would make us rebuilding QUA (or anything like the other DSLs), since that will resemble more a program with a processor/interpreter (i.e. the sequencer), rather than a pre-compiled sequence.

At least Zurich has a way of checking if the measurement result was a 0 or a 1. So, having some pulse parameter to tell some of the pulses to be played in those situations would be enough for now. That would also allow for custom active reset sequences instead of just the pi_pulse I applied to the state 1 on my trials.

@alecandido
Copy link
Member

At least Zurich has a way of checking if the measurement result was a 0 or a 1. So, having some pulse parameter to tell some of the pulses to be played in those situations would be enough for now.

Yes, and that's why I said we could implement it as a patch. We could just label a pulse with the id of another measurement, and resolve the translation in the drivers.

That would also allow for custom active reset sequences instead of just the pi_pulse I applied to the state 1 on my trials.

Point is that, for sequences, we need to label all the pulses. Feasible, but hits the boundary. If you wanted to nest two different ifs, then we'd stop there, or we should start implementing boolean operations in the labeling ids, and that would be a mess...
At that point, much better to give up on the idea of the sequence, and switch paradigm for a program.

@Jacfomg
Copy link
Contributor Author

Jacfomg commented May 9, 2024

At least Zurich has a way of checking if the measurement result was a 0 or a 1. So, having some pulse parameter to tell some of the pulses to be played in those situations would be enough for now.

Yes, and that's why I said we could implement it as a patch. We could just label a pulse with the id of another measurement, and resolve the translation in the drivers.

That would also allow for custom active reset sequences instead of just the pi_pulse I applied to the state 1 on my trials.

Point is that, for sequences, we need to label all the pulses. Feasible, but hits the boundary. If you wanted to nest two different ifs, then we'd stop there, or we should start implementing boolean operations in the labeling ids, and that would be a mess... At that point, much better to give up on the idea of the sequence, and switch paradigm for a program.

Ah yes, but with the patch we could play with some simple active reset schemes that may cut down the relaxation time a lot or just some checks, even if it is just a conditional if you measure a 0 skip the relaxation time and just do resonator deplation and if you measure 1 wait the relaxation time. Just so maybe you could consider this for the qibolab 0.2. Also, the several mesurements seems a bit for more advanced active reset schemes or error correction.

@alecandido
Copy link
Member

alecandido commented May 9, 2024

Yes, definitely, I would do that (you could even add an issue in Qibolab, if not yet there, and add the milestone 0.2).

I hope the patch will be backward compatible, I have to think about that (I'm mainly worried about deserialization, since it will be an additional argument). If it is, we don't even need to do necessarily in 0.2.0 or postpone it forever, to avoid breaking, but rather release 0.2.0 asap, and then implement it in 0.2.1.

(The program approach is for sure breaking, and it would be 0.3 or further, no way it could land in current 0.2)

@Jacfomg
Copy link
Contributor Author

Jacfomg commented May 9, 2024

Yes, definitely, I would do that (you could even add an issue in Qibolab, if not yet there, and add the milestone 0.2).

I hope the patch will be backward compatible, I have to think about that (I'm mainly worried about deserialization, since it will be an additional argument). If it is, we don't even need to do necessarily in 0.2.0 or postpone it forever, to avoid breaking, but rather release 0.2.0 asap, and then implement it in 0.2.1.

(The program approach is for sure breaking, and it would be 0.3 or further, no way it could land in current 0.2)

You have this already qiboteam/qibolab#592 , so I won't create another active reset issue if this is okay for you

@andrea-pasquale andrea-pasquale added this pull request to the merge queue May 20, 2024
Merged via the queue into main with commit 9c5ad41 May 20, 2024
21 checks passed
@andrea-pasquale andrea-pasquale deleted the allxy_resonator branch May 20, 2024 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants