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

Update workflow images in documentation #2034

Merged
merged 15 commits into from
Dec 18, 2023
Merged

Update workflow images in documentation #2034

merged 15 commits into from
Dec 18, 2023

Conversation

purva-thakre
Copy link
Collaborator

@purva-thakre purva-thakre commented Sep 29, 2023

Fixes #2025

To Do:

  • In Classical Shadows workflow, center the text for mitiq.classicalshadows.
  • In png of Classical Shadows workflow, the lowest layer is visible. Remove it.
  • In Classical Shadows workflow, remove error-mitigated from error mitigated expectation value.
  • In png of Robust Shadows workflow, the lowest layer is visible. Remove it.
  • Re-orient the two blocks
    image

@codecov
Copy link

codecov bot commented Sep 29, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7d05a9f) 98.21% compared to head (d40e1e6) 98.19%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2034      +/-   ##
==========================================
- Coverage   98.21%   98.19%   -0.02%     
==========================================
  Files          87       88       +1     
  Lines        4135     4166      +31     
==========================================
+ Hits         4061     4091      +30     
- Misses         74       75       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@purva-thakre
Copy link
Collaborator Author

If anyone uses a browser other than Chrome or Firefox, it's possible the SVG images don't appear as intended.

@purva-thakre purva-thakre force-pushed the shadows_workflow branch 2 times, most recently from c7743e2 to 27334b0 Compare September 29, 2023 19:19
@purva-thakre
Copy link
Collaborator Author

purva-thakre commented Sep 29, 2023

This is ready for a review.

@Misty-W Misty-W self-requested a review October 27, 2023 04:47
Copy link
Contributor

@Misty-W Misty-W left a comment

Choose a reason for hiding this comment

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

Nice work @purva-thakre, this is a great addition and future timesaver!

Minor comment on the general workflow diagram, it looks a little inconsistent between "Step 1" and "2. Inference". It might help to put "Step 1" in brackets or parentheses, or some other way of indicating that it is a placeholder, unlike "2. Inference" which is consistent across techniques. Maybe even just making the font and size/shape of the boxes the same would be enough to make the diagram look unified.

@purva-thakre purva-thakre force-pushed the shadows_workflow branch 2 times, most recently from a468803 to 912329e Compare October 27, 2023 18:41
@purva-thakre
Copy link
Collaborator Author

Maybe even just making the font and size/shape of the boxes the same would be enough to make the diagram look unified.

@Misty-W I have tried to make the font type consistent. I will ping you when this is ready for a review later. I still need to make the size and shape of the boxes consistent because the text style is still a bit 'off'.

@Misty-W
Copy link
Contributor

Misty-W commented Oct 31, 2023

hi @purva-thakre, I wanted to give a heads up that the Mitiq milestone is closing this Thurs (before I go on vacation 😄).

I think the only things remaining to address before merging are Nate's comment about the shadows workflow and my suggestion of how to make the svg download link work. No worries if you can't get to it by then, we'll go ahead with the release and close this up early in the next milestone.

@purva-thakre
Copy link
Collaborator Author

purva-thakre commented Oct 31, 2023

@Misty-W Let's move this to the next milestone.

I have been working on other issues and I do want to spend some additional days on this. In addition to Nate's comment, I also want to work on understanding how text scales in Inkscape. The text is still a bit 'off'.

Thank you for your comment on how to make the download link work! Enjoy your vacation!

@Misty-W
Copy link
Contributor

Misty-W commented Oct 31, 2023

@Misty-W Let's move this to the next milestone.

I have been working on other issues and I do want to spend some additional days on this. In addition to Nate's comment, I also want to work on understanding how text scales in Inkscape. The text is still a bit 'off'.

Sounds good thanks @purva-thakre!

@natestemen natestemen self-requested a review December 15, 2023 17:07
Copy link
Member

@natestemen natestemen left a comment

Choose a reason for hiding this comment

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

New images are looking really nice! I love the aesthetic.

Copy link
Member

Choose a reason for hiding this comment

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

  • I don't think we "insert [a] noise channel" in the first dark green box, do we?
  • I think it should read mitiq.shadows in the center box instead of mitiq.classicalshadows.

Copy link
Collaborator Author

@purva-thakre purva-thakre Dec 18, 2023

Choose a reason for hiding this comment

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

I don't think we "insert [a] noise channel" in the first dark green box, do we?

Yes, we do. According to the docs. See step 1 in this section of the docs.

I think it should read mitiq.shadows in the center box instead of mitiq.classicalshadows

Thanks for catching that! I did not double-check the API-doc. Only followed what the previous images stated.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, we do. According to the docs. See step 1 in this section of the docs.

That is the "user defined input" section, however. I think that part of the code to ensure we are using a realistic executor. That is not something that happens in the mitiq.shadows module, which this diagram is explaining.

Copy link
Collaborator Author

@purva-thakre purva-thakre Dec 18, 2023

Choose a reason for hiding this comment

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

Would you prefer to have Insert noisy channel moved to the hardware region?

Otherwise, I don't know how to explain the difference between the workflows for ideal classical shadows and robust shadows. The way I understand it, we use the latter in the former after the device noise is characterized.

OR Step 2 could be changed to Noisy Z-basis measurement where the noise is user-defined or the one characterized from the robust shadows workflow.

Copy link
Member

Choose a reason for hiding this comment

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

I see this diagram as explaining what happens under the hood, and I cannot find anywhere in the mitiq.shadows module where we add a noise channel. I can see we apply random Paulis in shadow_quantum_processing, but don't see any insertion/application of a noise channel, which is why I think that part may be unnecessary. If you agree this is the purpose of the image, can you show me where I'm missing this part?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I personally can't understand the details of robust shadow in Mitiq. I looked at what the main reference of this technique does. https://arxiv.org/abs/2011.09636

Step 7 is where the device noise is characterized.

Steps 8, 9 and 10 are where the classical shadows workflow comes into play.

image

How about I remove the insert noisy channel part and make changes to Step 2? It would then be labeled as Noisy Z-basis measurement.

Copy link
Member

Choose a reason for hiding this comment

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

Just in case anyone is following along, Purva and I chatted and agreed her suggestion sounds good. We will go forward with that.

docs/source/img/rshadows_workflow_minli.png Outdated Show resolved Hide resolved
@purva-thakre
Copy link
Collaborator Author

I am going ahead and merging this.

There is a drop in coverage but the uncovered lines are not related to this PR.

@purva-thakre purva-thakre merged commit 05be477 into master Dec 18, 2023
15 of 16 checks passed
@purva-thakre purva-thakre deleted the shadows_workflow branch December 18, 2023 23:07
@purva-thakre purva-thakre restored the shadows_workflow branch December 21, 2023 01:45
@purva-thakre purva-thakre deleted the shadows_workflow branch December 21, 2023 01:46
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.

Simpler workflow in shadows documentation
3 participants