hardware module

Hardware configuration common to all modes of operation.

Detailed information is provided in the documentation for each class:

Hardware

Interface to the Vivace/Presto hardware.

TriggerSource

Select trigger source for starting a pulsed measurement

AdcMode

Configuration for analog-to-digital converters (ADC), i.e. input channels.

DacMode

Configuration for digital-to-analog converters (DAC), i.e. output channels.

AdcFSample

Sampling rate setting for analog-to-digital converters (ADC), i.e. input channels.

DacFSample

Sampling rate setting for digital-to-analog converters (DAC), i.e. output channels.


Advanced tile configuration

It is possible to specify different converter modes and converter rates on groups (tiles) of different input/output ports, depending on the available hardware. The tiles configurations are as follows:

Tile

8-channels Vivace

8-channel Presto

16-channel Presto

ADC0

input ports 1-2

input ports 1-2

input ports 1-4

ADC1

input ports 3-4

input ports 3-4

input ports 5-8

ADC2

input ports 5-6

input ports 5-6

input ports 9-12

ADC3

input ports 7-8

input ports 7-8

input ports 13-16

DAC0

output ports 1-4

output ports 1-2

output ports 1-4

DAC1

output ports 5-8

output ports 3-4

output ports 5-8

DAC2

output ports 5-6

output ports 9-12

DAC3

output ports 7-8

output ports 13-16

For example, on an 8-channel Presto hardware setting the parameters:
adc_mode=AdcMode.Direct
adc_fsample=[AdcFSample.G4, AdcFSample.G2, AdcFSample.G2, AdcFSample.G2]
dac_mode=[DacMode.Mixed42, DacMode.Mixed42, DacMode.Mixed02, DacMode.Mixed02]
dac_fsample=DacFSample.G6
will configure:
all the input ports in direct mode;
input ports 1-2 to sample at 4 GS/s and ports 3-8 at 2 GS/s;
output ports 1-4 to use the Mixed42 mode and ports 5-8 the Mixed02 mode;
all output ports to synthesize at 6 GS/s.

Hardware class

class presto.hardware.Hardware(address=None, port=None, dry_run=False)

Interface to the Vivace/Presto hardware.

This class does not need to be instantiated by the user. It is available as the hardware attribute of instances of Lockin, Pulsed and Test classes.

Examples

Configure digital IQ mixers:

>>> from presto.hardware import AdcMode, DacMode
>>> from presto import lockin
>>> with lockin.Lockin(adc_mode=AdcMode.Mixed, dac_mode=DacMixed02) as lck:
>>>     lck.hardware.configure_mixer(
>>>         freq=3.5e+9,  # 3.5 GHz
>>>         in_ports=1,
>>>         out_ports=[1, 2],
>>>     )
assert_errors()

Print errors from the hardware and raise an exception if there were any.

Raises

RuntimeError

See also

get_errors, print_errors

blank_output(ports, state)

Disable the output port(s). Has no effect on the DC bias.

The new setting is applied immediately.

Parameters
  • ports (int or list of int) – Output ports to enable/disable

  • state (bool) – When True, disable the RF output.

close()

Close the connection to the hardware

This method is called automatically upon exit from a with block

configure_mixer(freq, *, in_ports=None, out_ports=None, in_zone=None, out_zone=None, in_phase=0.0, out_phase=0.0, sync=True, tune=True)

Configure the NCO for the digital IQ mixers.

The new setting is applied immediately.

Parameters
  • freq (float) – frequency of the numerically-controlled oscillator (NCO) in Hz

  • in_ports (int or list of int) – configure downconversion for ports in in_ports

  • out_ports (int or list of int) – configure upconversion for ports in out_ports

  • in_zone (int, optional) – optimize downconversion mixer for operation in the in_zoneth Nyquist band. If None (default), choose appropriate zone automatically

  • out_zone (int, optional) – optimize upconversion mixer for operation in the out_zoneth Nyquist band. If None (default), choose appropriate zone automatically

  • in_phase (float, optional) – phase of the numerically-controlled oscillator (NCO) in radians for each input port

  • out_phase (float, optional) – phase of the numerically-controlled oscillator (NCO) in radians for each output port

  • sync (bool, optional) – if True (default), issue a sync() event to align the phase of the NCO for in_ports and out_ports. When using multiple calls to configure different NCO frequencies on different ports, set sync=True only on the last call to ensure that all NCO phases align. See Examples section.

  • tune (bool, optional) – if True (default), avoid long-term drifts by rounding freq so that it is representable exactly by all the NCOs in in_ports and out_ports. If False, freq will be programmed as-is into the different NCOs and a small frequency mismatch (at most 40 μHz) can occur between different channels, leading to a slow phase drift (at most 0.8 deg/min).

Examples

>>> from presto.hardware import AdcMode, DacMode
>>> from presto import lockin
>>> with lockin.Lockin(adc_mode=AdcMode.Mixed, dac_mode=DacMixed02) as lck:
>>>     lck.hardware.configure_mixer(
>>>         freq=3.5e+9,  # 3.5 GHz
>>>         in_ports=1,
>>>         out_ports=1,
>>>         sync=False,  # sync on last call...
>>>     )
>>>     lck.hardware.configure_mixer(
>>>         freq=3.6e+9,  # 3.6 GHz
>>>         out_ports=2,
>>>         sync=False,  # ...not yet...
>>>     )
>>>     lck.hardware.configure_mixer(
>>>         freq=3.7e+9,  # 3.7 GHz
>>>         out_ports=3,
>>>         sync=True,  # <-- ...here!
>>>     )
format_errors()

Format error messages from the hardware, ready for printing.

Returns

a formatted string containing the errors, or an empty string.

Return type

str

get_errors()

Get error messages, if any, from the hardware.

Return type

list of str

See also

print_errors, assert_errors

restore_cal_coeff()

Restore previously saved coefficients for the background calibration of the input ports (ADC)

The new setting is applied immediately.

save_cal_coeff()

Save the current coefficients for the background calibration of the input ports (ADC)

set_adc_attenuation(ports, attenuation)

Set the attenuation of the input ports (ADC)

Results in changing the analog range of the input. Only on Presto hardware.

The new setting is applied immediately.

Parameters
  • ports (int or list of int) –

  • attenuation (float) – attenuation in dB, valid values are between 0.0 and 11.0 in steps of 0.5 dB

set_cal_freeze(freeze)

Freeze/unfreeze the background calibration of the input ports (ADC)

The new setting is applied immediately.

Parameters

freeze (bool) – set to True to freeze (stop) the background calibration; set to False to unfreeze

set_dac_current(ports, current_ua)

Set the full-scale current of the output ports (DAC)

Results in changing the analog range of the output.

The new setting is applied immediately.

Parameters
  • ports (int or list of int) –

  • current_ua (int) – full-scale current in μA, see Notes for valid values

Notes

On Vivace hardware, valid values for current_ua are 20_000 (20 mA) and 32_000 (32 mA). On Presto hardware, valid values range from 2_250 (2.25 mA) to 40_500 (40.5 mA) in steps of 43.75 μA.

set_dc_bias(bias, port, range_i=None)

Set a DC bias on the output ports.

The new setting is applied immediately.

Parameters
  • bias (float) – DC bias value. Must be within the selected range.

  • port (int or array_like) – Output port, if None set DC bias for all ports. See Notes for valid ports.

  • range_i (int, optional) – Range setting for DC bias DAC. On Vivace hardware this setting is ignored and the selected range is always ±1.0 FS. On Presto hardware, the default behavior is to auto-select an appropriate range based on the value of bias. See Notes for other available options.

Raises

ValueError – If bias or port are outside valid range.

Notes

On Vivace hardware, the DC bias is applied to the RF output ports by means of a internal bias tees; as such, valid values for port are in the interval [1,8]. On Presto hardware, DC bias is provided from the dedicated DC output ports on the front panel; valid values for port are then in the interval [1,16] regardless of the available number of RF outputs.

On Presto hardware, there are 5 available range settings:

range_i

Analog range

0

0V — 3.33V

1

0V — 6.67V

2

±3.33V

3

±6.67V

4

±10.0V

When selecting range_i=None (default), the API will choose the smallest bipolar range (2, 3 or 4) such that bias is at most 90% of the range.

Examples

>>> from presto import lockin
>>> with lockin.Lockin() as lck:
>>>     lck.hardware.set_dc_bias(
>>>         bias=5.0,  # 5V
>>>         port=[5, 6, 7, 8],  # update 4 ports simultaneously
>>>         range_i=None,  # auto-select `range_i=3`, i.e. ±6.67V
>>>     )
>>>     lck.hardware.set_dc_bias(
>>>         bias=-2.0,  # -2V
>>>         port=1,
>>>         range_i=4,  # manually select `range_i=4`, i.e. ±10.0V
>>>     )
set_inv_sinc(ports, mode)

Enable/disable the inverse-sinc FIR filter on the output ports (DAC)

The new setting is applied immediately.

Parameters
  • ports (int or list of int) –

  • mode (int) – which FIR filter to use: 0 disables correction; 1 for operation in 1st Nyquist zone; 2 for operation in 2nd Nyquist zone (only on Presto hardware)

Notes

