Skip to main content

A Python package for simulated quantum computing.

Project description

pypSQUEAK — Python Packaged Semantic Quantum Expression Architecture

An extension of Python providing high-level object abstractions for quantum devices.

Features of pypSQUEAK include:

  • Variable-size quantum registers. The sky's the limit. (Well, your hard drive's size is anyway.)
  • Built-in set of universal one-qubit gates as well as several important two-qubit gates.
  • User-defined static or parametric gates of arbitrary size.
  • Modeling of noisy quantum channels.

For more information, consult the documentation.

Installation

Installation is done via pip: pip install pypsqueak

Examples

Several examples are provided in the examples folder. They are Python scripts demonstrating various aspects of pypSQUEAK.

Here is an example of a script that constructs a pypSQUEAK program to measure a qubit in the |1> state in the presence of noise:

import pypsqueak.api as sq
from pypsqueak.gates import X
from pypsqueak.noise import damping_map

noisy_channel = sq.qOp(kraus_ops=damping_map(0.3))

zeros = 0
ones = 0
n_runs = 100
for i in range(n_runs):
    q = sq.qReg()
    # Prep the |1> state
    X.on(q)
    # Send it through an amp decay channel with 0.3 chance of decay
    noisy_channel.on(q)
    # measure the resulting qubit
    result = q.measure(0)
    if result == 0:
        zeros += 1
    else:
        ones += 1

print(zeros/n_runs, ones/n_runs)

License

This projects is licensed under the MIT License. See LICENSE.txt for more details.

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

pypSQUEAK-2.1.0.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

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

pypSQUEAK-2.1.0-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

File details

Details for the file pypSQUEAK-2.1.0.tar.gz.

File metadata

  • Download URL: pypSQUEAK-2.1.0.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.0 importlib_metadata/3.7.3 packaging/20.9 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10

File hashes

Hashes for pypSQUEAK-2.1.0.tar.gz
Algorithm Hash digest
SHA256 a2dbcb8218e5b7cdcad8e5097dd2322e96d421f13594a120ef4e5fe0021e9ec3
MD5 ce0d63c519441ff8d435ee4298ba3d10
BLAKE2b-256 ba5136e737418f49222b13d999f6a0285497346677ba480884c19fffdbe9f28d

See more details on using hashes here.

File details

Details for the file pypSQUEAK-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: pypSQUEAK-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.0 importlib_metadata/3.7.3 packaging/20.9 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10

File hashes

Hashes for pypSQUEAK-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 48e94d2f393dcd8a08f214c423d5623990a677643f2e8d7ced83d76b9adb0802
MD5 e0d062f1d33ec947c8e56d42bfd0bed0
BLAKE2b-256 7ac4ec180cff5f9f42a4d673a6e2216ca6a220c09bb79c3d4bf7be864b4b0b44

See more details on using hashes here.

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