Skip to main content

Implements a cirq.Sampler backed by stim.

Project description

stimcirq

Implements stimcirq.StimSampler, a cirq.Sampler that uses the stabilizer circuit simulator stim to generate samples.

Example

import cirq
a, b = cirq.LineQubit.range(2)
c = cirq.Circuit(
    cirq.H(a),
    cirq.CNOT(a, b),
    cirq.measure(a, key="a"),
    cirq.measure(b, key="b"),
)

import stimcirq
sampler = stimcirq.StimSampler()
result = sampler.run(c, repetitions=30)

print(result)
# prints something like:
# a=000010100101000011001100110011
# b=000010100101000011001100110011

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

stimcirq-1.3.0.tar.gz (10.6 kB view details)

Uploaded Source

File details

Details for the file stimcirq-1.3.0.tar.gz.

File metadata

  • Download URL: stimcirq-1.3.0.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for stimcirq-1.3.0.tar.gz
Algorithm Hash digest
SHA256 1982e7620d1c3c6d5d2b258dbfc9e4cb0068758930a1ed7766f2092b553d837f
MD5 87651a412a49911160ce7dd992576437
BLAKE2b-256 99bcb5ffbfb97c8e7574c730ef87238206ed25dfcc28ac239cf527282514743e

See more details on using hashes here.

Provenance

Supported by

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