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

Fidelity-aware heuristic and search graph visualization #384

Merged
merged 130 commits into from
Dec 22, 2023

Conversation

EliasLF
Copy link
Collaborator

@EliasLF EliasLF commented Oct 23, 2023

Description

Includes:

  • a new fidelity-aware heuristic (+some changes to the current heuristic mapping system making it compatible with the new approach)
  • a data logger (logging all search nodes and metadata in the heuristic mapper)
  • a Python visualization module for visualizing search graphs after mapping
  • the option to automatically split layers if the search takes too long
  • iterative bidirectional routing (similar to Qiskit's SabreLayout but using QMAP's routing pass)

Currently, the fidelity-aware heuristic mapping is not yet compatible with dynamic initial layouting, lookahead or qubit teleportation. Therefore, I did not yet add an example for fidelity-aware mapping in Mapping.ipynb in the documentation. (I think advertising this feature outside the API reference only makes sense once it is more fleshed out)

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.

@EliasLF EliasLF added feature New feature or request python Anything related to Python code c++ Anything related to C++ code labels Oct 23, 2023
@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

Attention: 87 lines in your changes are missing coverage. Please review.

Comparison is base (07642b8) 92.3% compared to head (aebd205) 93.0%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #384     +/-   ##
=======================================
+ Coverage   92.3%   93.0%   +0.7%     
=======================================
  Files         44      46      +2     
  Lines       4158    4875    +717     
  Branches     701     843    +142     
=======================================
+ Hits        3838    4534    +696     
- Misses       320     341     +21     
Flag Coverage Δ
cpp 92.6% <90.7%> (+0.8%) ⬆️
python 96.0% <100.0%> (+0.1%) ⬆️
Files Coverage Δ
include/DataLogger.hpp 100.0% <100.0%> (ø)
include/Mapper.hpp 83.8% <ø> (+19.3%) ⬆️
include/MappingResults.hpp 79.1% <100.0%> (+0.6%) ⬆️
include/configuration/Configuration.hpp 100.0% <100.0%> (ø)
include/heuristic/HeuristicMapper.hpp 98.3% <100.0%> (+0.1%) ⬆️
include/utils.hpp 80.0% <ø> (ø)
src/mqt/qmap/__init__.py 66.6% <100.0%> (+1.9%) ⬆️
src/mqt/qmap/compile.py 97.1% <100.0%> (+0.9%) ⬆️
src/utils.cpp 92.5% <100.0%> (+1.8%) ⬆️
include/configuration/InitialLayout.hpp 47.0% <0.0%> (-0.6%) ⬇️
... and 6 more

src/heuristic/HeuristicMapper.cpp Fixed Show fixed Hide fixed
src/heuristic/HeuristicMapper.cpp Fixed Show fixed Hide fixed
src/DataLogger.cpp Fixed Show fixed Hide fixed
test/test_heuristic.cpp Fixed Show fixed Hide fixed
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link
Member

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many many thanks again for this nice contribution.
As discussed, I quickly skimmed over everything again and checked the most important parts. You can find a couple of extremely small comments inline as part of this review. Most of them, you should just be able to collect in a batch and commit in bulk (if you agree with the suggestions of course).
After that, I'd be happy to merge this 🎉

docs/source/library/Visualization.rst Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
src/mqt/qmap/compile.py Outdated Show resolved Hide resolved
src/mqt/qmap/__init__.py Show resolved Hide resolved
src/mqt/qmap/__init__.py Show resolved Hide resolved
src/mqt/qmap/visualization/search_visualizer.py Outdated Show resolved Hide resolved
src/mqt/qmap/visualization/visualize_search_graph.py Outdated Show resolved Hide resolved
src/heuristic/HeuristicMapper.cpp Outdated Show resolved Hide resolved
Copy link
Member

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is good to go, so let's get it in 🎉
Many thanks for all the work here. Looking forward to what's next!

@burgholzer burgholzer enabled auto-merge (squash) December 22, 2023 19:40
@EliasLF
Copy link
Collaborator Author

EliasLF commented Dec 22, 2023

I agree, let's merge👍
Thank you very much for the suggestions and the recent work on the Graphviz issue!

@burgholzer burgholzer merged commit b20ddfa into cda-tum:main Dec 22, 2023
34 checks passed
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 feature New feature or request python Anything related to Python code
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants