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

docs(notebooks): add LO guide #21

Merged
merged 8 commits into from
May 1, 2024
Merged

docs(notebooks): add LO guide #21

merged 8 commits into from
May 1, 2024

Conversation

ritajitmajumdar1
Copy link
Contributor

Summary

This notebook shows an MVP for using gate cutting to improve the hardware connectivity.

Details and comments

  • This notebook uses a periodic MBL circuit for demonstration.
  • The results from this notebook does not use any error mitigation techniques.

@ritajitmajumdar1 ritajitmajumdar1 added PL-3 Priority level 3/5 → Medium notebook Notebook improvements or additions labels Mar 6, 2024
@ritajitmajumdar1 ritajitmajumdar1 self-assigned this Mar 6, 2024
@coveralls
Copy link

coveralls commented Mar 6, 2024

Pull Request Test Coverage Report for Build 8865421534

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 8708380490: 0.0%
Covered Lines: 290
Relevant Lines: 290

💛 - Coveralls

This notebook contains a basic example of how gate cutting can be useful when dealing with periodic problems. This is the basic version that doesn't use any error mitigation method, and simply deals with cutting the periodic gate. This notebook does not use the Qiskit Primitives V2 because there is still no update on Circuit knitting toolbox to use them.
@ritajitmajumdar1 ritajitmajumdar1 marked this pull request as ready for review March 27, 2024 14:42
Copy link
Member

@pedrorrivero pedrorrivero left a comment

Choose a reason for hiding this comment

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

Haven't reviewed the notebook but this needs to be addressed first, marking the PR as draft again until it's resolved so that others don't start reviewing.

docs/notebooks/circuits.py Outdated Show resolved Hide resolved
@pedrorrivero pedrorrivero marked this pull request as draft March 27, 2024 17:08
Circuit construction is added within notebook. Later this may be replaced with function call from repository
@ritajitmajumdar1 ritajitmajumdar1 marked this pull request as ready for review April 1, 2024 04:43
Updated the example to 80 qubits. Note that Nazca could provide a 80 qubit straight line, whereas pinguino1 is able to provide only 60 (because of some ECR gates having error probability 1).
@ritajitmajumdar1
Copy link
Contributor Author

This notebook currently uses Primitives V1. This is because as per my last discussion with Jim Garrison, circuit-knitting-toolbox can support Primitives V2, but it should be separately installed from source for now. Support for Primitives V2 is not yet available for pip installation. So, I am sticking to Primitives V1 till the time support for V2 is available in pip installation.

Copy link
Member

@pedrorrivero pedrorrivero left a comment

Choose a reason for hiding this comment

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

Points to address:

  • We need to add CKT as a notebook dependency to the repo in pyproject.toml
  • Please update the circuit generation functions to use:
    • compute_uncompute function (copied and pasted) from our library
    • No need for a random spin chain, just do 010101...
    • Produce the MBL parameters in the same way as we do in the latest version of the scaling notebook
  • Delete the commented initial_layout
  • Instead of hardcoding the initial layout manually, I would fix the number of qubits and find a way to generate the initial layout for the circuit (before the final transpilation). And explain why we need to know the initial layout in words.
  • You mention in text that the circuit is 127 qubits, this is not correct
  • Use Batch instead of session, since you say that you execute the circuit in batches

Other than this I really like the notebook, and I think that including the last section to compare against the uncut circuit is a really nice touch 🙂

Great job!!

@pedrorrivero pedrorrivero added PL-2 Priority level 2/5 → Medium-high and removed PL-3 Priority level 3/5 → Medium labels Apr 5, 2024
@ritajitmajumdar1
Copy link
Contributor Author

Addressed the comments by @pedrorrivero. For this example, running in Batch is not necessary. So I have removed it to avoid unnecessary complications. We may include it when we scale this up to more depth.

I have not used transpilation to find initial layout. I have mentioned in the notes that it is possible to find the layout via transpilation, but here we do it manually. The reason beings, we have already performed one transpilation with virtual coupling map. Finding good initial layout automatically will require creating a virtual circuit without the long range entanglement, and then again add those entanglements. The first one (virtual coupling map) is absolutely necessary. I am of the opinion to not add the 2nd one to avoid complications. I feel anyone going through the notebook may get lost in these, and miss the primary message.

Copy link
Member

@pedrorrivero pedrorrivero left a comment

Choose a reason for hiding this comment

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

Great job @ritajitmajumdar1! LGTM 🥳

@pedrorrivero pedrorrivero merged commit ad3b9e3 into main May 1, 2024
8 of 11 checks passed
@pedrorrivero pedrorrivero deleted the lo branch May 2, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notebook Notebook improvements or additions PL-2 Priority level 2/5 → Medium-high
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants