diff --git a/rfcs/analog/examples/capture_delay.quil b/rfcs/analog/examples/capture_delay.quil new file mode 100644 index 0000000..3adc8f5 --- /dev/null +++ b/rfcs/analog/examples/capture_delay.quil @@ -0,0 +1,14 @@ +# capture_delay.quil +# In this example we target qubit 0. + +DECLARE scale REAL +DECLARE freq REAL +DECLARE pulse_duration REAL +DECLARE capture_duration REAL +DECLARE iqs REAL[65536] + +SET-SCALE 0 "ro" scale +SET-FREQUENCY 0 "ro" freq +PULSE 0 "ro" flat(duration: pulse_duration, iq: [1 0]) + +RAW-CAPTURE 0 "out" capture_duration iqs diff --git a/rfcs/analog/examples/cavity_scan.quil b/rfcs/analog/examples/cavity_scan.quil new file mode 100644 index 0000000..e6b705a --- /dev/null +++ b/rfcs/analog/examples/cavity_scan.quil @@ -0,0 +1,36 @@ +# cavity_scan.quil +# In this example we target qubit 0. + +# Other values that will be set by user input +DECLARE freq_min REAL +DECLARE freq_max REAL +DECLARE freq_step REAL +DECLARE scale REAL + +# Values set by program +DECLARE buffer REAL[65536] +DECLARE iq REAL[2] +DECLARE freq REAL +DECLARE idx INTEGER +DECLARE continue BIT + +# Assign initial values +MOVE idx 0 +MOVE freq freq_min + + +LABEL @scan_step +SET-FREQUENCY 0 "ro" freq +SET-SCALE 0 "ro" scale +PULSE 0 "ro" flat(duration: duration, iq: [1 0]) +CAPTURE 0 "out" flat(duration: duration, iq: [1 0]) iq # Capture delay is built-in to CAPTURE + +# Store results in the buffer, increment +STORE buffer idx iq[0] +ADD idx 1 +STORE buffer idx iq[1] +ADD idx 1 + +ADD freq freq_step +LE continue freq freq_max +JUMP-WHEN @scan_step continue