def __init__(self, name, num_models=10, **kw): super().__init__(name, **kw) self._num_models = num_models self.add_parameter('cfg_sampling_rate', parameter_class=ManualParameter, initial_value=1e9, vals=vals.Numbers()) self.add_parameter('cfg_gain_correction', parameter_class=ManualParameter, initial_value=1, vals=vals.Numbers()) self.add_parameter('instr_AWG', parameter_class=InstrumentRefParameter, docstring='Used in combination with the real-time ' 'predistortion filters of the ZI HDAWG') self.add_parameter('cfg_awg_channel', parameter_class=ManualParameter, vals=vals.Ints(), docstring='Used in combination with the real-time ' 'predistortion filters of the ZI HDAWG') for i in range(self._num_models): self.add_parameter('filter_model_{:02}'.format(i), parameter_class=ManualParameter, initial_value={}, vals=vals.Dict())
def __init__(self, name, **kw): logging.info(__name__ + ' : Initializing instrument') super().__init__(name, **kw) # FIXME: rename to instr_AWG to be consistent with other instr refs self.add_parameter( 'AWG', parameter_class=InstrumentRefParameter, docstring=( "Name of the AWG instrument used, note that this can also be " "a UHFQC or a CBox as these also contain AWG's"), vals=vals.Strings()) self._add_cfg_parameters() self._add_waveform_parameters() self.add_parameter( 'LutMap', docstring=( 'Dictionary containing the mapping between waveform' ' names and parameter names (codewords).'), initial_value={}, vals=vals.Dict(), parameter_class=ManualParameter) self.add_parameter('sampling_rate', unit='Hz', vals=vals.Numbers(1, 1e10), initial_value=1e9, parameter_class=ManualParameter) # Used to determine bounds in plotting. # overwrite in child classes if used. self._voltage_min = None self._voltage_max = None # initialize the _wave_dict to an empty dictionary self._wave_dict = {} self.set_default_lutmap()
def __init__(self, name, **kw): super().__init__(name, **kw) # Instrument parameters for parname in ['x', 'y', 'z', 'x0', 'y0', 'z0']: self.add_parameter(parname, unit='m', parameter_class=ManualParameter, vals=vals.Numbers(), initial_value=0) self.add_parameter('noise', unit='V', label='white noise amplitude', parameter_class=ManualParameter, vals=vals.Numbers(), initial_value=0) self.add_parameter('delay', unit='s', label='Sampling delay', parameter_class=ManualParameter, vals=vals.Numbers(), initial_value=0) self.add_parameter('parabola', unit='V', get_cmd=self._measure_parabola) self.add_parameter('parabola_list', unit='V', get_cmd=self._measure_parabola_list) self.add_parameter('skewed_parabola', unit='V', get_cmd=self._measure_skewed_parabola) self.add_parameter('cos_mod_parabola', unit='V', get_cmd=self._measure_cos_mod_parabola) self.add_parameter('lorentz_dip', unit='V', get_cmd=self._measure_lorentz_dip) self.add_parameter('lorentz_dip_cos_mod', unit='V', get_cmd=self._measure_lorentz_dip_cos_mod) self.add_parameter('array_like', unit='a.u.', parameter_class=ManualParameter, vals=vals.Arrays()) self.add_parameter('dict_like', unit='a.u.', parameter_class=ManualParameter, vals=vals.Dict()) self.add_parameter('status', vals=vals.Anything(), parameter_class=ManualParameter)
def __init__(self, name, num_models=10, **kw): super().__init__(name, **kw) self._num_models = num_models self.add_parameter('cfg_hardware_friendly', initial_value=False, parameter_class=ManualParameter, vals=vals.Bool()) self.add_parameter('cfg_sampling_rate', parameter_class=ManualParameter, initial_value=1e9, vals=vals.Numbers()) self.add_parameter('cfg_gain_correction', parameter_class=ManualParameter, initial_value=1, vals=vals.Numbers()) for i in range(self._num_models): self.add_parameter('filter_model_{:02}'.format(i), parameter_class=ManualParameter, initial_value={}, vals=vals.Dict())
def __init__(self, name, **kw): logging.info(__name__ + ' : Initializing instrument') super().__init__(name, **kw) self.add_parameter('QWG', parameter_class=InstrumentParameter) self.add_parameter('F_kernel_instr', parameter_class=InstrumentParameter) self.add_parameter('F_amp', unit='frac', docstring=('Amplitude of flux pulse as fraction of ' 'the peak amplitude. Beware of factor 2' ' with Vpp in the QWG'), initial_value=0.5, parameter_class=ManualParameter) self.add_parameter('F_length', unit='s', parameter_class=ManualParameter, initial_value=200e-9) self.add_parameter('F_ch', label='Flux channel', vals=vals.Ints(), parameter_class=ManualParameter) self.add_parameter('F_delay', label='Flux pulse delay', unit='s', initial_value=0, vals=vals.Numbers(), parameter_class=ManualParameter) self.add_parameter('F_compensation_delay', label='compens. pulse delay', unit='s', initial_value=4e-6, vals=vals.Numbers(), parameter_class=ManualParameter) self.add_parameter('F_lambda_1', docstring='first lambda coef. for martinis pulse', label='Lambda_1', unit='', initial_value=0, vals=vals.Numbers(), parameter_class=ManualParameter) self.add_parameter('F_lambda_2', docstring='second lambda coef. for martinis pulse', label='Lambda_2', unit='', initial_value=0, vals=vals.Numbers(), parameter_class=ManualParameter) self.add_parameter('F_lambda_3', docstring='third lambda coef. for martinis pulse', label='Lambda_3', unit='', initial_value=0, vals=vals.Numbers(), parameter_class=ManualParameter) self.add_parameter('F_theta_f', docstring='theta_f for martinis pulse', label='theta_f', unit='deg', initial_value=90, vals=vals.Numbers(), parameter_class=ManualParameter) self.add_parameter('F_J2', docstring='coupling between 11-02', label='J2', unit='Hz', initial_value=10e6, vals=vals.Numbers(), parameter_class=ManualParameter) self.add_parameter('F_f_interaction', label='interaction frequency', unit='Hz', initial_value=5e9, vals=vals.Numbers(), parameter_class=ManualParameter) self.add_parameter('F_dac_flux_coef', docstring='conversion factor AWG voltage to flux', label='dac flux coef', unit='(V^-1)', initial_value=1.0, vals=vals.Numbers(), parameter_class=ManualParameter) self.add_parameter('F_E_c', label='qubit E_c', unit='Hz', initial_value=250e6, vals=vals.Numbers(), parameter_class=ManualParameter) self.add_parameter('F_f_01_max', label='sweet spot freq', unit='Hz', initial_value=6e9, vals=vals.Numbers(), parameter_class=ManualParameter) self.add_parameter('F_asymmetry', label='qubit asymmetry', unit='Hz', initial_value=0.0, vals=vals.Numbers(), parameter_class=ManualParameter) self.add_parameter('codeword_dict', docstring='Dict assigning codewords to pulses', label='codeword dict', unit='', initial_value={}, vals=vals.Anything(), parameter_class=ManualParameter) self.add_parameter('sampling_rate', docstring='Sampling rate of the QWG', label='sampling rate', unit='Hz', initial_value=1.0e9, vals=vals.Numbers(), parameter_class=ManualParameter) self.add_parameter('Z_length', docstring=('Duration of single qubit Z pulse in' ' seconds'), label='Z length', unit='s', initial_value=10e-9, vals=vals.Numbers(), parameter_class=ManualParameter) self.add_parameter('Z_amp', docstring=('Amplitude of the single qubit phase ' 'correction in CZ pulses.'), label='Z amplitude', unit='frac', initial_value=0.0, vals=vals.Numbers(), parameter_class=ManualParameter) self.add_parameter('Z_amp_grover', docstring=('Amplitude of the single qubit phase ' 'correction for the second CZ pulse ' "used in Grover's algorithm."), label='Z amplitude 2', unit='frac', initial_value=0.0, vals=vals.Numbers(), parameter_class=ManualParameter) self.add_parameter('max_waveform_length', unit='s', parameter_class=ManualParameter, initial_value=30e-6) self.add_parameter('codeword_channels', parameter_class=ManualParameter, docstring='Channels used for triggering specific ' 'codewords.', vals=vals.Lists(vals.Ints())) self.add_parameter('disable_CZ', parameter_class=ManualParameter, vals=vals.Bool(), initial_value=False) self.add_parameter('pulse_map', initial_value={'cz': 'adiabatic_Z', 'cz_grover': 'adiabatic_Z_grover', 'square': 'square'}, parameter_class=ManualParameter, vals=vals.Dict()) self.add_parameter('wave_dict_unit', get_cmd=self._get_wave_dict_unit, set_cmd=self._set_wave_dict_unit, docstring='Unit in which the waveforms are ' 'specified.\n' '"frac" means "fraction of the maximum QWG ' 'range".\n' '"V" means volts.', vals=vals.Enum('frac', 'V')) self._wave_dict_unit = 'frac' # Initial value for wave_dict_unit self.add_parameter('V_offset', unit='V', label='V offset', docstring='pulsed sweet spot offset', parameter_class=ManualParameter, initial_value=0, vals=vals.Numbers()) self.add_parameter('V_per_phi0', unit='V', label='V per phi_0', docstring='pulsed voltage required for one phi0 ' 'of flux', parameter_class=ManualParameter, initial_value=1, vals=vals.Numbers()) self.add_parameter('S_gauss_sigma', unit='s', label='gauss sigma', docstring='Width (sigma) of Gaussian shaped flux ' 'pulse.', parameter_class=ManualParameter, initial_value=40e-9, vals=vals.Numbers()) self.add_parameter('S_amp', unit='frac', label='S_amp', docstring='Amplitude of scoping flux pulse.', parameter_class=ManualParameter, initial_value=0.5, vals=vals.Numbers()) self._wave_dict = {}
def __init__(self, name, **kw): super().__init__(name, **kw) # Instrument parameters for parname in ["x", "y", "z", "x0", "y0", "z0"]: self.add_parameter( parname, unit="m", parameter_class=ManualParameter, vals=vals.Numbers(), initial_value=0., ) # Instrument integer parameters for parname in [ "x_int", "y_int", "z_int", "x0_int", "y0_int", "z0_int" ]: self.add_parameter( parname, unit="m", parameter_class=ManualParameter, vals=vals.Ints(), initial_value=0, ) self.add_parameter( "noise", unit="V", label="white noise amplitude", parameter_class=ManualParameter, vals=vals.Numbers(), initial_value=0, ) self.add_parameter( "delay", unit="s", label="Sampling delay", parameter_class=ManualParameter, vals=vals.Numbers(), initial_value=0, ) self.add_parameter("parabola", unit="V", get_cmd=self._measure_parabola) self.add_parameter("parabola_int", unit="V", get_cmd=self._measure_parabola_int) self.add_parameter("parabola_float_int", unit="V", get_cmd=self._measure_parabola_float_int) self.add_parameter("parabola_list", unit="V", get_cmd=self._measure_parabola_list) self.add_parameter("skewed_parabola", unit="V", get_cmd=self._measure_skewed_parabola) self.add_parameter("cos_mod_parabola", unit="V", get_cmd=self._measure_cos_mod_parabola) self.add_parameter("lorentz_dip", unit="V", get_cmd=self._measure_lorentz_dip) self.add_parameter("lorentz_dip_cos_mod", unit="V", get_cmd=self._measure_lorentz_dip_cos_mod) self.add_parameter( "array_like", unit="a.u.", parameter_class=ManualParameter, vals=vals.Arrays(), ) self.add_parameter("nested_lists_like", unit="a.u.", parameter_class=ManualParameter, vals=vals.Lists(elt_validator=vals.Lists())) self.add_parameter("dict_like", unit="a.u.", parameter_class=ManualParameter, vals=vals.Dict()) self.add_parameter("complex_like", unit="a.u.", parameter_class=ManualParameter, vals=vals.ComplexNumbers()) self.add_parameter("status", vals=vals.Anything(), parameter_class=ManualParameter)
def __init__(self, instrument_name: str, acquisition_controller_names: List[str] = [], default_settings={}, **kwargs): # TODO: Change acquisition_controller_names to acquisition_controllers super().__init__(instrument_name, **kwargs) # Override untargeted pulse adding (measurement pulses can be added) self.pulse_sequence.allow_untargeted_pulses = True default_settings = { 'channel_range': 2, 'coupling': 'DC', **default_settings } # Define channels self._acquisition_channels = { 'ch' + idx: Channel(instrument_name=self.instrument_name(), name='ch' + idx, id=idx, input=True) for idx in ['A', 'B', 'C', 'D'] } self._aux_channels = { 'aux' + idx: Channel(instrument_name=self.instrument_name(), name='aux' + idx, input_TTL=True, output_TTL=(0, 5)) for idx in ['1', '2'] } self._channels = { **self._acquisition_channels, **self._aux_channels, 'trig_in': Channel(instrument_name=self.instrument_name(), name='trig_in', id='trig_in', input_trigger=True), 'software_trig_out': Channel(instrument_name=self.instrument_name(), name='software_trig_out') } self.pulse_implementations = [ SteeredInitializationImplementation(pulse_requirements=[]), TriggerWaitPulseImplementation(pulse_requirements=[]) ] # Organize acquisition controllers self.acquisition_controllers = {} for acquisition_controller_name in acquisition_controller_names: self.add_acquisition_controller(acquisition_controller_name) # Obtain a list of all valid ATS configuration settings self._configuration_settings_names = sorted( list(inspect.signature(AlazarTech_ATS.config).parameters.keys())) # Obtain a list of all valid ATS acquisition settings self._acquisition_settings_names = sorted( list(inspect.signature(AlazarTech_ATS.acquire).parameters.keys())) self._settings_names = sorted(self._acquisition_settings_names + self._configuration_settings_names) self.add_parameter(name='default_settings', get_cmd=None, set_cmd=None, initial_value=default_settings, docstring='Default settings to use when setting up ' 'ATS for a pulse sequence') initial_configuration_settings = { k: v for k, v in default_settings.items() if k in self._configuration_settings_names } self.add_parameter( name='configuration_settings', get_cmd=None, set_cmd=None, vals=vals.Dict(allowed_keys=self._configuration_settings_names), initial_value=initial_configuration_settings) initial_acquisition_settings = { k: v for k, v in default_settings.items() if k in self._acquisition_settings_names } self.add_parameter( name='acquisition_settings', get_cmd=None, set_cmd=None, vals=vals.Dict(allowed_keys=self._acquisition_settings_names), initial_value=initial_acquisition_settings) self.add_parameter(name="acquisition", parameter_class=ATSAcquisitionParameter) self.add_parameter(name='default_acquisition_controller', set_cmd=None, initial_value='None', vals=vals.Enum( None, 'None', *self.acquisition_controllers.keys())) self.add_parameter(name='acquisition_controller', set_cmd=None, vals=vals.Enum( 'None', *self.acquisition_controllers.keys())) # Names of acquisition channels [chA, chB, etc.] self.add_parameter(name='acquisition_channels', set_cmd=None, initial_value=[], vals=vals.Anything(), docstring='Names of acquisition channels ' '[chA, chB, etc.]. Set by the layout') self.add_parameter(name='samples', set_cmd=None, initial_value=1, docstring='Number of times to acquire the pulse ' 'sequence.') self.add_parameter( 'points_per_trace', get_cmd=lambda: self._acquisition_controller.samples_per_trace(), docstring='Number of points in a trace.') self.add_parameter(name='trigger_channel', set_cmd=None, initial_value='trig_in', vals=vals.Enum('trig_in', 'disable', *self._acquisition_channels.keys())) self.add_parameter(name='trigger_slope', set_cmd=None, vals=vals.Enum('positive', 'negative')) self.add_parameter(name='trigger_threshold', unit='V', set_cmd=None, vals=vals.Numbers()) self.add_parameter( name='sample_rate', unit='samples/sec', get_cmd=partial(self.setting, 'sample_rate'), set_cmd=lambda x: self.default_settings().update(sample_rate=x), vals=vals.Numbers(), docstring='Acquisition sampling rate (Hz)') self.add_parameter('capture_full_trace', initial_value=False, vals=vals.Bool(), set_cmd=None, docstring='Capture from t=0 to end of pulse ' 'sequence. False by default, in which ' 'case start and stop times correspond to ' 'min(t_start) and max(t_stop) of all ' 'pulses with the flag acquire=True, ' 'respectively.') self.traces = {} self.pulse_traces = {}
def create_channel_parameters(self, id: str, ch_name: str, ch_type: str): """Create parameters in the pulsar specific to one added channel. Arguments: id: Channel id. Typically ``ch{index}`` where index is a 1-based channel index. For marker channels, usually ``ch{ch_nr + 1}m``. ch_name: Name of the channel to address it in rest of the codebase. ch_type: Type of channel: ``"analog"`` or ``"marker"``. """ # Sanity check if ch_type not in ["analog", "marker"]: raise ValueError(f"Invalid {ch_type=}.") pulsar = self.pulsar awg = self.awg pulsar.add_parameter(f"{ch_name}_id", get_cmd=lambda: id) pulsar.add_parameter(f"{ch_name}_awg", get_cmd=lambda: awg.name) pulsar.add_parameter(f"{ch_name}_type", get_cmd=lambda: ch_type) if 'amp' in self.IMPLEMENTED_ACCESSORS: pulsar.add_parameter( f"{ch_name}_amp", label=f"{ch_name} amplitude", unit='V', set_cmd=partial(self.awg_setter, id, "amp"), get_cmd=partial(self.awg_getter, id, "amp"), vals=vals.Numbers(*self.CHANNEL_AMPLITUDE_BOUNDS[ch_type])) if 'offset' in self.IMPLEMENTED_ACCESSORS: pulsar.add_parameter( f"{ch_name}_offset", unit='V', set_cmd=partial(self.awg_setter, id, "offset"), get_cmd=partial(self.awg_getter, id, "offset"), vals=vals.Numbers(*self.CHANNEL_OFFSET_BOUNDS[ch_type])) if ch_type == "analog": pulsar.add_parameter(f"{ch_name}_distortion", label=f"{ch_name} distortion mode", initial_value="off", vals=vals.Enum("off", "precalculate"), parameter_class=ManualParameter) pulsar.add_parameter(f"{ch_name}_distortion_dict", vals=vals.Dict(), parameter_class=ManualParameter) pulsar.add_parameter(f"{ch_name}_charge_buildup_compensation", parameter_class=ManualParameter, vals=vals.Bool(), initial_value=False) pulsar.add_parameter(f"{ch_name}_compensation_pulse_scale", parameter_class=ManualParameter, vals=vals.Numbers(0., 1.), initial_value=0.5) pulsar.add_parameter(f"{ch_name}_compensation_pulse_delay", initial_value=0, unit='s', parameter_class=ManualParameter) pulsar.add_parameter( f"{ch_name}_compensation_pulse_gaussian_filter_sigma", initial_value=0, unit='s', parameter_class=ManualParameter) else: # ch_type == "marker" # So far no additional parameters specific to marker channels pass
def __init__(self, name, qubits, connectivity_graph, **kw): """ Instantiates device instrument and adds its parameters. Args: name (str): name of the device qubits (list of QudevTransmon or names of QudevTransmon objects): qubits of the device connectivity_graph: list of elements of the form [qb1, qb2] with qb1 and qb2 QudevTransmon objects or names thereof. qb1 and qb2 should be physically connected on the device. """ super().__init__(name, **kw) qb_names = [qb if isinstance(qb, str) else qb.name for qb in qubits] qubits = [qb if not isinstance(qb, str) else self.find_instrument(qb) for qb in qubits] connectivity_graph = [[qb1 if isinstance(qb1, str) else qb1.name, qb2 if isinstance(qb2, str) else qb2.name] for [qb1, qb2] in connectivity_graph] self._two_qb_gates = [] for qb in qubits: setattr(self, qb.name, qb) self.qubits = qubits self.add_parameter('qb_names', vals=vals.Lists(), initial_value=qb_names, parameter_class=ManualParameter) self._operations = {} # dictionary containing dictionaries of operations with parameters # Instrument reference parameters self.add_parameter('instr_mc', parameter_class=InstrumentRefParameter) self.add_parameter('instr_pulsar', parameter_class=InstrumentRefParameter) self.add_parameter('instr_dc_source', parameter_class=InstrumentRefParameter) self.add_parameter('instr_trigger', parameter_class=InstrumentRefParameter) self.add_parameter('connectivity_graph', vals=vals.Lists(), label="Qubit Connectivity Graph", docstring="Stores the connections between the qubits " "in form of a list of lists [qbi_name, qbj_name]", parameter_class=ManualParameter, initial_value=connectivity_graph ) self.add_parameter('last_calib', vals=vals.Strings(), initial_value='', docstring='stores timestamp of last calibration', parameter_class=ManualParameter) self.add_parameter('operations', docstring='a list of operations on the device, without single QB operations.', get_cmd=self._get_operations) self.add_parameter('two_qb_gates', docstring='stores all two qubit gate names', get_cmd=lambda s=self: copy(s._two_qb_gates) ) self.add_parameter('relative_delay_graph', label='Relative Delay Graph', docstring='Stores the relative delays between ' 'drive and flux channels of the device.', initial_value=RelativeDelayGraph(), parameter_class=ManualParameter, set_parser=RelativeDelayGraph) self.add_parameter('flux_crosstalk_calibs', parameter_class=ManualParameter, ) # Pulse preparation parameters default_prep_params = dict(preparation_type='wait', post_ro_wait=1e-6, reset_reps=1) self.add_parameter('preparation_params', parameter_class=ManualParameter, initial_value=default_prep_params, vals=vals.Dict())