|
554 | 554 | ; - p_f1: name of .qasm file. |
555 | 555 | ; - p_f2: name of .qreg file. |
556 | 556 | ; - p_r: where results will be saved to: |
557 | | -; - "json" to save results to a json file. |
558 | | -; - "sqlite3" to save results to a sqlite3 database. |
| 557 | +; - "json" to save results to a json file. |
| 558 | +; - "sqlite3" to save results to a sqlite3 database. |
559 | 559 | ; - p_d: device. |
560 | 560 | ; - p_s: shots. |
561 | 561 | ; - p_m: max credits. |
562 | 562 | ; - p_e: seed. |
563 | 563 | ; |
564 | 564 | ; Sources: |
565 | 565 | ; - Casey, K. (2017). Archived | Quantum computing in action: IBM's Q experience |
566 | | -; and the quantum shell game. [online] IBM Developer. Available at: |
567 | | -; https://developer.ibm.com/tutorials/os-quantum-computing-shell-game/ |
568 | | -; [Accessed 30 Sep. 2019]. |
| 566 | +; and the quantum shell game. [online] IBM Developer. Available at: |
| 567 | +; https://developer.ibm.com/tutorials/os-quantum-computing-shell-game/ |
| 568 | +; [Accessed 30 Sep. 2019]. |
569 | 569 | ; |
570 | 570 | (define (qreq p_f1 p_f2 p_r p_d p_s p_m p_e) |
571 | 571 | (let ((port1 (current-output-port)) |
|
817 | 817 | ; - p_l2: quantum register name 2. |
818 | 818 | ; - p_y2: qubit 2, max limit of the range. |
819 | 819 | ; |
| 820 | +; Remarks: |
| 821 | +; - See the comments for qftyn. |
| 822 | +; |
820 | 823 | ; Sources: |
821 | 824 | ; - IBM Q Experience. (2019). IBM Q Experience. [online] Available at: |
822 | 825 | ; https://quantum-computing.ibm.com/support/guides/quantum-algorithms-with-qiskit? |
823 | 826 | ; page=5cc0b79786b50d00642353b9#qiskit-implementation-1 [Accessed 7 Oct. 2019]. |
824 | 827 | ; |
825 | | -; Notes: |
826 | | -; - See the comments for qftyn. |
827 | | -; |
828 | 828 | (define (qftdgyn p_l1 p_y1 p_l2 p_y2) |
829 | 829 | (qcomg "qftdgyn" 0) |
830 | 830 | (let ((i p_y1) |
|
843 | 843 | ; cswap - Gate Fredkin in atomic form. Swaps p_y2 and p_y3 if p_y1 is |1> |
844 | 844 | ; (controlled swap). |
845 | 845 | ; |
| 846 | +; Arguments: |
846 | 847 | ; - p_l1: quantum register name 1. |
847 | 848 | ; - p_y1: qubit 1. |
848 | 849 | ; - p_l2: quantum register name 2. |
|
893 | 894 | ; - p_y1: qubit 1, control qubit of the cx gate where the ladder begins. |
894 | 895 | ; - p_y2: qubit 2, target qubit of the cx gate where the ladder ends. |
895 | 896 | ; - p_s: mode: |
896 | | -; - 1: descending ladder, control qubit on top (p_y1). |
897 | | -; - 2: ascending ladder, control qubit on top (p_y1). |
898 | | -; - 3: descending ladder, control qubit on bottom (p_y2). |
899 | | -; - 4: ascending ladder, control qubit on bottom (p_y2). |
| 897 | +; - 1: descending ladder, control qubit on top (p_y1). |
| 898 | +; - 2: ascending ladder, control qubit on top (p_y1). |
| 899 | +; - 3: descending ladder, control qubit on bottom (p_y2). |
| 900 | +; - 4: ascending ladder, control qubit on bottom (p_y2). |
900 | 901 | ; |
901 | 902 | (define (cx-ladder p_l1 p_y1 p_y2 p_s) |
902 | 903 | (qcomg "cx-ladder" 0) |
|
940 | 941 | ; - p_y1: qubit 1, lower registry number qubit where the ladder begins. |
941 | 942 | ; - p_y2: qubit 2, higher registry number qubit where the ladder ends. |
942 | 943 | ; - p_s: mode: |
943 | | -; - 1: descending ladder. |
944 | | -; - 2: ascending ladder. |
| 944 | +; - 1: descending ladder. |
| 945 | +; - 2: ascending ladder. |
945 | 946 | ; |
946 | 947 | (define (swap-fast-ladder p_l1 p_y1 p_y2 p_s) |
947 | 948 | (qcomg "swap-fast-ladder" 0) |
|
973 | 974 | ; - p_y1: qubit 1, lower registry number qubit where the ladder begins. |
974 | 975 | ; - p_y2: qubit 2, higher registry number qubit where the ladder ends. |
975 | 976 | ; - p_s1: mode: |
976 | | -; - 1: descending ladder. |
977 | | -; - 2: ascending ladder. |
| 977 | +; - 1: descending ladder. |
| 978 | +; - 2: ascending ladder. |
978 | 979 | ; |
979 | 980 | (define (swap-ladder p_l1 p_y1 p_y2 p_s1) |
980 | 981 | (qcomg "swap-ladder" 0) |
|
1008 | 1009 | ; - p_y1: qubit 1, lower registry qubit of the GHZ array. |
1009 | 1010 | ; - p_y2: qubit 2, higher registry qubit of the GHZ array. |
1010 | 1011 | ; - p_s1: mode: |
1011 | | -; - 1: descending order. |
1012 | | -; - 2: ascending order. |
| 1012 | +; - 1: descending order. |
| 1013 | +; - 2: ascending order. |
1013 | 1014 | ; |
1014 | 1015 | ; Remarks: |
1015 | 1016 | ; - If p_s1 = 1, qubit p_y2 contains the non - Hadamard gate. |
1016 | 1017 | ; - If p_s1 = 2, qubit p_y1 contains the non - Hadamard gate. |
| 1018 | +; - This function places a barrier on all involved qubits after its relevant |
| 1019 | +; code. |
1017 | 1020 | ; |
1018 | 1021 | ; Sources: |
1019 | 1022 | ; - IBM Q Experience. (2019). IBM Q Experience. [online] Available at: |
|
1060 | 1063 | (qcomg "ghzy" 1))) |
1061 | 1064 |
|
1062 | 1065 |
|
1063 | | -; g1yl - Places gates on y axis according to list p_l. |
| 1066 | +; g1yl - Places gates on y axis according to list p_l. This allows you to set |
| 1067 | +; a complete array of gates at once. While setting gates at a given execution |
| 1068 | +; step can be achieved by means of other functions, g1y1 is yet another |
| 1069 | +; option that might be more convenient at times, for example, when you want |
| 1070 | +; to define an array of gates for a given time step procedureally depending |
| 1071 | +; on certain factors such as the kind of reading that you might want to |
| 1072 | +; perform after a certain operation such as a GHZ state preparation. |
1064 | 1073 | ; |
1065 | 1074 | ; Arguments: |
1066 | 1075 | ; - p_l1: quantum register name (.e. "q"). |
|
1069 | 1078 | ; h gates on the first and second, and an s gate on the third. |
1070 | 1079 | ; - p_y1: qubit 1, lower registry qubit |
1071 | 1080 | ; |
| 1081 | +; Remarks: |
| 1082 | +; - You might want to place a barrier on all qubits before or after calling |
| 1083 | +; this function. g1y1 does not place any barriers by itself, so if that is |
| 1084 | +; your choice, you would have to place your barrier(s) using the appropriate |
| 1085 | +; function calls. |
| 1086 | +; |
1072 | 1087 | (define (g1yl p_l1 p_l2 p_y1) |
1073 | 1088 | (qcomg "g1y1" 0) |
1074 | 1089 | (let ((l (length p_l2)) |
|
0 commit comments