Sample notebook running a previously compiled QGL2 program


In [ ]:
import QGL
from QGL.Compiler import compile_to_hardware
from QGL.Scheduler import schedule
from QGL.PulseSequencePlotter import plot_pulse_files
from pyqgl2.test_cl import create_default_channelLibrary

# This next should be a valid import of a compiled QGL2 program and its qgl2main
# EG do the compilation manually with -o and put it in the right spot
from RabiAmpqgl1 import RabiAmp

Create a test ChannelLibrary


In [ ]:
create_default_channelLibrary(True, True)
# Alternatively could load an existing library, or create one here; see the 'AllXY' notebook

Generate pulse sequences


In [ ]:
# Now run the QGL1 function as before, producing a list of sequences
seqs = RabiAmp()

In [ ]:
# Note we cannot provide the correct axis description without knowing the amplitudes used
# Note we schedule the sequences and ensure they are a list
metaFileName = compile_to_hardware([schedule(seqs)], "Rabi/Rabi")
print(f"Generated sequence details in '{metaFileName}'")

Plot the sequences


In [ ]:
display(plot_pulse_files(metaFileName))