# 2.1.1. qmix.exp package

## 2.1.1.1. Submodules

## 2.1.1.2. qmix.exp.clean_data module

This module contains functions for cleaning experimental data.

This includes removing NaN values, removing repeated values, and sorting.

The data can either be in x/y format (i.e., two arrays of equal length) or in matrix form (i.e., a matrix with two columns).

qmix.exp.clean_data.clean_matrix(matrix)

  Clean 2D matrix data.

  Remove NaNs, sort by first column, remove double values for first column.

  Parameters:

    matrix (ndarray) – 2-column matrix

  Returns:

    Cleaned 2-column matrix

qmix.exp.clean_data.clean_xy(x, y)

  Clean x/y data.

  Remove NaNs, sort by x, remove double values for x.

  Parameters:

    - x (ndarray) – x data

    - y (ndarray) – y data

  Returns:

    Cleaned x/y data

qmix.exp.clean_data.matrix_to_xy(matrix)

  Convert matrix into x/y data.

  Parameters:

    matrix (ndarray) – 2-column matrix

  Returns:

    x/y data

qmix.exp.clean_data.remove_doubles_matrix(matrix, col=0, check=True)

  Remove double values from 2-column matrix.

  Parameters:

    - matrix – 2-column matrix

    - col – column to remove doubles from (default 0)

    - check (bool) – check that x data is sorted

  Returns:

    2-column matrix with double values of given column removed

qmix.exp.clean_data.remove_doubles_xy(x, y, check=True)

  Given x/y data, remove double values of x.

  This function assumes that the data is already sorted by x!

  Parameters:

    - x (ndarray) – x array

    - y (ndarray) – y array

    - check (bool) – check that x is sorted

  Returns:

    x/y data with doubles values of x removed

qmix.exp.clean_data.remove_nans_matrix(matrix)

  Remove all NaN values data from a matrix

  Parameters:

    matrix (ndarray) – 2-column matrix

  Returns:

    2-column matrix with NaNs removed

qmix.exp.clean_data.remove_nans_xy(x, y)

  Remove NaNs from x/y data.

  Parameters:

    - x (ndarray) – x array

    - y (ndarray) – y array

  Returns:

    x/y data with NaNs removed

qmix.exp.clean_data.sort_matrix(matrix, col=0)

  Sort a 2D matrix by a specific column.

  Parameters:

    - matrix (ndarray) – 2-column matrix

    - col (int) – column to sort by

  Returns:

    2-column matrix sorted by the given column

qmix.exp.clean_data.sort_xy(x, y)

  Sort x/y data by the x values.

  Parameters:

    - x (ndarray) – x array

    - y (ndarray) – y array

  Returns:

    x/y data sorted by x

qmix.exp.clean_data.xy_to_matrix(x, y)

  Take x/y data in separate arrays and combine into a matrix.

  Parameters:

    - x (ndarray) – x data

    - y (ndarray) – y data

  Returns:

    Matrix of x/y data

## 2.1.1.3. qmix.exp.exp_data module

This module contains classes for importing, filtering and analyzing raw I-V and IF data obtained from SIS mixer experiments.

Two classes (`RawData0` and `RawData`) are provided to help manage the data. `RawData0` is intended for data that was collected with no LO injection (i.e., unpumped data), and `RawData` is intended for data that was collected with LO injection (i.e., pumped data).

Note

Experimental data can be passed to these classes either in the form of CSV data files or Numpy arrays. In both bases, the data should have two columns: the first for voltage, and the second for current or IF power, depending on the file type.

For CSV files, you can define the delimiter using the keyword argument `delimiter=','`, the number of rows to skip for the header using `skip_header=1`, and which columns to import using `usecols=(0,1)`. Take a look at the data in `QMix/notebooks/eg-230-data/` for an example. Also, take a look at `QMix/notebooks/analyze-experimental-data.ipynb` for an example of how to use this module.

class qmix.exp.exp_data.RawData(ivdata, dciv, if_hot=None, if_cold=None, **kw)

  Bases: `object`

  Class for importing and analyzing experimental pumped data (LO present).

  Note

  Experimental data can be passed to this class either in the form of CSV data files or Numpy arrays. In both bases, the data should have two columns: the first for voltage, and the second for current or IF power, depending on the file type.

  For CSV files, you can define the delimiter using the keyword argument `delimiter=','`, the number of rows to skip for the header using `skip_header=1`, and which columns to import using `usecols=(0,1)`. Take a look at the data in `QMix/notebooks/eg-230-data/` for an example. Also, take a look at `QMix/notebooks/analyze-experimental-data.ipynb` for an example of how to use this module.

  See `qmix.exp.parameters.params` for all possible keyword arguments. These parameters control how the data is imported and analyzed.

  Parameters:

    - ivdata – I-V data. Either a CSV data file or a Numpy array. The data should have two columns: the first for voltage, and the second for current. If you are using CSV files, the properties of the CSV file can be set through additional keyword arguments (see below).

    - dciv (qmix.exp.iv_data.DCIVData) – DC I-V metadata

  Keyword Arguments:

    - delimiter (str) – Delimiter for CSV files.

    - usecols (tuple) – List of columns to import (tuple of length 2).

    - skip_header (int) – Number of rows to skip, used to skip the header.

    - v_fmt (str) – Units for voltage (‘uV’, ‘mV’, or ‘V’).

    - i_fmt (str) – Units for current (‘uA’, ‘mA’, or ‘A’).

    - vmax (float) – Maximum voltage to import in units [V].

    - npts (int) – Number of points to have in I-V interpolation.

    - debug (bool) – Plot each step of the I-V processing procedure.

    - voffset (float) – Voltage offset, in units [V].

    - ioffset (float) – Current offset, in units [A].

    - voffset_range (float) – Voltage range over which to search for offset, in units [V].

    - voffset_sigma (float) – Standard deviation of Gaussian filter when searching for offset.

    - rseries (float) – Series resistance in experimental measurement system, in units [ohms].

    - i_multiplier (float) – Multiply the imported current by this value.

    - v_multiplier (float) – Multiply the imported voltage by this value.

    - ifdata_vmax (float) – Maximum IF voltage to import.

    - ifdata_npts (int) – Number of points for interpolation.

    - filter_data (bool) – Filter data

    - vgap_guess (float) – Guess of gap voltage. Used to temporarily normalize while filtering. Given in units [V].

    - igap_guess (float) – Guess of gap current. Used to temporarily normalize while filtering. Given in units [A].

    - filter_theta (float) – Angle by which to the rotate data while filtering. Given in radians.

    - filter_nwind (int) – Window size for Savitsky-Golay filter.

    - filter_npoly (int) – Order of Savitsky-Golay filter.

    - ifdata_sigma (float) – Standard deviation of Gaussian used for filtering, in units [V]

    - analyze_iv (bool) – Analyze I-V data?

    - analyze_if (bool) – Analyze IF data?

    - area (float) – Area of the junction in um^2.

    - freq (float) – Frequency of LO signal.

    - cut_low (float) – only fit over first photon step, start at Vgap - vph + vph * cut_low

    - cut_high – only fit over first photon step, finish at Vgap - vph * cut_high

    - remb_range (tuple) – range of embedding resistances to check, normalized to the normal-state resistance

    - xemb_range (tuple) – range of embedding reactances to check, normalized to the normal-state resistance

    - alpha_max (float) – Maximum drive level.

    - num_b (int) – Summation limits for Bessel functions.

    - t_cold (float) – Temperature of cold blackbody load.

    - t_hot (float) – Temperature of hot blackbody load.

    - vmax_plot (float) – Maximum bias voltage for plots.

    - comment (str) – Comment to describe this instance.

    - verbose (bool) – Print to terminal.

  plot_all(fig_folder, file_struc=None, **kw)

    Plot all pumped data and save to specified directory.

    This method will call the following methods: `plot_iv`, `plot_ivif`, `plot_error_surface`, `plot_simulated`, `plot_simulated`, `plot_noise_temp`, and `plot_gain_noise_temp`.

    The plots generated by the different methods will be placed in different sub-directories. This is set by the `file_struc` argument. This argument is a dictionary with the following keys: `'Pumped IV data'`, `'IF data'`, `'Impedance recovery'`, and `'Noise temperature'`. Set `file_struc` to an empty string (“”) if you want all the figures to go into `fig_folder`.

    Parameters:

      - fig_folder (str) – folder where the figures go

      - file_struc (dict) – dictionary listing all the sub-folders

      - kw – keyword arguments that will be passed to the plotting methods

  plot_error_surface(fig_name=None, ax=None)

    Plot error surface (from impedance recovery).

    Note: If `fig_name` is provided, this method will save the plot to the specified folder and then close the plot. This means that the Matplotlib axis object will not be returned in this case. This is done to prevent too many plots from being open at the time.

    Parameters:

      - fig_name – figure filename

      - ax – Matplotlib axis

  plot_gain(fig_name=None, ax=None, vmax_plot=4.0)

    Plot gain.

    Note: If `fig_name` is provided, this method will save the plot to the specified folder and then close the plot. This means that the Matplotlib axis object will not be returned in this case. This is done to prevent too many plots from being open at the time.

    Parameters:

      - fig_name – figure filename

      - ax – Matplotlib axis

      - vmax_plot – max voltage to include in plot (in mV)

  plot_gain_noise_temp(fig_name=None, ax=None, vmax_plot=4.0)

    Plot gain and noise temperature.

    Note: If `fig_name` is provided, this method will save the plot to the specified folder and then close the plot. This means that the Matplotlib axis object will not be returned in this case. This is done to prevent too many plots from being open at the time.

    Parameters:

      - fig_name – figure filename

      - ax – Matplotlib axis

      - vmax_plot – max voltage to include in plot (in mV)

  plot_if(fig_name=None, ax=None, vmax_plot=4.0)

    Plot IF power from hot and cold loads.

    Note: If `fig_name` is provided, this method will save the plot to the specified folder and then close the plot. This means that the Matplotlib axis object will not be returned in this case. This is done to prevent too many plots from being open at the time.

    Parameters:

      - fig_name – figure filename

      - ax – Matplotlib axis

      - vmax_plot – max voltage to include in plot (in mV)

  plot_if_noise(fig_name=None, ax=None)

    Plot IF noise.

    Note: If `fig_name` is provided, this method will save the plot to the specified folder and then close the plot. This means that the Matplotlib axis object will not be returned in this case. This is done to prevent too many plots from being open at the time.

    Parameters:

      - fig_name – figure filename

      - ax – Matplotlib axis (should be tuple with two axes)

  plot_iv(fig_name=None, ax=None, vmax_plot=4.0)

    Plot pumped I-V curve.

    Note: If `fig_name` is provided, this method will save the plot to the specified folder and then close the plot. This means that the Matplotlib axis object will not be returned in this case. This is done to prevent too many plots from being open at the time.

    Parameters:

      - fig_name – figure filename

      - ax – Matplotlib axis

      - vmax_plot – max voltage to include in plot (in mV)

  plot_ivif(fig_name=None, ax=None, vmax_plot=4.0)

    Plot IV and IF data on same plot.

    Note: If `fig_name` is provided, this method will save the plot to the specified folder and then close the plot. This means that the Matplotlib axis object will not be returned in this case. This is done to prevent too many plots from being open at the time.

    Parameters:

      - fig_name – figure filename

      - ax – Matplotlib axis (should be tuple with two axes)

      - vmax_plot – max voltage to include in plot (in mV)

  plot_noise_temp(fig_name=None, ax=None, vmax_plot=4.0)

    Plot noise temperature.

    Note: If `fig_name` is provided, this method will save the plot to the specified folder and then close the plot. This means that the Matplotlib axis object will not be returned in this case. This is done to prevent too many plots from being open at the time.

    Parameters:

      - fig_name – figure filename

      - ax – Matplotlib axis (should be tuple with two axes)

      - vmax_plot – max voltage to include in plot (in mV)

  plot_rdyn(fig_name=None, ax=None, vmax_plot=4.0)

    Plot dynamic resistance.

    Note: If `fig_name` is provided, this method will save the plot to the specified folder and then close the plot. This means that the Matplotlib axis object will not be returned in this case. This is done to prevent too many plots from being open at the time.

    Parameters:

      - fig_name – figure filename

      - ax – Matplotlib axis

      - vmax_plot – max voltage to include in plot (in mV)

  plot_shapiro(fig_name=None, ax=None)

    Plot Shapiro steps.

    Note: If `fig_name` is provided, this method will save the plot to the specified folder and then close the plot. This means that the Matplotlib axis object will not be returned in this case. This is done to prevent too many plots from being open at the time.

    Parameters:

      - fig_name – figure filename

      - ax – Matplotlib axis

  plot_simulated(fig_name=None, ax=None, vmax_plot=4.0)

    Plot simulated I-V curve (from impedance recovery).

    Note: If `fig_name` is provided, this method will save the plot to the specified folder and then close the plot. This means that the Matplotlib axis object will not be returned in this case. This is done to prevent too many plots from being open at the time.

    Parameters:

      - fig_name – figure filename

      - ax – Matplotlib axis

      - vmax_plot – max voltage to include in plot (in mV)

  plot_yfac_noise_temp(fig_name=None, ax=None, vmax_plot=4.0)

    Plot Y-factor and noise temperature.

    Note: If `fig_name` is provided, this method will save the plot to the specified folder and then close the plot. This means that the Matplotlib axis object will not be returned in this case. This is done to prevent too many plots from being open at the time.

    Parameters:

      - fig_name – figure filename

      - ax – Matplotlib axis

      - vmax_plot – max voltage to include in plot (in mV)

class qmix.exp.exp_data.RawData0(dciv, dcif=None, **kw)

  Bases: `object`

  Class for importing and analyzing experimental DC data (with no LO).

  Note

  Experimental data can be passed to this class either in the form of CSV data files or Numpy arrays. In both cases, the data should have two columns: the first for voltage, and the second for current or IF power, depending on the file type.

  For CSV files, you can define the delimiter using the keyword argument `delimiter=','`, the number of rows to skip for the header using `skip_header=1`, and which columns to import using `usecols=(0,1)`. Take a look at the data in `QMix/notebooks/eg-230-data/` for an example. Also, take a look at `QMix/notebooks/analyze-experimental-data.ipynb` for an example of how to use this module.

  See `qmix.exp.parameters.params` for all possible keyword arguments. These parameters control how the data is imported and analyzed.

  Parameters:

    - dciv – DC I-V curve. Either a CSV data file or a Numpy array. The data should have two columns: the first for voltage, and the second for current. If you are using CSV files, the properties of the CSV file can be set through additional keyword arguments (see below).

    - dcif – DC IF data. Either a CSV data file or a Numpy array. The data should have two columns: the first for voltage, and the second for IF power. If you are using CSV files, the properties of the CSV file can be set through additional keyword arguments (see below).

  Keyword Arguments:

    - delimiter (str) – Delimiter for CSV files.

    - usecols (tuple) – List of columns to import (tuple of length 2).

    - skip_header (int) – Number of rows to skip, used to skip the header.

    - v_fmt (str) – Units for voltage (‘uV’, ‘mV’, or ‘V’).

    - i_fmt (str) – Units for current (‘uA’, ‘mA’, or ‘A’).

    - vmax (float) – Maximum voltage to import in units [V].

    - npts (int) – Number of points to have in I-V interpolation.

    - debug (bool) – Plot each step of the I-V processing procedure.

    - voffset (float) – Voltage offset, in units [V].

    - ioffset (float) – Current offset, in units [A].

    - voffset_range (float) – Voltage range over which to search for offset, in units [V].

    - voffset_sigma (float) – Standard deviation of Gaussian filter when searching for offset.

    - rseries (float) – Series resistance in experimental measurement system, in units [ohms].

    - i_multiplier (float) – Multiply the imported current by this value.

    - v_multiplier (float) – Multiply the imported voltage by this value.

    - ifdata_vmax (float) – Maximum IF voltage to import.

    - ifdata_npts (int) – Number of points for interpolation.

    - filter_data (bool) – Filter data

    - vgap_guess (float) – Guess of gap voltage. Used to temporarily normalize while filtering. Given in units [V].

    - igap_guess (float) – Guess of gap current. Used to temporarily normalize while filtering. Given in units [A].

    - filter_theta (float) – Angle by which to the rotate data while filtering. Given in radians.

    - filter_nwind (int) – Window size for Savitsky-Golay filter.

    - filter_npoly (int) – Order of Savitsky-Golay filter.

    - ifdata_sigma (float) – Standard deviation of Gaussian used for filtering, in units [V]

    - area (float) – Area of the junction in um^2.

    - vgap_threshold (float) – The current to measure the gap voltage at.

    - rn_vmin (float) – Lower voltage range to determine the normal resistance

    - rn_vmax (float) – Upper voltage range to determine the normal resistance

    - vrsg (float) – The voltage at which to calculate the subgap resistance.

    - vleak (float) – The voltage at which to calculate the subgap leakage current.

    - vshot (list) – Voltage range over which to fit shot noise slope, in units [V]. Can be a list of lists to define multiple ranges.

    - comment (str) – Comment to describe this instance.

    - verbose (bool) – Print to terminal.

  plot_all(fig_folder, sub_folder=None, **kw)

    Plot all DC data and save it to a specified directory.

    This method will call the following methods: `plot_dciv`, `plot_offset`, `plot_rdyn` and `plot_if_noise`.

    These figures will be put in `fig_folder/sub_folder`. Note that if `sub_folder` is left as `None`, this method will use the default file structure (see `qmix.exp.exp_data._file_structure`). If you would instead like the figures to go into `fig_folder`, set this argument as an empty string (“”).

    Parameters:

      - fig_folder (str) – directory where the figures go

      - sub_folder (str) – sub-directory where the DC I-V figures go

      - kw – keyword arguments that will be passed to the plotting methods

  plot_dciv(fig_name=None, ax=None, vmax_plot=4.0, **kw)

    Plot DC I-V curve.

    Some additional labels will be added as well, including normal-state resistance, subgap resistance, gap voltage, and gap current.

    Note: If `fig_name` is provided, this method will save the plot to the specified folder and then close the plot. This means that the Matplotlib axis object will not be returned in this case. This is done to prevent too many plots from being open at the time.

    Parameters:

      - fig_name (str) – figure filename

      - ax – Matplotlib axis

      - vmax_plot (float) – max voltage to include in plot (in mV)

      - kw – keyword arguments (not used)

  plot_if_noise(fig_name=None, ax=None, **kw)

    Plot IF noise.

    The IF noise is calculated from the slope of the shot noise.

    Note: If `fig_name` is provided, this method will save the plot to the specified folder and then close the plot. This means that the Matplotlib axis object will not be returned in this case. This is done to prevent too many plots from being open at the time.

    Parameters:

      - fig_name – figure filename

      - ax – Matplotlib axis (should be tuple with two axes)

      - kw (dict) – keyword arguments (not used)

  plot_offset(fig_name=None, ax=None, **kw)

    Plot DC I-V curve at the origin to see if there is an offset.

    Note: If `fig_name` is provided, this method will save the plot to the specified folder and then close the plot. This means that the Matplotlib axis object will not be returned in this case. This is done to prevent too many plots from being open at the time.

    Parameters:

      - fig_name (str) – figure filename

      - ax – Matplotlib axis

      - kw – keyword arguments (not used)

  plot_rdyn(fig_name=None, ax=None, vmax_plot=4.0, **kw)

    Plot dynamic resistance of the DC I-V curve.

    The dynamic resistance is the derivative of the I-V data, inverted to get resistance.

    Note: If `fig_name` is provided, this method will save the plot to the specified folder and then close the plot. This means that the Matplotlib axis object will not be returned in this case. This is done to prevent too many plots from being open at the time.

    Parameters:

      - fig_name – figure filename

      - ax – Matplotlib axis

      - vmax_plot – max voltage to include in plot (in mV)

      - kw (dict) – keyword arguments (not used)

  plot_rstat(fig_name=None, ax=None, vmax_plot=4.0, **kw)

    Plot static resistance of DC I-V data.

    The static resistance is the DC voltage divided by the DC current.

    Note: If `fig_name` is provided, this method will save the plot to the specified folder and then close the plot. This means that the Matplotlib axis object will not be returned in this case. This is done to prevent too many plots from being open at the time.

    Parameters:

      - fig_name – figure filename

      - ax – Matplotlib axis

      - vmax_plot – max voltage to include in plot (in mV)

      - kw (dict) – keyword arguments (not used)

  print_info()

    Print information about the DC I-V curve.

    This method is deprecated. Just use `print(dciv)` instead, assuming that `dciv` is an instance of this class.

