Skip to content

Commit

Permalink
Update VirtualQubit.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
twingdev committed Apr 9, 2024
1 parent acd4a9a commit 0f627f8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions VirtualQubit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ bool VirtualQubit::isEntangled() const {
}

int VirtualQubit::measure() {



std::uniform_real_distribution<> dis(0.0, 1.0);
double probabilityState0 = std::norm(state0);
int result = dis(gen) < probabilityState0 ? 0 : 1;
Expand Down

0 comments on commit 0f627f8

Please sign in to comment.