示例#1
0
    def pulse_gates(self,
                    gate_voltages,
                    waiting_times,
                    repetitions=1,
                    do_upload=True):
        """ Supplies custom sequences to the gates. The supplied list of voltage setpoints with
            waiting times are converted into sequences for each gate and upload to the AWG.

        Arguments:
            gate_voltages (dict): Each gate name key contains a an array with millivolt
                                  setpoint level to be converted into a sequence.
            waiting_times (list[float]): The duration in seconds of each pulse in the sequence.
            repetitions (int): The number of times to repeat the sequence.
            do_upload (bool, Optional): Does not upload the waves to the AWG's when set to False.

        Returns:
            A dictionary with the properties of the pulse waves; the original pulse sequence,
            the sweep ranges and the marker properties and period of the pulse waves.

        Example:
            >>> gates_voltages = {'P4': [50, 0, -50], 'P7': [-25, 0, 25]}
            >>> waiting_times = [1e-4, 1e-4, 1e-4]
            >>> pulse_data = virtualawg.pulse_gates(gate_voltages, waiting_times)
        """
        sequences = dict()
        period = sum(waiting_times)
        sequences.update(self.make_markers(period, repetitions))
        for gate_name, amplitudes in gate_voltages.items():
            sequences[gate_name] = Sequencer.make_pulse_table(
                amplitudes, waiting_times, repetitions, gate_name)
        sweep_data = self.sequence_gates(sequences, do_upload)
        sweep_data.update({'period': period, 'start_zero': True, 'width': 1.0})
        if VirtualAwg.__digitizer_name in self._settings.awg_map:
            sweep_data.update({'markerdelay': self.digitizer_marker_delay()})
        return sweep_data
 def test_make_pulse_table(self):
     with warnings.catch_warnings():
         warnings.filterwarnings("ignore", category=UserWarning, message="qupulse")
         amplitudes = [1, 2, 3]
         waiting_times = [1e-4, 2e-5, 3e-3]
         sampling_rate = 1e9
         pulse_data = Sequencer.make_pulse_table(amplitudes, waiting_times)
         raw_data = Sequencer.get_data(pulse_data, sampling_rate)
         self.assertTrue(raw_data[0] == amplitudes[0])
         self.assertTrue(raw_data[-1] == amplitudes[-1])