.. image:: https://raw.githubusercontent.com/quantumlib/Cirq/master/docs/images/Cirq_logo_color.png
:target: https://github.com/quantumlib/cirq
:alt: Cirq
:width: 500px
`Cirq <https://quantumai.google/cirq>`__ is a Python library for writing, manipulating, and optimizing quantum
circuits and running them against quantum computers and simulators.
This 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.
Documentation
-------------
Documentation for cirq-web can be found in the README files located in this module's subdirectories.
Below is a quick example of how to generate a portable 3D rendering of the Bloch sphere using cirq-web:
.. code-block:: 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 the 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 Colab or Jupyter notebook setting
with the following:
.. code-block:: 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)
See the example Jupyter notebook in this directory for more examples on how to use cirq-web.
Installation
------------
Cirq-web is currently in development, and therefore is only available via pre-release.
To install the pre-release version of only **cirq-web**, use `pip install cirq-web~=1.0.dev`.
Note, that this will install both cirq-web and cirq-core.
To get all the optional modules installed as well, you'll have to use `pip install cirq` or `pip install cirq~=1.0.dev` for the pre-release version.
Raw data
{
"_id": null,
"home_page": "http://github.com/quantumlib/cirq",
"name": "cirq-web",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10.0",
"maintainer_email": null,
"keywords": null,
"author": "The Cirq Developers",
"author_email": "cirq-dev@googlegroups.com",
"download_url": null,
"platform": null,
"description": ".. image:: https://raw.githubusercontent.com/quantumlib/Cirq/master/docs/images/Cirq_logo_color.png\n :target: https://github.com/quantumlib/cirq\n :alt: Cirq\n :width: 500px\n\n`Cirq <https://quantumai.google/cirq>`__ is a Python library for writing, manipulating, and optimizing quantum\ncircuits and running them against quantum computers and simulators.\n\nThis module is **cirq-web**, which allows users to take advantage of browser based 3D visualization tools\nand features in Cirq. cirq-web also provides a development environment for contributors to create and add \ntheir own visualizations to the module.\n\nDocumentation\n-------------\nDocumentation for cirq-web can be found in the README files located in this module's subdirectories.\n\nBelow is a quick example of how to generate a portable 3D rendering of the Bloch sphere using cirq-web:\n\n.. code-block:: python\n\n import cirq\n from cirq_web import BlochSphere\n\n # Prepare a state\n zero_state = [1+0j, 0+0j]\n state_vector = cirq.to_valid_state_vector(zero_state)\n\n # Create and display the Bloch sphere\n sphere = BlochSphere(state_vector=state_vector)\n sphere.generate_html_file()\n\nThis will create the file in the current working directory. There are additional options to specify the\noutput directory or to open the visualization in a browser for example.\n\nYou can also view and interact with a Bloch sphere in a Colab or Jupyter notebook setting\nwith the following:\n\n.. code-block:: python\n\n import cirq\n from cirq_web import BlochSphere\n\n # Prepare a state\n zero_state = [1+0j, 0+0j]\n state_vector = cirq.to_valid_state_vector(zero_state)\n\n # Create and display the Bloch sphere\n sphere = BlochSphere(state_vector=state_vector)\n display(sphere)\n\nSee the example Jupyter notebook in this directory for more examples on how to use cirq-web.\n\nInstallation\n------------\n\nCirq-web is currently in development, and therefore is only available via pre-release.\n\nTo install the pre-release version of only **cirq-web**, use `pip install cirq-web~=1.0.dev`.\n\nNote, that this will install both cirq-web and cirq-core.\n\nTo get all the optional modules installed as well, you'll have to use `pip install cirq` or `pip install cirq~=1.0.dev` for the pre-release version.\n",
"bugtrack_url": null,
"license": "Apache 2",
"summary": "Web-based 3D visualization tools for Cirq.",
"version": "1.4.1",
"project_urls": {
"Homepage": "http://github.com/quantumlib/cirq"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1f90f94c76f5263e52e3777d5c639d3ae92404f552e4796d9f24327499c3b0dd",
"md5": "90382cb802fa5b2636ad32425f9093ff",
"sha256": "7827ecea76c1aff5f07d4ff5c89fc4bdb6083f334b9e697532c39e205ec2e338"
},
"downloads": -1,
"filename": "cirq_web-1.4.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "90382cb802fa5b2636ad32425f9093ff",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10.0",
"size": 596452,
"upload_time": "2024-06-27T00:44:55",
"upload_time_iso_8601": "2024-06-27T00:44:55.114967Z",
"url": "https://files.pythonhosted.org/packages/1f/90/f94c76f5263e52e3777d5c639d3ae92404f552e4796d9f24327499c3b0dd/cirq_web-1.4.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-27 00:44:55",
"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"
}