cirq-web


Namecirq-web JSON
Version 1.3.0 PyPI version JSON
download
home_pagehttp://github.com/quantumlib/cirq
SummaryWeb-based 3D visualization tools for Cirq.
upload_time2023-12-01 22:12:16
maintainer
docs_urlNone
authorThe Cirq Developers
requires_python>=3.9.0
licenseApache 2
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. 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 --pre`.

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 --pre` for the pre-release version.

            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/quantumlib/cirq",
    "name": "cirq-web",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "The Cirq Developers",
    "author_email": "cirq-dev@googlegroups.com",
    "download_url": "",
    "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 --pre`.\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 --pre` for the pre-release version.\n",
    "bugtrack_url": null,
    "license": "Apache 2",
    "summary": "Web-based 3D visualization tools for Cirq.",
    "version": "1.3.0",
    "project_urls": {
        "Homepage": "http://github.com/quantumlib/cirq"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f7d7402a2661845e5d722290ff23b5bab27dc2f5442f962a5fe4bd3d210392a3",
                "md5": "b91a470ccff91222fed7e14600d4b47b",
                "sha256": "5206d96e378f8f6fe7e0067cb84db9f48eff372bbb565f0056e1e95d7952b458"
            },
            "downloads": -1,
            "filename": "cirq_web-1.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b91a470ccff91222fed7e14600d4b47b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9.0",
            "size": 596453,
            "upload_time": "2023-12-01T22:12:16",
            "upload_time_iso_8601": "2023-12-01T22:12:16.846937Z",
            "url": "https://files.pythonhosted.org/packages/f7/d7/402a2661845e5d722290ff23b5bab27dc2f5442f962a5fe4bd3d210392a3/cirq_web-1.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-01 22:12:16",
    "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"
}
        
Elapsed time: 0.24640s