Using the inverse-sinc correction can improve gain flatness over frequency, but can cause clipping of the output when used at full-scale amplitude. To avoid clipping, it is recommended to not drive above -3.5 dBFS when mode=1, and -1.0 dBFS when mode=2.

set_lmx(freq, pwr, ports=None)

Configure the clock chip on Presto hardware to use as RF source.

The new setting is applied immediately.

Parameters
  • freq (float) – frequency in Hz between <~ 10 MHz and 15 GHz

  • pwr (int) – power setting in [0, 47]

  • ports (int or list of int) – valid values are 1 and 2. If None (default), use both.

sleep(secs, wait=True)

Tell the hardware to sleep for secs seconds.

Like time.sleep(), except the sleep is done on the hardware rather than on the local computer.

Parameters
  • secs (float) – duration of sleep in seconds

  • wait (bool, optional) – if False, tell the hardware to sleep without waiting for completion. If True (default), block the calling thread on the local computer until the hardware is done sleeping

sync()

Manually issue a command to synchronize the NCO phases.

Can be used after a call to configure_mixer() with sync=False.

Examples

This code:

>>> with lockin.Lockin(adc_mode=AdcMode.Mixed, dac_mode=DacMixed02) as lck:
>>>     lck.hardware.configure_mixer(
>>>         freq=3.5e+9,  # 3.5 GHz
>>>         in_ports=1,
>>>         out_ports=1,
>>>         sync=False,  # don't sync here...
>>>     )
>>>     lck.hardware.sync()  # <-- sync here!

is equivalent to this code:

>>> with lockin.Lockin(adc_mode=AdcMode.Mixed, dac_mode=DacMixed02) as lck:
>>>     lck.hardware.configure_mixer(
>>>         freq=3.5e+9,  # 3.5 GHz
>>>         in_ports=1,
>>>         out_ports=1,
>>>         sync=True,  # <-- sync here!
>>>     )

TriggerSource class

class presto.hardware.TriggerSource(value)

Select trigger source for starting a pulsed measurement

DigitalIn1 = 8

Wait for high on digital input 1

DigitalIn2 = 16

Wait for high on digital input 2

DigitalIn3 = 32

Wait for high on digital input 3

DigitalIn4 = 64

Wait for high on digital input 4

Internal = 1

Run immediately

Sysref = 4

Wait for multi-presto synchronization


Converter modes

class presto.hardware.AdcMode(value)

Configuration for analog-to-digital converters (ADC), i.e. input channels

Direct = 0

direct mode, i.e. no digital downconversion

Mixed = 1

IQ mixed mode, i.e. with digital downconversion

class presto.hardware.DacMode(value)

Configuration for digital-to-analog converters (DAC), i.e. output channels

Direct = 0

direct mode, i.e. no digital upconversion

Mixed02 = 1

standard IQ mixed mode, i.e. with digital upconversion. Only valid for sampling rates \(f_\mathrm{S} \le 7 \mathrm{GS/s}\)

Mixed04 = 2

IQ mixed mode with \(f_\mathrm{out} \in [0;f_\mathrm{S}/4] \cup [3f_\mathrm{S}/4;f_\mathrm{S}]\). Only valid on Presto hardware

Mixed42 = 3

IQ mixed mode with \(f_\mathrm{out} \in [f_\mathrm{S}/4; 3f_\mathrm{S}/4]\). Only valid on Presto hardware


Converter rates

class presto.hardware.AdcFSample(value)

Sampling rate setting for analog-to-digital converters (ADC), i.e. input channels

G2 = 0

\(f_\mathrm{S} = 2 \mathrm{GS/s}\)

G3_2 = 1

\(f_\mathrm{S} = 3.2 \mathrm{GS/s}\). Only valid on Vivace hardware

G4 = 2

\(f_\mathrm{S} = 4 \mathrm{GS/s}\). Not valid on 16-channel Presto hardware

class presto.hardware.DacFSample(value)

Sampling rate setting for digital-to-analog converters (DAC), i.e. output channels

G10 = 5

\(f_\mathrm{S} = 10 \mathrm{GS/s}\). Only valid on Presto hardware

G2 = 0

\(f_\mathrm{S} = 2 \mathrm{GS/s}\)

G4 = 1

\(f_\mathrm{S} = 4 \mathrm{GS/s}\)

G6 = 2

\(f_\mathrm{S} = 6 \mathrm{GS/s}\). Only valid on Presto hardware

G6_4 = 3

\(f_\mathrm{S} = 6.4 \mathrm{GS/s}\). Only valid on Vivace hardware

G8 = 4

\(f_\mathrm{S} = 8 \mathrm{GS/s}\). Only valid on Presto hardware