Skip to content

Add Reset Operation in Simulator #276

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 4 commits into from
Aug 8, 2023
Merged

Add Reset Operation in Simulator #276

merged 4 commits into from
Aug 8, 2023

Conversation

hillmich
Copy link
Contributor

@hillmich hillmich commented Aug 8, 2023

This PR adds the non-unitary reset operation to DDSIM.

Fixes #270

@hillmich hillmich added the enhancement Anything related to improvements of the existing library label Aug 8, 2023
@hillmich hillmich self-assigned this Aug 8, 2023
@codecov
Copy link

codecov bot commented Aug 8, 2023

Codecov Report

Merging #276 (704c5a4) into main (6abdeff) will increase coverage by 0.0%.
The diff coverage is 100.0%.

@@          Coverage Diff          @@
##            main    #276   +/-   ##
=====================================
  Coverage   95.0%   95.0%           
=====================================
  Files         20      20           
  Lines       1940    1950   +10     
  Branches     345     348    +3     
=====================================
+ Hits        1843    1853   +10     
  Misses        97      97           
Files Changed Coverage Δ
src/CircuitSimulator.cpp 92.8% <100.0%> (+0.7%) ⬆️

... and 1 file with indirect coverage changes

@burgholzer
Copy link
Member

Just as a small hint: you could actually adapt some of the MQT Core tests for dynamic circuits here.
Dynamic variants are available for BV, QFT, and QPE.

@burgholzer
Copy link
Member

Additional side note: the Qiskit backends probably should add the Reset gate as a supported operation and should also be tested.
I'd suppose that not all of the backends support the operation though, e.g., the Simulation Path and the unitary simulator.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2023

Cpp-Linter Report ✔️

No problems need attention.

Have any feedback or feature suggestions? Share it here.

@hillmich
Copy link
Contributor Author

hillmich commented Aug 8, 2023

Additional side note: the Qiskit backends probably should add the Reset gate as a supported operation and should also be tested. I'd suppose that not all of the backends support the operation though, e.g., the Simulation Path and the unitary simulator.

Good point, I'd do this as addition to or after #267 to avoid just creating conflicts in merging.

@burgholzer
Copy link
Member

Additional side note: the Qiskit backends probably should add the Reset gate as a supported operation and should also be tested. I'd suppose that not all of the backends support the operation though, e.g., the Simulation Path and the unitary simulator.

Good point, I'd do this as addition to or after #267 to avoid just creating conflicts in merging.

Agreed! 👍🏻 then this is good to go from my end!
I'll also work on extracting that reset functionality in MQT Core itself so that code duplication is minimized. It should be as simple as calling an applyReset function in the simulator.

@hillmich hillmich merged commit d7e1cd4 into main Aug 8, 2023
@hillmich hillmich deleted the circ-sim-reset branch August 8, 2023 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Anything related to improvements of the existing library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The CircuitSimulator reports error when simulating BernsteinVazirani for nQubits > 1
2 participants