From 91b532678bc4d01019a5faa35a4344c33ff8e142 Mon Sep 17 00:00:00 2001 From: Chris Osborn Date: Mon, 15 Jul 2019 11:15:40 -0700 Subject: [PATCH 1/9] Add readout cavity scan example measurement in examples.md. --- rfcs/analog/examples.md | 48 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 rfcs/analog/examples.md diff --git a/rfcs/analog/examples.md b/rfcs/analog/examples.md new file mode 100644 index 0000000..6f1e4e1 --- /dev/null +++ b/rfcs/analog/examples.md @@ -0,0 +1,48 @@ +# Example measurements + +The following is an incomplete list of measurements an experimenter may use analog quil to perform. + +## Readout cavity scan + +``` +# Static constants that must be set before program execution +# TODO: Define how $qubit is set. May be used in e.g. DEFCIRCUIT + +# 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] # 16-bit memory +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 $qubit "ro" freq +SET-SCALE $qubit "ro" scale +PULSE $qubit "ro" flat(duration: duration, iq: ?) +# TODO: Determine if capture_delay is needed, and how it is set +DELAY(capture_delay) $qubit # Round trip acquisition delay +CAPTURE $qubit "out" flat(duration: duration, iq: ?) iq + +# 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 + +# TODO: Finalize +``` From 0d8c7a8b4d9f1469b385936eb2a5a475b259e0a1 Mon Sep 17 00:00:00 2001 From: Chris Osborn Date: Wed, 17 Jul 2019 13:09:11 -0700 Subject: [PATCH 2/9] Moved examples.md to examples/cavity_scan.quil. --- rfcs/analog/{examples.md => examples/cavity_scan.quil} | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) rename rfcs/analog/{examples.md => examples/cavity_scan.quil} (86%) diff --git a/rfcs/analog/examples.md b/rfcs/analog/examples/cavity_scan.quil similarity index 86% rename from rfcs/analog/examples.md rename to rfcs/analog/examples/cavity_scan.quil index 6f1e4e1..f26bfd6 100644 --- a/rfcs/analog/examples.md +++ b/rfcs/analog/examples/cavity_scan.quil @@ -1,10 +1,6 @@ -# Example measurements +# cavity_scan.quil +# Readout cavity scan -The following is an incomplete list of measurements an experimenter may use analog quil to perform. - -## Readout cavity scan - -``` # Static constants that must be set before program execution # TODO: Define how $qubit is set. May be used in e.g. DEFCIRCUIT @@ -45,4 +41,3 @@ LE continue freq freq_max JUMP-WHEN @scan_step continue # TODO: Finalize -``` From 4f3cc44cfe46fc8810bbdfdf2e085607afea87cc Mon Sep 17 00:00:00 2001 From: Chris Osborn Date: Wed, 17 Jul 2019 14:03:02 -0700 Subject: [PATCH 3/9] Add capture_delay.quil. --- rfcs/analog/examples/capture_delay.quil | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 rfcs/analog/examples/capture_delay.quil diff --git a/rfcs/analog/examples/capture_delay.quil b/rfcs/analog/examples/capture_delay.quil new file mode 100644 index 0000000..eabe993 --- /dev/null +++ b/rfcs/analog/examples/capture_delay.quil @@ -0,0 +1,16 @@ +# capture_delay.quil + +# TODO: Determine how $qubit is set. +DECLARE scale REAL +DECLARE pulse_duration REAL +DECLARE capture_duration REAL +DECLARE sample_rate INTEGER # Determine how this is set +DECLARE num_iqs INTEGER + +MUL num_iqs capture_duration sample_rate # Must be INTEGER +DECLARE iqs REAL[num_iqs] + +SET-SCALE $qubit "ro" scale +PULSE $qubit "ro" flat(duration: pulse_duration, iq: ?) + +RAW-CAPTURE $qubit "out" capture_duration iqs From 2dbb9918310b189f0a50f44a1fe8934668e0cbe5 Mon Sep 17 00:00:00 2001 From: Chris Osborn Date: Wed, 17 Jul 2019 14:07:02 -0700 Subject: [PATCH 4/9] Using constant large number for iqs mem allocation. --- rfcs/analog/examples/capture_delay.quil | 5 +---- rfcs/analog/examples/cavity_scan.quil | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/rfcs/analog/examples/capture_delay.quil b/rfcs/analog/examples/capture_delay.quil index eabe993..6a87010 100644 --- a/rfcs/analog/examples/capture_delay.quil +++ b/rfcs/analog/examples/capture_delay.quil @@ -5,10 +5,7 @@ DECLARE scale REAL DECLARE pulse_duration REAL DECLARE capture_duration REAL DECLARE sample_rate INTEGER # Determine how this is set -DECLARE num_iqs INTEGER - -MUL num_iqs capture_duration sample_rate # Must be INTEGER -DECLARE iqs REAL[num_iqs] +DECLARE iqs REAL[65536] SET-SCALE $qubit "ro" scale PULSE $qubit "ro" flat(duration: pulse_duration, iq: ?) diff --git a/rfcs/analog/examples/cavity_scan.quil b/rfcs/analog/examples/cavity_scan.quil index f26bfd6..d506269 100644 --- a/rfcs/analog/examples/cavity_scan.quil +++ b/rfcs/analog/examples/cavity_scan.quil @@ -1,5 +1,4 @@ # cavity_scan.quil -# Readout cavity scan # Static constants that must be set before program execution # TODO: Define how $qubit is set. May be used in e.g. DEFCIRCUIT From 040b1be749f74cd8251b2e4841dd36b359aaee8a Mon Sep 17 00:00:00 2001 From: Chris Osborn Date: Tue, 17 Sep 2019 10:02:07 -0700 Subject: [PATCH 5/9] Remove capture DELAY. --- rfcs/analog/examples/cavity_scan.quil | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rfcs/analog/examples/cavity_scan.quil b/rfcs/analog/examples/cavity_scan.quil index d506269..df9c639 100644 --- a/rfcs/analog/examples/cavity_scan.quil +++ b/rfcs/analog/examples/cavity_scan.quil @@ -25,9 +25,7 @@ LABEL @scan_step SET-FREQUENCY $qubit "ro" freq SET-SCALE $qubit "ro" scale PULSE $qubit "ro" flat(duration: duration, iq: ?) -# TODO: Determine if capture_delay is needed, and how it is set -DELAY(capture_delay) $qubit # Round trip acquisition delay -CAPTURE $qubit "out" flat(duration: duration, iq: ?) iq +CAPTURE $qubit "out" flat(duration: duration, iq: ?) iq # Capture delay is built-in # Store results in the buffer, increment STORE buffer idx iq[0] From 35559a7e9218981a70934192f96f1c914b950824 Mon Sep 17 00:00:00 2001 From: Chris Osborn Date: Tue, 17 Sep 2019 10:32:48 -0700 Subject: [PATCH 6/9] Remove sample_rate, add freq. --- rfcs/analog/examples/capture_delay.quil | 3 ++- rfcs/analog/examples/cavity_scan.quil | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/rfcs/analog/examples/capture_delay.quil b/rfcs/analog/examples/capture_delay.quil index 6a87010..8cde371 100644 --- a/rfcs/analog/examples/capture_delay.quil +++ b/rfcs/analog/examples/capture_delay.quil @@ -2,12 +2,13 @@ # TODO: Determine how $qubit is set. DECLARE scale REAL +DECLARE freq REAL DECLARE pulse_duration REAL DECLARE capture_duration REAL -DECLARE sample_rate INTEGER # Determine how this is set DECLARE iqs REAL[65536] SET-SCALE $qubit "ro" scale +SET-FREQUENCY $qubit "ro" freq PULSE $qubit "ro" flat(duration: pulse_duration, iq: ?) RAW-CAPTURE $qubit "out" capture_duration iqs diff --git a/rfcs/analog/examples/cavity_scan.quil b/rfcs/analog/examples/cavity_scan.quil index df9c639..8f94859 100644 --- a/rfcs/analog/examples/cavity_scan.quil +++ b/rfcs/analog/examples/cavity_scan.quil @@ -10,7 +10,7 @@ DECLARE freq_step REAL DECLARE scale REAL # Values set by program -DECLARE buffer REAL[65536] # 16-bit memory +DECLARE buffer REAL[65536] DECLARE iq REAL[2] DECLARE freq REAL DECLARE idx INTEGER From 2447c37928f08c94574ef8f19fabc3e38f5f0b88 Mon Sep 17 00:00:00 2001 From: Chris Osborn Date: Tue, 17 Sep 2019 12:12:54 -0700 Subject: [PATCH 7/9] Using [1 0] for pulse iq value. --- rfcs/analog/examples/cavity_scan.quil | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rfcs/analog/examples/cavity_scan.quil b/rfcs/analog/examples/cavity_scan.quil index 8f94859..77d4da9 100644 --- a/rfcs/analog/examples/cavity_scan.quil +++ b/rfcs/analog/examples/cavity_scan.quil @@ -24,8 +24,8 @@ MOVE freq freq_min LABEL @scan_step SET-FREQUENCY $qubit "ro" freq SET-SCALE $qubit "ro" scale -PULSE $qubit "ro" flat(duration: duration, iq: ?) -CAPTURE $qubit "out" flat(duration: duration, iq: ?) iq # Capture delay is built-in +PULSE $qubit "ro" flat(duration: duration, iq: [1 0]) +CAPTURE $qubit "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] From c471d4af859d15ef31fc6f0220e929a36b18a4ad Mon Sep 17 00:00:00 2001 From: Chris Osborn Date: Tue, 17 Sep 2019 12:14:28 -0700 Subject: [PATCH 8/9] Use [1 0] for iq value in flat pulse. Remove some TODOs. --- rfcs/analog/examples/capture_delay.quil | 3 +-- rfcs/analog/examples/cavity_scan.quil | 3 --- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/rfcs/analog/examples/capture_delay.quil b/rfcs/analog/examples/capture_delay.quil index 8cde371..a602728 100644 --- a/rfcs/analog/examples/capture_delay.quil +++ b/rfcs/analog/examples/capture_delay.quil @@ -1,6 +1,5 @@ # capture_delay.quil -# TODO: Determine how $qubit is set. DECLARE scale REAL DECLARE freq REAL DECLARE pulse_duration REAL @@ -9,6 +8,6 @@ DECLARE iqs REAL[65536] SET-SCALE $qubit "ro" scale SET-FREQUENCY $qubit "ro" freq -PULSE $qubit "ro" flat(duration: pulse_duration, iq: ?) +PULSE $qubit "ro" flat(duration: pulse_duration, iq: [1 0]) RAW-CAPTURE $qubit "out" capture_duration iqs diff --git a/rfcs/analog/examples/cavity_scan.quil b/rfcs/analog/examples/cavity_scan.quil index 77d4da9..a7ca55b 100644 --- a/rfcs/analog/examples/cavity_scan.quil +++ b/rfcs/analog/examples/cavity_scan.quil @@ -1,7 +1,6 @@ # cavity_scan.quil # Static constants that must be set before program execution -# TODO: Define how $qubit is set. May be used in e.g. DEFCIRCUIT # Other values that will be set by user input DECLARE freq_min REAL @@ -36,5 +35,3 @@ ADD idx 1 ADD freq freq_step LE continue freq freq_max JUMP-WHEN @scan_step continue - -# TODO: Finalize From e2d02c371b358227d9877f99d41cb1f5a2f061a8 Mon Sep 17 00:00:00 2001 From: Chris Osborn Date: Tue, 17 Sep 2019 13:03:56 -0700 Subject: [PATCH 9/9] Replace all with 0. --- rfcs/analog/examples/capture_delay.quil | 9 +++++---- rfcs/analog/examples/cavity_scan.quil | 11 +++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/rfcs/analog/examples/capture_delay.quil b/rfcs/analog/examples/capture_delay.quil index a602728..3adc8f5 100644 --- a/rfcs/analog/examples/capture_delay.quil +++ b/rfcs/analog/examples/capture_delay.quil @@ -1,4 +1,5 @@ # capture_delay.quil +# In this example we target qubit 0. DECLARE scale REAL DECLARE freq REAL @@ -6,8 +7,8 @@ DECLARE pulse_duration REAL DECLARE capture_duration REAL DECLARE iqs REAL[65536] -SET-SCALE $qubit "ro" scale -SET-FREQUENCY $qubit "ro" freq -PULSE $qubit "ro" flat(duration: pulse_duration, iq: [1 0]) +SET-SCALE 0 "ro" scale +SET-FREQUENCY 0 "ro" freq +PULSE 0 "ro" flat(duration: pulse_duration, iq: [1 0]) -RAW-CAPTURE $qubit "out" capture_duration iqs +RAW-CAPTURE 0 "out" capture_duration iqs diff --git a/rfcs/analog/examples/cavity_scan.quil b/rfcs/analog/examples/cavity_scan.quil index a7ca55b..e6b705a 100644 --- a/rfcs/analog/examples/cavity_scan.quil +++ b/rfcs/analog/examples/cavity_scan.quil @@ -1,6 +1,5 @@ # cavity_scan.quil - -# Static constants that must be set before program execution +# In this example we target qubit 0. # Other values that will be set by user input DECLARE freq_min REAL @@ -21,10 +20,10 @@ MOVE freq freq_min LABEL @scan_step -SET-FREQUENCY $qubit "ro" freq -SET-SCALE $qubit "ro" scale -PULSE $qubit "ro" flat(duration: duration, iq: [1 0]) -CAPTURE $qubit "out" flat(duration: duration, iq: [1 0]) iq # Capture delay is built-in to CAPTURE +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]