qmix.exp.exp_data.initialize_dir(fig_folder)

  Initialize a new directory for storing results.

  If you use either

  Parameters:

    fig_folder – desired location

qmix.exp.exp_data.plot_if_spectrum(data_folder, fig_folder=None, figsize=None)

  Plot all IF spectra within data_folder.

  Parameters:

    - data_folder – data folder

    - fig_folder – figure folder

    - figsize – figure size, in inches

qmix.exp.exp_data.plot_overall_results(dciv, data_list, fig_folder, vmax_plot=4.0, figsize=None, tn_max=None, f_range=None)

  Plot all results.

  This function is somewhat messy, but it will take in a list of RawData class instances, and plot the overall figures of merit (e.g., noise temperature vs LO frequency).

  Parameters:

    - dciv – DC I-V data (instance of RawData0)

    - data_list – list of pumped data (instances of RawData)

    - fig_folder – figure destination

## 2.1.1.4. qmix.exp.if_data module

This sub-module contains functions for importing and analyzing experimental IF power measurements.

The “IF data” is the IF output power from the SIS device versus bias voltage. The term “DC IF data” is used for IF power with no LO injection, and “IF data” is used for IF power with LO injection.

Note

The IF data is expected either in the form of a CSV file or a Numpy array. Either way the data should have two columns: the first for voltage and the second for current.

