{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# QCoDeS example with Keithley 3706A System Switch" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This is the example notebook that presents the features of the QCoDeS driver for Keithley 3706A-SNFP System Switch with 3730 6x16 High Density Matrix. The model 3706A-SNFP has no DMM capabilities. However, users who are in possession of models with DMM capabilities can use the present driver for switch operations." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Basic Operation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let us, first, import QCoDeS driver for the Keithley System Switch:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import qcodes as qc\n", "from qcodes.instrument_drivers.Keithley import Keithley3706A" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now, we create a station to hold our instrument:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "station = qc.Station()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We finalize the initialization of the instrument by instantiation and then adding it to the station:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Connected to: KEITHLEY INSTRUMENTS INC. 3706A-SNFP SYSTEM SWITCH (serial:04447336, firmware:01.56a)\n", "Slot 1- Model:3730, Matrix Type:6x16 High Density Matrix, Firmware:01.40h, Serial:4447332\n", "Slot 2- Model:3730, Matrix Type:6x16 High Density Matrix, Firmware:01.40h, Serial:4398982\n", "Slot 3- Model:3730, Matrix Type:6x16 High Density Matrix, Firmware:01.40h, Serial:4447333\n", "Interlock is disengaged in Slot 1.\n", "Interlock is disengaged in Slot 2.\n", "Interlock is disengaged in Slot 3.\n" ] }, { "data": { "text/plain": [ "'smatrix'" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix = Keithley3706A(\"smatrix\", address=\"USB0::0x05E6::0x3706::04447336::INSTR\")\n", "station.add_component(smatrix)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here, the driver not only shows information about the hardware specifications we have, but also reminds us about the interlocks. The channel relays can continue to operate even if the interlock in the corresponding slot is disengaged, however, one cannot perform measurements through the switching card, as the analog backplanes cannot be energized. Specific warnings shall be issued in related function calls as well. Now, let us continue to examine the properties of our instrument via its snapshot:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "smatrix:\n", "\tparameter value\n", "--------------------------------------------------------------------------------\n", "IDN :\t{'vendor': 'KEITHLEY INSTRUMENTS INC.', 'model': '3706...\n", "channel_connect_rule :\tBREAK_BEFORE_MAKE \n", "gpib_address :\t12 \n", "gpib_enabled :\tTrue \n", "lan_enabled :\tTrue \n", "timeout :\t5 (s)\n" ] } ], "source": [ "smatrix.print_readable_snapshot()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Connection types" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "System switch can be connected to a setup through USB, LAN as well as GPIB. Depending on the needs, one can enable (disable) LAN and/or GPIB connections." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "smatrix.gpib_enabled(False)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "smatrix.lan_enabled(False)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "smatrix:\n", "\tparameter value\n", "--------------------------------------------------------------------------------\n", "IDN :\t{'vendor': 'KEITHLEY INSTRUMENTS INC.', 'model': '3706...\n", "channel_connect_rule :\tBREAK_BEFORE_MAKE \n", "gpib_address :\t12 \n", "gpib_enabled :\tFalse \n", "lan_enabled :\tFalse \n", "timeout :\t5 (s)\n" ] } ], "source": [ "smatrix.print_readable_snapshot()" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "smatrix.gpib_enabled(True)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "smatrix.lan_enabled(True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "GPIB connection address can be changed at will. An integer value in between `1` and `30` can be assigned via:" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "smatrix.gpib_address(12)" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "smatrix:\n", "\tparameter value\n", "--------------------------------------------------------------------------------\n", "IDN :\t{'vendor': 'KEITHLEY INSTRUMENTS INC.', 'model': '3706...\n", "channel_connect_rule :\tBREAK_BEFORE_MAKE \n", "gpib_address :\t12 \n", "gpib_enabled :\tTrue \n", "lan_enabled :\tTrue \n", "timeout :\t5 (s)\n" ] } ], "source": [ "smatrix.print_readable_snapshot()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If an invalid address is passed as an argument, QCoDeS shall rise an error and the present address shall be preserved." ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "ename": "ValueError", "evalue": "('31 is invalid: must be between 1 and 30 inclusive; Parameter: smatrix.gpib_address', 'setting smatrix_gpib_address to 31')", "output_type": "error", "traceback": [ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)", "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0msmatrix\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mgpib_address\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m31\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[1;32mc:\\users\\a-alhard\\repos\\qcodes\\qcodes\\instrument\\parameter.py\u001b[0m in \u001b[0;36m__call__\u001b[1;34m(self, *args, **kwargs)\u001b[0m\n\u001b[0;32m 408\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 409\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mhasattr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'set'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 410\u001b[1;33m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mset\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 411\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 412\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32mc:\\users\\a-alhard\\repos\\qcodes\\qcodes\\instrument\\parameter.py\u001b[0m in \u001b[0;36mset_wrapper\u001b[1;34m(value, **kwargs)\u001b[0m\n\u001b[0;32m 646\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mException\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 647\u001b[0m \u001b[0me\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0margs\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0me\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0margs\u001b[0m \u001b[1;33m+\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'setting {} to {}'\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 648\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0me\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 649\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 650\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mset_wrapper\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32mc:\\users\\a-alhard\\repos\\qcodes\\qcodes\\instrument\\parameter.py\u001b[0m in \u001b[0;36mset_wrapper\u001b[1;34m(value, **kwargs)\u001b[0m\n\u001b[0;32m 606\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mset_wrapper\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mvalue\u001b[0m\u001b[1;33m:\u001b[0m \u001b[0mParamDataType\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m:\u001b[0m \u001b[0mAny\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;33m->\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 607\u001b[0m \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 608\u001b[1;33m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mvalidate\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mvalue\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 609\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 610\u001b[0m \u001b[1;31m# In some cases intermediate sweep values must be used.\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32mc:\\users\\a-alhard\\repos\\qcodes\\qcodes\\instrument\\parameter.py\u001b[0m in \u001b[0;36mvalidate\u001b[1;34m(self, value)\u001b[0m\n\u001b[0;32m 705\u001b[0m \u001b[0mcontext\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 706\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mvals\u001b[0m \u001b[1;32mis\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 707\u001b[1;33m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mvals\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mvalidate\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mvalue\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'Parameter: '\u001b[0m \u001b[1;33m+\u001b[0m \u001b[0mcontext\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 708\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 709\u001b[0m \u001b[1;33m@\u001b[0m\u001b[0mproperty\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32mc:\\users\\a-alhard\\repos\\qcodes\\qcodes\\utils\\validators.py\u001b[0m in \u001b[0;36mvalidate\u001b[1;34m(self, value, context)\u001b[0m\n\u001b[0;32m 340\u001b[0m \u001b[1;34m'{} is invalid: must be between '\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 341\u001b[0m '{} and {} inclusive; {}'.format(\n\u001b[1;32m--> 342\u001b[1;33m repr(value), self._min_value, self._max_value, context))\n\u001b[0m\u001b[0;32m 343\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 344\u001b[0m \u001b[0mis_numeric\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;32mTrue\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;31mValueError\u001b[0m: ('31 is invalid: must be between 1 and 30 inclusive; Parameter: smatrix.gpib_address', 'setting smatrix_gpib_address to 31')" ] } ], "source": [ "smatrix.gpib_address(31)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If the preferred connection method is LAN, one can querry the IP address of the instrument through the driver." ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'0.0.0.0'" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_ip_address()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here, the returned address is the default value if there is no LAN connection; indeed in this example we are connected to the instrument via USB. In cases where a reset to the LAN is required, a simple function call is sufficient:" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [], "source": [ "smatrix.reset_local_network()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Identifications" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "While QCoDeS prints out the instrument identifications including the installed matrix types upon a successfull connection, these metadata can be queried later on, as well." ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'vendor': 'KEITHLEY INSTRUMENTS INC.',\n", " 'model': '3706A-SNFP',\n", " 'serial': '04447336',\n", " 'firmware': '01.56a'}" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_idn()" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "({'slot_no': '1',\n", " 'model': '3730',\n", " 'mtype': '6x16 High Density Matrix',\n", " 'firmware': '01.40h',\n", " 'serial': '4447332'},\n", " {'slot_no': '2',\n", " 'model': '3730',\n", " 'mtype': '6x16 High Density Matrix',\n", " 'firmware': '01.40h',\n", " 'serial': '4398982'},\n", " {'slot_no': '3',\n", " 'model': '3730',\n", " 'mtype': '6x16 High Density Matrix',\n", " 'firmware': '01.40h',\n", " 'serial': '4447333'})" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_switch_cards()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Save and load setups, memory management" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The system switch provides an option for the users to save their current setups to be used later. One can save a configuration either to the non-volatile memory of the instrument or to a USB drive. To this end, we use `save_setup()` function which either takes no arguments or a string which represents the path and the file name to which the setup shall be saved on an external drive. If no arguments provided, the setup shall be saved to the intstument. Note that, in the latter case, any existing saved configurations shall be overwritten. " ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "smatrix.save_setup()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can recall saved setups via `load_setup()` function. It takes a single argument: If it is `0`, factory defaults load, if it is `1`, the saved setup from the nonvolatile memory is recalled. Otherwise, a string specifying the relative path to the saved setup on a USB drive should be passed in." ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "smatrix.load_setup(0)" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [], "source": [ "smatrix.load_setup(1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The system switch has limited memory which can be queried via:" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'System Memory (%)': '89.64',\n", " 'Script Memory (%)': '100.00',\n", " 'Pattern Memory (%)': '100.00',\n", " 'Config Memory (%)': '100.00'}" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_available_memory()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The memory usage of a saved setup is depicted by the `Config Memory`. User given channel patterns occupy the `Pattern Memory`. The system switch is capable of storing and running Lua scripts. This functionality is not explicitly implemented by the QCoDeS driver. However, if desired, one can still send, save and execute Lua scripts through `write()` and `ask()` methods of the `InstrumentBase` class of QCoDeS which is inherited by every instrument driver. If this is the case, the saved Lua scripts occupy the `Script Memory`. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Channel Control and Manipulations" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Channel Specifiers" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "First, let us call the installed switch cards again:" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "({'slot_no': '1',\n", " 'model': '3730',\n", " 'mtype': '6x16 High Density Matrix',\n", " 'firmware': '01.40h',\n", " 'serial': '4447332'},\n", " {'slot_no': '2',\n", " 'model': '3730',\n", " 'mtype': '6x16 High Density Matrix',\n", " 'firmware': '01.40h',\n", " 'serial': '4398982'},\n", " {'slot_no': '3',\n", " 'model': '3730',\n", " 'mtype': '6x16 High Density Matrix',\n", " 'firmware': '01.40h',\n", " 'serial': '4447333'})" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_switch_cards()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The system switch has six available slots from which three are currently occupied by `6x16` high density matrices. As implied, these matrices have `6` rows and `16` columns, hence, in total, `96` available channels, each. \n", "\n", "Each channel has identical properties but unique names. The properties of the channels can be manipulated via calling them individually, as a group or as a whole slot. The naming of the channels follows a general pattern. In particular, here for the model `3730` which has no `bank`, the names starts with the slot number, then the row number and finally follows the cloumn number which should always be two characters. For example, `1101` represents the channel at `Slot 1`, `Row 1` and `Column 1`. For other models, users should refer to the corresponding instrument manual.\n", "\n", "In certain cases manual deduction of the name of the channel could be more efficient. On the other hand, user can easily query the available channels as follows:" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['1101',\n", " '1102',\n", " '1103',\n", " '1104',\n", " '1105',\n", " '1106',\n", " '1107',\n", " '1108',\n", " '1109',\n", " '1110',\n", " '1111',\n", " '1112',\n", " '1113',\n", " '1114',\n", " '1115',\n", " '1116',\n", " '1201',\n", " '1202',\n", " '1203',\n", " '1204',\n", " '1205',\n", " '1206',\n", " '1207',\n", " '1208',\n", " '1209',\n", " '1210',\n", " '1211',\n", " '1212',\n", " '1213',\n", " '1214',\n", " '1215',\n", " '1216',\n", " '1301',\n", " '1302',\n", " '1303',\n", " '1304',\n", " '1305',\n", " '1306',\n", " '1307',\n", " '1308',\n", " '1309',\n", " '1310',\n", " '1311',\n", " '1312',\n", " '1313',\n", " '1314',\n", " '1315',\n", " '1316',\n", " '1401',\n", " '1402',\n", " '1403',\n", " '1404',\n", " '1405',\n", " '1406',\n", " '1407',\n", " '1408',\n", " '1409',\n", " '1410',\n", " '1411',\n", " '1412',\n", " '1413',\n", " '1414',\n", " '1415',\n", " '1416',\n", " '1501',\n", " '1502',\n", " '1503',\n", " '1504',\n", " '1505',\n", " '1506',\n", " '1507',\n", " '1508',\n", " '1509',\n", " '1510',\n", " '1511',\n", " '1512',\n", " '1513',\n", " '1514',\n", " '1515',\n", " '1516',\n", " '1601',\n", " '1602',\n", " '1603',\n", " '1604',\n", " '1605',\n", " '1606',\n", " '1607',\n", " '1608',\n", " '1609',\n", " '1610',\n", " '1611',\n", " '1612',\n", " '1613',\n", " '1614',\n", " '1615',\n", " '1616',\n", " '2101',\n", " '2102',\n", " '2103',\n", " '2104',\n", " '2105',\n", " '2106',\n", " '2107',\n", " '2108',\n", " '2109',\n", " '2110',\n", " '2111',\n", " '2112',\n", " '2113',\n", " '2114',\n", " '2115',\n", " '2116',\n", " '2201',\n", " '2202',\n", " '2203',\n", " '2204',\n", " '2205',\n", " '2206',\n", " '2207',\n", " '2208',\n", " '2209',\n", " '2210',\n", " '2211',\n", " '2212',\n", " '2213',\n", " '2214',\n", " '2215',\n", " '2216',\n", " '2301',\n", " '2302',\n", " '2303',\n", " '2304',\n", " '2305',\n", " '2306',\n", " '2307',\n", " '2308',\n", " '2309',\n", " '2310',\n", " '2311',\n", " '2312',\n", " '2313',\n", " '2314',\n", " '2315',\n", " '2316',\n", " '2401',\n", " '2402',\n", " '2403',\n", " '2404',\n", " '2405',\n", " '2406',\n", " '2407',\n", " '2408',\n", " '2409',\n", " '2410',\n", " '2411',\n", " '2412',\n", " '2413',\n", " '2414',\n", " '2415',\n", " '2416',\n", " '2501',\n", " '2502',\n", " '2503',\n", " '2504',\n", " '2505',\n", " '2506',\n", " '2507',\n", " '2508',\n", " '2509',\n", " '2510',\n", " '2511',\n", " '2512',\n", " '2513',\n", " '2514',\n", " '2515',\n", " '2516',\n", " '2601',\n", " '2602',\n", " '2603',\n", " '2604',\n", " '2605',\n", " '2606',\n", " '2607',\n", " '2608',\n", " '2609',\n", " '2610',\n", " '2611',\n", " '2612',\n", " '2613',\n", " '2614',\n", " '2615',\n", " '2616',\n", " '3101',\n", " '3102',\n", " '3103',\n", " '3104',\n", " '3105',\n", " '3106',\n", " '3107',\n", " '3108',\n", " '3109',\n", " '3110',\n", " '3111',\n", " '3112',\n", " '3113',\n", " '3114',\n", " '3115',\n", " '3116',\n", " '3201',\n", " '3202',\n", " '3203',\n", " '3204',\n", " '3205',\n", " '3206',\n", " '3207',\n", " '3208',\n", " '3209',\n", " '3210',\n", " '3211',\n", " '3212',\n", " '3213',\n", " '3214',\n", " '3215',\n", " '3216',\n", " '3301',\n", " '3302',\n", " '3303',\n", " '3304',\n", " '3305',\n", " '3306',\n", " '3307',\n", " '3308',\n", " '3309',\n", " '3310',\n", " '3311',\n", " '3312',\n", " '3313',\n", " '3314',\n", " '3315',\n", " '3316',\n", " '3401',\n", " '3402',\n", " '3403',\n", " '3404',\n", " '3405',\n", " '3406',\n", " '3407',\n", " '3408',\n", " '3409',\n", " '3410',\n", " '3411',\n", " '3412',\n", " '3413',\n", " '3414',\n", " '3415',\n", " '3416',\n", " '3501',\n", " '3502',\n", " '3503',\n", " '3504',\n", " '3505',\n", " '3506',\n", " '3507',\n", " '3508',\n", " '3509',\n", " '3510',\n", " '3511',\n", " '3512',\n", " '3513',\n", " '3514',\n", " '3515',\n", " '3516',\n", " '3601',\n", " '3602',\n", " '3603',\n", " '3604',\n", " '3605',\n", " '3606',\n", " '3607',\n", " '3608',\n", " '3609',\n", " '3610',\n", " '3611',\n", " '3612',\n", " '3613',\n", " '3614',\n", " '3615',\n", " '3616']" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_channels()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The `get_channels()` function returns an array of strings each being the name of an available channel in all occupied slots. The return type being `string` is intentional as the instrument accepts the channel names as strings and not integers during any manipulation. Thus, any element(s) of this list can be safely passed as an argument to another function which specifies a channel property. \n", "\n", "If desired, the available channels in a given slot can be queried, as well." ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['1101',\n", " '1102',\n", " '1103',\n", " '1104',\n", " '1105',\n", " '1106',\n", " '1107',\n", " '1108',\n", " '1109',\n", " '1110',\n", " '1111',\n", " '1112',\n", " '1113',\n", " '1114',\n", " '1115',\n", " '1116',\n", " '1201',\n", " '1202',\n", " '1203',\n", " '1204',\n", " '1205',\n", " '1206',\n", " '1207',\n", " '1208',\n", " '1209',\n", " '1210',\n", " '1211',\n", " '1212',\n", " '1213',\n", " '1214',\n", " '1215',\n", " '1216',\n", " '1301',\n", " '1302',\n", " '1303',\n", " '1304',\n", " '1305',\n", " '1306',\n", " '1307',\n", " '1308',\n", " '1309',\n", " '1310',\n", " '1311',\n", " '1312',\n", " '1313',\n", " '1314',\n", " '1315',\n", " '1316',\n", " '1401',\n", " '1402',\n", " '1403',\n", " '1404',\n", " '1405',\n", " '1406',\n", " '1407',\n", " '1408',\n", " '1409',\n", " '1410',\n", " '1411',\n", " '1412',\n", " '1413',\n", " '1414',\n", " '1415',\n", " '1416',\n", " '1501',\n", " '1502',\n", " '1503',\n", " '1504',\n", " '1505',\n", " '1506',\n", " '1507',\n", " '1508',\n", " '1509',\n", " '1510',\n", " '1511',\n", " '1512',\n", " '1513',\n", " '1514',\n", " '1515',\n", " '1516',\n", " '1601',\n", " '1602',\n", " '1603',\n", " '1604',\n", " '1605',\n", " '1606',\n", " '1607',\n", " '1608',\n", " '1609',\n", " '1610',\n", " '1611',\n", " '1612',\n", " '1613',\n", " '1614',\n", " '1615',\n", " '1616']" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_channels_by_slot(1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Backplane Specifiers" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Each matrix has typically six analog backplane relays which can be associated which a channel(s). The naming scheme of the relays are similar to that of the channels. Each name start with the slot number, continues with `9`, which is the unique backplane number, and then finishes with backplane relay identifier which can take the values `11`, `12`, ..., `16`. That is, we can select the backplane relay `12` on `Slot 3` via `3912`. \n", "\n", "Unless a backplane is associated with a channel, the instrument does not return the names of the relays. This is overcomed within the QCoDeS driver, so that user can list the available analog backplane relays." ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['1911',\n", " '1912',\n", " '1913',\n", " '1914',\n", " '1915',\n", " '1916',\n", " '2911',\n", " '2912',\n", " '2913',\n", " '2914',\n", " '2915',\n", " '2916',\n", " '3911',\n", " '3912',\n", " '3913',\n", " '3914',\n", " '3915',\n", " '3916']" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_analog_backplane_specifiers()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Control and manipulations" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The switch channels as well as the analog backplane relays can be controlled via a set of well defined functions. \n", "First, a channel can be opened and closed, as expected." ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [], "source": [ "smatrix.open_channel(\"1101\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can provide a list of channels as an argument. In this case, channel names should be provided as a single string, seperated with a comma and no blank spaces." ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [], "source": [ "smatrix.open_channel(\"1103,2111\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can provide a channel range via slicing. The following call opens the channels from `3101` to `3116`." ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [], "source": [ "smatrix.open_channel(\"3101:3116\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can open all the channels in a slot by passing `slotX` where `X=1,...,6` representing the slot id. In our case, `X` can be `1`, `2` or `3`." ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [], "source": [ "smatrix.open_channel(\"slot2\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Finally, we can open all channels in all slots via:" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [], "source": [ "smatrix.open_channel(\"allslots\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let us reset everything to factory defaults." ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [], "source": [ "smatrix.reset_channel(\"allslots\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The `reset_channel()` function can take the name of a single channel, a channel list, range or a slot, as well.\n", "\n", "We continue with closing the desired channels. In this case, one cannot pass slot ids or `allslots` as the argument; it is not possible to close slots all together, simultaneously." ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [], "source": [ "smatrix.close_channel(\"1101\")" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [], "source": [ "smatrix.close_channel(\"2111,3216\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can query the closed channels." ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['1101', '2111', '3216']" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_closed_channels(\"allslots\")" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['2111']" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_closed_channels(\"slot2\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can exclusively close channels, as well. In one of the two ways to achieve exclusive close of channels, we specify channels to be closed in such a way that any presently closed channels in all slots open if they are not included to list. \n", "\n", "Currently we know that the channels `1101`, `2111` and `3216` are closed. Now, let us close the channel `3101` exclusively and then query close channels. We expect to only see the latter and the former channels should be opened." ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [], "source": [ "smatrix.exclusive_close(\"3101\")" ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['3101']" ] }, "execution_count": 36, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_closed_channels(\"allslots\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Second way to exclusively close channels is similar to that of our previous example. We now exclusively close the specified channels on the associated slots. Other channels are opened if they are not specified by the parameter within the same slot, while the other slots remain untouched. Currently the only closed channel is `3101`. Let close, exclusively, `2101` and `2216`. Also, let us close the channel `2111` genericaly. We expect the channel `2111` opens while the channel `3101` remains closed." ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [], "source": [ "smatrix.close_channel(\"2111\")" ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [], "source": [ "smatrix.exclusive_slot_close(\"2101,2216\")" ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['2101', '2216', '3101']" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_closed_channels(\"allslots\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can control connection rules for closing and opening channels when using the `exclusive_close()` and `exlusive_slot_close()` functions. The three valid rules are `BREAK_BEFORE_MAKE`, `MAKE_BEFORE_BREAK` and `OFF`. The default rule is `BREAK_BEFORE_MAKE`." ] }, { "cell_type": "code", "execution_count": 40, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'BREAK_BEFORE_MAKE'" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.channel_connect_rule()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If the connection rule is set to `BREAK_BEFORE_MAKE`, it is ensured that all channels open before any channels close. If it is set to `MAKE_BEFORE_BREAK`, it is ensured that all channels close before any channels open. Finally, if it is set to `OFF`, channels open and close, simultaneously." ] }, { "cell_type": "code", "execution_count": 41, "metadata": {}, "outputs": [], "source": [ "smatrix.channel_connect_rule(\"MAKE_BEFORE_BREAK\")" ] }, { "cell_type": "code", "execution_count": 42, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'MAKE_BEFORE_BREAK'" ] }, "execution_count": 42, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.channel_connect_rule()" ] }, { "cell_type": "code", "execution_count": 43, "metadata": {}, "outputs": [], "source": [ "smatrix.channel_connect_rule(\"OFF\")" ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'OFF'" ] }, "execution_count": 44, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.channel_connect_rule()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note that, resetting channels to factory defaults will not change the connection rule:" ] }, { "cell_type": "code", "execution_count": 45, "metadata": {}, "outputs": [], "source": [ "smatrix.reset_channel(\"allslots\")" ] }, { "cell_type": "code", "execution_count": 46, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'OFF'" ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.channel_connect_rule()" ] }, { "cell_type": "code", "execution_count": 47, "metadata": {}, "outputs": [], "source": [ "smatrix.channel_connect_rule(\"BREAK_BEFORE_MAKE\")" ] }, { "cell_type": "code", "execution_count": 48, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'BREAK_BEFORE_MAKE'" ] }, "execution_count": 48, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.channel_connect_rule()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In certain cases, we may want to keep certain channels always open. We can achieve desired behavior by setting the specified channels (and analog backplane relays) as `forbidden` to close." ] }, { "cell_type": "code", "execution_count": 49, "metadata": {}, "outputs": [], "source": [ "smatrix.set_forbidden_channels(\"1101:1105\")" ] }, { "cell_type": "code", "execution_count": 50, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'1101,1102,1103,1104,1105'" ] }, "execution_count": 50, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_forbidden_channels(\"allslots\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "These channels cannot be closed:" ] }, { "cell_type": "code", "execution_count": 51, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\a-alhard\\anaconda3\\envs\\qcodes\\lib\\site-packages\\ipykernel_launcher.py:1: UserWarning: You are attempting to close channels that are forbidden to close.\n", " \"\"\"Entry point for launching an IPython kernel.\n" ] } ], "source": [ "smatrix.close_channel(\"1101\")" ] }, { "cell_type": "code", "execution_count": 52, "metadata": {}, "outputs": [], "source": [ "smatrix.get_closed_channels(\"slot1\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can forbid entire slots to be closed. In this case, the analog backplane relays of the corresponding slot shall be flagged as forbidden, as well." ] }, { "cell_type": "code", "execution_count": 53, "metadata": {}, "outputs": [], "source": [ "smatrix.set_forbidden_channels(\"slot2\")" ] }, { "cell_type": "code", "execution_count": 54, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'1101,1102,1103,1104,1105,2101,2102,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2201,2202,2203,2204,2205,2206,2207,2208,2209,2210,2211,2212,2213,2214,2215,2216,2301,2302,2303,2304,2305,2306,2307,2308,2309,2310,2311,2312,2313,2314,2315,2316,2401,2402,2403,2404,2405,2406,2407,2408,2409,2410,2411,2412,2413,2414,2415,2416,2501,2502,2503,2504,2505,2506,2507,2508,2509,2510,2511,2512,2513,2514,2515,2516,2601,2602,2603,2604,2605,2606,2607,2608,2609,2610,2611,2612,2613,2614,2615,2616,2911,2912,2913,2914,2915,2916'" ] }, "execution_count": 54, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_forbidden_channels(\"allslots\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can clear the forbidden list when we desire to do so." ] }, { "cell_type": "code", "execution_count": 55, "metadata": {}, "outputs": [], "source": [ "smatrix.clear_forbidden_channels(\"slot1\")" ] }, { "cell_type": "code", "execution_count": 56, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'2101,2102,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2201,2202,2203,2204,2205,2206,2207,2208,2209,2210,2211,2212,2213,2214,2215,2216,2301,2302,2303,2304,2305,2306,2307,2308,2309,2310,2311,2312,2313,2314,2315,2316,2401,2402,2403,2404,2405,2406,2407,2408,2409,2410,2411,2412,2413,2414,2415,2416,2501,2502,2503,2504,2505,2506,2507,2508,2509,2510,2511,2512,2513,2514,2515,2516,2601,2602,2603,2604,2605,2606,2607,2608,2609,2610,2611,2612,2613,2614,2615,2616,2911,2912,2913,2914,2915,2916'" ] }, "execution_count": 56, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_forbidden_channels(\"allslots\")" ] }, { "cell_type": "code", "execution_count": 57, "metadata": {}, "outputs": [], "source": [ "smatrix.clear_forbidden_channels(\"2911,2912,2916\")" ] }, { "cell_type": "code", "execution_count": 58, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'2101,2102,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2201,2202,2203,2204,2205,2206,2207,2208,2209,2210,2211,2212,2213,2214,2215,2216,2301,2302,2303,2304,2305,2306,2307,2308,2309,2310,2311,2312,2313,2314,2315,2316,2401,2402,2403,2404,2405,2406,2407,2408,2409,2410,2411,2412,2413,2414,2415,2416,2501,2502,2503,2504,2505,2506,2507,2508,2509,2510,2511,2512,2513,2514,2515,2516,2601,2602,2603,2604,2605,2606,2607,2608,2609,2610,2611,2612,2613,2614,2615,2616,2913,2914,2915'" ] }, "execution_count": 58, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_forbidden_channels(\"slot2\")" ] }, { "cell_type": "code", "execution_count": 59, "metadata": {}, "outputs": [], "source": [ "smatrix.clear_forbidden_channels(\"slot2\")" ] }, { "cell_type": "code", "execution_count": 60, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'nil'" ] }, "execution_count": 60, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_forbidden_channels(\"allslots\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Finally, we can set additional delay times to specified channels. The delays should be provided in seconds." ] }, { "cell_type": "code", "execution_count": 61, "metadata": {}, "outputs": [], "source": [ "smatrix.set_delay(\"1101\", 1)" ] }, { "cell_type": "code", "execution_count": 62, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[1.0]" ] }, "execution_count": 62, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_delay(\"1101\")" ] }, { "cell_type": "code", "execution_count": 63, "metadata": {}, "outputs": [], "source": [ "smatrix.set_delay(\"slot2\", 2)" ] }, { "cell_type": "code", "execution_count": 64, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0,\n", " 2.0]" ] }, "execution_count": 64, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_delay(\"slot2\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can use `reset_channel()` function to set delay times to defalult value of `0`" ] }, { "cell_type": "code", "execution_count": 65, "metadata": { "scrolled": true }, "outputs": [], "source": [ "smatrix.reset_channel(\"allslots\")" ] }, { "cell_type": "code", "execution_count": 66, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", " 0.0]" ] }, "execution_count": 66, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_delay(\"allslots\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can, conveniently, connect (disconnect) given rows (columns) of a slot to a column (row) of the same slot via the functions `connect_or_disconnect_row_to_columns()` and `connect_or_disconnect_column_to_rows()`. Each function takes an action as its first argument. The action should be either `connect` or `disconnect`. The slot id is provided as the second argument. The `connect_or_disconnect_row_to_columns()` takes the row number as the third argument to which the desired cloumns, specified by the final argument as a list, will be connected. Likewise, the `connect_or_disconnect_column_to_rows()` takes the column number as the third argument to which the desired rows, specified by the final argument as a list, will be connected. \n", "\n", "Both functions opens (closes) the formed channels automatically and returns their list which can be used for later use, if desired. Let us, first, connect `1`, `2` and `13` columns of `slot2` to the row `3` of the same slot. " ] }, { "cell_type": "code", "execution_count": 67, "metadata": {}, "outputs": [], "source": [ "channels = smatrix.connect_or_disconnect_row_to_columns(\"connect\", 2, 3, [1, 2, 13])" ] }, { "cell_type": "code", "execution_count": 68, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['2301', '2302', '2313']" ] }, "execution_count": 68, "metadata": {}, "output_type": "execute_result" } ], "source": [ "channels" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The channels of the matrix returned are now opened. Let us flag these channels as forbidden to close:" ] }, { "cell_type": "code", "execution_count": 69, "metadata": {}, "outputs": [], "source": [ "for channel in channels:\n", " smatrix.set_forbidden_channels(channel)" ] }, { "cell_type": "code", "execution_count": 70, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'2301,2302,2313'" ] }, "execution_count": 70, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_forbidden_channels(\"allslots\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Similarly, let us disconnect the rows `1`, `2` and `4` of `slot1` to the column `16` of the same slot:" ] }, { "cell_type": "code", "execution_count": 71, "metadata": {}, "outputs": [], "source": [ "channels = smatrix.connect_or_disconnect_column_to_rows(\"disconnect\", 1, 16, [1, 2, 4])" ] }, { "cell_type": "code", "execution_count": 72, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['1116', '1216', '1416']" ] }, "execution_count": 72, "metadata": {}, "output_type": "execute_result" } ], "source": [ "channels" ] }, { "cell_type": "code", "execution_count": 73, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['1116', '1216', '1416']" ] }, "execution_count": 73, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_closed_channels(\"slot1\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Association of Backplanes" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can set specific analog backplane relays to desired channels so that they can be utilized in switching applications. Note that the driver will correctly warn us as the slots are disengaged." ] }, { "cell_type": "code", "execution_count": 74, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\a-alhard\\anaconda3\\envs\\qcodes\\lib\\site-packages\\ipykernel_launcher.py:1: UserWarning: The hardware interlock in Slot 1 is disengaged. The corresponding analog backplane relays cannot be energized.\n", " \"\"\"Entry point for launching an IPython kernel.\n", "C:\\Users\\a-alhard\\anaconda3\\envs\\qcodes\\lib\\site-packages\\ipykernel_launcher.py:1: UserWarning: The hardware interlock in Slot 2 is disengaged. The corresponding analog backplane relays cannot be energized.\n", " \"\"\"Entry point for launching an IPython kernel.\n", "C:\\Users\\a-alhard\\anaconda3\\envs\\qcodes\\lib\\site-packages\\ipykernel_launcher.py:1: UserWarning: The hardware interlock in Slot 3 is disengaged. The corresponding analog backplane relays cannot be energized.\n", " \"\"\"Entry point for launching an IPython kernel.\n" ] } ], "source": [ "smatrix.set_backplane(\"1101:1109\", \"1916\")" ] }, { "cell_type": "code", "execution_count": 75, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'1916'" ] }, "execution_count": 75, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_backplane(\"1101\")" ] }, { "cell_type": "code", "execution_count": 76, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'1916;1916;1916;1916;1916;1916;1916;1916;1916'" ] }, "execution_count": 76, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_backplane(\"slot1\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can clear the association via resetting the corresponding channels (or all channels)." ] }, { "cell_type": "code", "execution_count": 77, "metadata": {}, "outputs": [], "source": [ "smatrix.reset_channel(\"1101:1109\")" ] }, { "cell_type": "code", "execution_count": 78, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'nil'" ] }, "execution_count": 78, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smatrix.get_backplane(\"slot1\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exceptions" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The instrument itself does not return any error messages if it encounters an exception, but, rather silently handles such situations. Thus, QCoDeS driver is equipped with validation and exception handling with informative error messages for probable scenerios. \n", "\n", "Here, we note some important cases where errors are generated if:\n", "\n", " - A non existing channel or slot passed as an argument to a function\n", " - Slots are passed as arguments of `close_channel()`, `exclusive_close()` and `exclusive_slot_close()`\n", " - A delay time is tried to be set for analog backplane relays\n", " - A channel name is used to set as a backplane instead of a backplane name in `set_backplane()` and vice versa" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.8" }, "nbsphinx": { "execute": "never" } }, "nbformat": 4, "nbformat_minor": 4 }