blob: e6ef630feadff6466b9b4f8de325b9b374d4903e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
*** measure.c.old Tue Jan 11 22:12:21 2005
--- measure.c Wed Feb 2 12:17:54 2005
***************
*** 39,45 ****
double
quantum_frand()
{
! return (double) rand() / RAND_MAX;
}
/* Measure the contents of a quantum register */
--- 39,45 ----
double
quantum_frand()
{
! return (double) random() / RAND_MAX;
}
/* Measure the contents of a quantum register */
***************
*** 64,70 ****
result. Otherwise, continue with the next base state. */
r -= quantum_prob_inline(reg.node[i].amplitude);
! if(quantum_prob_inline(reg.node[i].amplitude) >= r)
return reg.node[i].state;
}
--- 64,70 ----
result. Otherwise, continue with the next base state. */
r -= quantum_prob_inline(reg.node[i].amplitude);
! if(0 >= r)
return reg.node[i].state;
}
|