unitaryfund / mitiq

Mitiq is an open source toolkit for implementing error mitigation techniques on most current intermediate-scale quantum computers.
https://mitiq.readthedocs.io
GNU General Public License v3.0
356 stars 157 forks source link

Reduce documentation build time #2024

Closed nathanshammah closed 10 months ago

nathanshammah commented 11 months ago

Issue Description

The documentation build time has roughly doubled from 30 minutes to about 60 minutes after adding the classical shadows documentation.

Proposed Solution

Some data could be copied in a file and not really generated at documentation build, especially for the section "1. How do I use classical shadows estimation?", which takes a long time to build.

bdg221 commented 10 months ago

@Misty-W please assign this issue to me.

I have done some research and found: image

I am first looking at the examples/rshadows_tutorial.md. I have taken the files that are pulled from the github repository and put them into a docs/source/resources folder. I tested locally and did see some speed up, though I was not seeing the same delays that the build from a PR sees. I'll be submitting a PR for testing purposes.

Also, I did leave a commented out version of the code using the repo.

purva-thakre commented 10 months ago

@bdg221 Some parts of guide/shadows and rshadows_tutorial rely on quantum processing of the circuits (number of snapshots) which takes a lot of time.

If the output of these quantum processing steps is saved as a resource (perhaps in the form of a text file?), it could help shorten the time because RTD does not have to rerun those codeblocks for every commit.

Pinging Misty-W natestemen andreamari just in case

Edit: Never mind, I did not see the linked PR which was already trying out something similar.