mqt-qcec icon indicating copy to clipboard operation
mqt-qcec copied to clipboard

✨ switch to `mqt-core` Python package

Open burgholzer opened this issue 1 year ago • 2 comments

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 of mqt-core that allows to load any supported circuit format as input and has better handling for Qiskit QuantumCircuit 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.

burgholzer avatar Jan 26 '24 14:01 burgholzer

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

Impacted file tree graph

@@           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:

... and 2 files with indirect coverage changes

codecov[bot] avatar Jan 26 '24 14:01 codecov[bot]

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.

github-actions[bot] avatar Jan 27 '24 15:01 github-actions[bot]

Closing in favor of #432

burgholzer avatar Aug 06 '24 15:08 burgholzer