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

♻️ Refactor QASM import functionality and remove deprecated formats #822

Merged
merged 6 commits into from
Feb 4, 2025

Conversation

burgholzer
Copy link
Member

@burgholzer burgholzer commented Feb 3, 2025

Description

This pull request refactors the QASM import functionality by encapsulating the QASM parser into its own dedicated library, MQT::CoreQASM. This change removes the import functionality from the QuantumComputation class, improving modularity and maintainability. Additionally, deprecated formats have been removed, streamlining the codebase.

Notably, this removes support for parsing .real files. Corresponding support is expected to be integrated into the MQT SyReC Synthesizer at https://github.com/cda-tum/mqt-syrec.

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.

- ♻️ turn QASM parser into its own library
- 🔥 remove import functionality from `QuantumComputation`
  the respective functionality is now provided by a separate `MQT::CoreQASM` library
- ♻️ refactor QASM parser and improve imports

Signed-off-by: burgholzer <burgholzer@me.com>
@burgholzer burgholzer self-assigned this Feb 3, 2025
@burgholzer burgholzer added refactor Anything related to code refactoring code quality Code quality improvements Core Anything related to the Core library and IR c++ Anything related to C++ code extensive-cpp-ci Adding this label indicates that extensive C++ CI runs should be started for this PR. labels Feb 3, 2025
@burgholzer burgholzer added this to the MQT Core milestone Feb 3, 2025
@burgholzer burgholzer force-pushed the remove-non-qasm-parsers branch from 0e6105c to 5cb74d6 Compare February 3, 2025 20:11
Copy link

codecov bot commented Feb 3, 2025

Codecov Report

Attention: Patch coverage is 92.48879% with 67 lines in your changes missing coverage. Please review.

Project coverage is 92.4%. Comparing base (8b25b61) to head (e7a8e15).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
src/qasm3/Importer.cpp 90.8% 42 Missing ⚠️
src/qasm3/passes/ConstEvalPass.cpp 75.7% 8 Missing ⚠️
src/qasm3/Token.cpp 98.1% 5 Missing ⚠️
src/qasm3/Parser.cpp 90.0% 4 Missing ⚠️
src/qasm3/Scanner.cpp 69.2% 4 Missing ⚠️
src/qasm3/Statement.cpp 95.2% 2 Missing ⚠️
src/qasm3/passes/TypeCheckPass.cpp 83.3% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #822     +/-   ##
=======================================
+ Coverage   91.8%   92.4%   +0.5%     
=======================================
  Files        129     126      -3     
  Lines      14157   13257    -900     
  Branches    2208    2033    -175     
=======================================
- Hits       13009   12251    -758     
+ Misses      1148    1006    -142     
Flag Coverage Δ
cpp 92.1% <92.4%> (+0.5%) ⬆️
python 99.7% <100.0%> (ø)
Files with missing lines Coverage Δ
include/mqt-core/Definitions.hpp 76.4% <ø> (ø)
include/mqt-core/ir/QuantumComputation.hpp 100.0% <100.0%> (ø)
include/mqt-core/qasm3/Exception.hpp 53.8% <ø> (ø)
include/mqt-core/qasm3/Gate.hpp 100.0% <ø> (ø)
include/mqt-core/qasm3/InstVisitor.hpp 81.0% <ø> (ø)
include/mqt-core/qasm3/NestedEnvironment.hpp 100.0% <ø> (ø)
include/mqt-core/qasm3/Parser.hpp 100.0% <100.0%> (ø)
include/mqt-core/qasm3/Scanner.hpp 100.0% <ø> (ø)
include/mqt-core/qasm3/Statement.hpp 90.3% <100.0%> (ø)
include/mqt-core/qasm3/Token.hpp 100.0% <100.0%> (ø)
... and 15 more

... and 3 files with indirect coverage changes

src/qasm3/Token.cpp Fixed Show fixed Hide fixed
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: Lukas Burgholzer <burgholzer@me.com>
@burgholzer burgholzer merged commit be654c7 into main Feb 4, 2025
62 checks passed
@burgholzer burgholzer deleted the remove-non-qasm-parsers branch February 4, 2025 18:02
burgholzer added a commit to cda-tum/mqt-syrec that referenced this pull request Feb 4, 2025
## Description

This moves the `.real` parser from MQT Core, where it has been removed
in cda-tum/mqt-core#822, to this repository.
As there are no previous connection points to the SyReC repository, this
is relatively standalone for now.

## 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 mentioned this pull request Feb 4, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Anything related to C++ code code quality Code quality improvements Core Anything related to the Core library and IR extensive-cpp-ci Adding this label indicates that extensive C++ CI runs should be started for this PR. refactor Anything related to code refactoring
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant