Separate QPE circuit builder with simulator#471
Conversation
📊 Coverage Summary
Detailed Coverage ReportsC++ Coverage DetailsPython Coverage DetailsPybind11 Coverage Details |
There was a problem hiding this comment.
Pull request overview
This PR separates QPE circuit construction from phase-estimation execution by adding reusable QPE circuit builder abstractions and wiring them into iterative and Qiskit standard phase estimation.
Changes:
- Added a
qpe_circuit_builderalgorithm type with base settings/factory support. - Moved IQPE circuit construction into
IterativeQpeCircuitBuilder. - Added and registered
QiskitStandardQpeCircuitBuilder, with phase-estimation algorithms delegating circuit generation to builders.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
python/tests/test_phase_estimation_iterative.py |
Updates IQPE tests for the new iterative circuit builder. |
python/tests/test_interop_qiskit_phase_estimation_standard.py |
Adds Qiskit standard builder coverage and updates mocking. |
python/src/qdk_chemistry/plugins/qiskit/standard_phase_estimation.py |
Splits standard QPE circuit building from execution. |
python/src/qdk_chemistry/plugins/qiskit/__init__.py |
Registers the Qiskit standard QPE builder plugin. |
python/src/qdk_chemistry/algorithms/registry.py |
Registers the QPE circuit builder factory and iterative builder. |
python/src/qdk_chemistry/algorithms/phase_estimation/iterative_phase_estimation.py |
Delegates IQPE circuit generation to the new builder. |
python/src/qdk_chemistry/algorithms/phase_estimation/circuit_builder/iterative_builder.py |
Adds the iterative QPE circuit builder implementation. |
python/src/qdk_chemistry/algorithms/phase_estimation/circuit_builder/base.py |
Adds QPE circuit builder base classes, settings, and factory. |
python/src/qdk_chemistry/algorithms/phase_estimation/circuit_builder/__init__.py |
Adds the circuit builder package export. |
python/src/qdk_chemistry/algorithms/phase_estimation/base.py |
Removes controlled-circuit construction from the phase-estimation base. |
python/src/qdk_chemistry/algorithms/__init__.py |
Exposes the new QpeCircuitBuilder base class. |
Comments suppressed due to low confidence (1)
python/tests/test_phase_estimation_iterative.py:691
- This variable is an
IterativeQpeCircuitBuilder, not an IQPE algorithm instance. A builder-specific name would avoid confusion in a test that is explicitly validating the new separated builder.
iqpe = IterativeQpeCircuitBuilder(num_bits=5, num_iteration=0)
iqpe.settings().set(
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📊 Coverage Summary
Detailed Coverage ReportsC++ Coverage DetailsPython Coverage DetailsPybind11 Coverage Details |
nabbelbabbel
left a comment
There was a problem hiding this comment.
One minor comment, other than that it is looking good to me
| # Or create the standard QFT-based variant (requires Qiskit) | ||
| qpe = create("phase_estimation", "qiskit_standard") | ||
| # Or create the standard QFT-based variant | ||
| qpe = create("phase_estimation", "standard") |
There was a problem hiding this comment.
I don't like a sole "standard", the naming we use is usually specific to our package "qdk" or the plugin. Let's keep that so that other versions/names make sense in the future.
No description provided.