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 29 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 82.66667% with 13 lines in your changes missing coverage. Please review.

Project coverage is 90.7%. Comparing base (0d910e3) to head (0e63ef6).

Files with missing lines Patch % Lines
src/mqt/qmap/__init__.py 72.0% 7 Missing ⚠️
src/logicblocks/LogicTerm.cpp 0.0% 4 Missing ⚠️
include/sc/DataLogger.hpp 81.8% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #418     +/-   ##
=======================================
- Coverage   90.7%   90.7%   -0.1%     
=======================================
  Files         93      94      +1     
  Lines      10763   10788     +25     
  Branches    1830    1834      +4     
=======================================
+ Hits        9772    9794     +22     
- Misses       991     994      +3     
Flag Coverage Δ
cpp 90.5% <79.3%> (+<0.1%) ⬆️
python 94.9% <84.7%> (-1.1%) ⬇️
Files with missing lines Coverage Δ
include/hybridmap/NeutralAtomLayer.hpp 100.0% <100.0%> (ø)
src/mqt/qmap/clifford_synthesis.py 94.2% <100.0%> (-0.5%) ⬇️
src/mqt/qmap/compile.py 97.1% <100.0%> (+0.1%) ⬆️
src/mqt/qmap/load_architecture.py 100.0% <100.0%> (ø)
src/mqt/qmap/load_calibration.py 100.0% <100.0%> (ø)
src/mqt/qmap/na/__init__.py 100.0% <100.0%> (ø)
src/mqt/qmap/na/state_preparation.py 100.0% <ø> (ø)
src/mqt/qmap/plugins/__init__.py 100.0% <100.0%> (ø)
src/mqt/qmap/plugins/qiskit.py 96.5% <100.0%> (ø)
src/mqt/qmap/subarchitectures.py 95.4% <100.0%> (+<0.1%) ⬆️
... and 6 more

... and 4 files with indirect coverage changes

src/mqt/qmap/__init__.py Fixed Show fixed Hide fixed
@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
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
@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
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
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 <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
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 <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
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 <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 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