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

Improvements for Trace Computation #628

Merged
merged 16 commits into from
Jun 19, 2024
Merged

Conversation

TeWas
Copy link
Contributor

@TeWas TeWas commented Jun 6, 2024

Description

This PR introduces improvements for the trace computation:

  1. Adds a compute table for storing results of eliminated nodes during (partial) trace computation
  • this allows the full trace computation to scale linearly with the number of nodes
  • however, the partial trace computation still scales with the number of paths in the DD if the bottom qubits are to be eliminated: non-eliminated nodes cannot be stored in the compute table, as this would prevent their proper elimination in subsequent trace calls
  1. Normalizes the result

Fixes #336

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.

Copy link

codecov bot commented Jun 6, 2024

Codecov Report

Attention: Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.

Project coverage is 91.6%. Comparing base (0e4ff9e) to head (601edfa).
Report is 110 commits behind head on main.

Files with missing lines Patch % Lines
include/mqt-core/dd/Package.hpp 95.8% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #628     +/-   ##
=======================================
- Coverage   91.6%   91.6%   -0.1%     
=======================================
  Files        148     148             
  Lines      14736   14755     +19     
  Branches    2366    2369      +3     
=======================================
+ Hits       13511   13522     +11     
- Misses      1225    1233      +8     
Flag Coverage Δ
cpp 91.3% <95.8%> (-0.1%) ⬇️
python 99.7% <ø> (ø)
Files with missing lines Coverage Δ
include/mqt-core/dd/Package.hpp 97.4% <95.8%> (-0.3%) ⬇️

... and 3 files with indirect coverage changes

@burgholzer burgholzer added enhancement New feature or request DD Anything related to the DD package c++ Anything related to C++ code labels Jun 6, 2024
@TeWas TeWas marked this pull request as ready for review June 12, 2024 11:02
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 thanks for your work on this and for the clear code comments. These are highly appreciated!
I looked through all the changes here and you'll find my comments inline. Some are just minor suggestions that you can quickly incorporate. Some might take a little bit of work, but I think it shouldn't be too bad.

include/mqt-core/dd/Package.hpp Outdated Show resolved Hide resolved
include/mqt-core/dd/Package.hpp Show resolved Hide resolved
include/mqt-core/dd/Package.hpp Outdated Show resolved Hide resolved
include/mqt-core/dd/Package.hpp Outdated Show resolved Hide resolved
include/mqt-core/dd/Package.hpp Outdated Show resolved Hide resolved
include/mqt-core/dd/Package.hpp Outdated Show resolved Hide resolved
include/mqt-core/dd/Package.hpp Outdated Show resolved Hide resolved
test/dd/test_package.cpp Outdated Show resolved Hide resolved
test/dd/test_package.cpp Outdated Show resolved Hide resolved
test/dd/test_package.cpp Outdated Show resolved Hide resolved
…ble does not increase for non-eliminated lower-level qubits, but scales with the number of paths if lower-level qubits were eliminated
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 thanks for all your work on this. Especially, for writing thorough tests! ✅

I just pushed some finishing touches, which are mostly stylistic/minor. After CI is all green, this is good to go 🚀

@burgholzer burgholzer enabled auto-merge (squash) June 19, 2024 11:20
@burgholzer burgholzer merged commit 35e06ca into cda-tum:main Jun 19, 2024
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 DD Anything related to the DD package enhancement New feature or request
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

Improvements for Trace Computation
2 participants