In [ ]:
from pyqgl2.main import compile_function, qgl2_compile_to_hardware
from pyqgl2.test_cl import create_default_channelLibrary
from pyqgl2.qreg import QRegister
from QGL import plot_pulse_files, ChannelLibrary
In [ ]:
create_default_channelLibrary(True, True)
# Alternatively could load an existing library, or create one here; see the 'AllXY' notebook
In [ ]:
# For QGL2, use a QRegister, not a QGL Qubit
q = QRegister(1)
In [ ]:
#from pyqgl2.ast_util import NodeError
#from pyqgl2.debugmsg import DebugMsg
#DebugMsg.set_level(1)
#NodeError.MUTE_ERR_LEVEL = NodeError.NODE_ERROR_NONE
In [ ]:
# Insert proper path to QGL2 source and name of qgl2main if not so marked
# Here we compile the named function in the named file from QGL2 to QGL1 and return the new function
qgl1MainFunc = compile_function("../src/python/qgl2/basic_sequences/Rabi.py", "PulsedSpec", (q, True))
In [ ]:
# Now run the QGL1 function, producing a list of sequences
seqs = qgl1MainFunc()
In [ ]:
metaFileName = qgl2_compile_to_hardware(seqs, "Spec/Spec")
print(f"Generated sequence details in '{metaFileName}'")
In [ ]:
display(plot_pulse_files(metaFileName))