Skip to main content

No project description provided

Project description

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/*

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

jcircuit-0.0.1.tar.gz (339.6 kB view details)

Uploaded Source

Built Distribution

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

jcircuit-0.0.1-py2.py3-none-any.whl (387.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file jcircuit-0.0.1.tar.gz.

File metadata

  • Download URL: jcircuit-0.0.1.tar.gz
  • Upload date:
  • Size: 339.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for jcircuit-0.0.1.tar.gz
Algorithm Hash digest
SHA256 16389de447b1947a2d41893fee7c978865bdfa3498ebd624e4bcbd1ec83d0414
MD5 9f476c6468cecf6a0ee5cb66ff59474d
BLAKE2b-256 a6b2be42847b3ab13a12cd30d63f0705d2bb28611cdc45921d97a6fd9e5d6cae

See more details on using hashes here.

File details

Details for the file jcircuit-0.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: jcircuit-0.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 387.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for jcircuit-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1053b134fb02d36d2011c8c710a96ce8590cd837e6c652c43d1f82093cfba082
MD5 10431bc65275e8963c4bc8e1f0186eb9
BLAKE2b-256 3fd9bf9dfcf53d7d5bd0c618e85f1e83005892fc18c2ac1e951c01f6f8fa5f1b

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