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

✨ Add Python interface improvements and Qiskit export support #859

Merged
merged 7 commits into from
Mar 10, 2025

Conversation

burgholzer
Copy link
Member

Description

This pull request introduces several changes to enhance Python interoperability and integration with Qiskit. Key updates include:

  • Adding a method to natively export QuantumComputations objects to Qiskit QuantumCircuit.
  • Exposing registers from QuantumComputation in the Python interface.
  • Addressing issues with calling name and end on Python registers.
  • Fixing the implementation of __iter__ and providing items for Permutation.
  • Enhancing CompoundOperation to implement the MutableSequence[Operation] interface.

These changes provide better usability and extend functionality when using the library in Python environments.

Fixes #35

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

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>
@burgholzer burgholzer self-assigned this Mar 10, 2025
@burgholzer burgholzer added feature New feature or request fix Fix for something that isn't working Core Anything related to the Core library and IR python Anything related to Python code labels Mar 10, 2025
@burgholzer burgholzer added this to the MQT Core milestone Mar 10, 2025
Copy link

codecov bot commented Mar 10, 2025

Codecov Report

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

Project coverage is 92.3%. Comparing base (5e94260) to head (3845da9).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
src/mqt/core/plugins/qiskit/mqt_to_qiskit.py 93.3% 8 Missing ⚠️

❌ Your patch status has failed because the patch coverage (93.7%) is below the target coverage (95.0%). You can increase the patch coverage or adjust the target coverage.
❌ Your project status has failed because the head coverage (98.4%) is below the adjusted base coverage (99.2%). You can increase the head coverage or adjust the Removed Code Behavior.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #859     +/-   ##
=======================================
- Coverage   92.3%   92.3%   -0.1%     
=======================================
  Files        138     140      +2     
  Lines      13664   13786    +122     
  Branches    2104    2104             
=======================================
+ Hits       12621   12733    +112     
- Misses      1043    1053     +10     
Flag Coverage Δ
cpp 92.0% <ø> (-0.1%) ⬇️
python 98.4% <93.7%> (-1.4%) ⬇️
Files with missing lines Coverage Δ
...clude/mqt-core/ir/operations/CompoundOperation.hpp 100.0% <ø> (ø)
src/mqt/core/plugins/qiskit/__init__.py 100.0% <100.0%> (ø)
src/mqt/core/plugins/qiskit/qiskit_to_mqt.py 100.0% <100.0%> (ø)
src/mqt/core/plugins/qiskit/mqt_to_qiskit.py 93.3% <93.3%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: burgholzer <burgholzer@me.com>
@burgholzer burgholzer enabled auto-merge March 10, 2025 21:26
@burgholzer burgholzer merged commit b7c3cfc into main Mar 10, 2025
31 checks passed
@burgholzer burgholzer deleted the export-to-qiskit branch March 10, 2025 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Anything related to the Core library and IR feature New feature or request fix Fix for something that isn't working python Anything related to Python code
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

Export to Qiskit QuantumCircuit
1 participant