-
Notifications
You must be signed in to change notification settings - Fork 35
Integrate changes of noise aware simulation #126
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #126 +/- ##
=======================================
+ Coverage 83.2% 84.1% +0.8%
=======================================
Files 46 48 +2
Lines 7782 8238 +456
=======================================
+ Hits 6482 6935 +453
- Misses 1300 1303 +3
Continue to review full report at Codecov.
|
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.
A few really minor things to consider.
# Conflicts: # test/CMakeLists.txt
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.
Also here. One more thing that needs fixing and 2 very little details, then I'll gladly merge this PR.
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.
The new function is not fully functional. See the inline comments for further details.
for (auto target: op->getTargets()) { | ||
usedQubits.push_back(target); | ||
} | ||
for (auto control: op->getControls()) { | ||
usedQubits.push_back(control.qubit); | ||
} |
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.
this is not guaranteed to work properly. you have to call getUsedQubits
on each sub-operation and then add build the union of the current set and the newly generated set. To this end, it is probably easiest and cleanest to just replace the std::vector<dd::Qubit>
with a std::set<dd::Qubit>
which handles sorting an uniqueness automatically.
If you really need a vector
as the result of the call (which I don't think you need), then you can still construct a vector from the set by (pseudocode)
auto vec = std::vector{set.begin(), set.end()};
(the union of two set
s can be easily be computed in-place by using set1.insert(set2.begin(), set2.end())
)
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.
Indeed! I changed the code as suggested.
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.
LGTM and ready to merge 🥳 I'll merge once the other PRs are fully reviewed.
Signed-off-by: burgholzer <[email protected]>
This PR adds the latest changes of the noise aware quantum circuit simulation to the QFR.
More precisely, this includes the noise functionality of the stochastic noise aware quantum circuit simulator ) and the deterministic noise aware quantum circuit simulator.