{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 15 minutes to QCoDeS" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This short introduction is aimed mainly for beginners. Before you start with your first code using QCoDeS, make sure you have properly set up the Python environment for QCoDeS as explained in [this document](http://qcodes.github.io/Qcodes/start/index.html#installation). " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Introduction " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "An experimental setup comprises of many instruments. We call an experimental setup as \"station\". A station is connected to many instruments or devices. QCoDeS provides a way to interact with all these instruments to help users \n", "the measurements and store the data in a database. To interact (read, write, trigger, etc) with the instruments, we have created a [library of drivers](http://qcodes.github.io/Qcodes/api/generated/qcodes.instrument_drivers.html) for commonly used ones. These drivers implement the most needed functionalities of the instruments. \n", "\n", "An \"Instrument\" can perform many functions. For example, on an oscilloscope instrument, we first set a correct trigger level and other parameters and then obtain a trace. In QCoDeS lingo, we call \"trigger_level\" and \"trace\" as `parameter` of this `instrument`. An instrument at any moment will have many such parameters which together define the state of the instrument, hence a parameter can be thought of as a state variable of the instrument. QCoDeS provides a method to set values of these parameters (set trigger level) and get the values from them (obtain a trace). By this way, we can interact with all the needed parameters of an instrument and are ready to set up a measurement. \n", "\n", "QCoDeS has a similar programmatic structure, as well. QCoDeS structure comprises of a `Station` class which is a bucket of objects from `Instrument` class containing many objects from `Parameter` class. The value of these parameters are set and measured during a measurement. The `Measurement` class provides a context manager for registering the parameters and providing a link between different parameters. The measured data is stored in a database.\n", "\n", "Here, we will briefly discuss how you can set up your own experiment with the help of QCoDeS. \n", "\n", "![SchematicOverviewQcodes](files/Schematic_Overview_Qcodes.png)\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Imports" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If you are using QCoDeS as your main data acquisition framework, a typical Python script at your disposal may look like:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Logging hadn't been started.\n", "Activating auto-logging. Current session state plus future input saved.\n", "Filename : C:\\Users\\a-fbonabi\\.qcodes\\logs\\command_history.log\n", "Mode : append\n", "Output logging : True\n", "Raw input log : False\n", "Timestamping : True\n", "State : active\n", "Qcodes Logfile : C:\\Users\\a-fbonabi\\.qcodes\\logs\\210329-4928-qcodes.log\n" ] } ], "source": [ "%matplotlib inline\n", "import os\n", "from time import sleep\n", "\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import qcodes as qc\n", "from qcodes import (\n", " Measurement,\n", " experiments,\n", " initialise_database,\n", " initialise_or_create_database_at,\n", " load_by_guid,\n", " load_by_run_spec,\n", " load_experiment,\n", " load_last_experiment,\n", " load_or_create_experiment,\n", " new_experiment,\n", ")\n", "from qcodes.dataset.plotting import plot_dataset\n", "from qcodes.logger.logger import start_all_logging\n", "from qcodes.tests.instrument_mocks import DummyInstrument, DummyInstrumentWithMeasurement" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We strongly recommend not to import unused packages to increase readability of your code." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Logging " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In every measurement session, it is highly recommended to have QCoDeS logging turned on. This will allow you to have all the logs in case troubleshooting is required. To enable logging, we can either add the following single line of code at the beginnig of our scripts after the imports:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Activating auto-logging. Current session state plus future input saved.\n", "Filename : C:\\Users\\a-fbonabi\\.qcodes\\logs\\command_history.log\n", "Mode : append\n", "Output logging : True\n", "Raw input log : False\n", "Timestamping : True\n", "State : active\n", "Qcodes Logfile : C:\\Users\\a-fbonabi\\.qcodes\\logs\\210329-4928-qcodes.log\n" ] } ], "source": [ "start_all_logging()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "or we can configure qcodes to automatically start logging on every import of qcodes, by running the following code once. (This will persist the current configuration in `~\\qcodesrc.json`)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "from qcodes import config\n", "config.logger.start_logging_on_import = 'always'\n", "config.save_to_home()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can find the log files at \".qcodes\" directory, typically located at your home folder (e.g., see the corresponding path to the \"Filename\" key above). This path contains two log files: \n", " - command_history.log: contains the commands executed. \n", " \n", " And in this particular case\n", " - 191113-13960-qcodes.log: contains python logging information. The file is named as \n", " \\[date (YYMMDD)\\]-\\[process id\\]-\\[qcodes\\].log. The display message from `start_all_logging()` function shows that the `Qcodes Logfile` is saved at `C:\\Users\\a-halakh\\.qcodes\\logs\\191113-13960-qcodes.log`" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Station creation " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A station is a collection of all the instruments and devices present in your experiment. As mentioned earlier, it can be thought of as a bucket where you can add your `instruments`, `parameters` and other `components`. Each of these terms has a definite meaning in QCoDeS and shall be explained in later sections. Once a station is properly configured, you can use its instances to access these components. We refer to tutorial on [Station](http://qcodes.github.io/Qcodes/examples/Station.html) for more details." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We start with instantiating a station class which at the moment does not comprise of any instruments or parameters." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "station = qc.Station()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Snapshot" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can look at all the instruments and the parameters inside this station bucket using `snapshot` method. Since at the moment we have not added anything to our station, the snapshot will contain the names of the keys with no values: " ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'instruments': {}, 'parameters': {}, 'components': {}, 'config': None}" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "station.snapshot()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The [snapshot](http://qcodes.github.io/Qcodes/examples/DataSet/Working%20with%20snapshots.html) of the station is categorized as the dictionary of all the `instruments`,` parameters`, `components` and list of `default_measurement`. Once you have populated your station you may want to look at the snapshot again." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Instrument\n", "\n", "`Instrument` class in Qcodes is responsible for holding connections to hardware, creating a parameter or method for each piece of functionality of the instrument. For more information on instrument class we refer to the [detailed description here](http://qcodes.github.io/Qcodes/user/intro.html#instrument) or the corresponding [api documentation](http://qcodes.github.io/Qcodes/api/instrument/index.html). " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let us, now, create two dummy instruments and associate two parameters for each of them:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "# A dummy instrument dac with two parameters ch1 and ch2\n", "dac = DummyInstrument('dac', gates=['ch1', 'ch2'])\n", "\n", "# A dummy instrument that generates some real looking output depending\n", "# on the values set on the setter_instr, in this case the dac\n", "dmm = DummyInstrumentWithMeasurement('dmm', setter_instr=dac)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Aside from the bare ``snapshot``, which returns a Python dictionary, a more readable form can be returned via:" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "dac:\n", "\tparameter value\n", "--------------------------------------------------------------------------------\n", "IDN :\tNone \n", "ch1 :\t0 (V)\n", "ch2 :\t0 (V)\n" ] } ], "source": [ "dac.print_readable_snapshot()" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "dmm:\n", "\tparameter value\n", "--------------------------------------------------------------------------------\n", "IDN :\tNone \n", "v1 :\t0 (V)\n", "v2 :\t0 (V)\n" ] } ], "source": [ "dmm.print_readable_snapshot()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Add instruments into station " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Every instrument that you are working with during an experiment should be added to the instance of the `Station` class. Here, we add the `dac` and `dmm` instruments by using ``add_component`` method: " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Add components" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'dmm'" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "station.add_component(dac)\n", "station.add_component(dmm)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Remove component " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We use the method `remove_component` to remove a component from the station. For example you can remove `dac` as follows: \n" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "station.remove_component('dac')" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'dmm': }" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "station.components" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let us add the `dac` instrument back: " ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'dac'" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "station.add_component(dac)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Station snapshot" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "As there are two instruments added to the station object, the snapshot will include all the properties associated with them:" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'instruments': {'dmm': {'functions': {},\n", " 'submodules': {},\n", " '__class__': 'qcodes.tests.instrument_mocks.DummyInstrumentWithMeasurement',\n", " 'parameters': {'IDN': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'dmm_IDN',\n", " 'value': {'vendor': None,\n", " 'model': 'dmm',\n", " 'serial': None,\n", " 'firmware': None},\n", " 'raw_value': {'vendor': None,\n", " 'model': 'dmm',\n", " 'serial': None,\n", " 'firmware': None},\n", " 'ts': '2021-03-29 18:47:16',\n", " 'label': 'IDN',\n", " 'name': 'IDN',\n", " 'post_delay': 0,\n", " 'vals': '',\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.tests.instrument_mocks.DummyInstrumentWithMeasurement',\n", " 'instrument_name': 'dmm',\n", " 'unit': ''},\n", " 'v1': {'__class__': 'qcodes.tests.instrument_mocks.DmmExponentialParameter',\n", " 'full_name': 'dmm_v1',\n", " 'value': 5.136319425854842,\n", " 'raw_value': 5.136319425854842,\n", " 'ts': '2021-03-29 18:47:16',\n", " 'label': 'Gate v1',\n", " 'name': 'v1',\n", " 'post_delay': 0,\n", " 'vals': '',\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.tests.instrument_mocks.DummyInstrumentWithMeasurement',\n", " 'instrument_name': 'dmm',\n", " 'unit': 'V'},\n", " 'v2': {'__class__': 'qcodes.tests.instrument_mocks.DmmGaussParameter',\n", " 'full_name': 'dmm_v2',\n", " 'value': 0.7610037322648976,\n", " 'raw_value': 0.7610037322648976,\n", " 'ts': '2021-03-29 18:47:16',\n", " 'label': 'Gate v2',\n", " 'name': 'v2',\n", " 'post_delay': 0,\n", " 'vals': '',\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.tests.instrument_mocks.DummyInstrumentWithMeasurement',\n", " 'instrument_name': 'dmm',\n", " 'unit': 'V'}},\n", " 'name': 'dmm'},\n", " 'dac': {'functions': {},\n", " 'submodules': {},\n", " '__class__': 'qcodes.tests.instrument_mocks.DummyInstrument',\n", " 'parameters': {'IDN': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'dac_IDN',\n", " 'value': {'vendor': None,\n", " 'model': 'dac',\n", " 'serial': None,\n", " 'firmware': None},\n", " 'raw_value': {'vendor': None,\n", " 'model': 'dac',\n", " 'serial': None,\n", " 'firmware': None},\n", " 'ts': '2021-03-29 18:47:16',\n", " 'label': 'IDN',\n", " 'name': 'IDN',\n", " 'post_delay': 0,\n", " 'vals': '',\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.tests.instrument_mocks.DummyInstrument',\n", " 'instrument_name': 'dac',\n", " 'unit': ''},\n", " 'ch1': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'dac_ch1',\n", " 'value': 0,\n", " 'raw_value': 0,\n", " 'ts': '2021-03-29 18:47:16',\n", " 'label': 'Gate ch1',\n", " 'name': 'ch1',\n", " 'post_delay': 0,\n", " 'vals': '',\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.tests.instrument_mocks.DummyInstrument',\n", " 'instrument_name': 'dac',\n", " 'unit': 'V'},\n", " 'ch2': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'dac_ch2',\n", " 'value': 0,\n", " 'raw_value': 0,\n", " 'ts': '2021-03-29 18:47:16',\n", " 'label': 'Gate ch2',\n", " 'name': 'ch2',\n", " 'post_delay': 0,\n", " 'vals': '',\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.tests.instrument_mocks.DummyInstrument',\n", " 'instrument_name': 'dac',\n", " 'unit': 'V'}},\n", " 'name': 'dac'}},\n", " 'parameters': {},\n", " 'components': {},\n", " 'config': None}" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "station.snapshot()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Station Configurator" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The instantiation of the instruments, that is, setting up the proper initial values of the corresponding parameters and similar pre-specifications of a measurement constitutes the initialization portion of the code. In general, this portion can be quite long and tedious to maintain. These (and more) concerns can be solved by a YAML configuration file of the `Station` object. We refer to the notebook on [station](http://qcodes.github.io/Qcodes/examples/Station.html#Default-Station) for more details." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Parameter\n", "\n", "A QCoDeS `Parameter` has the property that it is settable, gettable or both. Let us clarify this with an example of a real instrument, say an oscilloscope. An oscilloscope contains settings such as trigger mode, trigger level, source etc. Most of these settings can be set to a particular value in the instrument. For example, trigger mode can be set to 'edge' mode and trigger level to some floating number. Hence, these parameters are called settable. Similarly, the parameters that we are able to retrieve the values currently associated with them are called gettable. In this example notebook, we have a 'dac' instrument with 'ch1' and 'ch2' are added as its `Parameter`s. Similarly, we have a 'dmm' instrument with 'v1' and 'v2' are added as its `Parameter`s. We also note that, apart from the trivial use of `Parameter` as the standard parameter of the instrument, it can be used as a common variable to utilize storing/retrieving data. Furthermore, it can be used as a subclass in more complex design cases.\n", "\n", "QCoDeS provides following parameter classes built in: \n", "\n", " - `Parameter` : Represents a single value at a given time. Example: voltage. \n", " - `ParameterWithSetpoints`: Represents an array of values of all the same type that are returned all at once. Example: voltage vs time waveform . We refer to the [notebook](http://qcodes.github.io/Qcodes/examples/Parameters/Simple-Example-of-ParameterWithSetpoints.html) in which more detailed examples concerning the use cases of this parameter can be found.\n", " - `DelegateParameter`: It is intended for proxy-ing other parameters. You can use different label, unit, etc in the delegated parameter as compared to the source parameter.\n", " - `MultiParameter`: Represents a collection of values with different meanings and possibly different dimensions. Example: I and Q, or I vs time and Q vs time.\n", "\n", "Most of the times you can use these classes directly and use the `get`, `set` functions to get or set the values to those parameters. But sometimes it may be useful to subclass the above classes, in that case you should define `get_raw` and `set_raw` methods rather then `get` or `set` methods. The `get_raw`, `set_raw` method is automatically wrapped to provide a `get`, `set` method on the parameter instance. Overwriting get in subclass of above parameters or the `_BaseParameter` is not allowed and will throw a runtime error. \n", "\n", "To understand more about parameters consult the [notebook on Parameter](http://qcodes.github.io/Qcodes/examples/index.html#parameters) for more details. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In most cases, a settable parameter accepts its value as a function argument. Let us set the a value of 1.1 for the 'ch1' parameter of the 'dac' instrument:" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [], "source": [ "dac.ch1(1.1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Similarly, we ask the current value of a gettable parameter with a simple function call. For example, the output voltage of dmm can be read via" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3.9778798280916714" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.v1()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Further information can be found in the [user guide](http://qcodes.github.io/Qcodes/user/intro.html#parameter) or [api documentation](http://qcodes.github.io/Qcodes/api/parameters/index.html) of parameter. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Initialise database and experiment" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Before starting a measurement, we first initialise a database. The location of the database is specified by the configuration object of the QCoDeS installation. The database is created with the latest supported version complying with the QCoDeS version that is currently under use. If a database already exists but an upgrade has been done to the QCoDeS, then that database can continue to be used and it is going to be upgraded to the latest version automatically at first connection." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The initialisation of the database is achieved via:" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Upgrading database; v0 -> v1: : 0it [00:00, ?it/s]\n", "Upgrading database; v1 -> v2: 100%|█████████████████████████████████████████████████████| 1/1 [00:00<00:00, 499.44it/s]\n", "Upgrading database; v2 -> v3: : 0it [00:00, ?it/s]\n", "Upgrading database; v3 -> v4: : 0it [00:00, ?it/s]\n", "Upgrading database; v4 -> v5: 100%|█████████████████████████████████████████████████████| 1/1 [00:00<00:00, 333.23it/s]\n", "Upgrading database; v5 -> v6: : 0it [00:00, ?it/s]\n", "Upgrading database; v6 -> v7: 100%|█████████████████████████████████████████████████████| 1/1 [00:00<00:00, 201.19it/s]\n", "Upgrading database; v7 -> v8: 100%|█████████████████████████████████████████████████████| 1/1 [00:00<00:00, 499.62it/s]\n", "Upgrading database; v8 -> v9: 100%|█████████████████████████████████████████████████████| 1/1 [00:00<00:00, 332.09it/s]\n" ] } ], "source": [ "initialise_database()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "As the result, a database according to the current QCoDeS configuration is created, which as per the default configuration, a database called \"experiments.db\" is created in the user's home folder. Let's check the database location and name:" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'~/experiments.db'" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "qc.config.core.db_location" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Alternatively, if you already have a QCoDeS database which you would like to use for your measurement, it is sufficient to use" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "initialise_or_create_database_at(\"~/experiments.db\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note that it is user's responsibility to provide the correct path for the existing database. The notation of the path may differ with respect to the operating system. The method ``initialise_or_create_database_at`` makes sure that your QCoDeS session is connected to the referred database. If the database file does not exist, it will be created at the provided path:" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Upgrading database; v0 -> v1: : 0it [00:00, ?it/s]\n", "Upgrading database; v1 -> v2: 100%|█████████████████████████████████████████████████████| 1/1 [00:00<00:00, 499.80it/s]\n", "Upgrading database; v2 -> v3: : 0it [00:00, ?it/s]\n", "Upgrading database; v3 -> v4: : 0it [00:00, ?it/s]\n", "Upgrading database; v4 -> v5: 100%|█████████████████████████████████████████████████████| 1/1 [00:00<00:00, 334.23it/s]\n", "Upgrading database; v5 -> v6: : 0it [00:00, ?it/s]\n", "Upgrading database; v6 -> v7: 100%|█████████████████████████████████████████████████████| 1/1 [00:00<00:00, 142.87it/s]\n", "Upgrading database; v7 -> v8: 100%|█████████████████████████████████████████████████████| 1/1 [00:00<00:00, 501.05it/s]\n", "Upgrading database; v8 -> v9: 100%|█████████████████████████████████████████████████████| 1/1 [00:00<00:00, 332.70it/s]\n" ] } ], "source": [ "initialise_or_create_database_at(\"./my_data.db\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If we check the database location again, it should be changed to ``./my_data.db``, because under the hood, ``initialise_or_create_database_at`` connects to the database in the provided path by changing the `db_location` to that path: " ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'./my_data.db'" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "qc.config.core.db_location" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Change location of database" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In case you would like to change the location of the database directly, for example, to the current working directory, it is sufficient to assign the new path as the value of the corresponding key ``db_location``:" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [], "source": [ "cwd = os.getcwd()\n", "qc.config[\"core\"][\"db_location\"] = os.path.join(cwd, 'testing.db')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note that any change in the qcodes configuration in a Python kernel is a temporary change in that kernel (means it does not permanently change the configuration file unless it is saved in the file). Users should be careful changing the config file (refer to the end of the notebook to learn more about QCoDeS configuration)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Load or create experiment" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "After initialising the database we create the `Experiment` object. This object contains the name of the experiment and the sample, and the path of the database. You can use `load_or_create_experiment` to find and return an experiment with the given experiment and sample name if it already exists, or create one if not found.\n", "\n" ] }, { "cell_type": "code", "execution_count": 22, "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Upgrading database; v0 -> v1: : 0it [00:00, ?it/s]\n", "Upgrading database; v1 -> v2: 100%|█████████████████████████████████████████████████████| 1/1 [00:00<00:00, 500.39it/s]\n", "Upgrading database; v2 -> v3: : 0it [00:00, ?it/s]\n", "Upgrading database; v3 -> v4: : 0it [00:00, ?it/s]\n", "Upgrading database; v4 -> v5: 100%|█████████████████████████████████████████████████████| 1/1 [00:00<00:00, 500.27it/s]\n", "Upgrading database; v5 -> v6: : 0it [00:00, ?it/s]\n", "Upgrading database; v6 -> v7: 100%|█████████████████████████████████████████████████████| 1/1 [00:00<00:00, 166.79it/s]\n", "Upgrading database; v7 -> v8: 100%|█████████████████████████████████████████████████████| 1/1 [00:00<00:00, 334.58it/s]\n", "Upgrading database; v8 -> v9: 100%|█████████████████████████████████████████████████████| 1/1 [00:00<00:00, 500.69it/s]\n" ] } ], "source": [ "exp = load_or_create_experiment(experiment_name='dataset_context_manager',\n", " sample_name=\"no sample1\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The path of the database for `Experiment` is the defined path in the QCoDeS configuration. First, `Experiment` loads the database in that path (or it creates one if there is no database in that path), and then saves the created experiment in that database. Although loading/ creating database by `Experiment` is a user-friendly feature, we recommend users to initialise their database, as shown earlier, before loading/ creating their experiment, because it allows them to better control their experiments and databases for their measurement." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The method shown above to load or create the experiment is the most versatile one. However for specific cases, the following alternative methods can be used to create or load experiments:" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [], "source": [ "# load_experiment_by_name(experiment_name='dataset_context_manager',sample_name=\"no sample\")\n", "# load_last_experiment()\n", "# load_experiment(1)\n", "# new_experiment(experiment_name='dataset_context_manager',sample_name=\"no sample\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Measurement" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Qcodes `Measurement` module provides a context manager for registering parameters to measure and store results. The measurement is first linked to the correct experiment and to the station by passing them as arguments. If no arguments are given, the latest experiment and station are taken as defaults. A keyword argument `name` can also be set as any string value for `Measurement`. This set `name` argument will be used as the name of the resulting dataset. \n", "\n", "QCoDeS is capable of storing relations between the parameters, i.e., which parameter is independent and which parameter depends on another one. This capability is later used to make useful plots, where the knowledge of interdependencies is used to define the corresponding variables for the coordinate axes. The required (mandatory) parameters in the measurement are first registered. If there is an interdependency between any given two or more parameters, the independent one is declared as a 'setpoint'. In our example, ``dac.ch1`` is the independent parameter and ``dmm.v1`` is the dependent parameter whose setpoint is ``dac.ch1``." ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Starting experimental run with id: 1. \n" ] } ], "source": [ "meas = Measurement(exp=exp, station=station, name='xyz_measurement')\n", "meas.register_parameter(dac.ch1) # register the first independent parameter\n", "meas.register_parameter(dmm.v1, setpoints=(dac.ch1,)) # now register the dependent oone\n", "\n", "meas.write_period = 2 \n", "\n", "with meas.run() as datasaver:\n", " for set_v in np.linspace(0, 25, 10):\n", " dac.ch1.set(set_v)\n", " get_v = dmm.v1.get()\n", " datasaver.add_result((dac.ch1, set_v),\n", " (dmm.v1, get_v))\n", "\n", " dataset = datasaver.dataset # convenient to have for plotting" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The ``meas.run()`` returns a context manager for the experiment run. Entering the context returns the ``DataSaver`` object to the `datasaver` variable. The ``DataSaver`` class handles the saving of data to the database using the method ``add_result``. The ``add_result`` method validates the sizes of all the data points and store them intermittently into a private variable. Within every write-period of the measurement, the data of the private variable is flushed to the database.\n", "\n", "``meas.write_period`` is used to define the periods after which the data is committed to the database. We do not commit individual datapoints during measurement to the database but only after some amount of data is collected in stipulated time period (in this case for 2 seconds). The default value of write_period is 5 seconds. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Measurement without defining an Experiment" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If we initialise a database but do not create/ load an experiment before running a `Measurement`, one of the two following outcomes would happen:\n", "1. if the initialised database does not contain any `Experiment`, then the `Measurement` will not run and an error related to the `Experiment` will be thrown; \n", "2. if the database already contains one/ more `Experiment`, then creating a `Measurement` object will automatically pick up the latest `Experiment` from the database, and the meaurement will be performed.\n", "\n", "Therefore, creating/ loading an `Experiment` is a prerequisite for running a `Measurement`." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Data exploration" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### List all the experiments in the database " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The list of experiments that are stored in the database can be called back as follows:" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[dataset_context_manager#no sample1#1@C:\\Users\\a-fbonabi\\Qcodes\\docs\\examples\\testing.db\n", " ---------------------------------------------------------------------------------------\n", " 1-results-1-dac_ch1,dmm_v1-10]" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "experiments()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "While our example database contains only few experiments, in reality the database will contain several experiments containing many datasets. Seldom, you would like to load a dataset from a particular experiment for further analysis. Here we shall explore different ways to find and retrieve already measured dataset from the database." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### List all the datasets in the database" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let us now retrieve the datasets stored within the current experiment via:" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[results #1@C:\\Users\\a-fbonabi\\Qcodes\\docs\\examples\\testing.db\n", " -------------------------------------------------------------\n", " dac_ch1 - numeric\n", " dmm_v1 - numeric]" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "exp.data_sets()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Load the data set using one or more specifications" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The method ``load_by_run_spec`` can be used to load a run with given specifications such as 'experiment name' and 'sample name':" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [], "source": [ "dataset = load_by_run_spec(experiment_name='dataset_context_manager', captured_run_id=1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "While the arguments are optional, the function call will raise an error if more than one run matching the supplied specifications is found. If such an error occurs, the traceback will contain the specifications of the runs, as well. Further information concerning 'Uniquely identifying and loading runs' can be found in [this example notebook](DataSet/Extracting-runs-from-one-DB-file-to-another.ipynb#Uniquely-identifying-and-loading-runs).\n", "\n", "For more information on the `DataSet` object that `load_by_run_spec` returned, refer to [DataSet class walkthrough article](DataSet/DataSet-class-walkthrough.ipynb)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Plot dataset " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We arrived at a point where we can visualize our data. To this end, we use the ``plot_dataset`` method with ``dataset`` as its argument:" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "([],\n", " [None])" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEWCAYAAAB8LwAVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAvO0lEQVR4nO3deXxcdb3/8dcnS5M2W7e0TdukK3TfaGnZLQhSFSjKIkVQvGIRAZXrzvVqvepPr6Lipcju1ctSBBc2kc0usnWltKUbLV3onnRP9yb5/P44J+10mCSTNtNJZt7PxyOPzJz1c86ZOZ/5fr/nfI+5OyIiItEykh2AiIg0T0oQIiISkxKEiIjEpAQhIiIxKUGIiEhMShAiIhKTEkQLYWZlZrbHzDKTHUtDzKynmbmZZSU7FkkvZvaGmY1IdhyJYGaTzOzRJlhOZzNbamY5DU3b5AnCzNaY2f7wZLbZzP5gZvlNvZ4Y691gZq3N7AIz+2vUuB+b2SIzqzKzSY1c7nQzOxBuT+3fc00afBzc/QN3z3f36pO97vBk3zdByx5rZusTsexkrKee9TdZ0lQCjs3MLgUq3X1+smNJNjO72szeNLN9ZjY9cpy7bwGmARMbWk6iShCXuns+MBwYAXwvQesBwMxKgW3uvh8YCbwdNclK4NvA349zFbeGJ+fav0tPINxG04lA5Kh6vg9fBh45mbE0Y9uBu4Cf1zH+MeCmhhaS0Comd98MvESQKGL+igtLHBeGryeZ2ZNm9n9mVmlmi81sVByrGgXMi3h9TIJw9z+6+z+AyhPbomOZ2XfMbFbtB9bMbg5jzo34lTfRzDaa2SYz+2bEvBlm9l0ze9/MtoXb3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7NewVN3pdV4WNykRVMZ2IpUDfqGFTgN8Aq9x9fe3AsFG+C0GnbSJJoQQhLUL40JjLgY+Y2Wozm03wKMra5xT/Dvi8mS0gaB/YGw5fCFSH1VG3Aw8BS4C3zexd4H6iStLuvhj4KTAjXF5kN9QxmdlrBFVbHzWz9WZ2cYzJ/k7QO2ukpwjaV6Krl0YCM929qqF1iySKenMVOYnM7HXgEnff2cB0vwWeDa+OEkkKlSBETq5vEDzjoCHvKjlIsqkEISIiMakEISIiMSlBiIhITEoQIiISkxKEiIjEpAQhIiIx/X9tTdLERQQFGgAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "plot_dataset(dataset)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For more detailed examples of plotting QCoDeS datasets, refer to the following articles:\n", "\n", "- [Offline plotting tutorial](DataSet/Offline%20Plotting%20Tutorial.ipynb)\n", "- [Offline plotting with categorical data](DataSet/Offline%20plotting%20with%20categorical%20data.ipynb)\n", "- [Offline plotting with complex data](DataSet/Offline%20plotting%20with%20complex%20data.ipynb)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Get data of specific parameter of a dataset" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If you are interested in numerical values of a particular parameter within a given dataset, the corresponding data can be retrieved by using `get_parameter_data` method:" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'dac_ch1': {'dac_ch1': array([ 0. , 2.77777778, 5.55555556, 8.33333333, 11.11111111,\n", " 13.88888889, 16.66666667, 19.44444444, 22.22222222, 25. ])}}" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dataset.get_parameter_data('dac_ch1')" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'dmm_v1': {'dmm_v1': array([ 5.03214429, 2.84005862, 1.72687832, 1.00516019, 0.58016103,\n", " 0.33032958, 0.24695827, 0.30077668, 0.13850775, -0.07606096]),\n", " 'dac_ch1': array([ 0. , 2.77777778, 5.55555556, 8.33333333, 11.11111111,\n", " 13.88888889, 16.66666667, 19.44444444, 22.22222222, 25. ])}}" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dataset.get_parameter_data('dmm_v1')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We refer reader to [exporting data section of the performing measurements using qcodes parameters and dataset](DataSet/Performing-measurements-using-qcodes-parameters-and-dataset.ipynb#Accessing-and-exporting-the-measured-data) and [Accessing data in DataSet notebook](DataSet/Accessing-data-in-DataSet.ipynb) for further information on `get_parameter_data` method." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Export data to pandas dataframe" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If desired, any data stored within a QCoDeS database can also be exported as pandas dataframes. This can be achieved via:" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
dmm_v1
dac_ch1
0.0000005.032144
2.7777782.840059
5.5555561.726878
8.3333331.005160
11.1111110.580161
\n", "
" ], "text/plain": [ " dmm_v1\n", "dac_ch1 \n", "0.000000 5.032144\n", "2.777778 2.840059\n", "5.555556 1.726878\n", "8.333333 1.005160\n", "11.111111 0.580161" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = dataset.to_pandas_dataframe_dict()['dmm_v1']\n", "df.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Export data to xarray" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It's also possible to export data stored within a QCoDeS database to an `xarray.DataArray`. This can be achieved via:" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
<xarray.DataArray 'dmm_v1' (dac_ch1: 5)>\n",
       "array([5.03214429, 2.84005862, 1.72687832, 1.00516019, 0.58016103])\n",
       "Coordinates:\n",
       "  * dac_ch1  (dac_ch1) float64 0.0 2.778 5.556 8.333 11.11\n",
       "Attributes:\n",
       "    name:           dmm_v1\n",
       "    paramtype:      numeric\n",
       "    label:          Gate v1\n",
       "    unit:           V\n",
       "    inferred_from:  []\n",
       "    depends_on:     ['dac_ch1']
" ], "text/plain": [ "\n", "array([5.03214429, 2.84005862, 1.72687832, 1.00516019, 0.58016103])\n", "Coordinates:\n", " * dac_ch1 (dac_ch1) float64 0.0 2.778 5.556 8.333 11.11\n", "Attributes:\n", " name: dmm_v1\n", " paramtype: numeric\n", " label: Gate v1\n", " unit: V\n", " inferred_from: []\n", " depends_on: ['dac_ch1']" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "xarray = dataset.to_xarray_dataarray_dict()['dmm_v1']\n", "xarray.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We refer to [example notebook on working with pandas](DataSet/Working-With-Pandas-and-XArray.ipynb) and [Accessing data in DataSet notebook](DataSet/Accessing-data-in-DataSet.ipynb) for further information." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Explore the data using an interactive widget" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Experiments widget presents the most important information at a glance, has buttons to plot the dataset and easily explore a snapshot, enabled users to add a note to a dataset.\n", "\n", "It is only available in the Jupyter notebook because it uses [`ipywidgets`](https://ipywidgets.readthedocs.io/) to display an interactive elements.\n", "\n", "Use it in the following ways:\n", "```python\n", "# import it first\n", "from qcodes.interactive_widget import experiments_widget\n", "\n", "# and then just run it\n", "experiments_widget() \n", "\n", "# you can pass a specific database path\n", "experiments_widget(db=\"path_of_db.db\")\n", "\n", "# you can also pass a specific list of DataSets:\n", "# say, you're only interested in datasets of a particular experiment\n", "experiments = qcodes.experiments()\n", "data_sets = experiments[2].data_sets()\n", "experiments_widget(data_sets=data_sets)\n", "\n", "# you can change the sorting of the datasets\n", "# by passing None, \"run_id\", \"timestamp\" as sort_by argument:\n", "experiments_widget(sort_by=\"timestamp\")\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here's a short video that summarizes the looks and the features:\n", "\n", "![video demo about experiments widget should show here](../_static/experiments_widget.webp)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Things to remember" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### QCoDeS configuration \n", "\n", "QCoDeS uses a JSON based configuration system. It is shipped with a default configuration. The default config file should not be overwritten. If you have any modifications, you should save the updated config file on your home directory or in the current working directory of your script/notebook. The QCoDeS config system first looks in the current directory for a config file and then in the home directory for one and only then - if no config files are found - it falls back to using the default one. The default config is located in `qcodes.config`. To know how to change and save the config please refer to the [documentation on config](http://qcodes.github.io/Qcodes/user/configuration.html?)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### QCoDeS instrument drivers" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We support and provide drivers for most of the instruments currently in use at the Microsoft stations. However, if more functionalities than the ones which are currently supported by drivers are required, one may update the driver or request the features form QCoDeS team. You are more than welcome to contribute and if you would like to have a quick overview on how to write instrument drivers, please refer to the [example notebooks on writing drivers](http://qcodes.github.io/Qcodes/examples/index.html#writing-drivers)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### QCoDeS measurements live plotting with Plottr" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Plottr supports and is recommended for QCoDeS measurements live plotting. [How to use plottr with QCoDeS for live plotting](plotting/How-to-use-Plottr-with-QCoDeS-for-live-plotting.ipynb) notebook contains more information." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.7.9" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": { "height": "calc(100% - 180px)", "left": "10px", "top": "150px", "width": "303px" }, "toc_section_display": true, "toc_window_display": true }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 4 }