mqt-qcec
mqt-qcec copied to clipboard
✨ switch to `mqt-core` Python package
Description
This PR is a best-of extraction from #352 and switches the project to use the newly developed mqt-core
Python package.
Due to the use of FetchContent
, any Python package build will only require the mqt-core
package as a build and runtime dependency and won't have to rely on the git submodule (or a fetched version of mqt-core) any more.
Any regular C++ build will use the FetchContent
CMake module. This logic could probably be improved a little bit so that the submodule is used whenever it has been properly cloned.
The change brings a range of advantages:
- Uses the new
load
function ofmqt-core
that allows to load any supported circuit format as input and has better handling for QiskitQuantumCircuit
objects. - Allows to directly feed QASM strings as inputs to the verification methods
- Completely eliminates the Qiskit dependency from the symbolic EC code as everything can be handled natively with mqt-core now.
- Simplifies the interfaces of the QCEC Python bindings
Checklist:
- [x] The pull request only contains commits that are related to it.
- [x] I have added appropriate tests and documentation.
- [ ] I have made sure that all CI jobs on GitHub pass.
- [ ] The pull request introduces no new warnings and follows the project's style guidelines.
Codecov Report
Attention: 2 lines
in your changes are missing coverage. Please review.
Comparison is base (
8a5779a
) 96.4% compared to head (b555c9f
) 96.2%.
Additional details and impacted files
@@ Coverage Diff @@
## main #355 +/- ##
=======================================
- Coverage 96.4% 96.2% -0.2%
=======================================
Files 34 34
Lines 1753 1749 -4
Branches 215 215
=======================================
- Hits 1690 1684 -6
- Misses 63 65 +2
Flag | Coverage Δ | |
---|---|---|
cpp | 96.0% <ø> (-0.2%) |
:arrow_down: |
python | 97.1% <97.2%> (-0.1%) |
:arrow_down: |
Files | Coverage Δ | |
---|---|---|
src/mqt/qcec/__init__.py | 100.0% <100.0%> (ø) |
|
src/mqt/qcec/verify.py | 100.0% <100.0%> (ø) |
|
src/mqt/qcec/verify_compilation_flow.py | 100.0% <ø> (ø) |
|
src/mqt/qcec/parameterized.py | 94.5% <96.8%> (-0.4%) |
:arrow_down: |
Cpp-Linter Report :warning:
Some files did not pass the configured checks!
clang-tidy reports: 4 concern(s)
-
include/mqt-qcec/checker/EquivalenceChecker.hpp
include/mqt-qcec/checker/EquivalenceChecker.hpp:42:33: warning: [cppcoreguidelines-avoid-const-or-ref-data-members]
member 'qc1' of type 'const qc::QuantumComputation &' is a reference
const qc::QuantumComputation& qc1; ^
include/mqt-qcec/checker/EquivalenceChecker.hpp:43:33: warning: [cppcoreguidelines-avoid-const-or-ref-data-members]
member 'qc2' of type 'const qc::QuantumComputation &' is a reference
const qc::QuantumComputation& qc2; ^
-
include/mqt-qcec/checker/dd/applicationscheme/SequentialApplicationScheme.hpp
include/mqt-qcec/checker/dd/applicationscheme/SequentialApplicationScheme.hpp:26:21: warning: [cppcoreguidelines-avoid-const-or-ref-data-members]
member 'gates1' of type 'const std::size_t' (aka 'const unsigned long') is const qualified
const std::size_t gates1; ^
include/mqt-qcec/checker/dd/applicationscheme/SequentialApplicationScheme.hpp:27:21: warning: [cppcoreguidelines-avoid-const-or-ref-data-members]
member 'gates2' of type 'const std::size_t' (aka 'const unsigned long') is const qualified
const std::size_t gates2; ^
Have any feedback or feature suggestions? Share it here.
Closing in favor of #432