Skip to content

Commit

Permalink
Better restore state function for the clifford simulator (for the cas…
Browse files Browse the repository at this point in the history
…es when one does not have to restore multiple times).
  • Loading branch information
aromanro committed Nov 15, 2024
1 parent b53b947 commit 2f125cf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions QCSim/Clifford.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,13 @@ namespace QC {
stabilizerGenerators = savedStabilizerGenerators;
}

void RestoreSavedStateDestructive()
{
destabilizerGenerators.swap(savedDestabilizerGenerators);
stabilizerGenerators.swap(savedStabilizerGenerators);
ClearSavedState();
}

void ClearSavedState()
{
savedDestabilizerGenerators.clear();
Expand Down

0 comments on commit 2f125cf

Please sign in to comment.