qkit-core


Nameqkit-core JSON
Version 0.4.6 PyPI version JSON
download
home_pageNone
SummaryqKIT quantum measurement suite in python
upload_time2024-10-31 12:39:38
maintainerNone
docs_urlNone
authorPHI AG Ustinov
requires_python>=3.7
licenseNone
keywords data acquisition framework measurement quantum
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            <p align="center">
  <img src="./images/Qkit_Logo.png" alt="QKIT" width="300">
</p>


# Qkit - a quantum measurement suite in python

[![PyPI - Version](https://img.shields.io/pypi/v/qkit-core.svg)](https://pypi.org/project/qkit-core)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/qkit-core.svg)](https://pypi.org/project/qkit-core)

## Features:
  * a collection of ipython notebooks for measurement and data analysis tasks.
  * hdf5 based data storage of 1,2 and 3 dimensional data, including a viewer.
  * classes for data fitting, e.g. of microwave resonator data. This includes also a robust circle fit algorithm.
  * extended and maintained drivers for various low frequency and microwave electronics.

### Platform:
  The qkit framework has been tested under windows and with limits under macos x and linux. 
  The gui requires h5py, qt and pyqtgraph, which work fine on these platforms. 
  The core of the framework should run with python 2.7.x/3.4+

## Configuration
There are three sources of configuration, which are used to set up your environment
- qkit defaults (you shouldn't change those)
- local config file
- configuration in notebooks

### Local config file
On import, qkit will look for a file called `qkit_local_config.py` or `local.py` in your current working directory or any of its parents. Note, that in case of a jupyter notebook, the current working directory is the directory in which your notebook is located.

If you can't put such a configuration file into a suitable location, you can set the environment variable `QKIT_LOCAL_CONFIG` with a path pointing to such a configuration file. This variable circumvents the search, and the file is directly loaded.

## Installation Guide
Installing qkit is a two step process: First you need to obtain the `qkit` package, and then you need to setup your system to use it properly. This guide will provide you with the required steps.

### Creating a Virtual Environment
It is recommended to use a virtual environment. This isolates this local environment from your global packages. This way, version conflicts can be avoided. If you choose to use a virtual environment, then it needs to be activated, otherwise, qkit and its dependencies will not be available. This also means double click to open .h5 files will require configuration.

**NOTE: WE DO NOT GUARANTEE COMPATIBILITY WITH ANACONDA/MINICONDA/CONDA! USE AT YOUR OWN RISK!**

 First, create a virtual environment:
```bash
python -m virtualenv venv
```
And then activate it on Linux:
```bash
source venv/bin/activate
```
or Windows:
```bat
.\venv\bin\activate.bat
```


### Obtaining the `qkit` package
You have two choices, based on whether you want to modify `qkit` (development) or only want to use it.

#### Install `qkit` for usage only
Create a virtual environment, as described above. Then use pip to install qkit:

```bash
pip install qkit-core[jupyter,analysis]
```

#### Install `qkit` for development
Clone this repository to wherever is convenient.
```bash
git clone https://github.com/qkitgroup/qkit
```

Create a virtual environment, as described above.

Now, you can install qkit as an editable package. This means, that you can change files in the cloned repository. Changes will affect your python setup.

The brackets contain optional dependencies. This pulls the libraries needed for jupyter lab.

```bash
pip install --editable '.[jupyter,analysis]'
```
### Configuring your system
In order to make `.h5`-files clickable and to configure qkit globally, run

```bash
qkit-install
```

On Windows, some of the changes require editing the registry. `qkit-install` can do that automatically, if run with elevated priviledges (as an Admin). To do so, run in a PowerShell
```ps1
Start-Process qkit-install -Verb runAs
```

This will associate `.h5`-files with qkit, and set the environment variables `QKIT_LOCAL_CONFIG` and `QKIT_VENV` to the correct values. It will also
create the required directories for data, notebooks and logs, and it will instantiate the configuration files for Jupyter Lab and Qkit.

If the notebooks folder this creates does not match your needs, you can change it by modifiying `jupyter_lab_config.py`:
```python 
# Set Notebook directory
notebook_dir = r'C:\notebooks' # Change this line
```

### Launching Jupyter Lab
On Linux, `qkit-install` will install a desktop file to launch Qkit. Look for "Qkit Jupyter Lab".
On Windows, `qkit-install` will create a batch script `launch.bat`. You can create a shortcut to it to launch it from the desktop.

## Upgrading
If you use an existing installation of qkit, there might be some breaking changes. They are not major, but need to be taken care of.
### Migrating Configuration
Previously, the configuration of qkit was located in `qkit/config/local.py`. As this directory is now a child of `src/`, you are probably not supposed to touch this file. This method is deprecated (you will receive warnings).

Instead, in a parent directory, a file named `qkit_local_config.py` is used to configure your environment.

To migrate, copy the code in your old `local.py` into the new `qkit_local_config.py` file. Do note, however, that the `datadir` and `logdir` paths have changed. It is recommended to use the new values. Conflicting entries in your config may need to be deleted.

### "My changes to the configuration are not applied after upgrading"
If your notebooks do not reside in a child directory of qkit, the `qkit_local_config.py` may not be found, as each notebook launches a Python process in its location running itself. Thus `qkit_local_config.py` may not be in any of the notebooks parent directories. In this case, either set the environment variable `QKIT_LOCAL_CONFIG` to your configuration, or place the configuration in your notebook directory instead.

### Migrating Notebooks
The new setup assumes, that notebooks are located in `notebooks/`. This way, `qkit_local_config.py` is in a parent directory of your notebooks and is thus loaded when you initialize qkit in your notebooks.

On measurement computers, it is recommended to move your notebooks into that directory. Alternatively, update `jupyter_lab_config.py` to point to the notebook directory:

```python 
# Set Notebook directory
notebook_dir = 'notebooks' # Change this line
```
On Windows, this might be set to:
```python 
# Set Notebook directory
notebook_dir = r'C:\notebooks' # Change this line
```

Also, you will need to migrate your local config to a parent directory of your notebooks, or point to it using the environment variable `QKIT_LOCAL_CONFIG`. It is possible to set this environment variable in `jupyter_lab_config.py`, as environment variables are inherited to process children.


## Long Term Goal: Pip Installation (NOT YET WORKING)
If you intend to actively work on the code, look at the section for developing this code.
To install this package, run:
```bash
pip install 'qkit[jupyter,analysis] @ git+https://github.com/qkitgroup/qkit.git@master'
```
If you are simply using qkit, changes to files in `src/` **should not** be necessary. If you find things you need to change there, this might be a bug. Please report this.

If you intend to use the option to click on .h5 files in order to open them, don't install qkit in a virtual environment.

## Requirements
This project uses python. An up to date installation of python is expected to be present.
| Library | Usage |
| ------- | ----- |
| [pyqt5](https://pypi.org/project/PyQt5/) | GUI   | 
| [numpy](https://pypi.org/project/numpy/), [scipy](https://pypi.org/project/scipy/), [uncertainties](https://pypi.org/project/uncertainties/) | General Usage |
| [pyqtgraph](https://pypi.org/project/pyqtgraph/), [matplotlib](https://pypi.org/project/matplotlib/) | Plotting |
| [h5py](https://pypi.org/project/h5py/) | Data Stroage |
| [jupyterlab](https://pypi.org/project/jupyterlab/) | Interactive Notebooks |
| [jupyterlab-templates](https://pypi.org/project/jupyterlab-templates/) | Notebook Templating |
| [pyvisa](https://pypi.org/project/PyVISA/), [pyvisa-py](https://pypi.org/project/PyVISA-py/) | Communication with Devices |
| [zhinst](https://pypi.org/project/zhinst/) | Drivers for Zurich Instruments devices |
| [zeromq](https://pypi.org/project/pyzmq/) | Messaging |  
| [toml](https://pypi.org/project/toml/) | Configuration |

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "qkit-core",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "Data Acquisition, Framework, Measurement, Quantum",
    "author": "PHI AG Ustinov",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/6c/f5/b13bb060d834fe259e281b5e12d7d09c5d6c53c5c11108ed508b9c9a8dc4/qkit_core-0.4.6.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n  <img src=\"./images/Qkit_Logo.png\" alt=\"QKIT\" width=\"300\">\n</p>\n\n\n# Qkit - a quantum measurement suite in python\n\n[![PyPI - Version](https://img.shields.io/pypi/v/qkit-core.svg)](https://pypi.org/project/qkit-core)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/qkit-core.svg)](https://pypi.org/project/qkit-core)\n\n## Features:\n  * a collection of ipython notebooks for measurement and data analysis tasks.\n  * hdf5 based data storage of 1,2 and 3 dimensional data, including a viewer.\n  * classes for data fitting, e.g. of microwave resonator data. This includes also a robust circle fit algorithm.\n  * extended and maintained drivers for various low frequency and microwave electronics.\n\n### Platform:\n  The qkit framework has been tested under windows and with limits under macos x and linux. \n  The gui requires h5py, qt and pyqtgraph, which work fine on these platforms. \n  The core of the framework should run with python 2.7.x/3.4+\n\n## Configuration\nThere are three sources of configuration, which are used to set up your environment\n- qkit defaults (you shouldn't change those)\n- local config file\n- configuration in notebooks\n\n### Local config file\nOn import, qkit will look for a file called `qkit_local_config.py` or `local.py` in your current working directory or any of its parents. Note, that in case of a jupyter notebook, the current working directory is the directory in which your notebook is located.\n\nIf you can't put such a configuration file into a suitable location, you can set the environment variable `QKIT_LOCAL_CONFIG` with a path pointing to such a configuration file. This variable circumvents the search, and the file is directly loaded.\n\n## Installation Guide\nInstalling qkit is a two step process: First you need to obtain the `qkit` package, and then you need to setup your system to use it properly. This guide will provide you with the required steps.\n\n### Creating a Virtual Environment\nIt is recommended to use a virtual environment. This isolates this local environment from your global packages. This way, version conflicts can be avoided. If you choose to use a virtual environment, then it needs to be activated, otherwise, qkit and its dependencies will not be available. This also means double click to open .h5 files will require configuration.\n\n**NOTE: WE DO NOT GUARANTEE COMPATIBILITY WITH ANACONDA/MINICONDA/CONDA! USE AT YOUR OWN RISK!**\n\n First, create a virtual environment:\n```bash\npython -m virtualenv venv\n```\nAnd then activate it on Linux:\n```bash\nsource venv/bin/activate\n```\nor Windows:\n```bat\n.\\venv\\bin\\activate.bat\n```\n\n\n### Obtaining the `qkit` package\nYou have two choices, based on whether you want to modify `qkit` (development) or only want to use it.\n\n#### Install `qkit` for usage only\nCreate a virtual environment, as described above. Then use pip to install qkit:\n\n```bash\npip install qkit-core[jupyter,analysis]\n```\n\n#### Install `qkit` for development\nClone this repository to wherever is convenient.\n```bash\ngit clone https://github.com/qkitgroup/qkit\n```\n\nCreate a virtual environment, as described above.\n\nNow, you can install qkit as an editable package. This means, that you can change files in the cloned repository. Changes will affect your python setup.\n\nThe brackets contain optional dependencies. This pulls the libraries needed for jupyter lab.\n\n```bash\npip install --editable '.[jupyter,analysis]'\n```\n### Configuring your system\nIn order to make `.h5`-files clickable and to configure qkit globally, run\n\n```bash\nqkit-install\n```\n\nOn Windows, some of the changes require editing the registry. `qkit-install` can do that automatically, if run with elevated priviledges (as an Admin). To do so, run in a PowerShell\n```ps1\nStart-Process qkit-install -Verb runAs\n```\n\nThis will associate `.h5`-files with qkit, and set the environment variables `QKIT_LOCAL_CONFIG` and `QKIT_VENV` to the correct values. It will also\ncreate the required directories for data, notebooks and logs, and it will instantiate the configuration files for Jupyter Lab and Qkit.\n\nIf the notebooks folder this creates does not match your needs, you can change it by modifiying `jupyter_lab_config.py`:\n```python \n# Set Notebook directory\nnotebook_dir = r'C:\\notebooks' # Change this line\n```\n\n### Launching Jupyter Lab\nOn Linux, `qkit-install` will install a desktop file to launch Qkit. Look for \"Qkit Jupyter Lab\".\nOn Windows, `qkit-install` will create a batch script `launch.bat`. You can create a shortcut to it to launch it from the desktop.\n\n## Upgrading\nIf you use an existing installation of qkit, there might be some breaking changes. They are not major, but need to be taken care of.\n### Migrating Configuration\nPreviously, the configuration of qkit was located in `qkit/config/local.py`. As this directory is now a child of `src/`, you are probably not supposed to touch this file. This method is deprecated (you will receive warnings).\n\nInstead, in a parent directory, a file named `qkit_local_config.py` is used to configure your environment.\n\nTo migrate, copy the code in your old `local.py` into the new `qkit_local_config.py` file. Do note, however, that the `datadir` and `logdir` paths have changed. It is recommended to use the new values. Conflicting entries in your config may need to be deleted.\n\n### \"My changes to the configuration are not applied after upgrading\"\nIf your notebooks do not reside in a child directory of qkit, the `qkit_local_config.py` may not be found, as each notebook launches a Python process in its location running itself. Thus `qkit_local_config.py` may not be in any of the notebooks parent directories. In this case, either set the environment variable `QKIT_LOCAL_CONFIG` to your configuration, or place the configuration in your notebook directory instead.\n\n### Migrating Notebooks\nThe new setup assumes, that notebooks are located in `notebooks/`. This way, `qkit_local_config.py` is in a parent directory of your notebooks and is thus loaded when you initialize qkit in your notebooks.\n\nOn measurement computers, it is recommended to move your notebooks into that directory. Alternatively, update `jupyter_lab_config.py` to point to the notebook directory:\n\n```python \n# Set Notebook directory\nnotebook_dir = 'notebooks' # Change this line\n```\nOn Windows, this might be set to:\n```python \n# Set Notebook directory\nnotebook_dir = r'C:\\notebooks' # Change this line\n```\n\nAlso, you will need to migrate your local config to a parent directory of your notebooks, or point to it using the environment variable `QKIT_LOCAL_CONFIG`. It is possible to set this environment variable in `jupyter_lab_config.py`, as environment variables are inherited to process children.\n\n\n## Long Term Goal: Pip Installation (NOT YET WORKING)\nIf you intend to actively work on the code, look at the section for developing this code.\nTo install this package, run:\n```bash\npip install 'qkit[jupyter,analysis] @ git+https://github.com/qkitgroup/qkit.git@master'\n```\nIf you are simply using qkit, changes to files in `src/` **should not** be necessary. If you find things you need to change there, this might be a bug. Please report this.\n\nIf you intend to use the option to click on .h5 files in order to open them, don't install qkit in a virtual environment.\n\n## Requirements\nThis project uses python. An up to date installation of python is expected to be present.\n| Library | Usage |\n| ------- | ----- |\n| [pyqt5](https://pypi.org/project/PyQt5/) | GUI   | \n| [numpy](https://pypi.org/project/numpy/), [scipy](https://pypi.org/project/scipy/), [uncertainties](https://pypi.org/project/uncertainties/) | General Usage |\n| [pyqtgraph](https://pypi.org/project/pyqtgraph/), [matplotlib](https://pypi.org/project/matplotlib/) | Plotting |\n| [h5py](https://pypi.org/project/h5py/) | Data Stroage |\n| [jupyterlab](https://pypi.org/project/jupyterlab/) | Interactive Notebooks |\n| [jupyterlab-templates](https://pypi.org/project/jupyterlab-templates/) | Notebook Templating |\n| [pyvisa](https://pypi.org/project/PyVISA/), [pyvisa-py](https://pypi.org/project/PyVISA-py/) | Communication with Devices |\n| [zhinst](https://pypi.org/project/zhinst/) | Drivers for Zurich Instruments devices |\n| [zeromq](https://pypi.org/project/pyzmq/) | Messaging |  \n| [toml](https://pypi.org/project/toml/) | Configuration |\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "qKIT quantum measurement suite in python",
    "version": "0.4.6",
    "project_urls": {
        "Bug Tracker": "https://github.com/qkitgroup/qkit/issues",
        "Homepage": "https://github.com/qkitgroup/qkit"
    },
    "split_keywords": [
        "data acquisition",
        " framework",
        " measurement",
        " quantum"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "809fedf4a5c21c882c0018fc9e7cb9261cd587f6b8008daa884d97d407c7ef18",
                "md5": "30541e8457c7676e5bb7e3ff31e982e1",
                "sha256": "18fbf12f1e2082b5b1e890f6c4590b8961ec26f990fbb09909be0df62e13c1f6"
            },
            "downloads": -1,
            "filename": "qkit_core-0.4.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "30541e8457c7676e5bb7e3ff31e982e1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 5237762,
            "upload_time": "2024-10-31T12:39:39",
            "upload_time_iso_8601": "2024-10-31T12:39:39.889195Z",
            "url": "https://files.pythonhosted.org/packages/80/9f/edf4a5c21c882c0018fc9e7cb9261cd587f6b8008daa884d97d407c7ef18/qkit_core-0.4.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6cf5b13bb060d834fe259e281b5e12d7d09c5d6c53c5c11108ed508b9c9a8dc4",
                "md5": "ce12e30565edf1dec1f2d4d42036f224",
                "sha256": "fb1434b3ea9742a9b53b60745d23e843271a6448960036719d0c24b008590d04"
            },
            "downloads": -1,
            "filename": "qkit_core-0.4.6.tar.gz",
            "has_sig": false,
            "md5_digest": "ce12e30565edf1dec1f2d4d42036f224",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 5505958,
            "upload_time": "2024-10-31T12:39:38",
            "upload_time_iso_8601": "2024-10-31T12:39:38.108317Z",
            "url": "https://files.pythonhosted.org/packages/6c/f5/b13bb060d834fe259e281b5e12d7d09c5d6c53c5c11108ed508b9c9a8dc4/qkit_core-0.4.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-31 12:39:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "qkitgroup",
    "github_project": "qkit",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "lcname": "qkit-core"
}
        
Elapsed time: 0.36783s