spinqick.helper_functions.hardware_manager

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

logger

Classes

VoltageSource

Base class for protocol classes.

DummyDCSource

DCSource

Wraps low speed DAC control functions.

Module Contents

spinqick.helper_functions.hardware_manager.logger
class spinqick.helper_functions.hardware_manager.VoltageSource

Bases: 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:
        ...
open(address)
Parameters:

address (str)

close()
get_voltage(ch)
Parameters:

ch (int)

Return type:

float

set_voltage(ch, volts)
Parameters:
  • ch (int)

  • volts (float)

set_sweep(ch, start, stop, length, num_steps)
Parameters:
  • ch (int)

  • start (float)

  • stop (float)

  • length (float)

  • num_steps (int)

trigger(ch)
Parameters:

ch (int)

arm_sweep(ch)
Parameters:

ch (int)

class spinqick.helper_functions.hardware_manager.DummyDCSource
open(address)
Parameters:

address (str)

close()
get_voltage(ch)
Parameters:

ch (int)

Return type:

float

set_voltage(ch, volts)
Parameters:
  • ch (int)

  • volts (float)

set_sweep(ch, start, stop, length, num_steps)
Parameters:
  • ch (int)

  • start (float)

  • stop (float)

  • length (float)

  • num_steps (int)

trigger(ch)
Parameters:

ch (int)

arm_sweep(ch)
Parameters:

ch (int)

class spinqick.helper_functions.hardware_manager.DCSource(voltage_source)

Wraps low speed DAC control functions.

User supplies a hardware config file with channel to gate mapping and voltage conversion factors

Parameters:

voltage_source (VoltageSource)

cfg
vsource
source_type
property all_voltages

Get all slow dac voltages.

get_dc_voltage(gate)

Get voltage at gate. Values are converted via the dc_conversion_factor parameter which is stored in the hardware config.

Parameters:

gate (spinqick.helper_functions.spinqick_enums.GateNames) – Gate to read voltage from

Returns:

Voltage in units of volts at the gate.

Return type:

float

set_dc_voltage(volts, gate)

Sets gate voltage.

Parameters:
calculate_compensated_voltage(delta_v, gates, iso_gates)

Given crosscoupling parameters in hardware_config and desired voltages at gates, calculate voltages to apply.

Parameters:
set_dc_voltage_compensate(volts, gates, iso_gates)

Set gate voltage while compensating on iso_gates.

Parameters:
program_ramp(vstart, vstop, tstep, nsteps, gate)

Program a fast sweep on DCSource. Needs to be followed with arm and trigger.

Parameters:
  • vstart (float) – Ramp start voltage in units of volts at the gate

  • vstop (float) – Ramp end voltage in units of volts at the gate

  • tstep (float) – time per step in seconds

  • nsteps (int) – number of steps

  • gate (spinqick.helper_functions.spinqick_enums.GateNames) – Gate to set voltage on

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.

Parameters:
digital_trigger(gate)

Trigger the fast sweep on DCSource digitally.

Parameters:

gate (spinqick.helper_functions.spinqick_enums.GateNames) – Gate to trigger

arm_sweep(gate)

Arm sleeperdac sweep.

Parameters:

gate (spinqick.helper_functions.spinqick_enums.GateNames) – Gate to arm sweep on

set_voltage_from_dict(v_dict)

Set voltage from a dict of gate, voltage pairs.

Parameters:

v_dict (dict)

save_voltage_state(file_path=None)

Save voltage state of all gates.

Parameters:

file_path (str | None) – Path to save voltage data to. Defaults to the default data directory.