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

Add Qiskit CollectCliffordspass to UCC defaults #61

Merged
merged 3 commits into from
Nov 2, 2024

Conversation

Misty-W
Copy link
Collaborator

@Misty-W Misty-W commented Oct 31, 2024

Fixes #60

Add Qiskit CollectCliffords pass to UCC defaults to reduce multi-qubit gate counts.

Per the Qiskit transpiler API doc, the CollectCliffords pass collects blocks of Clifford gates and replaces them with an N-qubit unitary operator from the Clifford group. More details on Clifford objects in Qiskit can be found at: https://docs.quantum.ibm.com/api/qiskit/qiskit.quantum_info.Clifford.

In this PR, the CollectCliffords pass is appended at the end of the add_local_passes method of the class UCCDefault1. The UCC benchmarks are re-run to reflect the resulting improvements in gate counts. Theoretically, the additional pass should incur a small compile time cost, but when compared to the version of the benchmark notebook on main, my local version showed a slight decrease in compile time, i.e. 1.9s on main (no additional pass) vs. 1.2s locally (with pass added). The numbers are close enough that I would expect in most cases the compile time cost to be acceptable, given the gate reduction improvements on multiple benchmarks.

@Misty-W Misty-W linked an issue Oct 31, 2024 that may be closed by this pull request
Move notebook testing additional Qiskit passes to old_notebooks folder
Move folder containing test results of additional qiskit passes to old_notebooks folder
@Misty-W
Copy link
Collaborator Author

Misty-W commented Nov 1, 2024

Since this PR adds an unmodified Qiskit pass to UCCDefault1, we can go directly to acceptance criteria for being incorporated into UCCDefault1.

  • Reduction in compiled 2 qubit gate count:
    Before:
    image
    After:
    image

  • Key metric: increase in "gate reduction factor per second" -- as defined in the UCC benchmarks notebook:
    Before:
    image
    After:
    image

@Misty-W Misty-W marked this pull request as ready for review November 1, 2024 23:11
Copy link
Collaborator

@jordandsullivan jordandsullivan left a comment

Choose a reason for hiding this comment

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

Lgtm. Do we know any Qiskit isn't using this pass in their default?

@Misty-W Misty-W merged commit 6326d28 into main Nov 2, 2024
@Misty-W
Copy link
Collaborator Author

Misty-W commented Nov 2, 2024

Lgtm. Do we know any Qiskit isn't using this pass in their default?

Thanks Jordan! I haven’t come across any indications as to why it’s not default, but would be good to be aware. Maybe the folks on the earlier thread about support for parametric gates would know.

@Misty-W Misty-W deleted the gate-reduction-improvements branch November 2, 2024 03:52
jordandsullivan pushed a commit that referenced this pull request Nov 13, 2024
Add Qiskit `CollectCliffords`pass to UCC defaults
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.

Add Qiskit Optimization pass(es) that improve UCC gate reduction
2 participants