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

✨ switch to mqt-core Python package #355

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

Conversation

burgholzer
Copy link
Member

@burgholzer burgholzer commented Jan 26, 2024

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:

  • The pull request only contains commits that are related to it.
  • 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 burgholzer added dependencies Pull requests that update a dependency file python Anything related to Python code usability Anything related to usability packaging Anything related to Python packaging minor Part of a minor release labels Jan 26, 2024
@burgholzer burgholzer self-assigned this Jan 26, 2024
Copy link

codecov bot commented Jan 26, 2024

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%) ⬇️
python 97.1% <97.2%> (-0.1%) ⬇️
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%) ⬇️

... and 2 files with indirect coverage changes

@burgholzer burgholzer force-pushed the mqt-core-switch branch 3 times, most recently from c870020 to b9de1de Compare January 27, 2024 14:15
Copy link

Cpp-Linter Report ⚠️

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.

burgholzer added a commit that referenced this pull request Jan 29, 2024
## Description

This PR updates the mqt-core submodule and brings in some further
advancements from #355.
Specifically, it switches to using `FetchContent` for obtaining
`mqt-core`.
Per default, it is pointed to the vendored submodule via an overridable
CMake variable.

## Checklist:

<!---
This checklist serves as a reminder of a couple of things that ensure
your pull request will be merged swiftly.
-->

- [x] The pull request only contains commits that are related to it.
- [x] I have added appropriate tests and documentation.
- [x] I have made sure that all CI jobs on GitHub pass.
- [x] The pull request introduces no new warnings and follows the
project's style guidelines.

---------

Signed-off-by: burgholzer <burgholzer@me.com>
@burgholzer burgholzer force-pushed the mqt-core-switch branch 2 times, most recently from 6cf3f5f to b54600d Compare February 5, 2024 15:46
@burgholzer burgholzer force-pushed the mqt-core-switch branch 2 times, most recently from 0fea3ca to 9992718 Compare February 9, 2024 12:11
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file minor Part of a minor release packaging Anything related to Python packaging python Anything related to Python code usability Anything related to usability
Projects
Status: In Progress
Status: In Progress
Development

Successfully merging this pull request may close these issues.

None yet

1 participant