Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

13/analog-quil-examples #14

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions rfcs/analog/examples/capture_delay.quil
Original file line number Diff line number Diff line change
@@ -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
36 changes: 36 additions & 0 deletions rfcs/analog/examples/cavity_scan.quil
Original file line number Diff line number Diff line change
@@ -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