mirror of
https://github.com/libquantum/libquantum.git
synced 2025-10-03 16:51:37 +00:00
updated libquantum 1.1.1 source files
This commit is contained in:
5
grover.c
5
grover.c
@@ -145,6 +145,7 @@ int main(int argc, char **argv)
|
||||
width = quantum_getwidth(N+1);
|
||||
|
||||
reg = quantum_new_qureg(0, width);
|
||||
// reg.width--;
|
||||
|
||||
quantum_sigma_x(reg.width, ®);
|
||||
|
||||
@@ -169,9 +170,9 @@ int main(int argc, char **argv)
|
||||
|
||||
for(i=0; i<reg.size; i++)
|
||||
{
|
||||
if(reg.node[i].state == N)
|
||||
if(reg.state[i] == N)
|
||||
printf("\nFound %i with a probability of %f\n\n", N,
|
||||
quantum_prob(reg.node[i].amplitude));
|
||||
quantum_prob(reg.amplitude[i]));
|
||||
}
|
||||
|
||||
quantum_delete_qureg(®);
|
||||
|
Reference in New Issue
Block a user