class qmix.exp.if_data.DCIFData(if_noise, corr, if_fit, shot_slope, vmax)

  Bases: `tuple`

  Struct for DC IF metadata.

  Parameters:

    - if_noise (float) – IF noise in units K, derived from the shot noise.

    - corr (float) – The correction required to transform the measured IF power (measured in arbitrary units, A.U.) to units K.

    - if_fit (bool) – Is the estimated IF noise a reasonable value?

    - shot_slope (float) – The slope of the line fit to the shot noise.

    - vmax (float) – Maximum bias voltage, in units V.

  corr

    Alias for field number 1

  if_fit

    Alias for field number 2

  if_noise

    Alias for field number 0

  shot_slope

    Alias for field number 3

  vmax

    Alias for field number 4

qmix.exp.if_data.dcif_data(ifdata, dc, **kwargs)

  Analyze DC IF measurements.

  This is the IF data that is measured with no LO present. This data is used to analyze the shot noise, which can then be used to convert the IF data into units ‘K’ and estimate the IF noise component.

  Parameters:

    - ifdata – IF data. Either a CSV data file or a Numpy array. The data should have two columns: the first for voltage, and the second for IF power. If you are passing a CSV file, the properties of the CSV file can be set through additional keyword arguments (see below).

    - dc (qmix.exp.iv_data.DCIVData) – DC I-V metadata.

  Keyword Arguments:

    - delimiter (str) – Delimiter for CSV files.

    - usecols (tuple) – List of columns to import (tuple of length 2).

    - skip_header (int) – Number of rows to skip, used to skip the header.

    - v_fmt (str) – Units for voltage (‘uV’, ‘mV’, or ‘V’).

    - i_fmt (str) – Units for current (‘uA’, ‘mA’, or ‘A’).

    - rseries (float) – Series resistance in experimental measurement system, in units [ohms].

    - v_multiplier (float) – Multiply the imported voltage by this value.

    - ifdata_npts (int) – Number of points for interpolation.

    - ifdata_sigma (float) – Standard deviation of Gaussian used for filtering, in units [V]

    - vshot (list) – Voltage range over which to fit shot noise slope, in units [V]. Can be a list of lists to define multiple ranges.

    - verbose (bool) – Print to terminal.

  Returns:

    DC IF data, IF noise contribution, A.U. to K correction factor,

      shot noise slope data, good fit to IF noise?

  Return type:

    tuple

qmix.exp.if_data.if_data(if_hot, if_cold, dc, **kwargs)

  Analyze IF measurements from a hot/cold load experiment.

  Parameters:

    - if_hot – Hot IF data. Either a CSV data file or a Numpy array. The data should have two columns: the first for voltage, and the second for IF power.

    - if_cold – Cold IF data. Either a CSV data file or a Numpy array. The data should have two columns: the first for voltage, and the second for IF power.

    - dc (qmix.exp.iv_data.DCIVData) – DC I-V metadata.

  Keyword Arguments:

    - delimiter (str) – Delimiter for CSV files.

    - usecols (tuple) – List of columns to import (tuple of length 2).

    - skip_header (int) – Number of rows to skip, used to skip the header.

    - v_fmt (str) – Units for voltage (‘uV’, ‘mV’, or ‘V’).

    - i_fmt (str) – Units for current (‘uA’, ‘mA’, or ‘A’).

    - rseries (float) – Series resistance in experimental measurement system, in units [ohms].

    - v_multiplier (float) – Multiply the imported voltage by this value.

    - ifdata_max (float) – Maximum IF voltage to import.

    - ifdata_npts (int) – Number of points for interpolation.

    - ifdata_sigma (float) – Standard deviation of Gaussian used for filtering, in units [V]

    - t_cold (float) – Temperature of cold blackbody load.

    - t_hot (float) – Temperature of hot blackbody load.

    - vbest (float) – Bias voltage for best results (best temperature and gain).

    - verbose (bool) – Print to terminal.

  Returns:

    Hot IF data, Cold IF data, Noise temperature, Gain, Index of

      best noise temperature, IF noise contribution, Good fit to IF noise?, shot noise slope

  Return type:

    tuple

## 2.1.1.5. qmix.exp.iv_data module

This sub-module contains functions for importing and analyzing experimental current-voltage (I-V) data.

“I-V data” is the DC tunneling current versus DC bias voltage that is measured from an SIS junction. In general, the term “DC I-V data” is used for I-V data that is collected with no local-oscillator (LO) injection, and “I-V data” is used for I-V data that is collected with LO injection (also known as the “pumped I-V curve”).

Note

The I-V data is expected either in the form of a CSV file or a Numpy array. Either way the data should have two columns: the first for voltage and the second for current.

