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

qq compare command to compare two qibocal reports #714

Merged
merged 48 commits into from
Aug 13, 2024
Merged

Conversation

GabrielePalazzo
Copy link
Contributor

@GabrielePalazzo GabrielePalazzo commented Feb 15, 2024

Example of a combined report containing a resonator spectroscopy and a resonator flux dependence:
http://login.qrccluster.com:9000/T5rbRzsmTRmKLtOSaa03DQ==

Another example:
http://login.qrccluster.com:9000/o73U5W5dTuKIjl_8wCkTzg==/

Only experiments with the same id are compared. All other experiments are discarded.
Tables contain results from both experiments side-by-side.
Experiments with scatterplots (e.g.: resonator spectroscopy) are shown in the same figure (with overlapping points and lines).
Plots of experiments with heatmaps (e.g.: resonator punchout) are vertically stacked.

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

Copy link

codecov bot commented Feb 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.61%. Comparing base (4350b94) to head (c8984c2).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##             main     #714    +/-   ##
========================================
  Coverage   97.60%   97.61%            
========================================
  Files         119      121     +2     
  Lines        9260     9417   +157     
========================================
+ Hits         9038     9192   +154     
- Misses        222      225     +3     
Flag Coverage Δ
unittests 97.61% <100.00%> (+<0.01%) ⬆️

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

Files Coverage Δ
src/qibocal/auto/history.py 91.37% <100.00%> (+0.81%) ⬆️
src/qibocal/cli/_base.py 92.85% <100.00%> (+0.92%) ⬆️
src/qibocal/cli/compare.py 100.00% <100.00%> (ø)
src/qibocal/cli/report.py 100.00% <100.00%> (ø)
src/qibocal/web/compared_report.py 100.00% <100.00%> (ø)
src/qibocal/web/report.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

@andrea-pasquale
Copy link
Contributor

Missing lxml dependency.

@Edoardo-Pedicillo
Copy link
Contributor

Hi @GabrielePalazzo, what is the status of this PR ?

@GabrielePalazzo
Copy link
Contributor Author

Hi @GabrielePalazzo, what is the status of this PR ?

Comparison of single sweeper experiments (like resonator spectroscopy) works.
Flux experiments or readout characterization are not working (we should probably not compare heatmap plots). If I have some spare time later this week I’ll try to make it ready for review.

@Edoardo-Pedicillo
Copy link
Contributor

Edoardo-Pedicillo commented Apr 17, 2024

Flux experiments or readout characterization are not working (we should probably not compare heatmap plots)

I agree. If you want, you can just put the plots of the two reports near each other.

@andrea-pasquale
Copy link
Contributor

Flux experiments or readout characterization are not working (we should probably not compare heatmap plots)

I agree. If you want, you can just put the plots of the two reports near each other.

I was going to suggest the same. Another possible idea would be to come up with some sort of ratio plot to see the differences between the two outcomes. I don't know how feasible it is.

@GabrielePalazzo GabrielePalazzo marked this pull request as ready for review April 29, 2024 10:16
@GabrielePalazzo
Copy link
Contributor Author

The new code is not covered by tests. I'll try to write some.

@Edoardo-Pedicillo
Copy link
Contributor

@GabrielePalazzo, could you resolve the conflicts? Thanks

@andrea-pasquale
Copy link
Contributor

@GabrielePalazzo, could you resolve the conflicts? Thanks

For conflicts let me know if you need help. I recently changed some stuff related to the report generation.

Copy link
Contributor

@andrea-pasquale andrea-pasquale left a comment

Choose a reason for hiding this comment

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

Thanks @GabrielePalazzo I have a few comments.
I start playing with qq compare and I have noticed that if I combined together two monitoring report it feels very slow: http://login.qrccluster.com:9000/nmg4AkeKRuCBKYp3M-NnrA==/
I think because of the fact that the HTML along is 20 MB. We don't have to address it here but I was wondering if there could be a way to produce less heavy reports. Any ideas @alecandido?

Comment on lines +87 to +88
if any(isinstance(trace, go.Heatmap) for trace in fig0.data):
# TODO: check if this is valid for all protocols
Copy link
Contributor

Choose a reason for hiding this comment

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

There are still problems with same 2D plots like Chevron, flux dependence or readout characterization. Of course we cannot have something that works for everything. It would be nice to support the readout characterization out of the box given that it would used for the monitoring most likely.
If it is too much of an issue we can postpone it for a later PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll have a look. In case it takes too long, we can do it later.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, actually I would say that if it works just for readout_characterization it might be better because as we already discussed people will not compare much Heatmaps. I can also help with that.

src/qibocal/cli/compare.py Outdated Show resolved Hide resolved
@alecandido
Copy link
Member

I think because of the fact that the HTML along is 20 MB. We don't have to address it here but I was wondering if there could be a way to produce less heavy reports. Any ideas @alecandido?

I'm pretty sure that the size of the HTML is all driven by plots (the rest of the page is incredibly minimal).
I still believe that the best is to decouple the frontend from Qibocal, and size optimization, lazy-loading of plots (or even multiple files splitting, even when they are loaded eagerly), and the HTML generation in general are all frontend features (well, frontend doesn't mean only the aesthetics).

To be fair, even qq compare is fully a frontend project, and I would have started from optimizing base reports before creating a more advanced infrastructure on top.
But since it was achievable (and maybe easier for someone else), that has not necessarily been a bad idea. At least you're getting the feature now.

However, regarding performances, I'd really advise putting here the threshold: this is definitely not the best way to optimize, and a black hole in terms of time required to improve.
Let's take it as it is, and schedule a proper overhauling of Qibocal's report interface from the basics, whenever we'll be more stable with other core features (or we'll have spare manpower, which is the same thing).

@andrea-pasquale andrea-pasquale added this to the Qibocal 0.0.11 milestone Jul 31, 2024
@andrea-pasquale
Copy link
Contributor

Another thing @GabrielePalazzo, you could add just a couple of sentences in the documentation that would be perfect.

@andrea-pasquale andrea-pasquale added the ui Non-functional features, affecting user interaction label Aug 12, 2024
Copy link
Contributor

@Edoardo-Pedicillo Edoardo-Pedicillo left a comment

Choose a reason for hiding this comment

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

LGTM, thanks !

@andrea-pasquale andrea-pasquale added this pull request to the merge queue Aug 13, 2024
Merged via the queue into main with commit 760b740 Aug 13, 2024
21 checks passed
@andrea-pasquale andrea-pasquale deleted the qq_compare branch August 13, 2024 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui Non-functional features, affecting user interaction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants