Skip to main content

Plot your spicy quantum measurements with ease

Project description

Qimchi

Plotly based data visualization tool for xarray data. Optimized to work with the qcutils package. Qimchi expects the data to be zarr formatted xarray files, documentation for handling these files can be found here.

Full API documentation and more can be found here

Installation

Qimchi supports multiple installation methods, including Docker, uv, and pip. We recommend using Docker, as it provides a containerized environment that isolates Qimchi from your local system. This ensures a smooth setup with all required dependencies and avoids potential conflicts with other software.

This guide provides instructions for installing Qimchi using various methods. Choose the one that best suits your use case.

Docker Installation

[!tip] Recommended, scroll down for local installation instructions.

Prerequisites

First, ensure Docker is installed on your system. You can find installation instructions on the official Docker website.

[!important] Docker might require administrative privileges to be installed and run.

Basic Setup

To get started quickly without domain configuration, use the following compose.yaml file:

networks:
  squad:
    driver: bridge

services:
  qimchi:
    image: registry.gitlab.com/squad-lab/qimchi:latest
    container_name: qimchi
    profiles: ["webdev"]
    restart: unless-stopped
    ports:
      - 80:80
    volumes:
      - ./qimchi/data:/root/.qimchi/
      - /your/data/:/data/
    networks:
      - squad

Environment variables can be provided via a .env file:

NUM_WORKERS=10

This setup exposes Qimchi on localhost:80.

Advanced Setup (with Cloudflare Domain + HTTPS)

For production deployments with HTTPS and domain support (e.g., via Cloudflare), use the following compose.yaml configuration:

networks:
  squad:
    driver: bridge

services:
  nginx:
    image: nginx:latest
    container_name: nginx
    profiles: ["webdev"]
    user: root
    restart: unless-stopped
    volumes:
      - ./nginx/conf.d:/etc/nginx/conf.d
      - ./nginx/letsencrypt:/etc/letsencrypt
      - ./nginx/html:/usr/share/nginx/html
    ports:
      - 80:80
      - 443:443
    networks:
      - squad

  certbot:
    image: certbot/dns-cloudflare
    container_name: certbot
    profiles: ["webdev"]
    restart: unless-stopped
    env_file:
      - .env
    volumes:
      - ./nginx/letsencrypt:/etc/letsencrypt
      - ./nginx/html:/usr/share/nginx/html
      - ./nginx/certbot-secrets:/certbot-secrets
    entrypoint: >
      /bin/sh -c '
      echo "dns_cloudflare_api_token=$$CLOUDFLARE_API_TOKEN" > /certbot-secrets/cloudflare.ini;
      chmod 600 /certbot-secrets/cloudflare.ini;
      trap exit TERM;
      while :; do certbot renew; sleep 12h & wait $${!}; done;
      '
    networks:
      - squad

  qimchi:
    image: registry.gitlab.com/squad-lab/qimchi:latest
    container_name: qimchi
    profiles: ["webdev"]
    restart: unless-stopped
    volumes:
      - ./qimchi/data:/root/.qimchi/
      - /your/data/:/data/
    networks:
      - squad

Environment file .env example:

CLOUDFLARE_API_TOKEN=your_cloudflare_api_token
NUM_WORKERS=10

Example NGINX configuration (./nginx/conf.d/default.conf):

server {
    listen 80;
    server_name example.domain.org;

    # Redirect all HTTP traffic to HTTPS
    location / {
        return 301 https://$host$request_uri;
    }
}

server {
    listen 443 ssl;
    server_name plot.domain.org;

    ssl_certificate /etc/letsencrypt/live/domain.org/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/domain.org/privkey.pem;

    location / {
        proxy_pass http://qimchi:80;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
    }
}

This setup uses Certbot with Cloudflare for automatic TLS certificate renewal. Be sure to replace domain.org and plot.domain.org with your actual domain names.

[!note] The CLOUDFLARE_API_TOKEN environment variable is used to authenticate with Cloudflare's DNS API for domain verification.

Local Installation

With uv

Follow the official instructions from Astral's website to install uv. uv manages virtual environments and dependencies for you, making it easier to work with Python packages. For this project, we include the lock file which allows you to use the exact package versions we used to develop the package.

Measure and Plot

   uv init measurement_name
   cd measurement_name
   uv add qimchi

This method should automatically generate a virtual environment and install the package with all its dependencies. To add more packages to the current measurement/project, you can use the uv add command. For example, to add qcodes to the current project, run:

   uv add qcodes

uv automatically creates and manages the virtual environment for you.

Run Qimchi

To run Qimchi, use the following command:

   uv run -m qimchi

This command will start the Qimchi application, and you can access it in your web browser at http://localhost. If you can't. please check if you are allowed to have a hosted session at port 80. If not, you can run the application on a different port by using the -p option:

   uv run -m qimchi -p 8080

With pip

Create and activate a virtual environment

On macOS or Linux:

   python3 -m venv .venv
   source .venv/bin/activate

On Windows:

   python3 -m venv .venv
   .venv\Scripts\activate

Install the package

   pip install git+https://gitlab.com/squad-lab/qimchi.git

Run Qimchi

After activating the virtual environment, you can run the package with:

   python -m qimchi

This command will start the Qimchi application, and you can access it in your web browser at http://localhost. If you can't. please check if you are allowed to have a hosted session at port 80. If not, you can run the application on a different port by using the -p option:

   python -m qimchi -p 8080

Development Installation

We strongly recommend using uv for development. You can clone and install the package locally with uv.

   git clone https://gitlab.com/squad-lab/qimchi.git
   cd qimchi
   uv add --dev .

This makes and installs qimchi in a virtual environment with all dependencies.

Measurements

Measurement examples while using qcutils can be found in its own repository. Refer to its repository for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qimchi-0.0.20.tar.gz (134.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qimchi-0.0.20-py3-none-any.whl (141.8 kB view details)

Uploaded Python 3

File details

Details for the file qimchi-0.0.20.tar.gz.

File metadata

  • Download URL: qimchi-0.0.20.tar.gz
  • Upload date:
  • Size: 134.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for qimchi-0.0.20.tar.gz
Algorithm Hash digest
SHA256 639b12738271f71b11fb3e0f33c8388d00105fc8dada3790deb82c47434fc318
MD5 3c02d8f36474f5c5b3ff13d88bee2f3a
BLAKE2b-256 3a72cf7bebb3e4e43db0a2a1ea0b2e960b9e8e54487fc52de0045a9a0a717f7c

See more details on using hashes here.

File details

Details for the file qimchi-0.0.20-py3-none-any.whl.

File metadata

  • Download URL: qimchi-0.0.20-py3-none-any.whl
  • Upload date:
  • Size: 141.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for qimchi-0.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 ae1ee21afc3fe20033ba22ba11ac9c514b23e8a3ec33af59f3a3b4d2ae1f5aa5
MD5 9321d08524be548aac22dc568a172055
BLAKE2b-256 57b0b76307c8f014d2277ac1a7cf5fe5eb7d4e20afc8c834eeac272c4cc1c071

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page