Skip to content

🧑‍💻 Base Example Device on Template#326

Open
ystade wants to merge 48 commits intodevelopfrom
example-device-template
Open

🧑‍💻 Base Example Device on Template#326
ystade wants to merge 48 commits intodevelopfrom
example-device-template

Conversation

@ystade
Copy link
Collaborator

@ystade ystade commented Feb 11, 2026

Description

This PR refactors the example device implementation by instantiating the device template for the example device. This adds a couple of convieniet features to the example device like install instructin and the packaging as a python package.

Checklist:

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • I have added entries to the changelog for any noteworthy additions, changes, fixes, or
    removals.
  • I have added migration instructions to the upgrade guide (if needed).
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

@ystade ystade added this to the v1.3.0 milestone Feb 11, 2026
@ystade ystade self-assigned this Feb 11, 2026
@ystade ystade added enhancement Enhancement of existing functionality refactor Refactoring the code base usability Increasing usability of the library labels Feb 11, 2026
@ystade ystade changed the base branch from develop to install-all-header February 11, 2026 10:14
@burgholzer burgholzer modified the milestones: v1.3.0, v1.2.3 Feb 15, 2026
Base automatically changed from install-all-header to develop February 15, 2026 15:27
@burgholzer
Copy link
Contributor

@ystade This can be rebased now that #325 is merged.

@ystade ystade requested a review from burgholzer February 26, 2026 17:28
@ystade
Copy link
Collaborator Author

ystade commented Mar 5, 2026

@burgholzer I just realized that including also the constants.h in the dynamic library may lead to conflicts when linking devices statically together. In that scenario, the contained types will be defined twice (because they are contained in header files with different names even). I put that here even though this was done in #325 because it also influences this PR and this one is still open.

@burgholzer
Copy link
Contributor

@burgholzer I just realized that including also the constants.h in the dynamic library may lead to conflicts when linking devices statically together. In that scenario, the contained types will be defined twice (because they are contained in header files with different names even). I put that here even though this was done in #325 because it also influences this PR and this one is still open.

Yeah, I had some intuition that something like this might come up.
I was hoping that it's fine as long as those are defined in separate translation units. But that is probably not the case when thinking about a driver that connects to multiple devices, like in MQT Core.
This should be moderately easy to find out though, right? We simply update the QDMI version in MQT Core to the latest v1.2.x commit and adjust the code to rely on the respective device headers... and see whether it crashes.
Or am I overlooking things?

@ystade
Copy link
Collaborator Author

ystade commented Mar 6, 2026

@burgholzer THis should actually be enough, yes.

@burgholzer
Copy link
Contributor

Alright, I actually tried this out real quick (updated the QDMI ref, removed the qdmi::qdmi link target from the devices, compiled), and it does lead to problems at least in MQT Core; particularly because of https://github.com/munich-quantum-toolkit/core/blob/main/include/mqt-core/qdmi/common/Common.hpp where we define common, device independent helpers.

So something definitely needs to change.
An option here would be to also prefix the enum definitions. Then there would have to be some casting down the line somewhere between the generic enum and the prefixed one.

We could also try to work it out in MQT Core by restructuring the common helper (which eventually should be moved here) and compiling the devices we have over there as shared libraries.
Feels like this could work, but we would lose the ability to link devices statically.

@burgholzer burgholzer added the backport-potential Changes to be backported to the stable branch label Mar 14, 2026
@mergify mergify bot added the conflict label Mar 14, 2026
@burgholzer
Copy link
Contributor

burgholzer commented Mar 14, 2026

@ystade Based on the latest changes from the docs update, this now needs to be updated to resolve the conflicts.

Edit: I also think that once we get this PR in, and we figured out how to proceed with the constants.h header, it is time for the v1.2.2 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-potential Changes to be backported to the stable branch conflict enhancement Enhancement of existing functionality refactor Refactoring the code base usability Increasing usability of the library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants