⚡️ Use Gate in AE phase_estimation path#886
Conversation
Assisted-by: GPT-5.3 via codex
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe phase estimation circuit now wraps the Grover operator into a named gate before passing it to the phase estimation function, changing the input type from a QuantumCircuit object to a Gate object while preserving all downstream circuit operations. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Description
This PR fixes a performance issue in the
aebenchmark by passing aGate(instead of aQuantumCircuit) tophase_estimation.What changed
src/mqt/bench/benchmarks/ae.pype = phase_estimation(num_eval_qubits, grover_operator)pe = phase_estimation(num_eval_qubits, grover_operator.to_gate(label="Q"))Why
qiskit.circuit.library.phase_estimationaccepts bothQuantumCircuitandGate, and documents that passing aGatecan be more performant because control/power operations can use optimized subroutines.Correctness validation (n = 2..16)
I compared old vs. new construction for all
nin[2, 16]:Result:
n=2..16.0.9999999999999802(numerical precision tolerance).Performance validation (same environment, same run, n = 2..16)
No additional dependencies are required.
Checklist
If PR contains AI-assisted content:
Assisted-by: [Model Name] via [Tool Name]footer.