-
Notifications
You must be signed in to change notification settings - Fork 33
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
✨ Noise-Aware Simulator Refactor and Backends #321
Conversation
# Conflicts: # CMakeLists.txt # src/mqt/ddsim/noiseawarestochasticsimulator.py
…tures # Conflicts: # include/StochasticNoiseSimulator.hpp
…tures # Conflicts: # test/python/noiseawareSimulator/test_noiseaware_stochastic_simulator.py
…adapting tests for new interface
…adapting tests for new interface
…ator and also changing the interface
test/python/noiseawareSimulator/test_noiseaware_determinstic_simulator.py
Fixed
Show fixed
Hide fixed
Signed-off-by: burgholzer <[email protected]>
Signed-off-by: burgholzer <[email protected]>
Signed-off-by: burgholzer <[email protected]>
Signed-off-by: burgholzer <[email protected]>
src/DeterministicNoiseSimulator.cpp
Outdated
std::map<std::string, std::size_t> results; | ||
for (size_t n = 0; n < shots; ++n) { | ||
const auto sampleIdx = d(mt); | ||
const auto& [state, prob] = *std::next(resultProbabilityMap.begin(), static_cast<std::int64_t>(sampleIdx)); |
Check notice
Code scanning / CodeQL
Unused local variable
Signed-off-by: burgholzer <[email protected]>
Signed-off-by: burgholzer <[email protected]>
Signed-off-by: burgholzer <[email protected]>
src/DeterministicNoiseSimulator.cpp
Outdated
std::map<std::string, std::size_t> results; | ||
for (size_t n = 0; n < shots; ++n) { | ||
const auto sampleIdx = d(mt); | ||
const auto& [state, _] = *std::next(resultProbabilityMap.begin(), static_cast<std::int64_t>(sampleIdx)); |
Check notice
Code scanning / CodeQL
Unused local variable
Signed-off-by: burgholzer <[email protected]>
Signed-off-by: burgholzer <[email protected]>
Signed-off-by: burgholzer <[email protected]>
## Description This PR contains a couple of fixes for the noise-aware simulation techniques currently being reworked in cda-tum/mqt-ddsim#321. More precisely, this PR makes sure that the corresponding DD package configs are already defined in the mqt-core library and that explicit instantiations for the methods relevant for DDSIM are in place. ## 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. --------- Signed-off-by: burgholzer <[email protected]>
Signed-off-by: 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.
@33Gjl1Xe Many thanks for your work on this!
I took the liberty to refactor the overall functionality some more and fix certain aspects. At this point, I think the PR is ready to merge as soon as all checks pass.
I believe there are a couple of nice follow-ups after that:
- In 📝 Extended documentation for simulators #347, the documentation for the simulators has been enhanced quite a bit. It would be nice to transform the existing documentation on the noise-aware simulators in a similar fashion (i.e., in the form of a Jupyter notebook)
- Qiskit has its own way of specifying noise models for simulators. It would be great if we would support those models directly instead of our backends having their own options.
- The repository could really use some more tests for these new simulators. Especially the support for dynamic circuits.
Neither of the above needs to happen in this PR and would only prolong the time until this gets merged. They would be much appreciated as a follow-up though. (@33Gjl1Xe 😉)
Signed-off-by: burgholzer <[email protected]>
Description
This PR adds support for non-unitary operations such as mid-circuit measurements and resets to the noise-aware simulation approaches in DDSIM.
Furthermore, it exposes both noise-aware simulators as Qiskit backends. For the first time, this makes them available to the Python users of DDSIM.
Fixes #89
Fixes #93
Checklist: