-
Notifications
You must be signed in to change notification settings - Fork 35
✨ added state preparation routines for GHZ and W state #445
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
✨ added state preparation routines for GHZ and W state #445
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #445 +/- ##
=====================================
Coverage 90.1% 90.1%
=====================================
Files 111 111
Lines 11817 11845 +28
Branches 2057 2065 +8
=====================================
+ Hits 10649 10677 +28
Misses 1168 1168
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey 👋🏼
Many thanks for this nice initial contribution. I just went through your changes and left some comments on things that I believe still need a more detailed look/some changes.
Note that #444 will hopefully land soon and that might require some changes within this PR. No action item for now though.
…ea/mqt-core into add-state-preparation-routines
…corner case for GHZ state
…ea/mqt-core into add-state-preparation-routines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for the changes here! Looking way better already 👍🏼
I left some comments inline on how to improve it even further and a minor request for some more generic tests that I think would make sense.
Co-authored-by: Lukas Burgholzer <[email protected]>
Co-authored-by: Lukas Burgholzer <[email protected]>
Co-authored-by: Lukas Burgholzer <[email protected]>
Co-authored-by: Lukas Burgholzer <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for the latest set of changes. We are really getting there. I think this should be the last round of changes requested. After that, we are good to merge.
eb03ca5
to
818983d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for this nice addition!
## Description One of the recently introduced tests (in #445) adjusted the DD package tolerance to trigger a potential error. However, that test did not restore the tolerance to its prior setting. At least locally, this has led to quite some strange errors of subsequent tests failing. I am kind of puzzled that this hasn't led to any CI failures. Anyway, this PR fixes the underlying issue by properly resetting the tolerance to its original value. ## 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.
Description
In #341 the DD package provided methods for directly constructing DD for computational basis states or any product state that can be constructed from the single-qubit states
|0>, |1>, |+>, |->, |L>, |R>
.Updates
There are now 2 routines which implement the
also, there are unit tests which check that the preparation routines provide the desired states for a smaller number of qubits.
Fixes #341
Notes
In the beginning, I tried adding the routines to a different header file, however, I noticed that it was a lot easier to stick to the current structure and add the functions to the Package.hpp header inside the DD package. Additionally, I tried to use the existing functions in order to create & normalize the decision diagrams.
Checklist: