Example #1
0
    def __init__(self, name, current_channels, fluxcurrent=None, **kw):
        super().__init__(name, **kw)
        self.add_parameter('fluxcurrent',
                           initial_value=fluxcurrent,
                           parameter_class=InstrumentParameter)
        self.num_channels = len(current_channels)
        self.add_parameter('dac_offsets',
                           unit='A',
                           label='Dac offsets',
                           docstring=('Offsets in A corresponding to setting'
                                      ' all qubits to the'
                                      ' sweetspot. N.B. the order here is the'
                                      ' same as the flux vector.'),
                           parameter_class=ManualParameter,
                           vals=vals.Arrays())
        self.add_parameter(
            'A_per_Phi0s',
            unit='A',
            label='A_per_Phi0s',
            docstring=('A_per_phi0s. This requires the matrix to have the'
                       'diagonal elements to be set to 1.'),
            initial_value=np.ones(self.num_channels),
            parameter_class=ManualParameter,
            vals=vals.Arrays())

        self._flux_vector = np.zeros(self.num_channels)
        for i, current_channel in enumerate(current_channels):
            self.add_parameter(
                'flux_' + current_channel,
                label='flux_' + current_channel,
                unit=r'$\Phi_0$',
                get_cmd=self._gen_ch_get_func(self._get_flux, i),
                set_cmd=self._gen_ch_set_func(self._set_flux, i),
                vals=vals.Numbers())
        self.dac_mapping(current_channels)
Example #2
0
def test_setpoints_non_parameter_raises():
    """
    Test that putting some random function as a setpoint parameter will
    raise as expected.
    """

    n_points_1 = Parameter('n_points_1', set_cmd=None, vals=vals.Ints())
    n_points_2 = Parameter('n_points_2', set_cmd=None, vals=vals.Ints())

    n_points_1.set(10)
    n_points_2.set(20)

    err_msg = (r"Setpoints is of type <class 'function'> "
               r"expcected a QCoDeS parameter")
    with pytest.raises(TypeError, match=err_msg):
        param_with_setpoints_1 = ParameterWithSetpoints(
            'param_1',
            get_cmd=lambda: rand(n_points_1()),
            setpoints=(lambda x: x, ),
            vals=vals.Arrays(shape=(n_points_1, )))

    param_with_setpoints_1 = ParameterWithSetpoints(
        'param_1',
        get_cmd=lambda: rand(n_points_1()),
        vals=vals.Arrays(shape=(n_points_1, )))

    with pytest.raises(TypeError, match=err_msg):
        param_with_setpoints_1.setpoints = (lambda x: x, )
Example #3
0
    def __init__(self, name, **kw):
        super().__init__(name, **kw)
        trnsf_mat_docst = ('Converts dac voltages to virtual flux.'
                           'This matrix is defined as'
                           'flux = T dac_voltages'
                           'T is then d flux/ d dac')
        # Ramiro will expand this to include the proper equations
        self.add_parameter('transfer_matrix',
                           label='Transfer Matrix',
                           docstring=trnsf_mat_docst,
                           parameter_class=ManualParameter,
                           vals=vals.Arrays())
        self._inv_transfer_matrix = None
        self.add_parameter('inv_transfer_matrix',
                           label='Inverse transfer Matrix',
                           docstring=('Returns the inverse of the transfer'
                                      ' matrix, unless explictly specified'),
                           set_cmd=self._do_set_inv_transfer_matrix,
                           get_cmd=self._do_get_inv_transfer_matrix,
                           vals=vals.Arrays())

        self.add_parameter(
            'dac_mapping',
            label='mapping of flux channels to current/voltage channels',
            parameter_class=ManualParameter,
            vals=vals.Lists())
Example #4
0
def test_validation_one_sp_dim_missing():
    """
    If one or more setpoint validators has no shape the validation will fail.
    """
    n_points_1 = Parameter('n_points_1', set_cmd=None, vals=vals.Ints())
    n_points_2 = Parameter('n_points_2', set_cmd=None, vals=vals.Ints())

    n_points_1.set(10)
    n_points_2.set(20)
    setpoints_1 = Parameter('setpoints_1',
                            get_cmd=lambda: rand(n_points_1()),
                            vals=vals.Arrays(shape=(n_points_1, None)))
    param_sp_without_shape = ParameterWithSetpoints(
        'param_6',
        get_cmd=lambda: rand(n_points_1()),
        setpoints=(setpoints_1, ),
        vals=vals.Arrays(shape=(n_points_1, n_points_2)))
    expected_err_msg = (
        r"One or more dimensions have unknown shape "
        r"when comparing output: \(<qcodes.instrument.parameter.Parameter: n_points_1 at [0-9]+>, <qcodes.instrument.parameter.Parameter: n_points_2 at [0-9]+>\) to setpoints: "
        r"\(<qcodes.instrument.parameter.Parameter: n_points_1 at [0-9]+>, None\)"
    )
    with pytest.raises(ValueError, match=expected_err_msg):
        param_sp_without_shape.validate_consistent_shape()
    with pytest.raises(ValueError, match=expected_err_msg):
        param_sp_without_shape.validate(param_sp_without_shape.get())
Example #5
0
def test_validation_without_sp_shape():
    """
    If the setpoints validator has no shape the validation will fail
    """
    n_points_1 = Parameter('n_points_1', set_cmd=None, vals=vals.Ints())
    n_points_2 = Parameter('n_points_2', set_cmd=None, vals=vals.Ints())

    n_points_1.set(10)
    n_points_2.set(20)

    setpoints_1 = Parameter("setpoints_1",
                            get_cmd=lambda: rand(n_points_1()),
                            vals=vals.Arrays())
    param_sp_without_shape = ParameterWithSetpoints(
        "param_6",
        get_cmd=lambda: rand(n_points_1()),
        setpoints=(setpoints_1, ),
        vals=vals.Arrays(shape=(n_points_1, )),
    )
    expected_err_msg = (
        r"One or more dimensions have unknown shape "
        r"when comparing output: \(<qcodes.parameters.parameter"
        r".Parameter: n_points_1 at [0-9]+>,\) to setpoints: "
        r"\(None,\)")
    with pytest.raises(ValueError, match=expected_err_msg):
        param_sp_without_shape.validate_consistent_shape()
    with pytest.raises(ValueError, match=expected_err_msg):
        param_sp_without_shape.validate(param_sp_without_shape.get())
Example #6
0
    def __init__(self, name, num_channels, IVVI=None, **kw):
        super().__init__(name, **kw)
        self.add_parameter('IVVI',
                           initial_value=IVVI,
                           parameter_class=InstrumentParameter)
        self.add_parameter('dac_offsets',
                           unit='mV',
                           label='Dac offsets',
                           docstring=('Offsets in mV corresponding to setting'
                                      ' all qubits to the'
                                      ' sweetspot. N.B. the order here is the'
                                      ' same as the flux vector.'),
                           parameter_class=ManualParameter,
                           vals=vals.Arrays())
        self.add_parameter(
            'V_per_Phi0s',
            unit='V',
            label='V_per_Phi0s',
            docstring=('V_per_phi0s. This requires the matrix to have the'
                       'diagonal elements to be set to 1.'),
            parameter_class=ManualParameter,
            initial_value=np.ones([num_channels]),
            vals=vals.Arrays())
        self._flux_vector = np.zeros(num_channels)

        for i in range(0, num_channels):
            self.add_parameter(
                'flux{}'.format(i),
                label='Flux {}'.format(i),
                unit=r'$\Phi_0$',
                get_cmd=self._gen_ch_get_func(self._get_flux, i),
                set_cmd=self._gen_ch_set_func(self._set_flux, i),
                vals=vals.Numbers())
Example #7
0
def test_validation_wrong_validator():
    """
    If the validator does not match the actual content the validation should
    fail
    """
    n_points_1 = Parameter('n_points_1', set_cmd=None, vals=vals.Ints())
    n_points_2 = Parameter('n_points_2', set_cmd=None, vals=vals.Ints())

    n_points_1.set(10)
    n_points_2.set(20)
    setpoints_1 = Parameter('setpoints_1',
                            get_cmd=lambda: rand(n_points_1()),
                            vals=vals.Arrays(shape=(n_points_1, )))
    # output is not consistent with validator
    param_with_wrong_validator = ParameterWithSetpoints(
        'param_2',
        get_cmd=lambda: rand(n_points_2()),
        setpoints=(setpoints_1, ),
        vals=vals.Arrays(shape=(n_points_1, )))

    # this does not raise because the validator shapes are consistent
    param_with_wrong_validator.validate_consistent_shape()
    # but the output is not consistent with the validator
    with pytest.raises(ValueError,
                       match=r'does not have expected shape'
                       r' \(10,\), '
                       r'it has shape \(20,\); '
                       r'Parameter: param_2'):
        param_with_wrong_validator.validate(param_with_wrong_validator())
Example #8
0
def test_validation_inconsistent_shape():
    """
    Parameters with shapes inconsistent with their setpoints should not
    validate
    """
    n_points_1 = Parameter('n_points_1', set_cmd=None, vals=vals.Ints())
    n_points_2 = Parameter('n_points_2', set_cmd=None, vals=vals.Ints())

    n_points_1.set(10)
    n_points_2.set(20)

    setpoints_1 = Parameter('setpoints_1',
                            get_cmd=lambda: rand(n_points_1()),
                            vals=vals.Arrays(shape=(n_points_1, )))

    param_with_diff_length = ParameterWithSetpoints(
        'param_1',
        get_cmd=lambda: rand(n_points_2()),
        setpoints=(setpoints_1, ),
        vals=vals.Arrays(shape=(n_points_2, )))

    # inconsistent shapes
    expected_err_msg = (
        r'Shape of output is not consistent '
        r'with setpoints. Output is shape '
        r'\(<qcodes.instrument.parameter.Parameter: n_points_2 at [0-9]+>,\) '
        r'and setpoints are shape '
        r'\(<qcodes.instrument.parameter.Parameter: n_points_1 at [0-9]+>,\)')
    with pytest.raises(ValueError, match=expected_err_msg):
        param_with_diff_length.validate_consistent_shape()
    with pytest.raises(ValueError, match=expected_err_msg):
        param_with_diff_length.validate(param_with_diff_length.get())
Example #9
0
    def __init__(self, name, num_channels, IVVI=None, **kw):
        super().__init__(name, **kw)

        self.add_parameter('IVVI',
                           initial_value=IVVI,
                           parameter_class=InstrumentParameter)
        trnsf_mat_docst = ('Converts dac voltages to virtual flux.'
                           'This matrix is defined as'
                           'flux = T dac_voltages'
                           'T is then d flux/ d dac')
        # Ramiro will expand this to include the proper equations
        self.add_parameter('transfer_matrix',
                           label='Transfer Matrix',
                           docstring=trnsf_mat_docst,
                           parameter_class=ManualParameter,
                           vals=vals.Arrays())
        self._inv_transfer_matrix = None
        self.add_parameter('inv_transfer_matrix',
                           label='Inverse transfer Matrix',
                           docstring=('Returns the inverse of the transfer'
                                      ' matrix, unless explictly specified'),
                           set_cmd=self._do_set_inv_transfer_matrix,
                           get_cmd=self._do_get_inv_transfer_matrix,
                           vals=vals.Arrays())
        self.add_parameter('dac_offsets',
                           unit='mV',
                           label='Dac offsets',
                           docstring=('Offsets in mV corresponding to setting'
                                      ' all qubits to the'
                                      ' sweetspot. N.B. the order here is the'
                                      ' same as the flux vector.'),
                           parameter_class=ManualParameter,
                           vals=vals.Arrays())

        self.add_parameter('dac_mapping',
                           label='Linear transformation coefficients',
                           parameter_class=ManualParameter,
                           vals=vals.Arrays())

        self._flux_vector = np.zeros(num_channels)
        for i in range(0, num_channels):
            self.add_parameter(
                'flux{}'.format(i),
                label='Flux {}'.format(i),
                unit=r'$\Phi_0$',
                get_cmd=self._gen_ch_get_func(self._get_flux, i),
                set_cmd=self._gen_ch_set_func(self._set_flux, i),
                vals=vals.Numbers())
Example #10
0
def test_expand_setpoints_3d(parameters):

    n_points_1, n_points_2, n_points_3, \
        setpoints_1, setpoints_2, setpoints_3 = parameters

    param_with_setpoints_3 = ParameterWithSetpoints(
        'param_2',
        get_cmd=lambda: rand(n_points_1(), n_points_2(), n_points_3()),
        vals=vals.Arrays(shape=(n_points_1, n_points_2, n_points_3)))
    param_with_setpoints_3.setpoints = (setpoints_1, setpoints_2, setpoints_3)
    data = expand_setpoints_helper(param_with_setpoints_3)
    assert len(data) == 4
    assert data[0][1].shape == data[1][1].shape
    assert data[0][1].shape == data[2][1].shape
    assert data[0][1].shape == data[3][1].shape

    sp1 = data[0][1]
    for i in range(sp1.shape[1]):
        for j in range(sp1.shape[2]):
            np.testing.assert_array_equal(sp1[:, i, j],
                                          np.arange(sp1.shape[0]))
    sp2 = data[1][1]
    for i in range(sp2.shape[0]):
        for j in range(sp2.shape[2]):
            np.testing.assert_array_equal(sp2[i, :, j],
                                          np.arange(sp2.shape[1]))

    sp3 = data[2][1]
    for i in range(sp3.shape[0]):
        for j in range(sp3.shape[1]):
            np.testing.assert_array_equal(sp3[i, j, :],
                                          np.arange(sp3.shape[2]))
Example #11
0
    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)
Example #12
0
def test_expand_setpoints_2d(parameters):

    n_points_1, n_points_2, n_points_3, \
    setpoints_1, setpoints_2, setpoints_3 = parameters

    param_with_setpoints_2 = ParameterWithSetpoints(
        'param_2',
        get_cmd=lambda: rand(n_points_1(), n_points_2()),
        vals=vals.Arrays(shape=(n_points_1, n_points_2)))
    param_with_setpoints_2.setpoints = (setpoints_1, setpoints_2)

    data = expand_setpoints_helper(param_with_setpoints_2)

    assert len(data) == 3
    assert data[0][1].shape == data[1][1].shape
    assert data[0][1].shape == data[2][1].shape

    sp1 = data[0][1]
    sp2 = data[1][1]
    # the first set of setpoints should be repeated along the second axis
    for i in range(sp1.shape[1]):
        np.testing.assert_array_equal(sp1[:, i], np.arange(sp1.shape[0]))
    # the second set of setpoints should be repeated along the first axis
    for i in range(sp2.shape[0]):
        np.testing.assert_array_equal(sp2[i, :], np.arange(sp1.shape[1]))
Example #13
0
def test_validation_without_shape():
    """
    If the Arrays validator does not have a shape the validation will fail
    """
    n_points_1 = Parameter('n_points_1', set_cmd=None, vals=vals.Ints())

    n_points_1.set(10)
    setpoints_1 = Parameter('setpoints_1',
                            get_cmd=lambda: rand(n_points_1()),
                            vals=vals.Arrays(shape=(n_points_1, )))
    with pytest.raises(RuntimeError,
                       match=r"A ParameterWithSetpoints must "
                       r"have a shape defined "
                       r"for its validator."):
        param_without_shape = ParameterWithSetpoints(
            'param_5',
            get_cmd=lambda: rand(n_points_1()),
            setpoints=(setpoints_1, ),
            vals=vals.Arrays())
Example #14
0
    def _add_cfg_parameters(self):

        self.add_parameter(
            'polycoeffs_freq_conv',
            docstring='coefficients of the polynomial used to convert '
            'amplitude in V to detuning in Hz. N.B. it is important to '
            'include both the AWG range and channel amplitude in the params.\n'
            'In order to convert a set of cryoscope flux arc coefficients to '
            ' units of Volts they can be rescaled using [c0*sc**2, c1*sc, c2]'
            ' where sc is the desired scaling factor that includes the sq_amp '
            'used and the range of the AWG (5 in amp mode).',
            vals=vals.Arrays(),
            # initial value is chosen to not raise errors
            initial_value=np.array([2e9, 0, 0]),
            parameter_class=ManualParameter)

        self.add_parameter('cfg_operating_mode',
                           initial_value='Codeword',
                           vals=vals.Enum('Codeword', 'LongSeq'),
                           parameter_class=ManualParameter)
        self.add_parameter('cfg_awg_channel',
                           initial_value=1,
                           vals=vals.Ints(1, 8),
                           parameter_class=ManualParameter)
        self.add_parameter('cfg_distort',
                           initial_value=True,
                           vals=vals.Bool(),
                           parameter_class=ManualParameter)
        self.add_parameter(
            'cfg_append_compensation', docstring=(
                'If True compensation pulses will be added to individual '
                ' waveforms creating very long waveforms for each codeword'),
            initial_value=True, vals=vals.Bool(),
            parameter_class=ManualParameter)
        self.add_parameter('cfg_compensation_delay',
                           parameter_class=ManualParameter,
                           initial_value=3e-6,
                           unit='s',
                           vals=vals.Numbers())

        self.add_parameter(
            'cfg_pre_pulse_delay', unit='s', label='Pre pulse delay',
            docstring='This parameter is used for fine timing corrections, the'
                      ' correction is applied in distort_waveform.',
            initial_value=0e-9,
            vals=vals.Numbers(0, 1e-6),
            parameter_class=ManualParameter)

        self.add_parameter('instr_distortion_kernel',
                           parameter_class=InstrumentRefParameter)

        self.add_parameter('cfg_max_wf_length',
                           parameter_class=ManualParameter,
                           initial_value=10e-6,
                           unit='s', vals=vals.Numbers(0, 100e-6))
Example #15
0
def parameters():
    n_points_1 = Parameter('n_points_1', set_cmd=None, vals=vals.Ints())
    n_points_2 = Parameter('n_points_2', set_cmd=None, vals=vals.Ints())
    n_points_3 = Parameter('n_points_3', set_cmd=None, vals=vals.Ints())

    n_points_1.set(10)
    n_points_2.set(20)
    n_points_3.set(15)

    setpoints_1 = Parameter('setpoints_1',
                            get_cmd=lambda: np.arange(n_points_1()),
                            vals=vals.Arrays(shape=(n_points_1, )))
    setpoints_2 = Parameter('setpoints_2',
                            get_cmd=lambda: np.arange(n_points_2()),
                            vals=vals.Arrays(shape=(n_points_2, )))
    setpoints_3 = Parameter('setpoints_3',
                            get_cmd=lambda: np.arange(n_points_3()),
                            vals=vals.Arrays(shape=(n_points_3, )))
    yield (n_points_1, n_points_2, n_points_3, setpoints_1, setpoints_2,
           setpoints_3)
Example #16
0
def test_validation_shapes():
    """
    Test that various parameters with setpoints and shape combinations
    validate correctly.
    """

    n_points_1 = Parameter('n_points_1', set_cmd=None, vals=vals.Ints())
    n_points_2 = Parameter('n_points_2', set_cmd=None, vals=vals.Ints())

    n_points_1.set(10)
    n_points_2.set(20)

    setpoints_1 = Parameter('setpoints_1',
                            get_cmd=lambda: rand(n_points_1()),
                            vals=vals.Arrays(shape=(n_points_1, )))
    setpoints_2 = Parameter('setpoints_2',
                            get_cmd=lambda: rand(n_points_2()),
                            vals=vals.Arrays(shape=(n_points_2, )))

    param_with_setpoints_1 = ParameterWithSetpoints(
        "param_1",
        get_cmd=lambda: rand(n_points_1()),
        setpoints=(setpoints_1, ),
        vals=vals.Arrays(shape=(n_points_1, )),
    )
    assert ("<Arrays, shape: (<qcodes.parameters.parameter."
            "Parameter: n_points_1 at" in param_with_setpoints_1.__doc__)

    # the two shapes are the same so validation works
    param_with_setpoints_1.validate_consistent_shape()
    param_with_setpoints_1.validate(param_with_setpoints_1.get())

    param_with_setpoints_2 = ParameterWithSetpoints(
        'param_2',
        get_cmd=lambda: rand(n_points_1(), n_points_2()),
        vals=vals.Arrays(shape=(n_points_1, n_points_2)))

    param_with_setpoints_2.setpoints = (setpoints_1, setpoints_2)
    # 2d
    param_with_setpoints_2.validate_consistent_shape()
    param_with_setpoints_2.validate(param_with_setpoints_2.get())
Example #17
0
def test_expand_setpoints_1c(parameters):
    """
    Test that the setpoints expander helper function works correctly
    """

    n_points_1, n_points_2, n_points_3, \
    setpoints_1, setpoints_2, setpoints_3 = parameters

    param_with_setpoints_1 = ParameterWithSetpoints(
        'param_1',
        get_cmd=lambda: rand(n_points_1()),
        setpoints=(setpoints_1, ),
        vals=vals.Arrays(shape=(n_points_1, )))

    data = expand_setpoints_helper(param_with_setpoints_1)

    assert len(data) == 2
    assert len(data[0][1]) == len(data[1][1])
Example #18
0
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        ZI_AcquisitionDevice.__init__(self, *args, **kwargs)
        self.n_acq_units = len(self.qachannels)
        self.lo_freqs = [None] * self.n_acq_units  # re-create with correct length
        self.n_acq_int_channels = self.max_qubits_per_channel
        self._reset_acq_poll_inds()
        # Mode of the acquisition units ('readout' or 'spectroscopy')
        # This is different from self._acq_mode (allowed_modes)
        self._acq_units_modes = {}
        self._awg_program = [None]*self.n_acq_units
        self.seqtrigger = None
        self.timer = None

        self.awg_active = [False] * self.n_acq_units

        self.add_parameter(
            'allowed_lo_freqs',
            initial_value=np.arange(1e9, 8.1e9, 100e6),
            parameter_class=ManualParameter,
            docstring='List of values that the center frequency (LO) is '
                      'allowed to take. As of now this is limited to steps '
                      'of 100 MHz.',
            set_parser=lambda x: list(np.atleast_1d(x).flatten()),
            vals=validators.MultiType(validators.Lists(), validators.Arrays(),
                                      validators.Numbers()))
        self.add_parameter(
            'use_hardware_sweeper',
            initial_value=False,
            parameter_class=ManualParameter,
            docstring='Bool indicating whether the hardware sweeper should '
                      'be used in spectroscopy mode',
            vals=validators.Bool())

        self.add_parameter(
            'acq_trigger_delay',
            initial_value=200e-9,
            parameter_class=ManualParameter,
            docstring='Delay between the pulse generation and acquisition. '
                      'This is used both in the scope and the integration '
                      'units for consistency.',
            vals=validators.Numbers())
Example #19
0
def test_validation_no_validator():
    """
    If a parameter does not use array validators it cannot be validated.
    """
    n_points_1 = Parameter('n_points_1', set_cmd=None, vals=vals.Ints())

    n_points_1.set(10)
    setpoints_1 = Parameter('setpoints_1',
                            get_cmd=lambda: rand(n_points_1()),
                            vals=vals.Arrays(shape=(n_points_1, )))
    # output does not have a validator

    with pytest.raises(ValueError,
                       match=r"A ParameterWithSetpoints must have "
                       r"an Arrays validator got "
                       r"<class 'NoneType'>"):
        param_without_validator = ParameterWithSetpoints(
            'param_3',
            get_cmd=lambda: rand(n_points_1()),
            setpoints=(setpoints_1, ))
Example #20
0
    def _add_codeword_parameters(self):
        """
        Adds parameters parameters that are used for uploading codewords.
        It also contains initial values for each codeword to ensure
        that the "upload_codeword_program"

        """
        docst = ('Specifies a waveform to for a specific codeword. ' +
                 'The waveforms must be uploaded using ' +
                 '"upload_codeword_program". The channel number corresponds' +
                 ' to the channel as indicated on the device (1 is lowest).')
        self._params_to_skip_update = []
        for ch in range(self._num_channels):
            for cw in range(self._num_codewords):
                parname = 'wave_ch{}_cw{:03}'.format(ch + 1, cw)
                self.add_parameter(
                    parname,
                    label='Waveform channel {} codeword {:03}'.format(
                        ch + 1, cw),
                    vals=vals.Arrays(),  # min_value, max_value = unknown
                    parameter_class=ManualParameter,
                    docstring=docst)
                self._params_to_skip_update.append(parname)
Example #21
0
def test_validation_sp_no_validator():
    """
    If the setpoints do not have an Arrays validator validation
    will fail.
    """
    n_points_2 = Parameter('n_points_2', set_cmd=None, vals=vals.Ints())

    n_points_2.set(20)
    # setpoints do not have a validator
    setpoints_2 = Parameter('setpoints_2', get_cmd=lambda: rand(n_points_2()))
    param_sp_without_validator = ParameterWithSetpoints(
        'param_4',
        get_cmd=lambda: rand(n_points_2()),
        setpoints=(setpoints_2, ),
        vals=vals.Arrays(shape=(n_points_2, )))

    expected_err_msg = (r"Can only validate shapes for "
                        r"parameters with Arrays validator. "
                        r"setpoints_2 is a setpoint")
    with pytest.raises(ValueError, match=expected_err_msg):
        param_sp_without_validator.validate_consistent_shape()
    with pytest.raises(ValueError, match=expected_err_msg):
        param_sp_without_validator.validate(param_sp_without_validator.get())
    def _add_cz_sim_parameters(self):
        for this_cz in ["NE", "NW", "SW", "SE"]:
            self.add_parameter(
                "bus_freq_%s" % this_cz,
                docstring="[CZ simulation] Bus frequency.",
                vals=vals.Numbers(0.1e9, 1000e9),
                initial_value=7.77e9,
                parameter_class=ManualParameter,
            )
            self.add_parameter(
                "instr_sim_control_CZ_%s" % this_cz,
                docstring="Noise and other parameters for CZ simulation.",
                parameter_class=InstrumentRefParameter,
            )

        self.add_parameter(
            "step_response",
            initial_value=np.array([]),
            label="Step response",
            docstring=("Stores the normalized flux line step response. "
                       "Intended for use in cz simulations with noise."),
            parameter_class=ManualParameter,
            vals=vals.Arrays(),
        )
Example #23
0
    def __init__(self, parent: Instrument, name: str, channel: str) -> None:
        """
        Args:
            parent: The Instrument instance to which the channel is
                to be attached.
            name: The 'colloquial' name of the channel
            channel: The name used by the Keithley, i.e. either
                'smua' or 'smub'
        """

        if channel not in ['smua', 'smub']:
            raise ValueError('channel must be either "smub" or "smua"')

        super().__init__(parent, name)
        self.model = self._parent.model
        self._extra_visa_timeout = 5000
        self._measurement_duration_factor = 2  # Ensures that we are always above
        # the expected time.
        vranges = self._parent._vranges
        iranges = self._parent._iranges
        vlimit_minmax = self.parent._vlimit_minmax
        ilimit_minmax = self.parent._ilimit_minmax

        self.add_parameter('volt',
                           parameter_class=_MeasurementVoltageParameter,
                           label='Voltage',
                           unit='V',
                           snapshot_get=False)

        self.add_parameter('ramp_voltage',
                           get_cmd=f'{channel}.measure.v()',
                           get_parser=float,
                           set_cmd=self.ramp_voltage_to,
                           label='Voltage',
                           unit='V')

        self.add_parameter(
            'ramp_voltage_step',
            label='Step size for ramp_voltage',
            unit='V',
            initial_value=10e-3,
            get_cmd=None,
            set_cmd=None,
        )

        self.add_parameter(
            'ramp_voltage_delay',
            label='Delay for ramp_voltage',
            unit='s',
            initial_value=0,
            get_cmd=None,
            set_cmd=None,
        )

        self.add_parameter('curr',
                           parameter_class=_MeasurementCurrentParameter,
                           label='Current',
                           unit='A',
                           snapshot_get=False)

        self.add_parameter('ramp_current',
                           get_cmd=f'{channel}.measure.i()',
                           get_parser=float,
                           set_cmd=self.ramp_current_to,
                           label='Current',
                           unit='A')

        self.add_parameter(
            'ramp_current_step',
            label='Step size for ramp_current',
            unit='A',
            initial_value=0.3e-3,
            get_cmd=None,
            set_cmd=None,
        )

        self.add_parameter(
            'ramp_current_delay',
            label='Delay for ramp_current',
            unit='s',
            initial_value=10e-3,
            get_cmd=None,
            set_cmd=None,
        )

        self.add_parameter('res',
                           get_cmd=f'{channel}.measure.r()',
                           get_parser=float,
                           set_cmd=False,
                           label='Resistance',
                           unit='Ohm')

        self.add_parameter('mode',
                           get_cmd=f'{channel}.source.func',
                           get_parser=float,
                           set_cmd=f'{channel}.source.func={{:d}}',
                           val_mapping={
                               'current': 0,
                               'voltage': 1
                           },
                           docstring='Selects the output source type. '
                           'Can be either voltage or current.')

        self.add_parameter('output',
                           get_cmd=f'{channel}.source.output',
                           get_parser=float,
                           set_cmd=f'{channel}.source.output={{:d}}',
                           val_mapping=create_on_off_val_mapping(on_val=1,
                                                                 off_val=0))

        self.add_parameter('linefreq',
                           label='Line frequency',
                           get_cmd='localnode.linefreq',
                           get_parser=float,
                           set_cmd=False,
                           unit='Hz')

        self.add_parameter('nplc',
                           label='Number of power line cycles',
                           set_cmd=f'{channel}.measure.nplc={{}}',
                           get_cmd=f'{channel}.measure.nplc',
                           get_parser=float,
                           docstring='Number of power line cycles, used '
                           'to perform measurements',
                           vals=vals.Numbers(0.001, 25))
        # volt range
        # needs get after set (WilliamHPNielsen): why?
        self.add_parameter('sourcerange_v',
                           label='voltage source range',
                           get_cmd=f'{channel}.source.rangev',
                           get_parser=float,
                           set_cmd=self._set_sourcerange_v,
                           unit='V',
                           docstring='The range used when sourcing voltage '
                           'This affects the range and the precision '
                           'of the source.',
                           vals=vals.Enum(*vranges[self.model]))

        self.add_parameter(
            'source_autorange_v_enabled',
            label='voltage source autorange',
            get_cmd=f'{channel}.source.autorangev',
            get_parser=float,
            set_cmd=f'{channel}.source.autorangev={{}}',
            docstring='Set autorange on/off for source voltage.',
            val_mapping=create_on_off_val_mapping(on_val=1, off_val=0))

        self.add_parameter('measurerange_v',
                           label='voltage measure range',
                           get_cmd=f'{channel}.measure.rangev',
                           get_parser=float,
                           set_cmd=self._set_measurerange_v,
                           unit='V',
                           docstring='The range to perform voltage '
                           'measurements in. This affects the range '
                           'and the precision of the measurement. '
                           'Note that if you both measure and '
                           'source current this will have no effect, '
                           'set `sourcerange_v` instead',
                           vals=vals.Enum(*vranges[self.model]))

        self.add_parameter(
            'measure_autorange_v_enabled',
            label='voltage measure autorange',
            get_cmd=f'{channel}.measure.autorangev',
            get_parser=float,
            set_cmd=f'{channel}.measure.autorangev={{}}',
            docstring='Set autorange on/off for measure voltage.',
            val_mapping=create_on_off_val_mapping(on_val=1, off_val=0))
        # current range
        # needs get after set
        self.add_parameter('sourcerange_i',
                           label='current source range',
                           get_cmd=f'{channel}.source.rangei',
                           get_parser=float,
                           set_cmd=self._set_sourcerange_i,
                           unit='A',
                           docstring='The range used when sourcing current '
                           'This affects the range and the '
                           'precision of the source.',
                           vals=vals.Enum(*iranges[self.model]))

        self.add_parameter(
            'source_autorange_i_enabled',
            label='current source autorange',
            get_cmd=f'{channel}.source.autorangei',
            get_parser=float,
            set_cmd=f'{channel}.source.autorangei={{}}',
            docstring='Set autorange on/off for source current.',
            val_mapping=create_on_off_val_mapping(on_val=1, off_val=0))

        self.add_parameter('measurerange_i',
                           label='current measure range',
                           get_cmd=f'{channel}.measure.rangei',
                           get_parser=float,
                           set_cmd=self._set_measurerange_i,
                           unit='A',
                           docstring='The range to perform current '
                           'measurements in. This affects the range '
                           'and the precision of the measurement. '
                           'Note that if you both measure and source '
                           'current this will have no effect, set '
                           '`sourcerange_i` instead',
                           vals=vals.Enum(*iranges[self.model]))

        self.add_parameter(
            'measure_autorange_i_enabled',
            label='current autorange',
            get_cmd=f'{channel}.measure.autorangei',
            get_parser=float,
            set_cmd=f'{channel}.measure.autorangei={{}}',
            docstring='Set autorange on/off for measure current.',
            val_mapping=create_on_off_val_mapping(on_val=1, off_val=0))
        # Compliance limit
        self.add_parameter('limitv',
                           get_cmd=f'{channel}.source.limitv',
                           get_parser=float,
                           set_cmd=f'{channel}.source.limitv={{}}',
                           docstring='Voltage limit e.g. the maximum voltage '
                           'allowed in current mode. If exceeded '
                           'the current will be clipped.',
                           vals=vals.Numbers(vlimit_minmax[self.model][0],
                                             vlimit_minmax[self.model][1]),
                           unit='V')
        # Compliance limit
        self.add_parameter('limiti',
                           get_cmd=f'{channel}.source.limiti',
                           get_parser=float,
                           set_cmd=f'{channel}.source.limiti={{}}',
                           docstring='Current limit e.g. the maximum current '
                           'allowed in voltage mode. If exceeded '
                           'the voltage will be clipped.',
                           vals=vals.Numbers(ilimit_minmax[self.model][0],
                                             ilimit_minmax[self.model][1]),
                           unit='A')

        self.add_parameter('fastsweep', parameter_class=LuaSweepParameter)

        self.add_parameter('timetrace_npts',
                           initial_value=500,
                           label='Number of points',
                           get_cmd=None,
                           set_cmd=None)

        self.add_parameter('timetrace_dt',
                           initial_value=1e-3,
                           label='Time resolution',
                           unit='s',
                           get_cmd=None,
                           set_cmd=None)

        self.add_parameter(name='time_axis',
                           label='Time',
                           unit='s',
                           snapshot_value=False,
                           vals=vals.Arrays(shape=(self.timetrace_npts, )),
                           parameter_class=TimeAxis)

        self.add_parameter('timetrace',
                           vals=vals.Arrays(shape=(self.timetrace_npts, )),
                           setpoints=(self.time_axis, ),
                           parameter_class=TimeTrace)

        self.add_parameter('timetrace_mode',
                           initial_value='current',
                           get_cmd=None,
                           set_cmd=self.timetrace._set_mode,
                           vals=vals.Enum('current', 'voltage'))

        self.channel = channel
    def __init__(self, name, **kw):
        super().__init__(name, **kw)

        # Noise parameters
        self.add_parameter('T1_q0',
                           unit='s',
                           label='T1 fluxing qubit',
                           parameter_class=ManualParameter,
                           vals=vals.Numbers())
        self.add_parameter('T1_q1',
                           unit='s',
                           label='T1 static qubit',
                           parameter_class=ManualParameter,
                           vals=vals.Numbers())
        self.add_parameter('T2_q1',
                           unit='s',
                           label='T2 static qubit',
                           parameter_class=ManualParameter,
                           vals=vals.Numbers())
        self.add_parameter(
            'T2_q0_amplitude_dependent',
            unit='Hz, a.u., s',
            label=
            'fitcoefficients giving T2echo_q0 as a function of frequency_q0: gc, amp, tau. Function is gc+gc*amp*np.exp(-x/tau)',
            parameter_class=ManualParameter,
            vals=vals.Arrays())  # , initial_value=np.array([-1,-1,-1])
        # for flux noise simulations
        self.add_parameter(
            'sigma_q0',
            unit='flux quanta',
            label=
            'standard deviation of the Gaussian from which we sample the flux bias, q0',
            parameter_class=ManualParameter,
            vals=vals.Numbers())
        self.add_parameter(
            'sigma_q1',
            unit='flux quanta',
            label=
            'standard deviation of the Gaussian from which we sample the flux bias, q1',
            parameter_class=ManualParameter,
            vals=vals.Numbers())

        # Some system parameters
        self.add_parameter('w_bus',
                           unit='Hz',
                           label='omega of the bus resonator',
                           parameter_class=ManualParameter,
                           vals=vals.Numbers())
        self.add_parameter('alpha_q1',
                           unit='Hz',
                           label='anharmonicity of the static qubit',
                           parameter_class=ManualParameter,
                           vals=vals.Numbers())
        self.add_parameter(
            'w_q1_sweetspot',
            label='NB: different from the operating point in general',
            parameter_class=ManualParameter,
            vals=vals.Numbers())
        self.add_parameter(
            'Z_rotations_length',
            unit='s',
            label=
            'duration of the single qubit Z rotations at the end of the pulse',
            parameter_class=ManualParameter,
            vals=vals.Numbers())

        # Control parameters for the simulations
        self.add_parameter(
            'dressed_compsub',
            label=
            'true if we use the definition of the comp subspace that uses the dressed 00,01,10,11 states',
            parameter_class=ManualParameter,
            vals=vals.Bool())
        self.add_parameter('distortions',
                           vals=vals.Bool(),
                           parameter_class=ManualParameter)
        self.add_parameter(
            'voltage_scaling_factor',
            unit='a.u.',
            label='scaling factor for the voltage for a CZ pulse',
            parameter_class=ManualParameter,
            vals=vals.Numbers())
        self.add_parameter(
            'n_sampling_gaussian_vec',
            label=
            'array. each element is a number of samples from the gaussian distribution. Std to guarantee convergence is [11]. More are used only to verify convergence',
            parameter_class=ManualParameter,
            vals=vals.Arrays())
        self.add_parameter('cluster',
                           label='true if we want to use the cluster',
                           parameter_class=ManualParameter,
                           vals=vals.Bool())
        self.add_parameter(
            'look_for_minimum',
            label=
            'changes cost function to optimize either research of minimum of avgatefid_pc or to get the heat map in general',
            parameter_class=ManualParameter,
            vals=vals.Bool())

        self.add_parameter(
            'T2_scaling',
            unit='a.u.',
            label='scaling factor for T2_q0_amplitude_dependent',
            parameter_class=ManualParameter,
            vals=vals.Numbers())
    def add_parameters_from_file(self, filename: str):
        """
        Takes in a node_doc JSON file auto generates parameters based on
        the contents of this file.
        """
        f = open(filename).read()
        node_pars = json.loads(f)
        for par in node_pars.values():
            node = par['Node'].split('/')
            # The parfile is valid for all devices of a certain type
            # so the device name has to be split out.
            parname = '_'.join(node[2:]).lower()
            parfunc = "/" + self._devname + "/" + "/".join(node[2:])

            # This block provides the mapping between the ZI node and QCoDes
            # parameter.
            par_kw = {}
            par_kw['name'] = parname
            if par['Unit'] != 'None':
                par_kw['unit'] = par['Unit']
            else:
                par_kw['unit'] = 'arb. unit'

            par_kw['docstring'] = par['Description']
            if "Options" in par.keys():
                # options can be done better, this is not sorted
                par_kw['docstring'] += '\nOptions:\n' + str(par['Options'])

            # Creates type dependent get/set methods
            if par['Type'] == 'Integer (64 bit)':
                par_kw['set_cmd'] = self._gen_set_func(self._dev.seti, parfunc)
                par_kw['get_cmd'] = self._gen_get_func(self._dev.geti, parfunc)
                # min/max not implemented yet for ZI auto docstrings #352
                par_kw['vals'] = vals.Ints()

            elif par['Type'] == 'Integer (enumerated)':
                par_kw['set_cmd'] = self._gen_set_func(self._dev.seti, parfunc)
                par_kw['get_cmd'] = self._gen_get_func(self._dev.geti, parfunc)
                par_kw['vals'] = vals.Ints(min_value=0,
                                           max_value=len(par["Options"]))


            elif par['Type'] == 'Double':
                par_kw['set_cmd'] = self._gen_set_func(self._dev.setd, parfunc)
                par_kw['get_cmd'] = self._gen_get_func(self._dev.getd, parfunc)
                # min/max not implemented yet for ZI auto docstrings #352
                par_kw['vals'] = vals.Numbers()

            elif par['Type'] == 'ZIVectorData':
                par_kw['set_cmd'] = self._gen_set_func(self._dev.setv, parfunc)
                par_kw['get_cmd'] = self._gen_get_func(self._dev.getv, parfunc)
                # min/max not implemented yet for ZI auto docstrings #352
                par_kw['vals'] = vals.Arrays()

            elif par['Type'] == 'String':
                par_kw['set_cmd'] = self._gen_set_func(self._dev.sets, parfunc)
                par_kw['get_cmd'] = self._gen_get_func(self._dev.gets, parfunc)
                par_kw['vals'] = vals.Strings()

            elif par['Type'] == 'CoreString':
                par_kw['get_cmd'] = self._gen_get_func(self._dev.getd, parfunc)
                par_kw['set_cmd'] = None  # Not implemented
                par_kw['vals'] = vals.Strings()

            elif par['Type'] == 'ZICntSample':
                par_kw['get_cmd'] = None  # Not implemented
                par_kw['set_cmd'] = None  # Not implemented
                par_kw['vals'] = None # Not implemented

            elif par['Type'] == 'ZITriggerSample':
                par_kw['get_cmd'] = None  # Not implemented
                par_kw['set_cmd'] = None  # Not implemented
                par_kw['vals'] = None # Not implemented
            else:
                raise NotImplementedError(
                    "Parameter '{}' of type '{}' not supported".format(
                        parname, par['Type']))

            # If not readable/writable the methods are removed after the type
            # dependent loop to keep this more readable.
            if 'Read' not in par['Properties']:
                par_kw['get_cmd'] = None
            if 'Write' not in par['Properties']:
                par_kw['set_cmd'] = None
            self.add_parameter(**par_kw)
    def __init__(self, name: str, address: str, silent: bool = False,
                 **kwargs: Any):
        """
        Create an instance of the instrument.

        Args:
            name: Name used by QCoDeS. Appears in the DataSet
            address: Visa-resolvable instrument address.
            silent: If True, the connect_message of the instrument
                is supressed. Default: False
        """

        super().__init__(name, address, terminator='\n', **kwargs)

        idn = self.IDN.get()
        self.model = idn['model']

        self.is_34465A_34470A = self.model in ['34465A', '34470A']

        ####################################
        # Instrument specifications

        options = self._options()
        self.has_DIG = self.is_34465A_34470A and (
            'DIG' in options
            or LooseVersion('A.03') <= LooseVersion(idn['firmware'])
        )
        # Note that the firmware version check is still needed because
        # ``_options`` (the ``*OPT?`` command) returns 'DIG' option for
        # firmware 3.0 only if it has been purchased before
        self.has_MEM = self.is_34465A_34470A and 'MEM' in options

        PLCs = {'34410A': [0.006, 0.02, 0.06, 0.2, 1, 2, 10, 100],
                '34460A': [0.02, 0.2, 1, 10, 100],
                '34461A': [0.02, 0.2, 1, 10, 100],
                '34465A': [0.02, 0.06, 0.2, 1, 10, 100],
                '34470A': [0.02, 0.06, 0.2, 1, 10, 100]
                }
        if self.has_DIG:
            PLCs['34465A'] = [0.001, 0.002, 0.006] + PLCs['34465A']
            PLCs['34470A'] = [0.001, 0.002, 0.006] + PLCs['34470A']

        ranges = {'34410A': [10**n for n in range(3, 10)],  # 100 to 1 G
                  '34460A': [10**n for n in range(-3, 9)],  # 1 m to 100 M
                  '34461A': [10**n for n in range(-3, 9)],  # 1 m to 100 M
                  '34465A': [10**n for n in range(-3, 10)],  # 1 m to 1 G
                  '34470A': [10**n for n in range(-3, 10)],  # 1 m to 1 G
                  }

        # The resolution factor order matches the order of PLCs
        res_factors = {'34410A': [30e-6, 15e-5, 6e-6, 3e-6, 1.5e-6, 0.7e-6,
                                  0.3e-6, 0.2e-6, 0.1e-6, 0.03e-6],
                       '34460A': [300e-6, 100e-6, 30e-6, 10e-6, 3e-6],
                       '34461A': [100e-6, 10e-6, 3e-6, 1e-6, 0.3e-6],
                       '34465A': [3e-6, 1.5e-6, 0.7e-6, 0.3e-6, 0.1e-6,
                                  0.03e-6],
                       '34470A': [1e-6, 0.5e-6, 0.3e-6, 0.1e-6, 0.03e-6,
                                  0.01e-6]
                       }
        if self.has_DIG:
            res_factors['34465A'] = [30e-6, 15e-6, 6e-6] + res_factors['34465A']
            res_factors['34470A'] = [30e-6, 10e-6, 3e-6] + res_factors['34470A']

        self._resolution_factors = res_factors[self.model]
        self.ranges = ranges[self.model]
        self.NPLC_list = PLCs[self.model]

        ####################################
        # PARAMETERS

        # this is the "master" parameter that determines whether the DMM is
        # a voltmeter, an ampmeter, etc.
        self.add_parameter('sense_function',
                           label="Instrument sense function",
                           get_cmd="SENSe:FUNCtion?",
                           set_cmd="SENSe:FUNCtion {}",
                           val_mapping={"DC Voltage": '"VOLT"',
                                        "AC Voltage": '"VOLT:AC"',
                                        "DC Current": '"CURR"',
                                        "AC Current": '"CURR:AC"',
                                        "2 Wire Resistance": '"RES"',
                                        "4 Wire Resistance": '"FRES"'})

        self.add_parameter('line_frequency',
                           get_cmd='SYSTem:LFRequency?',
                           get_parser=int,
                           set_cmd=False,
                           label='Line Frequency',
                           unit='Hz',
                           docstring=('The frequency of the power line where '
                                      'the instrument is plugged')
                           )

        self.add_parameter('NPLC',
                           get_cmd='SENSe:VOLTage:DC:NPLC?',
                           get_parser=float,
                           set_cmd=self._set_NPLC,
                           vals=vals.Enum(*self.NPLC_list),
                           label='Integration time',
                           unit='NPLC',
                           docstring=textwrap.dedent("""\
            Sets the integration time in number of power line cycles (PLC)
            for DC voltage and ratio measurements. Integration time is the
            period that the instrument's analog-to-digital (A/D) converter
            samples the input signal for a measurement. A longer integration
            time gives better measurement resolution but slower measurement
            speed.

            Only integration times of 1, 10, or 100 PLC provide normal mode
            (line frequency noise) rejection.

            Setting the integration time also sets the measurement
            resolution."""))

        self.add_parameter('range',
                           get_cmd='SENSe:VOLTage:DC:RANGe?',
                           get_parser=float,
                           set_cmd='SENSe:VOLTage:DC:RANGe {:f}',
                           vals=vals.Enum(*self.ranges))

        self.add_parameter('resolution',
                           get_cmd='SENSe:VOLTage:DC:RESolution?',
                           get_parser=float,
                           set_cmd=self._set_resolution,
                           label='Resolution',
                           unit='V',
                           vals=vals.MultiType(
                               vals.Numbers(0),
                               vals.Enum('MIN', 'MAX', 'DEF')),
                           docstring=textwrap.dedent("""\
            Selects the measurement resolution for DC voltage and ratio
            measurements. The resolution is specified in the same units as the
            selected measurement function, not in number of digits.

            You can also specify MIN (best resolution) or MAX (worst
            resolution).

            To achieve normal mode (line frequency noise) rejection,
            use a resolution that corresponds to an integration time that is
            an integral number of power line cycles.

            Refer to "Resolution Table" or "Range, Resolution and NPLC"
            sections of the instrument's manual for the available ranges for
            the resolution values."""))

        self.add_parameter('autorange',
                           label='Autorange',
                           set_cmd='SENSe:VOLTage:DC:RANGe:AUTO {}',
                           get_cmd='SENSe:VOLTage:DC:RANGe:AUTO?',
                           val_mapping={'ON': 1, 'OFF': 0},
                           vals=vals.Enum('ON', 'OFF'))

        self.add_parameter('autozero',
                           label='Autozero',
                           set_cmd='SENSe:VOLTage:DC:ZERO:AUTO {}',
                           get_cmd='SENSe:VOLTage:DC:ZERO:AUTO?',
                           val_mapping={'ON': 1, 'OFF': 0, 'ONCE': 'ONCE'},
                           vals=vals.Enum('ON', 'OFF', 'ONCE'),
                           docstring=textwrap.dedent("""\
            Disables or enables the autozero mode for DC voltage and ratio
            measurements.

            ON:   the DMM internally measures the offset following each
                  measurement. It then subtracts that measurement from the
                  preceding reading. This prevents offset voltages present on
                  the DMM’s input circuitry from affecting measurement
                  accuracy.
            OFF:  the instrument uses the last measured zero measurement and
                  subtracts it from each measurement. It takes a new zero
                  measurement each time you change the function, range or
                  integration time.
            ONCE: the instrument takes one zero measurement and sets
                  autozero OFF. The zero measurement taken is used for all
                  subsequent measurements until the next change to the
                  function, range or integration time. If the specified
                  integration time is less than 1 PLC, the zero measurement
                  is taken at 1 PLC to optimize noise rejection. Subsequent
                  measurements are taken at the specified fast (< 1 PLC)
                  integration time."""))

        ####################################
        # Aperture parameters

        if self.is_34465A_34470A:
            # Define the extreme aperture time values for the 34465A and 34470A
            utility_freq = self.line_frequency()
            if utility_freq == 50:
                apt_times = {'34465A': [0.3e-3, 2],
                            '34470A': [0.3e-3, 2]}
            elif utility_freq == 60:
                apt_times = {'34465A': [0.3e-3, 1.67],
                            '34470A': [0.3e-3, 1.67]}
            if self.has_DIG:
                apt_times['34465A'][0] = 20e-6
                apt_times['34470A'][0] = 20e-6

            self.add_parameter('aperture_mode',
                               label='Aperture mode',
                               set_cmd='SENSe:VOLTage:DC:APERture:ENABled {}',
                               get_cmd='SENSe:VOLTage:DC:APERture:ENABled?',
                               val_mapping={'ON': 1, 'OFF': 0},
                               vals=vals.Enum('ON', 'OFF'),
                               docstring=textwrap.dedent("""\
                Enables the setting of integration time in seconds (called
                aperture time) for DC voltage measurements. If aperture time
                mode is disabled (default), the integration time is set in PLC
                (power-line cycles)."""))

            self.add_parameter('aperture_time',
                               label='Aperture time',
                               set_cmd=self._set_apt_time,
                               get_cmd='SENSe:VOLTage:DC:APERture?',
                               get_parser=float,
                               vals=vals.Numbers(*apt_times[self.model]),
                               docstring=textwrap.dedent("""\
                Specifies the integration time in seconds (called aperture
                time) with 2 µs resolution for DC voltage measurements.

                Use this command for precise control of the DMM's
                integration time. Use `NPLC` for better power-line noise
                rejection characteristics (NPLC > 1).

                Setting the aperture time automatically enables the aperture
                mode."""))

        ####################################
        # Submodules

        self.add_submodule('display', Display(self, 'display'))
        self.add_submodule('trigger', Trigger(self, 'trigger'))
        self.add_submodule('sample', Sample(self, 'sample'))

        ####################################
        # Measurement Parameters
        # snapshot_get is disabled for each of these to prevent rapid mode
        # changes on initialization or snapshot update, however the cached
        # (last read) value will still be stored in the snapshot.

        self.add_parameter('volt',
                           get_cmd=partial(self._get_parameter, "DC Voltage"),
                           label='Voltage',
                           unit='V',
                           snapshot_get=False)

        self.add_parameter('curr',
                           get_cmd=partial(self._get_parameter, "DC Current"),
                           label='Current',
                           unit='A',
                           snapshot_get=False)

        self.add_parameter('ac_volt',
                           get_cmd=partial(self._get_parameter, "AC Voltage"),
                           label='AC Voltage',
                           unit='V',
                           snapshot_get=False)

        self.add_parameter('ac_curr',
                           get_cmd=partial(self._get_parameter, "AC Current"),
                           label='AC Current',
                           unit='A',
                           snapshot_get=False)

        self.add_parameter('res',
                           get_cmd=partial(self._get_parameter,
                                           "2 Wire Resistance"),
                           label='Resistance',
                           unit='Ohms',
                           snapshot_get=False)

        self.add_parameter('four_wire_res',
                           get_cmd=partial(self._get_parameter,
                                           "4 Wire Resistance"),
                           label='Resistance',
                           unit='Ohms',
                           snapshot_get=False)

        #####################################
        # Time trace parameters

        self.add_parameter('timetrace_npts',
                           label='Time trace number of points',
                           initial_value=500,
                           get_cmd=None,
                           set_cmd=None,
                           vals=vals.Ints(1))

        self.add_parameter('timetrace_dt',
                           label='Time trace time interval',
                           unit='s',
                           initial_value=1e-1,
                           get_cmd=None,
                           set_cmd=None,
                           vals=vals.Numbers(0))

        self.add_parameter('time_axis',
                           label='Time',
                           unit='s',
                           snapshot_value=False,
                           vals=vals.Arrays(shape=(self.timetrace_npts,)),
                           parameter_class=TimeAxis)

        self.add_parameter('timetrace',
                           vals=vals.Arrays(shape=(self.timetrace_npts,)),
                           setpoints=(self.time_axis,),
                           parameter_class=TimeTrace)

        ####################################
        # Connect message

        if not silent:
            self.connect_message()
Example #27
0
    def __init__(self, name, f0=5e9, df=1e6, **kw):
        super().__init__(name, **kw)

        self._frq_mod = 0.0
        self._frq_mod_multiply = False

        # add params of the resonator and the virtual detection chain
        self.add_parameter('resonator_frequency',
                           set_cmd=None,
                           unit='Hz',
                           vals=validators.Numbers(1, 50e9),
                           initial_value=f0)
        self.add_parameter('resonator_linewidth',
                           set_cmd=None,
                           unit='Hz',
                           vals=validators.Numbers(1, 1e9),
                           initial_value=df)
        self.add_parameter('noise_temperature',
                           set_cmd=None,
                           unit='K',
                           vals=validators.Numbers(0.05, 3000),
                           initial_value=4.0)
        self.add_parameter('input_attenuation',
                           set_cmd=None,
                           unit='dB',
                           vals=validators.Numbers(0, 200),
                           initial_value=70)

        # actual instrument parameters
        self.add_parameter('start_frequency',
                           set_cmd=None,
                           unit='Hz',
                           vals=validators.Numbers(20e3, 19.999e9),
                           initial_value=20e3)
        self.add_parameter('stop_frequency',
                           set_cmd=None,
                           unit='Hz',
                           vals=validators.Numbers(20.1e3, 20e9),
                           initial_value=20e9)
        self.add_parameter('npoints',
                           set_cmd=None,
                           vals=validators.Ints(2, 40001),
                           initial_value=1601)
        self.add_parameter('bandwidth',
                           set_cmd=None,
                           unit='Hz',
                           vals=validators.Numbers(1, 1e6),
                           initial_value=10e3)
        self.add_parameter('power',
                           set_cmd=None,
                           unit='dBm',
                           vals=validators.Numbers(-100, 0),
                           initial_value=-100)

        # data parameters
        self.add_parameter(
            'frequency',
            unit='Hz',
            vals=validators.Arrays(shape=(self.npoints.get_latest, )),
            get_cmd=self._frequency_vals,
            snapshot_value=False,
        )
        self.add_parameter(
            'data',
            parameter_class=ParameterWithSetpoints,
            setpoints=[
                self.frequency,
            ],
            vals=validators.Arrays(
                shape=(self.npoints.get_latest, ),
                valid_types=[np.complexfloating],
            ),
            get_cmd=self._get_data,
        )
Example #28
0
    def _add_waveform_parameters(self):
        """
        Adds the parameters required to generate the standard waveforms

        The following prefixes are used for waveform parameters
            sq
            cz
            czd
            mcz
            custom

        """
        self.add_parameter('sq_amp', initial_value=.5,
                           # units is part of the total range of AWG8
                           label='Square pulse amplitude',
                           unit='dac value', vals=vals.Numbers(),
                           parameter_class=ManualParameter)
        self.add_parameter('sq_length', unit='s',
                           label='Square pulse length',
                           initial_value=40e-9,
                           vals=vals.Numbers(0, 100e-6),
                           parameter_class=ManualParameter)

        self.add_parameter('cz_length', vals=vals.Numbers(),
                           unit='s', initial_value=35e-9,
                           parameter_class=ManualParameter)
        self.add_parameter('cz_lambda_2', vals=vals.Numbers(),
                           initial_value=0,
                           parameter_class=ManualParameter)
        self.add_parameter('cz_lambda_3', vals=vals.Numbers(),
                           initial_value=0,
                           parameter_class=ManualParameter)
        self.add_parameter('cz_theta_f', vals=vals.Numbers(),
                           unit='deg',
                           initial_value=80,
                           parameter_class=ManualParameter)

        self.add_parameter('czd_length_ratio', vals=vals.Numbers(0, 1),
                           initial_value=0.5,
                           parameter_class=ManualParameter)
        self.add_parameter(
            'czd_lambda_2',
            docstring='lambda_2 parameter of the negative part of the cz pulse'
            ' if set to np.nan will default to the value of the main parameter',
            vals=vals.MultiType(vals.Numbers(), NP_NANs()),
            initial_value=np.nan,
            parameter_class=ManualParameter)

        self.add_parameter(
            'czd_lambda_3',
            docstring='lambda_3 parameter of the negative part of the cz pulse'
            ' if set to np.nan will default to the value of the main parameter',
            vals=vals.MultiType(vals.Numbers(), NP_NANs()),
            initial_value=np.nan,
            parameter_class=ManualParameter)
        self.add_parameter(
            'czd_theta_f',
            docstring='theta_f parameter of the negative part of the cz pulse'
            ' if set to np.nan will default to the value of the main parameter',
            vals=vals.MultiType(vals.Numbers(), NP_NANs()),
            unit='deg',
            initial_value=np.nan,
            parameter_class=ManualParameter)

        self.add_parameter('cz_freq_01_max', vals=vals.Numbers(),
                           # initial value is chosen to not raise errors
                           initial_value=6e9,
                           unit='Hz', parameter_class=ManualParameter)
        self.add_parameter('cz_J2', vals=vals.Numbers(), unit='Hz',
                            # initial value is chosen to not raise errors
                           initial_value=15e6,
                           parameter_class=ManualParameter)
        self.add_parameter('cz_freq_interaction', vals=vals.Numbers(),
                           # initial value is chosen to not raise errors
                           initial_value=5e9,
                           unit='Hz',
                           parameter_class=ManualParameter)

        self.add_parameter('cz_phase_corr_length', unit='s',
                           initial_value=5e-9, vals=vals.Numbers(),
                           parameter_class=ManualParameter)
        self.add_parameter('cz_phase_corr_amp',
                           unit='dac value',
                           initial_value=0, vals=vals.Numbers(),
                           parameter_class=ManualParameter)

        self.add_parameter('czd_amp_ratio',
                           docstring='Amplitude ratio for double sided CZ gate',
                           initial_value=1,
                           vals=vals.Numbers(),
                           parameter_class=ManualParameter)

        self.add_parameter('czd_amp_offset',
                           docstring='used to add an offset to the negative '
                           ' pulse that is used in the net-zero cz gate',
                           initial_value=0,
                           unit='dac value',
                           vals=vals.Numbers(),
                           parameter_class=ManualParameter)

        self.add_parameter('czd_double_sided',
                           initial_value=False,
                           vals=vals.Bool(),
                           parameter_class=ManualParameter)

        self.add_parameter('mcz_nr_of_repeated_gates',
                           initial_value=1, vals=vals.PermissiveInts(1, 40),
                           parameter_class=ManualParameter)
        self.add_parameter('mcz_gate_separation', unit='s',
                           label='Gate separation',  initial_value=0,
                           docstring=('Separtion between the start of CZ gates'
                                      'in the "multi_cz" gate'),
                           parameter_class=ManualParameter,
                           vals=vals.Numbers(min_value=0))

        self.add_parameter(
            'custom_wf',
            initial_value=np.array([]),
            label='Custom waveform',
            docstring=('Specifies a custom waveform, note that '
                       '`custom_wf_length` is used to cut of the waveform if'
                       'it is set.'),
            parameter_class=ManualParameter,
            vals=vals.Arrays())
        self.add_parameter(
            'custom_wf_length',
            unit='s',
            label='Custom waveform length',
            initial_value=np.inf,
            docstring=('Used to determine at what sample the custom waveform '
                       'is forced to zero. This is used to facilitate easy '
                       'cryoscope measurements of custom waveforms.'),
            parameter_class=ManualParameter,
            vals=vals.Numbers(min_value=0))