class qmix.exp.iv_data.DCIVData(vraw, iraw, vnorm, inorm, vgap, igap, fgap, rn, rsg, offset, vint, rseries)

  Bases: `tuple`

  Struct for DC I-V curve metadata.

  Parameters:

    - vraw (ndarray) – DC bias voltage in units [V]. This data has been filtered and the offset has been corrected.

    - iraw (ndarray) – DC tunneling current in units [A]. This data has been filtered and the offset has been corrected.

    - vnorm (ndarray) – DC bias voltage, normalized to the gap voltage.

    - inorm (ndarray) – DC tunneling current, normalized to the gap current.

    - vgap (float) – Gap voltage in units [V].

    - igap (flaot) – Gap current in units [A].

    - fgap (float) – Gap frequency in units [Hz].

    - rn (float) – Normal-state resistance in units [ohms].

    - rsg (float) – Sub-gap resistance in units [ohms].

    - offset (tuple) – Voltage and current offset in the raw measured data, in units [V] and [A], respectively.

    - vint (float) – If you fit a line to the normal-state resistance (i.e., the DC I-V curve above the gap), the line will intercept the x-axis at `vint`. This is given in units [V].

    - rseries (float) – The series resistance to remove from the I-V data. Given in units [ohms].

  fgap

    Alias for field number 6

  igap

    Alias for field number 5

  inorm

    Alias for field number 3

  iraw

    Alias for field number 1

  offset

    Alias for field number 9

  rn

    Alias for field number 7

  rseries

    Alias for field number 11

  rsg

    Alias for field number 8

  vgap

    Alias for field number 4

  vint

    Alias for field number 10

  vnorm

    Alias for field number 2

  vraw

    Alias for field number 0

qmix.exp.iv_data.dciv_curve(ivdata, **kwargs)

  Import and analyze DC I-V data (a.k.a., the unpumped I-V curve).

  Parameters:

    ivdata – DC I-V data. Either a CSV data file or a Numpy array. The data should have two columns: the first for voltage, and the second for current. If you are using CSV files, the properties of the CSV file can be set through additional keyword arguments. (See below).

  Keyword Arguments:

    - delimiter (str) – Delimiter for CSV files.

    - usecols (tuple) – List of columns to import (tuple of length 2).

    - skip_header (int) – Number of rows to skip, used to skip the header.

    - v_fmt (str) – Units for voltage (‘uV’, ‘mV’, or ‘V’).

    - i_fmt (str) – Units for current (‘uA’, ‘mA’, or ‘A’).

    - vmax (float) – Maximum voltage to import in units [V].

    - npts (int) – Number of points to have in I-V interpolation.

    - debug (bool) – Plot each step of the I-V processing procedure.

    - voffset (float) – Voltage offset, in units [V].

    - ioffset (float) – Current offset, in units [A].

    - voffset_range (list) – Voltage range over which to search for offset, in units [V].

    - voffset_sigma (float) – Standard deviation of Gaussian filter when searching for offset.

    - rseries (float) – Series resistance in experimental measurement system, in units [ohms].

    - i_multiplier (float) – Multiply the imported current by this value.

    - v_multiplier (float) – Multiply the imported voltage by this value.

    - filter_data (bool) – Filter data

    - vgap_guess (float) – Guess of gap voltage. Used to temporarily normalize while filtering. Given in units [V].

    - igap_guess (float) – Guess of gap current. Used to temporarily normalize while filtering. Given in units [A].

    - filter_theta (float) – Angle by which to the rotate data while filtering. Given in radians.

    - filter_nwind (int) – Window size for Savitsky-Golay filter.

    - filter_npoly (int) – Order of Savitsky-Golay filter.

    - vgap_threshold (float) – The current to measure the gap voltage at.

    - vrn (list) – Voltage range over which to calculate the normal resistance, in units [V]

    - rn_vmin (float) – Lower voltage range to determine the normal resistance, in units [V] (DEPRECATED)

    - rn_vmax (float) – Upper voltage range to determine the normal resistance, in units [V] (DEPRECATED)

    - vrsg (float) – The voltage at which to calculate the subgap resistance.

    - vleak (float) – The voltage at which to calculate the subgap leakage current.

  Returns:

    normalized voltage, normalized current, DC I-V metadata

  Return type:

    tuple

qmix.exp.iv_data.iv_curve(ivdata, dc, **kwargs)

  Load and analyze pumped I-V curve data.

  Parameters:

    - ivdata – I-V data. Either a CSV data file or a Numpy array. The data should have two columns: the first for voltage, and the second for current. If you are using a CSV file, the properties of the CSV file can be set through additional keyword arguments (see below).

    - dc (qmix.exp.iv_data.DCIVData) – DC I-V data metadata. Generated previously by `dciv_curve`.

  Keyword Arguments:

    - delimiter (str) – Delimiter for CSV files.

    - usecols (tuple) – List of columns to import (tuple of length 2).

    - skip_header (int) – Number of rows to skip, used to skip the header.

    - v_fmt (str) – Units for voltage (‘uV’, ‘mV’, or ‘V’).

    - i_fmt (str) – Units for current (‘uA’, ‘mA’, or ‘A’).

    - vmax (float) – Maximum voltage to import in units [V].

    - npts (int) – Number of points to have in I-V interpolation.

    - debug (bool) – Plot each step of the I-V processing procedure.

    - voffset (float) – Voltage offset, in units [V].

    - ioffset (float) – Current offset, in units [A].

    - voffset_range (list) – Voltage range over which to search for offset, in units [V].

    - voffset_sigma (float) – Standard deviation of Gaussian filter when searching for offset.

    - rseries (float) – Series resistance in experimental measurement system, in units [ohms].

    - i_multiplier (float) – Multiply the imported current by this value.

    - v_multiplier (float) – Multiply the imported voltage by this value.

    - filter_data (bool) – Filter data

    - vgap_guess (float) – Guess of gap voltage. Used to temporarily normalize while filtering. Given in units [V].

    - igap_guess (float) – Guess of gap current. Used to temporarily normalize while filtering. Given in units [A].

    - filter_theta (float) – Angle by which to the rotate data while filtering. Given in radians.

    - filter_nwind (int) – Window size for Savitsky-Golay filter.

    - filter_npoly (int) – Order of Savitsky-Golay filter.

  Returns:

    normalized voltage, normalized current

  Return type:

    tuple

