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

✨ Noise-Aware Simulator Refactor and Backends #321

Merged
merged 82 commits into from
Feb 23, 2024
Merged

Conversation

33Gjl1Xe
Copy link
Contributor

@33Gjl1Xe 33Gjl1Xe commented Nov 17, 2023

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:

  • 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.

Thomas Grurl added 24 commits August 29, 2023 10:36
# Conflicts:
#	CMakeLists.txt
#	src/mqt/ddsim/noiseawarestochasticsimulator.py
…tures

# Conflicts:
#	include/StochasticNoiseSimulator.hpp
…tures

# Conflicts:
#	test/python/noiseawareSimulator/test_noiseaware_stochastic_simulator.py
@burgholzer burgholzer added enhancement Anything related to improvements of the existing library python Pull requests that update Python code minor Part of a minor release c++ Anything related to C++ code labels Nov 17, 2023
@burgholzer burgholzer marked this pull request as ready for review February 23, 2024 10:37
@burgholzer burgholzer changed the title Noise-Aware Simulator Cleanup ✨ Noise-Aware Simulator Refactor and Backends Feb 23, 2024
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
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

Variable prob is not used.
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
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

Variable _ is not used.
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
burgholzer added a commit to cda-tum/mqt-core that referenced this pull request Feb 23, 2024
## 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 <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
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.

@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 😉)

@burgholzer burgholzer enabled auto-merge (squash) February 23, 2024 18:25
Signed-off-by: burgholzer <burgholzer@me.com>
@burgholzer burgholzer merged commit 3283ca5 into main Feb 23, 2024
37 checks passed
@burgholzer burgholzer deleted the nw_sim_features branch February 23, 2024 20:40
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 enhancement Anything related to improvements of the existing library minor Part of a minor release python Pull requests that update Python code
Projects
Status: Done
Status: Done
2 participants