Skip to content

Commit 587e18a

Browse files
remove print statements
1 parent 654a445 commit 587e18a

File tree

1 file changed

+47
-7
lines changed

1 file changed

+47
-7
lines changed

shor_algorithm.ipynb

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@
465465
},
466466
{
467467
"cell_type": "code",
468-
"execution_count": 42,
468+
"execution_count": 45,
469469
"id": "20025ca7-71ed-4215-a8a4-a6d1ab5173a3",
470470
"metadata": {
471471
"tags": []
@@ -497,8 +497,6 @@
497497
" counts = result[0].data.c.get_counts()\n",
498498
" max_index = max(counts)\n",
499499
" max_count = counts[max_index]\n",
500-
" print(type(max_count))\n",
501-
" print(max_count)\n",
502500
" print(\"Register Reading: \" + str(max_count))\n",
503501
" phase = max_count/(2**N_COUNT)\n",
504502
" print(f\"Corresponding Phase: {phase}\")\n",
@@ -535,7 +533,7 @@
535533
},
536534
{
537535
"cell_type": "code",
538-
"execution_count": 48,
536+
"execution_count": 46,
539537
"id": "fd95996d-c25b-4f38-9653-127b9893d87d",
540538
"metadata": {
541539
"tags": []
@@ -547,9 +545,51 @@
547545
"text": [
548546
"\n",
549547
"ATTEMPT 1:\n",
550-
"Register Reading: 10000000\n",
551-
"Corresponding Phase: 0.5\n",
552-
"Result: r = 2\n",
548+
"Register Reading: 257\n",
549+
"Corresponding Phase: 1.00390625\n",
550+
"Result: r = 1\n",
551+
"Guessed Factors: 15 and 1\n",
552+
"\n",
553+
"ATTEMPT 2:\n",
554+
"Register Reading: 256\n",
555+
"Corresponding Phase: 1.0\n",
556+
"Result: r = 1\n",
557+
"Guessed Factors: 15 and 1\n",
558+
"\n",
559+
"ATTEMPT 3:\n",
560+
"Register Reading: 262\n",
561+
"Corresponding Phase: 1.0234375\n",
562+
"Result: r = 1\n",
563+
"Guessed Factors: 15 and 1\n",
564+
"\n",
565+
"ATTEMPT 4:\n",
566+
"Register Reading: 252\n",
567+
"Corresponding Phase: 0.984375\n",
568+
"Result: r = 1\n",
569+
"Guessed Factors: 15 and 1\n",
570+
"\n",
571+
"ATTEMPT 5:\n",
572+
"Register Reading: 260\n",
573+
"Corresponding Phase: 1.015625\n",
574+
"Result: r = 1\n",
575+
"Guessed Factors: 15 and 1\n",
576+
"\n",
577+
"ATTEMPT 6:\n",
578+
"Register Reading: 257\n",
579+
"Corresponding Phase: 1.00390625\n",
580+
"Result: r = 1\n",
581+
"Guessed Factors: 15 and 1\n",
582+
"\n",
583+
"ATTEMPT 7:\n",
584+
"Register Reading: 260\n",
585+
"Corresponding Phase: 1.015625\n",
586+
"Result: r = 1\n",
587+
"Guessed Factors: 15 and 1\n",
588+
"\n",
589+
"ATTEMPT 8:\n",
590+
"Register Reading: 273\n",
591+
"Corresponding Phase: 1.06640625\n",
592+
"Result: r = 15\n",
553593
"Guessed Factors: 3 and 1\n",
554594
"*** Non-trivial factor found: {guess} ***\n"
555595
]

0 commit comments

Comments
 (0)