Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

⚠️ WARNING
This is a development version of cirq-web and may be
unstable. For the latest stable release of cirq-web,
please visit
https://pypi.org/project/cirq-web.
Cirq logo

cirq-web

Cirq is a Python package for writing, manipulating, and running quantum circuits on quantum computers and simulators. Cirq provides useful abstractions for dealing with today’s noisy intermediate-scale quantum (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.

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

    pip install cirq-web
    
  • To install the latest pre-release version of cirq-web, use

    pip install 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 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:

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 notebook or Jupyter notebook. Here is an example:

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.

Disclaimer

Cirq is not an official Google product. Copyright 2019 The Cirq Developers.

Metadata

Release files for cirq-web 1.5.0.dev20250226130824

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for cirq-web 1.5.0.dev20250226130824
File Interpreter ABI Platform Actions
cirq_web-1.5.0.dev20250226130824-py3-none-any.whl Python 3 none any Details for cirq_web-1.5.0.dev20250226130824-py3-none-any.whl

Release files / cirq_web-1.5.0.dev20250226130824-py3-none-any.whl

Download URL cirq_web-1.5.0.dev20250226130824-py3-none-any.whl
Size 424.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c3d23fc3790c89d2f802c706820f3a72999789bcb65b6f294ff073ceb3d133c
BLAKE2b-256 checksum
How to use checksums
4d5c071eb60c108b67238cc86fc7ec052cb55fa2881d3611ff8cc00e9e28708c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Security for cirq-web 1.5.0.dev20250226130824

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page