phy-521/presentation/entanglement.cpp

43 lines
859 B
C++
Raw Permalink Normal View History

2020-12-23 21:45:08 +00:00
#include <vector>
struct spin {bool up; bool down;}
struct entangled_spin {bool up_1; bool up_2; bool down_1; bool down_2; }
struct state { double prob_up; double prob_down; }
struct entangled_state {}
spin measure (particle measured) {
}
int main(int argc, char const *argv[])
{
std::vector<spin> v;
spin electron_spin;
spin positron_spin;
\\ uncorrelated measurements
for (int trial=1; trial<=1000; trial++) {
particle positron;
particle electron;
measure_spin(positron)
}
\\ entangled measurements
for (int trial=1; trial<=1000; trial++) {
entangled_pair pair = new entangled_pair(
particle position,
particle electron);
measure_spin(positron)
}
return 0;
//=============================================================================