Skip to content

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

Merged
merged 64 commits into from
Jul 5, 2022
Merged

Conversation

33Gjl1Xe
Copy link
Contributor

@33Gjl1Xe 33Gjl1Xe commented Jun 17, 2022

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.

@codecov
Copy link

codecov bot commented Jun 18, 2022

Codecov Report

Merging #126 (6836a62) into main (933c666) will increase coverage by 0.8%.
The diff coverage is 97.2%.

@@           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     
Impacted Files Coverage Δ
include/dd/Operations.hpp 92.3% <ø> (ø)
include/operations/CompoundOperation.hpp 83.5% <ø> (ø)
include/operations/NonUnitaryOperation.hpp 96.4% <ø> (ø)
include/operations/OpType.hpp 10.5% <ø> (ø)
src/parsers/RealParser.cpp 64.3% <0.0%> (+2.9%) ⬆️
test/algorithms/eval_dynamic_circuits.cpp 86.7% <ø> (ø)
include/dd/NoiseFunctionality.hpp 96.2% <96.2%> (ø)
include/QuantumComputation.hpp 94.0% <100.0%> (+<0.1%) ⬆️
include/operations/Operation.hpp 93.5% <100.0%> (+0.8%) ⬆️
test/unittests/test_dd_noise_functionality.cpp 100.0% <100.0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 933c666...6836a62. Read the comment docs.

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.

A few really minor things to consider.

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.

Also here. One more thing that needs fixing and 2 very little details, then I'll gladly merge this PR.

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.

The new function is not fully functional. See the inline comments for further details.

Comment on lines 165 to 170
for (auto target: op->getTargets()) {
usedQubits.push_back(target);
}
for (auto control: op->getControls()) {
usedQubits.push_back(control.qubit);
}
Copy link
Member

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 sets can be easily be computed in-place by using set1.insert(set2.begin(), set2.end()))

Copy link
Contributor Author

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.

@33Gjl1Xe 33Gjl1Xe requested a review from burgholzer July 5, 2022 13:55
@burgholzer burgholzer added the enhancement New feature or request label Jul 5, 2022
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.

LGTM and ready to merge 🥳 I'll merge once the other PRs are fully reviewed.

@burgholzer burgholzer marked this pull request as ready for review July 5, 2022 14:39
@burgholzer burgholzer enabled auto-merge (squash) July 5, 2022 14:56
@burgholzer burgholzer merged commit fa019ea into main Jul 5, 2022
@burgholzer burgholzer deleted the noiseComputeTable branch July 5, 2022 15:00
burgholzer added a commit that referenced this pull request Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants