Skip to content

Commit c11a5ec

Browse files
authored
Merge pull request #77 from PESchoenberg/develop
Improved comments.
2 parents 6d08f2e + 000a5aa commit c11a5ec

File tree

3 files changed

+36
-21
lines changed

3 files changed

+36
-21
lines changed

g2q1.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
; g2q-ibm-config - TODO : configuration for using IBM Q series machines;
5353
; equivalent to functions found on Qiskit IDE. (Deprecated).
5454
;
55-
; Elements:
55+
; List elements:
5656
; - 1: base uri for online access.
5757
; - 2: token.
5858
; - 3: subdir to post https execution requests.

g2q2.scm

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -554,18 +554,18 @@
554554
; - p_f1: name of .qasm file.
555555
; - p_f2: name of .qreg file.
556556
; - 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.
559559
; - p_d: device.
560560
; - p_s: shots.
561561
; - p_m: max credits.
562562
; - p_e: seed.
563563
;
564564
; Sources:
565565
; - 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].
569569
;
570570
(define (qreq p_f1 p_f2 p_r p_d p_s p_m p_e)
571571
(let ((port1 (current-output-port))
@@ -817,14 +817,14 @@
817817
; - p_l2: quantum register name 2.
818818
; - p_y2: qubit 2, max limit of the range.
819819
;
820+
; Remarks:
821+
; - See the comments for qftyn.
822+
;
820823
; Sources:
821824
; - IBM Q Experience. (2019). IBM Q Experience. [online] Available at:
822825
; https://quantum-computing.ibm.com/support/guides/quantum-algorithms-with-qiskit?
823826
; page=5cc0b79786b50d00642353b9#qiskit-implementation-1 [Accessed 7 Oct. 2019].
824827
;
825-
; Notes:
826-
; - See the comments for qftyn.
827-
;
828828
(define (qftdgyn p_l1 p_y1 p_l2 p_y2)
829829
(qcomg "qftdgyn" 0)
830830
(let ((i p_y1)
@@ -843,6 +843,7 @@
843843
; cswap - Gate Fredkin in atomic form. Swaps p_y2 and p_y3 if p_y1 is |1>
844844
; (controlled swap).
845845
;
846+
; Arguments:
846847
; - p_l1: quantum register name 1.
847848
; - p_y1: qubit 1.
848849
; - p_l2: quantum register name 2.
@@ -893,10 +894,10 @@
893894
; - p_y1: qubit 1, control qubit of the cx gate where the ladder begins.
894895
; - p_y2: qubit 2, target qubit of the cx gate where the ladder ends.
895896
; - 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).
900901
;
901902
(define (cx-ladder p_l1 p_y1 p_y2 p_s)
902903
(qcomg "cx-ladder" 0)
@@ -940,8 +941,8 @@
940941
; - p_y1: qubit 1, lower registry number qubit where the ladder begins.
941942
; - p_y2: qubit 2, higher registry number qubit where the ladder ends.
942943
; - p_s: mode:
943-
; - 1: descending ladder.
944-
; - 2: ascending ladder.
944+
; - 1: descending ladder.
945+
; - 2: ascending ladder.
945946
;
946947
(define (swap-fast-ladder p_l1 p_y1 p_y2 p_s)
947948
(qcomg "swap-fast-ladder" 0)
@@ -973,8 +974,8 @@
973974
; - p_y1: qubit 1, lower registry number qubit where the ladder begins.
974975
; - p_y2: qubit 2, higher registry number qubit where the ladder ends.
975976
; - p_s1: mode:
976-
; - 1: descending ladder.
977-
; - 2: ascending ladder.
977+
; - 1: descending ladder.
978+
; - 2: ascending ladder.
978979
;
979980
(define (swap-ladder p_l1 p_y1 p_y2 p_s1)
980981
(qcomg "swap-ladder" 0)
@@ -1008,12 +1009,14 @@
10081009
; - p_y1: qubit 1, lower registry qubit of the GHZ array.
10091010
; - p_y2: qubit 2, higher registry qubit of the GHZ array.
10101011
; - p_s1: mode:
1011-
; - 1: descending order.
1012-
; - 2: ascending order.
1012+
; - 1: descending order.
1013+
; - 2: ascending order.
10131014
;
10141015
; Remarks:
10151016
; - If p_s1 = 1, qubit p_y2 contains the non - Hadamard gate.
10161017
; - 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.
10171020
;
10181021
; Sources:
10191022
; - IBM Q Experience. (2019). IBM Q Experience. [online] Available at:
@@ -1060,7 +1063,13 @@
10601063
(qcomg "ghzy" 1)))
10611064

10621065

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.
10641073
;
10651074
; Arguments:
10661075
; - p_l1: quantum register name (.e. "q").
@@ -1069,6 +1078,12 @@
10691078
; h gates on the first and second, and an s gate on the third.
10701079
; - p_y1: qubit 1, lower registry qubit
10711080
;
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+
;
10721087
(define (g1yl p_l1 p_l2 p_y1)
10731088
(qcomg "g1y1" 0)
10741089
(let ((l (length p_l2))

g2q3.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
;
5757
; Output:
5858
; - A result that consists of the maximum probability obtained from the
59-
; execution of the compiled quantum circuit.
59+
; execution of the compiled quantum circuit.
6060
;
6161
(define (qcompile-and-run p_fname p_fnameo p_qver p_ddir p_qpu p_qf p_q p_c p_qn p_cn p_mc p_i p_v p_rf)
6262
(let ((porto1 (current-output-port))

0 commit comments

Comments
 (0)