## 2.1.1.6. qmix.exp.parameters module

This module contains a dictionary of parameters (`params`) that is used by `qmix.exp.RawData` and `qmix.exp.RawData0` to control how experimental data is loaded and analyzed.

Note

This dictionary just contains the default values. You can overwrite these values by passing keyword arguments to `RawData` or `RawData0`. For example, the default value for voltage units is millivolts (`"mV"`). You can change this parameter to be microvolts (`"uV"`) by passing `v_fmt="uV"` to `RawData` or `RawData0`.

Also note that experimental data can be passed to `RawData0` and `RawData` either as CSV data files or as Numpy arrays. In both cases, the data should have two columns: one for voltage and one for current or IF power, depending on the file. See Example #3 on the QMix website for more information.

All of the different parameters are described below along with their default values.

Parameters:

> - CSV files:

>     - Note: If you are using CSV files, these parameters control how the data is loaded from the CSV files.

>     - `delimiter = ","` : The delimiter used by the CSV data files.

>     - `usecols = (0,1)` : Which columns to import from the CSV data files.

>     - `skip_header = 1` : Number of rows to skip at the beginning CSV data files. (Used to skip the header.)

> - Units:

>     - `v_fmt = "mV"` : Units for imported voltage data. The options are: `"uV"`, `"mV"` and `"V"`.

>     - `i_fmt = "mA"` : Units for imported current data. The options are: `"uA"`, `"mA"` and `"A"`.

> - Importing I-V data:

>     - `vmax = 6e-3` : Maximum voltage to import in units [V]. Used in case the current is saturated beyond some bias voltage.

>     - `npts = 6001` : Number of points to use in the I-V data interpolation.

>     - `debug = False` : If set to `True`, this will plot each step of the I-V data loading and analysis procedure. Note: This will display 4 individual plots for each I-V curve that is loaded, so do not use this if you are looping through multiple files.

> - Correcting voltage/current offsets:

>     - Note: Sometimes there is an offset in the I-V data. The parameters below can be used to correct this. If you know the current and voltage offset, you can define `ioffset` and `voffset`, respectively. Otherwise, `RawData0` will attempt to find the offset on its own. This is done by taking the derivative of the DC I-V curve, and then finding the maximum derivative value between `voffset_range[0]` and `voffset_range[1]`.

>     - `ioffset = None` : Offset of the DC tunneling current data in units [A].

>     - `voffset = None` : Offset of the DC bias voltage data in units [V].

>     - `voffset_range = (-3e-4, 3e-4)` : Voltage range over which to look for the voltage offset in units [V]. The `RawData0` class will look from `voffset_range[0]` to `+voffset_range[1]` for the voltage offset.

>     - `voffset_sigma = 1e-5` : When looking for the voltage offset, smooth the derivative of the DC I-V curve by convolving data with a Gaussian distribution with this standard deviation.

> - Correcting experimental I-V data:

>     - `rseries = None` : Correct for a series resistance in the DC measurement system using this resistance in units [ohms]. Leave as `None` if there is no series resistance.

>     - `i_multiplier = 1.` : Multiply the imported I-V current by this number. Used to correct for errors in the I-V readout.

>     - `v_multiplier = 1.` : Multiply the imported I-V voltage by this number. Used to correct for errors in the I-V readout.

> - Filtering I-V data:

>     - Note: When I-V data is loaded, it is normalized, rotated 45 degrees, filtered using a Savitzky-Golay filter, and then rotated back. (The rotation allows for good filtering without smearing the transition.) The parameters below control this process.

>     - `filter_data = True` : Filter the I-V data?

>     - `filter_theta = 0.785` : Angle by which to rotate the DC I-V curve before filtering (in radians).

>     - `filter_nwind = 21` : Width of the Savitzky-Golay filter.

>     - `filter_npoly = 3` : Order of the Savitzky-Golay filter.

> - Analyzing the DC I-V curve:

>     - `vgap_threshold = 105e-6` : Threshold current, in units [A], at which to measure the gap voltage. (Note: the gap voltage is defined here as the voltage at which the DC I-V curve crosses this current value.)

>     - `vrn = (3.5e-3, 4.5e-3)` : Voltage range over which to calculate the normal-state resistance, in units [V].

>     - `vrsg = 2e-3` : Voltage at which to measure the subgap resistance, in units [V].

>     - `vleak = 2e-3` : Voltage at which to measure the leakage current, in units [V].

> - Analyzing pumped I-V data:

>     - `analyze_iv = True` : Analyze the pumped I-V data? This involves a procedure to recover the embedding circuit.

