|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "code", |
5 | | - "execution_count": 22, |
| 5 | + "execution_count": 43, |
6 | 6 | "id": "0", |
7 | 7 | "metadata": {}, |
8 | 8 | "outputs": [], |
|
107 | 107 | }, |
108 | 108 | { |
109 | 109 | "cell_type": "code", |
110 | | - "execution_count": 23, |
| 110 | + "execution_count": 44, |
111 | 111 | "id": "9", |
112 | 112 | "metadata": {}, |
113 | 113 | "outputs": [], |
|
137 | 137 | }, |
138 | 138 | { |
139 | 139 | "cell_type": "code", |
140 | | - "execution_count": 24, |
| 140 | + "execution_count": 45, |
141 | 141 | "id": "12", |
142 | 142 | "metadata": {}, |
143 | 143 | "outputs": [], |
|
156 | 156 | }, |
157 | 157 | { |
158 | 158 | "cell_type": "code", |
159 | | - "execution_count": 25, |
| 159 | + "execution_count": 46, |
160 | 160 | "id": "13", |
161 | 161 | "metadata": { |
162 | 162 | "colab": { |
|
179 | 179 | "name": "stdout", |
180 | 180 | "output_type": "stream", |
181 | 181 | "text": [ |
182 | | - "Quantum program link: https://platform.classiq.io/circuit/33367rxzbZSTd9ERZbbHvNHJQ7s\n" |
| 182 | + "Quantum program link: https://platform.classiq.io/circuit/333EX9Xfltpv6SiEWSLNBc03AF9\n" |
183 | 183 | ] |
184 | 184 | } |
185 | 185 | ], |
|
221 | 221 | "\n", |
222 | 222 | "\n", |
223 | 223 | "\n", |
224 | | - "For more information, refer to the [phase kickback](https://docs.classiq.io/latest/classiq_101/quantum_primitives_with_classiq/phase_kickback/) notebook." |
| 224 | + "For more information, refer to the [phase kickback](https://docs.classiq.io/latest/explore/tutorials/basic_tutorials/quantum_primitives/phase_kickback/phase_kickback/) notebook." |
225 | 225 | ] |
226 | 226 | }, |
227 | 227 | { |
|
236 | 236 | }, |
237 | 237 | { |
238 | 238 | "cell_type": "code", |
239 | | - "execution_count": 26, |
| 239 | + "execution_count": 47, |
240 | 240 | "id": "16", |
241 | 241 | "metadata": {}, |
242 | 242 | "outputs": [ |
243 | 243 | { |
244 | 244 | "name": "stdout", |
245 | 245 | "output_type": "stream", |
246 | 246 | "text": [ |
247 | | - "Quantum program link: https://platform.classiq.io/circuit/333682Ofz1ZWwrsVLS9w3veJ9vS\n" |
| 247 | + "Quantum program link: https://platform.classiq.io/circuit/333EXUuGhCIb4aOIDRAq265Sqtj\n" |
248 | 248 | ] |
249 | 249 | } |
250 | 250 | ], |
|
273 | 273 | }, |
274 | 274 | { |
275 | 275 | "cell_type": "code", |
276 | | - "execution_count": 27, |
| 276 | + "execution_count": 48, |
277 | 277 | "id": "17", |
278 | 278 | "metadata": {}, |
279 | 279 | "outputs": [ |
|
391 | 391 | }, |
392 | 392 | { |
393 | 393 | "cell_type": "code", |
394 | | - "execution_count": 28, |
| 394 | + "execution_count": 49, |
395 | 395 | "id": "25", |
396 | 396 | "metadata": {}, |
397 | 397 | "outputs": [], |
|
404 | 404 | }, |
405 | 405 | { |
406 | 406 | "cell_type": "code", |
407 | | - "execution_count": 29, |
| 407 | + "execution_count": 50, |
408 | 408 | "id": "26", |
409 | 409 | "metadata": {}, |
410 | 410 | "outputs": [ |
411 | 411 | { |
412 | 412 | "name": "stdout", |
413 | 413 | "output_type": "stream", |
414 | 414 | "text": [ |
415 | | - "Quantum program link: https://platform.classiq.io/circuit/33368VNOJ01SoR2V1hpvkNLjLqy\n" |
| 415 | + "Quantum program link: https://platform.classiq.io/circuit/333EXnfDjsWJPl4p4hbQgLtRLG3\n" |
416 | 416 | ] |
417 | 417 | } |
418 | 418 | ], |
|
424 | 424 | }, |
425 | 425 | { |
426 | 426 | "cell_type": "code", |
427 | | - "execution_count": 30, |
| 427 | + "execution_count": 51, |
428 | 428 | "id": "27", |
429 | 429 | "metadata": {}, |
430 | 430 | "outputs": [], |
|
481 | 481 | }, |
482 | 482 | { |
483 | 483 | "cell_type": "code", |
484 | | - "execution_count": 31, |
| 484 | + "execution_count": 52, |
485 | 485 | "id": "33", |
486 | 486 | "metadata": {}, |
487 | 487 | "outputs": [], |
|
507 | 507 | }, |
508 | 508 | { |
509 | 509 | "cell_type": "code", |
510 | | - "execution_count": 32, |
| 510 | + "execution_count": 53, |
511 | 511 | "id": "35", |
512 | 512 | "metadata": {}, |
513 | 513 | "outputs": [], |
|
528 | 528 | }, |
529 | 529 | { |
530 | 530 | "cell_type": "code", |
531 | | - "execution_count": 33, |
| 531 | + "execution_count": 54, |
532 | 532 | "id": "36", |
533 | 533 | "metadata": {}, |
534 | 534 | "outputs": [ |
535 | | - { |
536 | | - "name": "stderr", |
537 | | - "output_type": "stream", |
538 | | - "text": [ |
539 | | - "/Users/adamgitter/Library/Caches/pypoetry/virtualenvs/backend-X8DVKPvc-py3.11/lib/python3.11/site-packages/classiq/model_expansions/transformers/type_modifier_inference.py:185: ClassiqDeprecationWarning: The use of variable 'x' does not conform to its declared modifier: expected 'Permutable', but found 'Mutable'.\n", |
540 | | - "Tip: If the cumulative use of the variable in the function matches 'Permutable', use the `unchecked` flag to instruct the compiler to disregard individual operations.\n", |
541 | | - "\tat file grover.py line 54 character 43\n", |
542 | | - "The deprecation warning will be elevated to an error starting July 23, 2025, at the earliest.\n", |
543 | | - " warnings.warn(\n", |
544 | | - "/Users/adamgitter/Library/Caches/pypoetry/virtualenvs/backend-X8DVKPvc-py3.11/lib/python3.11/site-packages/classiq/model_expansions/transformers/type_modifier_inference.py:185: ClassiqDeprecationWarning: The use of variable 'target' does not conform to its declared modifier: expected 'Const', but found 'Mutable'.\n", |
545 | | - "Tip: If the cumulative use of the variable in the function matches 'Const', use the `unchecked` flag to instruct the compiler to disregard individual operations.\n", |
546 | | - "\tat file grover.py line 54 character 16\n", |
547 | | - "The deprecation warning will be elevated to an error starting July 23, 2025, at the earliest.\n", |
548 | | - " warnings.warn(\n" |
549 | | - ] |
550 | | - }, |
551 | 535 | { |
552 | 536 | "data": { |
553 | 537 | "text/plain": [ |
554 | | - "[{'vars': {'x': 0, 'y': 0}}: 143,\n", |
555 | | - " {'vars': {'x': 2, 'y': 2}}: 138,\n", |
556 | | - " {'vars': {'x': 3, 'y': 3}}: 138,\n", |
557 | | - " {'vars': {'x': 0, 'y': 2}}: 132,\n", |
| 538 | + "[{'vars': {'x': 2, 'y': 1}}: 152,\n", |
| 539 | + " {'vars': {'x': 3, 'y': 0}}: 136,\n", |
| 540 | + " {'vars': {'x': 3, 'y': 1}}: 135,\n", |
| 541 | + " {'vars': {'x': 3, 'y': 3}}: 134,\n", |
| 542 | + " {'vars': {'x': 1, 'y': 3}}: 133,\n", |
| 543 | + " {'vars': {'x': 2, 'y': 2}}: 133,\n", |
| 544 | + " {'vars': {'x': 2, 'y': 3}}: 132,\n", |
558 | 545 | " {'vars': {'x': 2, 'y': 0}}: 131,\n", |
559 | | - " {'vars': {'x': 2, 'y': 1}}: 131,\n", |
560 | | - " {'vars': {'x': 1, 'y': 1}}: 130,\n", |
561 | | - " {'vars': {'x': 0, 'y': 1}}: 129,\n", |
562 | | - " {'vars': {'x': 3, 'y': 0}}: 129,\n", |
563 | | - " {'vars': {'x': 1, 'y': 0}}: 128,\n", |
564 | | - " {'vars': {'x': 1, 'y': 2}}: 127,\n", |
565 | | - " {'vars': {'x': 0, 'y': 3}}: 125,\n", |
566 | | - " {'vars': {'x': 2, 'y': 3}}: 125,\n", |
567 | | - " {'vars': {'x': 1, 'y': 3}}: 116,\n", |
568 | | - " {'vars': {'x': 3, 'y': 1}}: 114,\n", |
569 | | - " {'vars': {'x': 3, 'y': 2}}: 112]" |
| 546 | + " {'vars': {'x': 0, 'y': 0}}: 129,\n", |
| 547 | + " {'vars': {'x': 0, 'y': 2}}: 128,\n", |
| 548 | + " {'vars': {'x': 0, 'y': 3}}: 121,\n", |
| 549 | + " {'vars': {'x': 1, 'y': 0}}: 120,\n", |
| 550 | + " {'vars': {'x': 3, 'y': 2}}: 119,\n", |
| 551 | + " {'vars': {'x': 1, 'y': 1}}: 119,\n", |
| 552 | + " {'vars': {'x': 1, 'y': 2}}: 118,\n", |
| 553 | + " {'vars': {'x': 0, 'y': 1}}: 108]" |
570 | 554 | ] |
571 | 555 | }, |
572 | | - "execution_count": 33, |
| 556 | + "execution_count": 54, |
573 | 557 | "metadata": {}, |
574 | 558 | "output_type": "execute_result" |
575 | 559 | } |
|
617 | 601 | }, |
618 | 602 | { |
619 | 603 | "cell_type": "code", |
620 | | - "execution_count": 34, |
| 604 | + "execution_count": 55, |
621 | 605 | "id": "41", |
622 | 606 | "metadata": {}, |
623 | 607 | "outputs": [ |
624 | 608 | { |
625 | 609 | "name": "stdout", |
626 | 610 | "output_type": "stream", |
627 | 611 | "text": [ |
628 | | - "Quantum program link: https://platform.classiq.io/circuit/33369RIkI3Jy95KPRNIEUHtkAkM\n" |
| 612 | + "Quantum program link: https://platform.classiq.io/circuit/333EYeLSVs7RGUkXqlgAj5irIFz\n" |
629 | 613 | ] |
630 | 614 | } |
631 | 615 | ], |
|
674 | 658 | }, |
675 | 659 | { |
676 | 660 | "cell_type": "code", |
677 | | - "execution_count": 35, |
| 661 | + "execution_count": 56, |
678 | 662 | "id": "42", |
679 | 663 | "metadata": { |
680 | 664 | "executionInfo": { |
|
750 | 734 | }, |
751 | 735 | { |
752 | 736 | "cell_type": "code", |
753 | | - "execution_count": 36, |
| 737 | + "execution_count": 57, |
754 | 738 | "id": "44", |
755 | 739 | "metadata": {}, |
756 | 740 | "outputs": [ |
757 | 741 | { |
758 | 742 | "name": "stdout", |
759 | 743 | "output_type": "stream", |
760 | 744 | "text": [ |
761 | | - "Quantum program link: https://platform.classiq.io/circuit/33369yl4DyTwGqzTOcXCrOBiJXu\n" |
| 745 | + "Quantum program link: https://platform.classiq.io/circuit/333EZAhTS7qIkIKj1pkbLSx3tig\n" |
762 | 746 | ] |
763 | 747 | } |
764 | 748 | ], |
|
784 | 768 | }, |
785 | 769 | { |
786 | 770 | "cell_type": "code", |
787 | | - "execution_count": 37, |
| 771 | + "execution_count": 58, |
788 | 772 | "id": "45", |
789 | 773 | "metadata": {}, |
790 | 774 | "outputs": [ |
|
794 | 778 | "text": [ |
795 | 779 | "x y |amp| angle/π note\n", |
796 | 780 | "----------------------------------\n", |
797 | | - "0 0 0.354 +0.12π \n", |
798 | | - "0 1 0.354 +0.12π \n", |
799 | | - "0 2 0.354 +0.12π \n", |
800 | | - "0 3 0.354 +0.12π \n", |
801 | | - "1 0 0.354 +0.12π \n", |
802 | | - "1 1 0.354 +0.12π \n", |
803 | | - "1 2 0.354 -0.88π ← solution\n", |
804 | | - "1 3 0.354 +0.12π \n" |
| 781 | + "0 0 0.354 +0.50π \n", |
| 782 | + "0 1 0.354 +0.50π \n", |
| 783 | + "0 2 0.354 +0.50π \n", |
| 784 | + "0 3 0.354 +0.50π \n", |
| 785 | + "1 0 0.354 +0.50π \n", |
| 786 | + "1 1 0.354 +0.50π \n", |
| 787 | + "1 2 0.354 -0.50π ← solution\n", |
| 788 | + "1 3 0.354 +0.50π \n" |
805 | 789 | ] |
806 | 790 | } |
807 | 791 | ], |
|
849 | 833 | }, |
850 | 834 | { |
851 | 835 | "cell_type": "code", |
852 | | - "execution_count": 38, |
| 836 | + "execution_count": 59, |
853 | 837 | "id": "47", |
854 | 838 | "metadata": {}, |
855 | 839 | "outputs": [], |
|
872 | 856 | }, |
873 | 857 | { |
874 | 858 | "cell_type": "code", |
875 | | - "execution_count": 39, |
| 859 | + "execution_count": 60, |
876 | 860 | "id": "48", |
877 | 861 | "metadata": {}, |
878 | 862 | "outputs": [ |
|
924 | 908 | }, |
925 | 909 | { |
926 | 910 | "cell_type": "code", |
927 | | - "execution_count": 40, |
| 911 | + "execution_count": 61, |
928 | 912 | "id": "51", |
929 | 913 | "metadata": {}, |
930 | 914 | "outputs": [], |
|
941 | 925 | }, |
942 | 926 | { |
943 | 927 | "cell_type": "code", |
944 | | - "execution_count": 41, |
| 928 | + "execution_count": 62, |
945 | 929 | "id": "52", |
946 | 930 | "metadata": {}, |
947 | 931 | "outputs": [], |
|
959 | 943 | }, |
960 | 944 | { |
961 | 945 | "cell_type": "code", |
962 | | - "execution_count": 42, |
| 946 | + "execution_count": 63, |
963 | 947 | "id": "53", |
964 | 948 | "metadata": {}, |
965 | 949 | "outputs": [ |
966 | 950 | { |
967 | 951 | "name": "stdout", |
968 | 952 | "output_type": "stream", |
969 | 953 | "text": [ |
970 | | - "Quantum program link: https://platform.classiq.io/circuit/3336B5z11cljwBj32td5T2sUffw\n" |
| 954 | + "Quantum program link: https://platform.classiq.io/circuit/333EaTIguJPylinHo20XImvejYC\n" |
971 | 955 | ] |
972 | 956 | }, |
973 | 957 | { |
974 | 958 | "data": { |
975 | 959 | "text/plain": [ |
976 | | - "[{'vars': {'x': 2, 'y': 0}}: 972,\n", |
977 | | - " {'vars': {'x': 3, 'y': 1}}: 952,\n", |
978 | | - " {'vars': {'x': 0, 'y': 2}}: 17,\n", |
979 | | - " {'vars': {'x': 2, 'y': 2}}: 12,\n", |
980 | | - " {'vars': {'x': 0, 'y': 3}}: 11,\n", |
981 | | - " {'vars': {'x': 0, 'y': 1}}: 10,\n", |
982 | | - " {'vars': {'x': 3, 'y': 2}}: 9,\n", |
983 | | - " {'vars': {'x': 0, 'y': 0}}: 9,\n", |
984 | | - " {'vars': {'x': 3, 'y': 3}}: 9,\n", |
| 960 | + "[{'vars': {'x': 3, 'y': 1}}: 1016,\n", |
| 961 | + " {'vars': {'x': 2, 'y': 0}}: 927,\n", |
| 962 | + " {'vars': {'x': 2, 'y': 3}}: 11,\n", |
| 963 | + " {'vars': {'x': 3, 'y': 0}}: 10,\n", |
| 964 | + " {'vars': {'x': 0, 'y': 3}}: 10,\n", |
| 965 | + " {'vars': {'x': 0, 'y': 2}}: 9,\n", |
985 | 966 | " {'vars': {'x': 1, 'y': 0}}: 9,\n", |
986 | | - " {'vars': {'x': 2, 'y': 1}}: 9,\n", |
987 | | - " {'vars': {'x': 1, 'y': 1}}: 8,\n", |
988 | | - " {'vars': {'x': 2, 'y': 3}}: 8,\n", |
989 | | - " {'vars': {'x': 1, 'y': 3}}: 7,\n", |
990 | | - " {'vars': {'x': 1, 'y': 2}}: 3,\n", |
991 | | - " {'vars': {'x': 3, 'y': 0}}: 3]" |
| 967 | + " {'vars': {'x': 2, 'y': 2}}: 9,\n", |
| 968 | + " {'vars': {'x': 0, 'y': 0}}: 8,\n", |
| 969 | + " {'vars': {'x': 3, 'y': 2}}: 7,\n", |
| 970 | + " {'vars': {'x': 3, 'y': 3}}: 7,\n", |
| 971 | + " {'vars': {'x': 0, 'y': 1}}: 6,\n", |
| 972 | + " {'vars': {'x': 1, 'y': 1}}: 6,\n", |
| 973 | + " {'vars': {'x': 1, 'y': 3}}: 5,\n", |
| 974 | + " {'vars': {'x': 1, 'y': 2}}: 4,\n", |
| 975 | + " {'vars': {'x': 2, 'y': 1}}: 4]" |
992 | 976 | ] |
993 | 977 | }, |
994 | | - "execution_count": 42, |
| 978 | + "execution_count": 63, |
995 | 979 | "metadata": {}, |
996 | 980 | "output_type": "execute_result" |
997 | 981 | } |
|
0 commit comments