<div align="center">
<img width="200px" alt="Cirq logo"
src="https://raw.githubusercontent.com/quantumlib/Cirq/refs/heads/main/docs/images/Cirq_logo_color.svg">
</div>
# cirq-web
[Cirq] is a Python package for writing, manipulating, and running [quantum
circuits](https://en.wikipedia.org/wiki/Quantum_circuit) on quantum computers
and simulators. Cirq provides useful abstractions for dealing with today’s
[noisy intermediate-scale quantum](https://arxiv.org/abs/1801.00862) (NISQ)
computers, where the details of quantum hardware are vital to achieving
state-of-the-art results. For more information about Cirq, please visit the
[Cirq documentation site].
This Python module is `cirq-web`, which allows users to take advantage of
browser-based 3D visualization tools and features in Cirq. `cirq-web` also
provides a development environment for contributors to create and add their
own visualizations to the module.
[Cirq]: https://github.com/quantumlib/cirq
[Cirq documentation site]: https://quantumai.google/cirq
## Installation
This module is built on top of [Cirq]; installing this module will
automatically install the `cirq-core` module and other dependencies. There are
two installation options for the `cirq-web` module:
* To install the stable version of `cirq-web`, use
```shell
pip install cirq-web
```
* To install the latest pre-release version of `cirq-web`, use
```shell
pip install --upgrade cirq-web~=1.0.dev
```
(The `~=` has a special meaning to `pip` of selecting the latest version
compatible with the `1.*` and `dev` in the name. Despite appearances,
this will not install an old version 1.0 release!)
If you would like to install Cirq with all the optional modules, not just
`cirq-web`, then instead of the above commands, use `pip install cirq` for the
stable release or `pip install --upgrade cirq~=1.0.dev` for the latest pre-release
version.
## Documentation
Documentation for `cirq-web` can be found in the `README` files located in the
module's subdirectories in the [Cirq repository on GitHub]. To get started
with using Cirq in general, please refer to the [Cirq documentation site].
Below is a quick example of using `cirq-web` to generate a portable 3D
rendering of the Bloch sphere:
```python
import cirq
from cirq_web import BlochSphere
# Prepare a state
zero_state = [1+0j, 0+0j]
state_vector = cirq.to_valid_state_vector(zero_state)
# Create and display the Bloch sphere
sphere = BlochSphere(state_vector=state_vector)
sphere.generate_html_file()
```
This will create an HTML file in the current working directory. There are
additional options to specify the output directory or to open the
visualization in a browser, for example.
You can also view and interact with a Bloch sphere in a [Google
Colab](https://colab.google.com) notebook or Jupyter notebook. Here is an
example:
```python
import cirq
from cirq_web import BlochSphere
# Prepare a state
zero_state = [1+0j, 0+0j]
state_vector = cirq.to_valid_state_vector(zero_state)
# Create and display the Bloch sphere
sphere = BlochSphere(state_vector=state_vector)
display(sphere)
```
You can find more example Jupyter notebooks in the `cirq-web` subdirectory of
the [Cirq repository on GitHub].
For more information about getting help, reporting bugs, and other matters
related to Cirq and the Cirq-Web integration module, please visit the [Cirq
repository on GitHub].
[Cirq repository on GitHub]: https://github.com/quantumlib/Cirq
## Disclaimer
Cirq is not an official Google product. Copyright 2019 The Cirq Developers.
Raw data
{
"_id": null,
"home_page": "http://github.com/quantumlib/cirq",
"name": "cirq-web",
"maintainer": "Google Quantum AI open-source maintainers",
"docs_url": null,
"requires_python": ">=3.10.0",
"maintainer_email": "quantum-oss-maintainers@google.com",
"keywords": "algorithms, api, cirq, google, google quantum, nisq, python, quantum, quantum algorithms, quantum circuit, quantum circuit simulator, quantum computer simulator, quantum computing, quantum development kit, quantum information, quantum programming, quantum programming language, quantum simulation, sdk, simulation",
"author": "The Cirq Developers",
"author_email": "cirq-dev@googlegroups.com",
"download_url": null,
"platform": null,
"description": "<div align=\"center\">\n<img width=\"200px\" alt=\"Cirq logo\"\nsrc=\"https://raw.githubusercontent.com/quantumlib/Cirq/refs/heads/main/docs/images/Cirq_logo_color.svg\">\n</div>\n\n# cirq-web\n\n[Cirq] is a Python package for writing, manipulating, and running [quantum\ncircuits](https://en.wikipedia.org/wiki/Quantum_circuit) on quantum computers\nand simulators. Cirq provides useful abstractions for dealing with today\u2019s\n[noisy intermediate-scale quantum](https://arxiv.org/abs/1801.00862) (NISQ)\ncomputers, where the details of quantum hardware are vital to achieving\nstate-of-the-art results. For more information about Cirq, please visit the\n[Cirq documentation site].\n\nThis Python module is `cirq-web`, which allows users to take advantage of\nbrowser-based 3D visualization tools and features in Cirq. `cirq-web` also\nprovides a development environment for contributors to create and add their\nown visualizations to the module.\n\n[Cirq]: https://github.com/quantumlib/cirq\n[Cirq documentation site]: https://quantumai.google/cirq\n\n## Installation\n\nThis module is built on top of [Cirq]; installing this module will\nautomatically install the `cirq-core` module and other dependencies. There are\ntwo installation options for the `cirq-web` module:\n\n* To install the stable version of `cirq-web`, use\n\n ```shell\n pip install cirq-web\n ```\n\n* To install the latest pre-release version of `cirq-web`, use\n\n ```shell\n pip install --upgrade cirq-web~=1.0.dev\n ```\n\n (The `~=` has a special meaning to `pip` of selecting the latest version\n compatible with the `1.*` and `dev` in the name. Despite appearances,\n this will not install an old version 1.0 release!)\n\nIf you would like to install Cirq with all the optional modules, not just\n`cirq-web`, then instead of the above commands, use `pip install cirq` for the\nstable release or `pip install --upgrade cirq~=1.0.dev` for the latest pre-release\nversion.\n\n## Documentation\n\nDocumentation for `cirq-web` can be found in the `README` files located in the\nmodule's subdirectories in the [Cirq repository on GitHub]. To get started\nwith using Cirq in general, please refer to the [Cirq documentation site].\n\nBelow is a quick example of using `cirq-web` to generate a portable 3D\nrendering of the Bloch sphere:\n\n```python\nimport cirq\nfrom cirq_web import BlochSphere\n\n# Prepare a state\nzero_state = [1+0j, 0+0j]\nstate_vector = cirq.to_valid_state_vector(zero_state)\n\n# Create and display the Bloch sphere\nsphere = BlochSphere(state_vector=state_vector)\nsphere.generate_html_file()\n```\n\nThis will create an HTML file in the current working directory. There are\nadditional options to specify the output directory or to open the\nvisualization in a browser, for example.\n\nYou can also view and interact with a Bloch sphere in a [Google\nColab](https://colab.google.com) notebook or Jupyter notebook. Here is an\nexample:\n\n```python\nimport cirq\nfrom cirq_web import BlochSphere\n\n# Prepare a state\nzero_state = [1+0j, 0+0j]\nstate_vector = cirq.to_valid_state_vector(zero_state)\n\n# Create and display the Bloch sphere\nsphere = BlochSphere(state_vector=state_vector)\ndisplay(sphere)\n```\n\nYou can find more example Jupyter notebooks in the `cirq-web` subdirectory of\nthe [Cirq repository on GitHub].\n\nFor more information about getting help, reporting bugs, and other matters\nrelated to Cirq and the Cirq-Web integration module, please visit the [Cirq\nrepository on GitHub].\n\n[Cirq repository on GitHub]: https://github.com/quantumlib/Cirq\n\n## Disclaimer\n\nCirq is not an official Google product. Copyright 2019 The Cirq Developers.\n",
"bugtrack_url": null,
"license": "Apache 2",
"summary": "Web-based 3D visualization tools for Cirq.",
"version": "1.5.0",
"project_urls": {
"Homepage": "http://github.com/quantumlib/cirq"
},
"split_keywords": [
"algorithms",
" api",
" cirq",
" google",
" google quantum",
" nisq",
" python",
" quantum",
" quantum algorithms",
" quantum circuit",
" quantum circuit simulator",
" quantum computer simulator",
" quantum computing",
" quantum development kit",
" quantum information",
" quantum programming",
" quantum programming language",
" quantum simulation",
" sdk",
" simulation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ccfeb831f5640a5369538a78b9b661eaa735e72d02cd08aa74f026fb54b732c9",
"md5": "579d206c2cbe0cfa8eeede6733fdb6c8",
"sha256": "47b931a8c8dbebde4775c6e82dc404c178b7592a24456e485e43ae823660984e"
},
"downloads": -1,
"filename": "cirq_web-1.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "579d206c2cbe0cfa8eeede6733fdb6c8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10.0",
"size": 425059,
"upload_time": "2025-04-10T18:06:06",
"upload_time_iso_8601": "2025-04-10T18:06:06.672822Z",
"url": "https://files.pythonhosted.org/packages/cc/fe/b831f5640a5369538a78b9b661eaa735e72d02cd08aa74f026fb54b732c9/cirq_web-1.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-04-10 18:06:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "quantumlib",
"github_project": "cirq",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "cirq-web"
}