>     - `fit_range = (0.25, 0.8)` : Fit interval for impedance recovery, normalized to the width of the first photon step. For example, with `(0.25, 0.8)`, the impedance recovery procedure will not consider the first 25% of the first step or the last 20%. It will only use the bias voltages between 25% and 80%. This is used to select only the middle of the step.

>     - `remb_range = (0, 1)` : Range of embedding resistances to test, normalized to the normal resistance.

>     - `xemb_range = (-1, 1)` : Range of embedding reactances to test, normalized to the normal resistance.

>     - `zemb = None` : During impedance recovery, force the embedding impedance to be this value (normalized).

>     - `alpha_max = 1.5` : Initial guess for the drive level (alpha) during impedance recovery.

>     - `num_b = 20` : Maximum number of Bessel functions to include when calculating the tunneling currents.

> - Importing IF data:

>     - `ifdata_npts = 3000` : Number of points to use when interpolating IF data.

> - Filtering IF data:

>     - `ifdata_sigma = 1e-5` : Smooth the measured IF power data by convolving it with a Gaussian distribution. This is the standard deviation, in units [V].

> - Analyzing the DC IF data:

>     - Note: DC IF data (IF power with no LO injection) is used to measure the IF noise contribution and convert the power units into units of temperature [K]. This is done by fitting a linear trend to the shot noise present in the DC IF data.

>     - `vshot = None` : Voltage range over which to fit the shot noise slope, in units [V]. Can be a list of lists to define multiple ranges. For example, to fit the shot noise slope from 4-5 mV and from 6-7 mV, you would pass `vshot=((4e-3, 5e-3), (6e-3, 7e-3))`. You can break it up this way in case there are Josephson effects present in the IF power data.

> - Analyzing pumped IF data (noise temperature analysis):

>     - `analyze_if = True` : Analyze the IF data? This involves calculating the noise temperature and gain.

>     - `t_cold = 78.` : Temperature of the cold load (likely liquid nitrogen), in units [K].

>     - `t_hot = 293.` : Temperature of the hot load (likely room temperature), in units [K].

>     - `vbest = None` : Bias voltage at which to calculate the best noise temperature value. If this value is set to `None`, the `RawData` class will determine the best bias voltage automatically.

>     - `best_pt = 'Max Gain'` : Which bias voltage should we select as the best bias? Where the gain is the highest (`'Max Gain'`)? Or the lowest noise temperature (`'Min Tn'`)?

> - IF response:

>     - `ifresp_delimiter = '\t'` : Delimiter for IF spectrum files.

>     - `ifresp_usecols = (0, 1, 2)` : Columns to import from IF spectrum files. The first column should be the frequency, the second should be the IF power from the hot load, and the third should be the IF power from the cold load.

>     - `ifresp_skipheader = 1` : Number of rows to skip at the beginning of the IF spectrum file.

>     - `ifresp_maxtn = 1e6` : Maximum noise temperature. All values above this value will be set to `ifresp_maxtn`.

> - Response function:

>     - Note: The `RawData0` class generates a response function based on the imported DC I-V data (using `qmix.respfn.RespFn`). It also generates a second response function that is slightly smeared. This smeared response function is useful for simulations because it simulates a small amount of heating.

>     - `v_smear = 0.020` : Voltage smear of the “smeared” response function.

> - Plotting parameters:

>     - `vmax_plot = 4.0` : Maximum bias voltage for plots, in units [mV].

> - Junction properties:

>     - `area = 1.5` : Area of the SIS junction in units [um^2].

> - Local-oscillator (LO) signal:

>     - `freq = None` : Frequency of the local-oscillator signal in units [GHz].

> - Miscellaneous:

>     - `comment = ""` : Add a comment to describe this instance.

>     - `verbose = True` : Print information to the terminal.

qmix.exp.parameters.params = {'alpha_max': 1.5, 'analyze': True, 'analyze_if': True, 'analyze_iv': True, 'area': 1.5, 'best_pt': 'Max Gain', 'comment': '', 'debug': False, 'delimiter': ',', 'filter_data': True, 'filter_npoly': 3, 'filter_nwind': 21, 'filter_theta': 0.785, 'fit_range': (0.25, 0.8), 'freq': None, 'i_fmt': 'mA', 'i_multiplier': 1.0, 'ifdata_npts': 3000, 'ifdata_sigma': 1e-05, 'ifresp_delimiter': '\t', 'ifresp_maxtn': 1000000.0, 'ifresp_skipheader': 1, 'ifresp_usecols': (0, 1, 2), 'ioffset': None, 'npts': 6001, 'num_b': 20, 'remb_range': (0, 1), 'rseries': None, 'skip_header': 1, 't_cold': 78.0, 't_hot': 293.0, 'usecols': (0, 1), 'v_fmt': 'mV', 'v_multiplier': 1.0, 'v_smear': 0.02, 'vbest': None, 'verbose': True, 'vgap_threshold': 0.000105, 'vleak': 0.002, 'vmax': 0.006, 'vmax_plot': 4.0, 'voffset': None, 'voffset_range': (-0.0003, 0.0003), 'voffset_sigma': 1e-05, 'vrn': (0.0035, 0.0045), 'vrsg': 0.002, 'vshot': None, 'xemb_range': (-1, 1), 'zemb': None}

  Default parameters for importing experimental data.

## 2.1.1.7. Module contents

This sub-package contains functions for importing and analyzing experimental data.