spinqick.helper_functions.hardware_manager ========================================== .. py:module:: spinqick.helper_functions.hardware_manager .. autoapi-nested-parse:: The DCSource class is designed to add a layer of abstraction between spinqick and whichever low speed DACs you are using. We use these DACs to control steady-state operation of the devices. Attributes ---------- .. autoapisummary:: spinqick.helper_functions.hardware_manager.logger Classes ------- .. autoapisummary:: spinqick.helper_functions.hardware_manager.VoltageSource spinqick.helper_functions.hardware_manager.DummyDCSource spinqick.helper_functions.hardware_manager.DCSource Module Contents --------------- .. py:data:: logger .. py:class:: VoltageSource Bases: :py:obj:`Protocol` Base class for protocol classes. Protocol classes are defined as:: class Proto(Protocol): def meth(self) -> int: ... Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing). For example:: class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:: class GenProto[T](Protocol): def meth(self) -> T: ... .. py:method:: open(address) .. py:method:: close() .. py:method:: get_voltage(ch) .. py:method:: set_voltage(ch, volts) .. py:method:: set_sweep(ch, start, stop, length, num_steps) .. py:method:: trigger(ch) .. py:method:: arm_sweep(ch) .. py:class:: DummyDCSource .. py:method:: open(address) .. py:method:: close() .. py:method:: get_voltage(ch) .. py:method:: set_voltage(ch, volts) .. py:method:: set_sweep(ch, start, stop, length, num_steps) .. py:method:: trigger(ch) .. py:method:: arm_sweep(ch) .. py:class:: DCSource(voltage_source) Wraps low speed DAC control functions. User supplies a hardware config file with channel to gate mapping and voltage conversion factors .. py:attribute:: cfg .. py:attribute:: vsource .. py:attribute:: source_type .. py:property:: all_voltages Get all slow dac voltages. .. py:method:: get_dc_voltage(gate) Get voltage at gate. Values are converted via the dc_conversion_factor parameter which is stored in the hardware config. :param gate: Gate to read voltage from :returns: Voltage in units of volts at the gate. .. py:method:: set_dc_voltage(volts, gate) Sets gate voltage. :param volts: Voltage in units of volts at the gate :param gate: Gate to set voltage on .. py:method:: calculate_compensated_voltage(delta_v, gates, iso_gates) Given crosscoupling parameters in hardware_config and desired voltages at gates, calculate voltages to apply. :param delta_v: provide a list of desired potential differences at the gates :param gates: list of gates :param iso_gates: list of gates whose potential at the gate will be kept constant .. py:method:: set_dc_voltage_compensate(volts, gates, iso_gates) Set gate voltage while compensating on iso_gates. :param volts: Voltage in units of volts at the gate :param gates: Gate to set voltage on :param iso_gates: charge sensor gate to compensate with .. py:method:: program_ramp(vstart, vstop, tstep, nsteps, gate) Program a fast sweep on DCSource. Needs to be followed with arm and trigger. :param vstart: Ramp start voltage in units of volts at the gate :param vstop: Ramp end voltage in units of volts at the gate :param tstep: time per step in seconds :param nsteps: number of steps :param gate: Gate to set voltage on .. py:method:: program_ramp_compensate(vstart, vstop, tstep, nsteps, gates, iso_gates) Program a fast sweep on DCSource with compensation on a charge sensor gate. Needs to be followed with arm and trigger. :param vstart: Ramp start voltage in units of volts at the gate :param vstop: Ramp end voltage in units of volts at the gate :param tstep: time per step in seconds :param nsteps: number of steps :param gate: Gate to set voltage on :param m_gate: charge sensor gate to compensate with .. py:method:: digital_trigger(gate) Trigger the fast sweep on DCSource digitally. :param gate: Gate to trigger .. py:method:: arm_sweep(gate) Arm sleeperdac sweep. :param gate: Gate to arm sweep on .. py:method:: set_voltage_from_dict(v_dict) Set voltage from a dict of gate, voltage pairs. .. py:method:: save_voltage_state(file_path = None) Save voltage state of all gates. :param file_path: Path to save voltage data to. Defaults to the default data directory.