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

Process tomography #1046

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Process tomography #1046

wants to merge 5 commits into from

Conversation

stavros11
Copy link
Member

Allows to reconstruct the channel corresponding to the application of an arbitrary single or two-qubit gate (or gates) on hardware, following https://arxiv.org/abs/quant-ph/9610001.

Some example results:

  - id: Process tomography
    operation: process_tomography
    targets: ["D2"]
    parameters:
      circuit: [["y90"]]
      nshots: 5000

  - id: Process tomography Two-Qubit
    operation: process_tomography
    targets: [["D2", "D1"]]
    parameters:
      circuit: [["cz", "cz"]]
      nshots: 5000

The plot corresponds to the chi matrix introduced in Eq. (3. 2) in the operator basis from (4.1)-(4.4). This fully describes the channel. Note that the gate set is currently limited to ["x180", "y180", "x90", "y90", "-x90", "-y90"] for simplification.

Draft mainly becasue it is lacking tests and documentation. Also, ideally this should be written using qibo circuits, similarly to the state tomographies, and potentially also reuse code from there. This would also fix the gate limitations, but I am not doing it because I want to keep it independent from transpiler/compiler until these are debugged.

Copy link

codecov bot commented Nov 20, 2024

Codecov Report

Attention: Patch coverage is 30.62201% with 145 lines in your changes missing coverage. Please review.

Project coverage is 95.92%. Comparing base (c8cd2a9) to head (ff65833).

Files with missing lines Patch % Lines
src/qibocal/protocols/process_tomography.py 30.28% 145 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1046      +/-   ##
==========================================
- Coverage   97.35%   95.92%   -1.44%     
==========================================
  Files         120      121       +1     
  Lines        9749     9958     +209     
==========================================
+ Hits         9491     9552      +61     
- Misses        258      406     +148     
Flag Coverage Δ
unittests 95.92% <30.62%> (-1.44%) ⬇️

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

Files with missing lines Coverage Δ
src/qibocal/protocols/__init__.py 100.00% <100.00%> (ø)
src/qibocal/protocols/process_tomography.py 30.28% <30.28%> (ø)

... and 1 file with indirect coverage changes

---- 🚨 Try these New Features:

@igres26
Copy link
Contributor

igres26 commented Nov 21, 2024

Great! Could we add a figure of merit to this? Some distance between the experiment data and the noiseless simulation.

@alecandido
Copy link
Member

Great! Could we add a figure of merit to this? Some distance between the experiment data and the noiseless simulation.

This is something that also @stavros11 was looking for.

What I suggested (was the most trivial attempt) was just to use the $\mathbb{L}^2$ norm on the displayed matrix.
However, this might not be meaningful at all as a distance in the space of channels.

Instead, what could have been a meaningful attempt, is to have an $\sup$ norm, maximizing over the space of states' fidelities (i.e. computing the superior of the fidelities of the results of channels applications, simulated and measured, over the possible $\rho$ initial states).
Since with the tomography you have reconstructed the whole channel, no further measure is needed. And since the space is finite-dimensional, the inferior should just be a maximum.
I'm not sure whether this is an actual distance over the space of channels: it is symmetric, and 0 iff the channels are the exact same. Not sure if it's triangular...

In any case, just plotting the difference matrix (instead of the two $\chi_{mn} matrices) it would already help me interpreting the result...

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.

3 participants