-
Notifications
You must be signed in to change notification settings - Fork 11
Home
Welcome to the PyQLab wiki!
To produce a sequence file usable with an AWG (e.g. BBN APS1, APS2, or Tek 5014), QGL relies upon a mapping from logical resources (qubits, measurements, markers) to physical resources (specific AWG channels). So, your first step is to create a basic channel library with the appropriate logical and physical channels. An example minimal library might include these logical channels:
- q1 (Qubit)
- M-q1 (Measurement)
- slaveTrig (LogicalMarker)
- digitizerTrig (LogicalMarker)
The naming convention for measurement channels of M-qubitname must be followed. In addition, the slaveTrig
and digitizerTrig
channels are required to compile a sequence.
To create and manage this library, launch the ExpSettingsGUI
script in the root PyQLab directory. The first tab, labeled "Channels" has two sub-panels for logical and physical channels, respectively. Start by populating the physical channel tab with physical quadrature and physical marker channels corresponding to your AWG resources. Then, create your logical channels and select the appropriate physical channel for each.
Physical channel names must follow the convention AWGName-channel, where AWGName corresponds to the name of the corresponding AWG in the instrument library. The available channel names depend on the type of AWG.
APS: 12, 34, 1m1, 2m1, 3m1, 4m1
APS2: 12, 12m1, 12m2, 12m3, 12m4
Tek5014: 12, 34, 1m1, 1m2, 2m1, 2m2, 3m1, 3m2, 4m1, 4m2
You'll notice that QGL explicitly groups pairs of analog output channels into quadrature pairs for I/Q modulation of a carrier waveform. Support for single-channel real output is still a TODO.
A simple Ramsey experiment with 50 steps between 0 and 100us:
import numpy as np
from QGL import *
q1 = QubitFactory('q1')
seqs = [[X90(q1), Id(q1, width=d), X90(q1), MEAS(q1)] for d in np.linspace(0,100e-6, 50)]
# get a view of the 10th sequence grouped by logical channels
show(seqs[9])
# compile
compile_to_hardware(seqs)
The QubitFactory
method is a convenience method to create a Qubit
object with parameters read from the pulse params file. The string 'q1'
identifies the qubit label to look up in the parameter file. You can also create Qubit
s on the fly by passing in the parameters.
To define the sequence, the example uses what is known as a list comprehension to express a list of sequences in a single line.
Multi-qubit sequences are represented with notation similar to a tensor product:
import numpy as np
from QGL import *
q1 = QubitFactory('q1')
q2 = QubitFactory('q2')
seq = [X90(q1)*Y(q2), CNOT(q1,q2), Y(q1), CNOT(q1,q2), X90(q1)*Y(q2), MEAS(q1)*MEAS(q2)]
show(seq)
compile_to_hardware(seq)
In this example you can see the use of the two-qubit primitive CNOT
. There are also multi-qubit MEAS
primitives that can be used for joint measurement channels.