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 #418

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

Conversation

burgholzer
Copy link
Member

@burgholzer burgholzer commented Jan 26, 2024

Description

This PR switches the project to use the newly developed mqt-core Python package.
Any Python package build will only require the mqt-core package as a build and runtime dependency and won't have to rely on fetched version of mqt-core any more.
Any regular C++ build will still use the FetchContent CMake module.

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 compilation methods
  • Simplifies the interfaces of the QMAP Python bindings
  • Allows OpenQASM3 as an input format.

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 Changes leading to a minor version increase labels Jan 26, 2024
@burgholzer burgholzer self-assigned this Jan 26, 2024
@burgholzer burgholzer force-pushed the mqt-core-switch branch 2 times, most recently from 57479ce to e05f117 Compare January 27, 2024 14:18
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 #418.
Specifically, it switches to using `FetchContent` for obtaining
`mqt-core` (and `LogicBlocks`).
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.
@burgholzer burgholzer force-pushed the mqt-core-switch branch 2 times, most recently from 2643b7b to c93369f Compare February 5, 2024 15:51
Copy link

codecov bot commented Feb 12, 2024

Codecov Report

Attention: Patch coverage is 93.16239% with 8 lines in your changes missing coverage. Please review.

Project coverage is 90.8%. Comparing base (3b7c97b) to head (0d125cd).

Files with missing lines Patch % Lines
src/logicblocks/LogicTerm.cpp 75.0% 5 Missing ⚠️
include/sc/DataLogger.hpp 81.8% 2 Missing ⚠️
src/na/nasp/Solver.cpp 95.0% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main    #418   +/-   ##
=====================================
  Coverage   90.7%   90.8%           
=====================================
  Files         93      94    +1     
  Lines      10763   10762    -1     
  Branches    1830    1831    +1     
=====================================
+ Hits        9772    9780    +8     
+ Misses       991     982    -9     
Flag Coverage Δ
cpp 90.6% <90.5%> (+<0.1%) ⬆️
python 96.2% <100.0%> (+0.2%) ⬆️
Files with missing lines Coverage Δ
include/cliffordsynthesis/CliffordSynthesizer.hpp 84.7% <100.0%> (-3.4%) ⬇️
include/cliffordsynthesis/Results.hpp 100.0% <ø> (ø)
include/hybridmap/NeutralAtomLayer.hpp 100.0% <100.0%> (ø)
include/na/nasp/Solver.hpp 95.0% <ø> (ø)
include/sc/Mapper.hpp 82.0% <100.0%> (-1.7%) ⬇️
src/cliffordsynthesis/CliffordSynthesizer.cpp 97.5% <100.0%> (+0.4%) ⬆️
src/cliffordsynthesis/Results.cpp 100.0% <100.0%> (ø)
src/cliffordsynthesis/Tableau.cpp 91.6% <100.0%> (ø)
src/hybridmap/NeutralAtomArchitecture.cpp 96.1% <100.0%> (ø)
src/mqt/qmap/__init__.py 100.0% <100.0%> (+5.8%) ⬆️
... and 15 more

... and 5 files with indirect coverage changes

@burgholzer burgholzer added major Changes leading to a major version increase and removed minor Changes leading to a minor version increase labels Sep 4, 2024
@burgholzer burgholzer force-pushed the mqt-core-switch branch 2 times, most recently from 73c1693 to f7d2f1d Compare January 22, 2025 10:45
@burgholzer burgholzer added extensive-python-ci Adding this label indicates that extensive Python CI runs should be started for this PR. extensive-cpp-ci Adding this label indicates that extensive C++ CI runs should be started for this PR. labels Jan 22, 2025
burgholzer added a commit to cda-tum/mqt-core that referenced this pull request Jan 22, 2025
## Description

This PR fixes an oversight in #753 where the respective changes would
sometimes create invalid output permutation dumps.
This surfaced as part of cda-tum/mqt-qmap#418.

## 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 <[email protected]>
burgholzer and others added 21 commits February 18, 2025 11:48
Signed-off-by: burgholzer <[email protected]>
This is mostly to avoid a naming conflict on editable installs because the `src/mqt/qmap` directory contained a subdirectory `qiskit`.

Signed-off-by: burgholzer <[email protected]>
given how the output was never displayed correctly anyways, this might as well be removed from the docs. That way, we do not need graphviz as well.

Signed-off-by: burgholzer <[email protected]>
the patch will now also check for Z3 in site-packages similar to how this is done for mqt-core.
Furthermore, the condition on the Python version is dropped as it was obsolete.

Signed-off-by: burgholzer <[email protected]>
Signed-off-by: burgholzer <[email protected]>
This is the first release of QCEC that also uses the MQT Core Python package. Both, mqt-qmap and mqt-qcec, need to be compiled using the same mqt-core library to avoid ABI incompatibilities.

Signed-off-by: burgholzer <[email protected]>
these lines are not feasible to test in CI for us at the moment

Signed-off-by: burgholzer <[email protected]>
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 extensive-cpp-ci Adding this label indicates that extensive C++ CI runs should be started for this PR. extensive-python-ci Adding this label indicates that extensive Python CI runs should be started for this PR. major Changes leading to a major version increase 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.

2 participants