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

MCMTGate & plugins #13150

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

MCMTGate & plugins #13150

wants to merge 5 commits into from

Conversation

Cryoris
Copy link
Contributor

@Cryoris Cryoris commented Sep 13, 2024

Summary

Make the MCMT circuits a gate with pluggable synthesis method, plus port the V-chain synthesis to Rust. This is part of #13046.

Details and comments

Even though the focus of this PR is the restructuring into a block that the compiler can reason about, there's also a nice speedup due to the port to Rust:

New runtime / Old runtime = 0.63 (geo mean)
-- n = 50 ntarg = 1
main: 5.604e-04 +- 1.514e-04
this: 3.490e-04 +- 1.771e-04
fraction: 0.64

-- n = 50 targ = 5
main: 5.612e-04 +- 1.180e-04
this: 3.051e-04 +- 1.267e-04
fraction: 0.54

-- n = 50 targ = 25
main: 7.027e-04 +- 1.188e-04
this: 3.727e-04 +- 1.225e-04
fraction: 0.53

-- n = 200 targ = 1
main: 2.074e-03 +- 2.704e-04
this: 1.631e-03 +- 2.565e-03
fraction: 0.78

-- n = 200 targ = 20
main: 2.693e-03 +- 2.488e-03
this: 1.646e-03 +- 2.433e-03
fraction: 0.62

-- n = 200 targ = 100
main: 2.616e-03 +- 2.670e-04
this: 1.880e-03 +- 2.594e-03
fraction: 0.71

-- n = 1000 targ = 1
main: 1.087e-02 +- 4.227e-03
this: 6.820e-03 +- 5.478e-03
fraction: 0.62

-- n = 1000 targ = 100
main: 1.251e-02 +- 6.234e-03
this: 7.843e-03 +- 6.380e-03
fraction: 0.62

-- n = 1000 targ = 500
main: 1.415e-02 +- 5.152e-03
this: 9.360e-03 +- 6.755e-03
fraction: 0.66

@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

  • @Cryoris
  • @Qiskit/terra-core
  • @ajavadia
  • @kevinhartman
  • @mtreinish

@Cryoris Cryoris added Rust This PR or issue is related to Rust code in the repository mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library labels Sep 13, 2024
@Cryoris Cryoris changed the title Rust/mcmt MCMTGate & plugins Sep 13, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 10850942524

Details

  • 189 of 204 (92.65%) changed or added relevant lines in 9 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.02%) to 88.924%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/transpiler/passes/synthesis/hls_plugins.py 25 27 92.59%
crates/accelerate/src/synthesis/multi_controlled/mcmt.rs 92 98 93.88%
qiskit/circuit/library/generalized_gates/mcmt.py 55 62 88.71%
Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 2 92.98%
Totals Coverage Status
Change from base Build 10838928352: 0.02%
Covered Lines: 73583
Relevant Lines: 82748

💛 - Coveralls

@ShellyGarion
Copy link
Member

thanks @Cryoris for opening this PR! It also handles issue #12863.
What do you think about issue #10698 ?
I think it should be a small addition, but could also be handled in a follow-up PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library Rust This PR or issue is related to Rust code in the repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants