Standard Error Amplification circuit - #1601
Conversation
|
Thanks @ElStabilini! The experiment is certainly interesting, since it is measuring the conditional phase with a single sequence. In principle, the amplification could be useful for landscape fine-tuning. But I don't have a feeling for how much precise we can get with the usual CZ scheme, since there is a tiny tension between the phase condition and leakage. However, for sure we will try it. As soon as the PR is ready (and we have a suitable platform available) |
Yes, this is the reason why in [https://arxiv.org/pdf/2607.01422](url) they use also the Echoed Leakage Error Amplification protocol. I think that the idea could be to write a cost function that takes the result from both to fine tune the calibration.
This might take some time on my side :) |
No worries, just take the time you need ^^ If needed on our side, we will just reimplement the idea in a landscape - which will be anyhow a different experiment (because of the further sweeps).
Indeed! Thanks again, also for the reference |
|
There is also section III of this paper https://arxiv.org/pdf/2508.16437, though it is tailored more towards couplers to reduce |02> state leakage |
As far as I know the main difference between the PALEA protocol described in section III of https://arxiv.org/pdf/2508.16437 and the ELEA described https://arxiv.org/pdf/2607.01422 is the phase sweep. I guess that choice depends on the kind of optimization loop one wants to perform.
As you prefer, the only reason why I implemented the protocol as it is was to understand how to write such a circuit in the context of pulse calibration. Eventually I can also leave the protocol simply as a way to estomate the conditional phase error without updating any of the pulses parameters. The update might be performed in an external optimization loop where the phase error is also combined with other FOMs. |
This is perfectly fine. We also have a virtual phases experiment, which is used for measuring the phases for the chosen gate. It could be useful to have the individual point, since when you settled on the landscape, you may want to have a measurement (possibly more precise) of that point, without performing any scan on the other parameters.
In this case, I would make a separate experiment, instead of an external loop. The reason is that I would implement in with hardware sweeps. |
It definitely makes sense.
Then I'll proceed to keep only the conditional phase error estimate :). |
|
I should have kept only the conditional phase estimation. Some things are still missing (real tests + circuit image) but overall I think it's ready for review. |
|
@ElStabilini do you perhaps have a report generated from this experiment? I'm not sure if you have access to the qrc cluster to upload the reports, but if not you can also just zip the folder and share it in a comment. |
RoyStegeman
left a comment
There was a problem hiding this comment.
A few quick observations. I don't have a platform to test with a CZ now, but if you can provide a report that would make my review a lot easier.
|
|
||
|
|
||
| def sea_fit(x, offset, amplitude, omega, phase, gamma): | ||
| return np.sin(x * omega + phase) * amplitude * np.exp(-x * gamma) + offset |
There was a problem hiding this comment.
The model in the docs is sin^2. Here the space of solutions is the same and you only care about omega, but a comment explaining why omega is the same as in the documentation would be helpful. Even better would be to match the functional form to that in the documentation.
|
|
||
| The final :math:`X(\pi/2)` pulse on :math:`Q_a` is the second pulse of the Ramsey pair: it converts the phase :math:`\phi_n` of :eq:`sea_phase` into a measurable excited-state population | ||
|
|
||
| .. math:: P(\ket{1}_{Q_a}) \approx \sin^2\left(\frac{n\,\delta}{2}\right) |
There was a problem hiding this comment.
Also since for n=0 the excited state probability is 1, should this be cos^2 instead?
| [0.4, 0.4, -np.inf, -np.pi / 4, 0], | ||
| [0.6, 0.6, np.inf, np.pi / 4, np.inf], |
There was a problem hiding this comment.
There are the same as in flipping, but should they be? My understanding is that for example offset is expected to be 1 (as long as the function is sin instead of cos).
There was a problem hiding this comment.
On this I think I must have a look again. At the beginning I had implemented the protocol in a way that was very similar to a flipping protocol and that's the reason why I had chosen those parameters. They probably come from there, I will check it.
There was a problem hiding this comment.
Pull request overview
Adds a Standard Error Amplification protocol for estimating CZ conditional-phase error.
Changes:
- Adds SEA pulse acquisition, fitting, plotting, and calibration storage.
- Registers the protocol and adds a test runcard.
- Adds protocol documentation and bibliography metadata.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
tests/runcards/protocols.yml |
Adds SEA smoke-test configuration. |
src/qibocal/protocols/two_qubit_interaction/sea.py |
Implements the SEA protocol. |
src/qibocal/protocols/two_qubit_interaction/__init__.py |
Exports the protocol. |
src/qibocal/calibration/calibration.py |
Adds conditional-phase storage. |
doc/source/refs.bib |
Adds the SEA reference and reformats entries. |
doc/source/protocols/standard_error_amplification.rst |
Documents the protocol. |
Suppressed comments (4)
src/qibocal/protocols/two_qubit_interaction/sea.py:165
- The intended population is at an extremum when
repetitions == 0(the documentation givessin²(nδ/2), while the pulse sequence has two same-axis π/2 pulses), but this model and its ±π/4 phase bound force the fit near the sine midpoint. Consequently, the model cannot represent the ideal SEA trace and the fittedomegais not a reliable phase error. Use the appropriate damped cosine/sign for the finalized pulse convention, or allow and initialize the equivalent ±π/2 phase.
return np.sin(x * omega + phase) * amplitude * np.exp(-x * gamma) + offset
src/qibocal/protocols/two_qubit_interaction/sea.py:308
conditional_phaseis declared aslist[float], but this assignment strips the uncertainty and stores a scalar. Because assignment validation is disabled, the invalid value survives until the calibration is serialized and later fails model validation when reloaded. Store the fitted value/error pair (or change the calibration field contract to a scalar consistently).
platform.calibration.two_qubits[target].conditional_phase = results.phase_error[
target
][0]
doc/source/protocols/standard_error_amplification.rst:19
- This placeholder leaves the central circuit description absent from the published protocol documentation. Add the circuit asset to the documentation tree and replace the comment with an image directive that references it.
..
missing svg image of the circuit
doc/source/protocols/standard_error_amplification.rst:56
- An
imagedirective requires a URI; this empty directive will emit a documentation error once the page is included. Reference an added output image, or remove the unfinished expected-output section.
.. image::
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Thank you @RoyStegeman for the review. I should have addressed most of the issues. Regarding the full functional form, I am not sure about keeping the exponential decay, I would probably test against some data but we are still trying to calibrate single qubit gates so I have no way to that. |
We may be able to test on our side, but it could happen by the end of September or a bit later. But you could also run it on the simulator :) |
I am trying to implement the Standard Error Amplification (SEA) circuit to estimate the conditional phase error in CZ gate implementation.
The intended circuit is the following*:
The idea was to implement a protocol to correct the pulse amplitude based on the conditional phase error, it doesn't include information on leakage or single-qubit rotation imperfection.
Right now I'm only estimating the conditional phase error without implementing any update as I haven't implemented any protocol to estimate the phase amplitude slope**.
*I didn't find the original reference for the protocol, but I took the idea for the implementation from what is described in https://arxiv.org/pdf/2607.01422
** Maybe there's already something similar but I didn't look for that.