Example #29
0
    def __init__(self, name, **kw):
        super().__init__(name, **kw)

        self.add_parameter('channel',
                           initial_value=1,
                           vals=vals.Ints(),
                           parameter_class=ManualParameter)

        self.add_parameter(
            'kernel_list', initial_value=[], vals=vals.Lists(vals.Strings()),
            parameter_class=ConfigParameter,
            docstring='List of filenames of external kernels to be loaded')

        self.add_parameter('kernel_dir',
                           initial_value='kernels/',
                           vals=vals.Strings(),
                           parameter_class=ManualParameter,
                           docstring='Path for loading external kernels,' +
                           'such as room temperature correction kernels.')

        self.add_parameter('config_changed',
                           vals=vals.Bool(),
                           get_cmd=self._get_config_changed)
        self.add_parameter(
            'kernel', vals=vals.Arrays(), get_cmd=self._get_kernel,
            docstring=('Returns the predistortion kernel. \n' +
                       'Recalculates if the parameters changed,\n' +
                       'otherwise returns a precalculated kernel.\n' +
                       'Kernel is based on parameters in kernel object \n' +
                       'and files specified in the kernel list.'))

        self.add_parameter('skineffect_alpha', unit='',
                           parameter_class=ConfigParameter,
                           initial_value=0,
                           vals=vals.Numbers())
        self.add_parameter('skineffect_length', unit='s',
                           parameter_class=ConfigParameter,
                           initial_value=600e-9,
                           vals=vals.Numbers())

        self.add_parameter('decay_amp_1', unit='',
                           initial_value=0,
                           parameter_class=ConfigParameter,
                           vals=vals.Numbers())
        self.add_parameter('decay_tau_1', unit='s',
                           initial_value=1e-9,
                           parameter_class=ConfigParameter,
                           vals=vals.Numbers())
        self.add_parameter('decay_length_1', unit='s',
                           initial_value=100e-9,
                           parameter_class=ConfigParameter,
                           vals=vals.Numbers())
        self.add_parameter('decay_amp_2', unit='',
                           initial_value=0,
                           parameter_class=ConfigParameter,
                           vals=vals.Numbers())
        self.add_parameter('decay_tau_2', unit='s',
                           initial_value=1e-9,
                           parameter_class=ConfigParameter,
                           vals=vals.Numbers())
        self.add_parameter('decay_length_2', unit='s',
                           initial_value=100e-9,
                           parameter_class=ConfigParameter,
                           vals=vals.Numbers())

        self.add_parameter('bounce_amp_1', unit='',
                           initial_value=0,
                           parameter_class=ConfigParameter,
                           vals=vals.Numbers())
        self.add_parameter('bounce_tau_1', unit='s',
                           initial_value=0,
                           parameter_class=ConfigParameter,
                           vals=vals.Numbers())
        self.add_parameter('bounce_length_1', unit='s',
                           initial_value=1e-9,
                           parameter_class=ConfigParameter,
                           vals=vals.Numbers())

        self.add_parameter('bounce_amp_2', unit='',
                           initial_value=0,
                           parameter_class=ConfigParameter,
                           vals=vals.Numbers())
        self.add_parameter('bounce_tau_2', unit='s',
                           initial_value=0,
                           parameter_class=ConfigParameter,
                           vals=vals.Numbers())
        self.add_parameter('bounce_length_2', unit='s',
                           initial_value=1e-9,
                           parameter_class=ConfigParameter,
                           vals=vals.Numbers())

        self.add_parameter('poly_a', unit='',
                           initial_value=0,
                           parameter_class=ConfigParameter,
                           vals=vals.Numbers())
        self.add_parameter('poly_b', unit='',
                           initial_value=0,
                           parameter_class=ConfigParameter,
                           vals=vals.Numbers())
        self.add_parameter('poly_c', unit='',
                           initial_value=1,
                           parameter_class=ConfigParameter,
                           vals=vals.Numbers())
        self.add_parameter('poly_length', unit='s',
                           initial_value=600e-9,
                           parameter_class=ConfigParameter,
                           vals=vals.Numbers())

        self.add_parameter('corrections_length', unit='s',
                           parameter_class=ConfigParameter,
                           initial_value=10e-6,
                           vals=vals.Numbers())

        self.add_parameter('sampling_rate',
                           parameter_class=ManualParameter,
                           initial_value=1e9,
                           vals=vals.Numbers())
    def __init__(self, name, **kw):
        super().__init__(name, **kw)

        # Noise parameters
        self.add_parameter(
            "T1_q0",
            unit="s",
            label="T1 fluxing qubit",
            docstring="T1 fluxing qubit",
            parameter_class=ManualParameter,
            vals=vals.Numbers(),
            initial_value=0,
        )
        self.add_parameter(
            "T1_q1",
            unit="s",
            label="T1 static qubit",
            docstring="T1 static qubit",
            parameter_class=ManualParameter,
            vals=vals.Numbers(),
            initial_value=0,
        )
        self.add_parameter(
            "T2_q1",
            unit="s",
            label="T2 static qubit",
            docstring="T2 static qubit",
            parameter_class=ManualParameter,
            vals=vals.Numbers(),
            initial_value=0,
        )
        self.add_parameter(
            "T2_q0_amplitude_dependent",
            docstring=
            "fitcoefficients giving T2_q0 or Tphi_q0 as a function of inverse sensitivity (in units of w_q0/Phi_0): a, b. Function is ax+b",
            parameter_class=ManualParameter,
            vals=vals.Arrays(),
            initial_value=np.array([-1, -1]),
        )
        # for flux noise simulations
        self.add_parameter(
            "sigma_q0",
            unit="flux quanta",
            docstring=
            "standard deviation of the Gaussian from which we sample the flux bias, q0",
            parameter_class=ManualParameter,
            vals=vals.Numbers(),
            initial_value=0,
        )
        self.add_parameter(
            "sigma_q1",
            unit="flux quanta",
            docstring=
            "standard deviation of the Gaussian from which we sample the flux bias, q1",
            parameter_class=ManualParameter,
            vals=vals.Numbers(),
            initial_value=0,
        )

        self.add_parameter(
            "w_q1_sweetspot",
            docstring="NB: different from the operating point in general",
            parameter_class=ManualParameter,
            vals=vals.Numbers(),
        )
        self.add_parameter(
            "w_q0_sweetspot",
            docstring="NB: different from the operating point in general",
            parameter_class=ManualParameter,
            vals=vals.Numbers(),
        )
        self.add_parameter(
            "Z_rotations_length",
            unit="s",
            docstring=
            "duration of the single qubit Z rotations at the end of the pulse",
            parameter_class=ManualParameter,
            vals=vals.Numbers(),
            initial_value=0,
        )
        self.add_parameter(
            "total_idle_time",
            unit="s",
            docstring="duration of the idle time",
            parameter_class=ManualParameter,
            vals=vals.Numbers(),
            initial_value=0,
        )

        # Control parameters for the simulations
        self.add_parameter(
            "dressed_compsub",
            docstring=
            "true if we use the definition of the comp subspace that uses the dressed 00,01,10,11 states",
            parameter_class=ManualParameter,
            vals=vals.Bool(),
            initial_value=True,
        )
        self.add_parameter(
            "distortions",
            parameter_class=ManualParameter,
            vals=vals.Bool(),
            initial_value=False,
        )
        self.add_parameter(
            "voltage_scaling_factor",
            unit="a.u.",
            docstring="scaling factor for the voltage for a CZ pulse",
            parameter_class=ManualParameter,
            vals=vals.Numbers(),
            initial_value=1,
        )
        self.add_parameter(
            "n_sampling_gaussian_vec",
            docstring=
            "array. each element is a number of samples from the gaussian distribution. Std to guarantee convergence is [11]. More are used only to verify convergence",
            parameter_class=ManualParameter,
            vals=vals.Arrays(),
            initial_value=np.array([11]),
        )
        self.add_parameter(
            "cluster",
            docstring="true if we want to use the cluster",
            parameter_class=ManualParameter,
            vals=vals.Bool(),
            initial_value=False,
        )
        self.add_parameter(
            "look_for_minimum",
            docstring=
            "changes cost function to optimize either research of minimum of avgatefid_pc or to get the heat map in general",
            parameter_class=ManualParameter,
            vals=vals.Bool(),
            initial_value=False,
        )

        self.add_parameter(
            "T2_scaling",
            unit="a.u.",
            docstring="scaling factor for T2_q0_amplitude_dependent",
            parameter_class=ManualParameter,
            vals=vals.Numbers(),
            initial_value=1,
        )

        self.add_parameter(
            "waiting_at_sweetspot",
            unit="s",
            docstring=
            "time spent at sweetspot during the two halves of a netzero pulse",
            parameter_class=ManualParameter,
            vals=vals.Numbers(min_value=0),
            initial_value=0,
        )

        self.add_parameter(
            "which_gate",
            docstring=
            "Direction of the CZ gate. E.g. 'NE'. Used to extract parameters from the fluxlutman ",
            parameter_class=ManualParameter,
            vals=vals.Strings(),
            initial_value="NE",
        )

        self.add_parameter(
            "simstep_div",
            docstring=
            "Division of the simulation time step. 4 is a good one, corresponding to a time step of 0.1 ns. For smaller values landscapes can deviate significantly from experiment.",
            parameter_class=ManualParameter,
            vals=vals.Numbers(min_value=1),
            initial_value=4,
        )

        self.add_parameter(
            "gates_num",
            docstring="Chain the same gate gates_num times.",
            parameter_class=ManualParameter,
            # It should be an integer but the measurement control cast to float when setting sweep points
            vals=vals.Numbers(min_value=1),
            initial_value=1,
        )

        self.add_parameter(
            "gates_interval",
            docstring=
            "Time interval that separates the gates if gates_num > 1.",
            parameter_class=ManualParameter,
            unit='s',
            vals=vals.Numbers(min_value=0),
            initial_value=0,
        )

        self.add_parameter(
            "cost_func",
            docstring=
            "Used to calculate the cost function based on the quantities of interest (qoi). Signature: cost_func(qoi). NB: qoi's that represent percentages will be in [0, 1] range. Inspect 'pycqed.simulations.cz_superoperator_simulation_new_functions.simulate_quantities_of_interest_superoperator_new??' in notebook for available qoi's.",
            parameter_class=ManualParameter,
            unit='a.u.',
            vals=vals.Callable(),
            initial_value=None,
        )

        self.add_parameter(
            "cost_func_str",
            docstring=
            "Not loaded automatically. Convenience parameter to store the cost function string and use `exec('sim_control_CZ.cost_func(' + sim_control_CZ.cost_func_str() + ')')` to load it.",
            parameter_class=ManualParameter,
            vals=vals.Strings(),
            initial_value=
            "lambda qoi: np.log10((1 - qoi['avgatefid_compsubspace_pc']) * (1 - 0.5) + qoi['L1'] * 0.5)",
        )

        self.add_parameter(
            "double_cz_pi_pulses",
            docstring=
            "If set to 'no_pi_pulses' or 'with_pi_pulses' will simulate two sequential CZs with or without Pi pulses simulated as an ideal superoperator multiplication.",
            parameter_class=ManualParameter,
            vals=vals.Strings(),
            initial_value="",  # Use empty string to evaluate to false
        )

        # for ramsey/Rabi simulations

        self.add_parameter(
            "detuning",
            unit="Hz",
            docstring="detuning of w_q0 from its sweet spot value",
            parameter_class=ManualParameter,
            vals=vals.Numbers(),
            initial_value=0,
        )
        self.add_parameter(
            "initial_state",
            docstring="determines initial state for ramsey_simulations_new",
            parameter_class=ManualParameter,
            vals=vals.Strings(),
            initial_value="changeme",
        )

        # for spectral tomo

        self.add_parameter(
            "repetitions",
            docstring="Repetitions of CZ gate, used for spectral tomo",
            parameter_class=ManualParameter,
            vals=vals.Numbers(),
            initial_value=1,
        )
        self.add_parameter(
            "time_series",
            docstring="",
            parameter_class=ManualParameter,
            vals=vals.Bool(),
            initial_value=False,
        )
        self.add_parameter(
            "overrotation_sims",
            docstring=
            "instead of constant shift in flux, we use constant rotations around some axis",
            parameter_class=ManualParameter,
            vals=vals.Bool(),
            initial_value=False,
        )
        self.add_parameter(
            "axis_overrotation",
            docstring="",
            parameter_class=ManualParameter,
            vals=vals.Arrays(),
            initial_value=np.array([1, 0, 0]),
        )