{"id":15015019,"url":"https://github.com/adgt/pyquirk","last_synced_at":"2025-04-09T19:24:00.400Z","repository":{"id":39988740,"uuid":"313829973","full_name":"adgt/pyQuirk","owner":"adgt","description":"A Python widget for Quirk to be used in Jupyter notebooks, JupyterLab, and the IPython kernel.","archived":false,"fork":false,"pushed_at":"2022-05-19T21:35:40.000Z","size":1085,"stargazers_count":24,"open_issues_count":1,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-18T14:49:50.750Z","etag":null,"topics":["quantum-computing"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adgt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-18T05:13:10.000Z","updated_at":"2024-08-10T15:09:25.000Z","dependencies_parsed_at":"2022-09-05T02:00:51.883Z","dependency_job_id":null,"html_url":"https://github.com/adgt/pyQuirk","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adgt%2FpyQuirk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adgt%2FpyQuirk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adgt%2FpyQuirk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adgt%2FpyQuirk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adgt","download_url":"https://codeload.github.com/adgt/pyQuirk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248096200,"owners_count":21046998,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["quantum-computing"],"created_at":"2024-09-24T19:46:23.919Z","updated_at":"2025-04-09T19:24:00.381Z","avatar_url":"https://github.com/adgt.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# pyQuirk\n[![pypi](https://img.shields.io/pypi/v/pyQuirk.svg)](https://pypi.org/project/pyQuirk/)\n\nA Python [widget](https://github.com/jupyter-widgets/ipywidgets) for [Quirk](https://github.com/Strilanc/Quirk) to be used in Jupyter notebooks, JupyterLab, and the IPython kernel.\n\n![Example](example.gif)\n\n## Getting Started\n### Installation\n\nTo install use pip (JupyterLab 3 recommended):\n\n    $ pip install pyQuirk\n\nIf you are wanting to use this with JupyterLab 2 or a classical Jupyter notebook install (i.e. not the one included with JupyterLab 3), then you can try following the [development install instructions](#development) below, but YMMV.\n\n### Example\n\nTake a look at [example.ipynb](example.ipynb) for a simple example.\n\nOtherwise, you can simply run:\n```python\nfrom pyQuirk import Quirk\nquirk = Quirk()\nquirk\n```\n\n### API\n\nQuirk()\n- `width`: display width of the widget\n- `height`: display height of the widget\n- `scale`: scale of the inner Quirk display (default 0.5)\n- `value`: circuit in Quirk format\n- `circuit_qasm`: read-only property to get the qasm of the current circuit\n- `update_circuit(circuit)`: convenience function for passing a Qiskit circuit\n- `update_from_qasm(qasm)`: replace the current circuit with qasm (not all gates supported, currently)\n\n## Development\n\nFor a development installation (requires [Node.js](https://nodejs.org) and [Yarn version 1](https://classic.yarnpkg.com/)),\n\n    $ git clone https://github.com/adgt/pyQuirk.git\n    $ cd pyQuirk\n    $ pip install -e .\n\nIf you are working with Jupyter notebook, then run these commands:\n\n    $ jupyter nbextension install --py --symlink --overwrite --sys-prefix pyQuirk\n    $ jupyter nbextension enable --py --sys-prefix pyQuirk\n\nIf you are working with JupyterLab 3, run the command:\n\n    $ jupyter labextension develop --overwrite pyQuirk\n\nThen you need to rebuild the JS when you make a code change:\n\n    $ cd js\n    $ yarn run build\n\nYou then need to refresh the JupyterLab page when your javascript changes.\n\n#### Project repository created with the [widget-cookiecutter](https://github.com/jupyter-widgets/widget-cookiecutter) template","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadgt%2Fpyquirk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadgt%2Fpyquirk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadgt%2Fpyquirk/lists"}