Skip to main content

jcircuit: Jupyter Circuit Designer

Jupyter Notebook widget for creating and exporting quantum circuits using the QuCAT Circuit generator. Built with AnyWidget and esbuild.

Users' Documentation

You can install jcircuit with pip:

pip install jcircuit

Open a Jupyter Notebook and run:

from jcircuit import JCircuitWidget

my_widget = JCircuitWidget()
my_widget

Once you have created your QuCAT circuit, you can click on the Export circuit button. Only then can you view the netlist elements in the Jupyter Notebook with:

my_widget.circuitElements

See example.ipynb.

Developers' Documentation

Overview

This Python Jupyter Notebook widget is built with AnyWidget and uses esbuild to bundle the JavaScript code.

You can change the QuCAT Circuit Generator version in the dependencies section of package.json. This file defines the npm dependencies and the build scripts needed for the JavaScript code.

The JavaScript code is in src/widget.js. This has to be kept in sync with gui-circuit-generator/src/gui/main.js and just enough of gui-circuit-generator/src/gui/gui.html, converted to JavaScript.

You can change the (Test)PyPI version number in pyproject.toml. This file defines the Python package metadata and dependencies.

The Python code is in jcircuit/__init__.py. The building process creates a jcircuit/static directory with the bundled JavaScript code and other static files needed for the widget.

The environment.yml file defines the conda environment with the necessary dependencies for development.

Conda Environment

You can create a conda environment with:

conda env create -y -f environment.yml

Activate the environment with:

conda activate jcircuit

Javascript part

You can create and activate an npm environment with:

nodeenv node_env
# source node_env/bin/activate  # linux
# Windows is more complicated, but these 2 lines should work:
export NODE_VIRTUAL_ENV=${PWD}/node_env
export PATH=${NODE_VIRTUAL_ENV}/Scripts:${PATH}

Install the npm dependencies with:

npm install

Build the Javascript module with:

npm run build

Python part

Build the Python package with:

python -m build

Upload to TestPyPI with:

python -m twine upload --repository testpypi dist/*

Upload to PyPI (production) with:

python -m twine upload dist/*

Metadata

Release files for jcircuit 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jcircuit 0.0.1
File Size Uploaded
jcircuit-0.0.1.tar.gz 339.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jcircuit 0.0.1
File Interpreter ABI Platform
jcircuit-0.0.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 727.1 kB

Release files / jcircuit-0.0.1.tar.gz

Download URL jcircuit-0.0.1.tar.gz
Size 339.6 kB
Tags Source
SHA-256 checksum
How to use checksums
16389de447b1947a2d41893fee7c978865bdfa3498ebd624e4bcbd1ec83d0414
BLAKE2b-256 checksum
How to use checksums
a6b2be42847b3ab13a12cd30d63f0705d2bb28611cdc45921d97a6fd9e5d6cae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / jcircuit-0.0.1-py2.py3-none-any.whl

Download URL jcircuit-0.0.1-py2.py3-none-any.whl
Size 387.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
1053b134fb02d36d2011c8c710a96ce8590cd837e6c652c43d1f82093cfba082
BLAKE2b-256 checksum
How to use checksums
3fd9bf9dfcf53d7d5bd0c618e85f1e83005892fc18c2ac1e951c01f6f8fa5f1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page