Skip to main content

devqubit adapter for Cirq

Project description

devqubit-cirq

PyPI

Google Cirq adapter for devqubit — automatic circuit capture, simulator snapshots, and result logging for Cirq samplers and simulators.

[!IMPORTANT] This is an internal adapter package. Install via pip install "devqubit[cirq]" and use the devqubit public API.

Installation

pip install "devqubit[cirq]"

Usage

import cirq
from devqubit import track

q0, q1 = cirq.LineQubit.range(2)
circuit = cirq.Circuit([
    cirq.H(q0),
    cirq.CNOT(q0, q1),
    cirq.measure(q0, q1, key="result"),
])

with track(project="cirq-exp") as run:
    simulator = run.wrap(cirq.Simulator())
    result = simulator.run(circuit, repetitions=1000)

Parameter Sweeps

import sympy

theta = sympy.Symbol("theta")
circuit = cirq.Circuit([
    cirq.Ry(theta).on(q0),
    cirq.measure(q0, key="m"),
])

with track(project="sweep") as run:
    simulator = run.wrap(cirq.Simulator())
    sweep = cirq.Linspace("theta", 0, 2 * 3.14159, 10)
    results = simulator.run_sweep(circuit, sweep, repetitions=100)

What's Captured

Artifact Kind Role
Cirq JSON cirq.circuit.json program
Circuit diagram cirq.circuits.txt program
Measurement counts result.counts.json result
Device properties device.cirq.raw_properties.json device_raw
Execution envelope devqubit.envelope.json envelope

Documentation

See the Adapters guide for parameter sweeps, performance tuning, and batch execution.

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

devqubit_cirq-0.1.12.tar.gz (44.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

devqubit_cirq-0.1.12-py3-none-any.whl (33.0 kB view details)

Uploaded Python 3

File details

Details for the file devqubit_cirq-0.1.12.tar.gz.

File metadata

  • Download URL: devqubit_cirq-0.1.12.tar.gz
  • Upload date:
  • Size: 44.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for devqubit_cirq-0.1.12.tar.gz
Algorithm Hash digest
SHA256 1e81fc7e0c0c1507865180eedc3968c9918fc89a4139d5b9fc05abd378a3b43d
MD5 db45caea8d0243566a6f177088ab369e
BLAKE2b-256 2e93826af296f6c615aefaab64f219ef046744b6a4a640e26143f3bff5c742df

See more details on using hashes here.

Provenance

The following attestation bundles were made for devqubit_cirq-0.1.12.tar.gz:

Publisher: release.yaml on devqubit-labs/devqubit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file devqubit_cirq-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: devqubit_cirq-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 33.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for devqubit_cirq-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 1cf0bbdfe8933d7ce5f0019a64ec339461891cc391e72ed97857e4d65f67fa87
MD5 c5f7e67666c564098cf4f72ca4f1a85e
BLAKE2b-256 f48ea4203a4e9d76c25b529e9fe5cffc03658447949e1407714520c134615c2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for devqubit_cirq-0.1.12-py3-none-any.whl:

Publisher: release.yaml on devqubit-labs/devqubit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page