Skip to main content

A quantum computing simulator.

Project description

Basic Design Layout

PyQCS has two fundamental classes for simulating the quantum computation: A state which represents the total simulator state at a single point in quasi-time [1] and gate circuits that can be applied to such a state; yielding a new state.

PyQCS states

A PyQCS state contains a representation of the quantum mechanical state in which the simulator is; using a numpy array. The application of a gate will return a new state with a changed qm state.

The state also contains a representation of the last measurement and information which qbits have been measured. This information will be used by classical parts of an algorithm.

PyQCS gates

A PyQCS gate is essentially a function mapping a 2**N dimensional cdouble array and an N dimensional double array to a 2**N dimensional cdouble array, an N dimensional double array and a int64 scalar.

PyQCS gates usually are implemented as objects with a numpy ufunc backend and some data.

A normal user will never access the gates directly but use either PyQCS gate circuits or PyQCS gate circuit builders

PyQCS gate circuits

Circuits are way one describes how the gates are applied to the state. Even single gate applications are described as circuits as those are more convenient to use. Gate circuits can also be used to optimize circuits in an abstract way and implement the error simulation.

PyQCS gate circuit builders

Gate circuit builders are a more abstract way to construct gate circuits and are used typically to reduce the effort to construct a circuit. When called a circuit builder returns a new circuit with the given parameters. Typical cases are circuits that can be applied to different qbits.

Built-in Gates

PyQCS currently has the following gates built-in:

X

Pauli-X or NOT gate. Flips the respective qbit.

H

Hadamard gate.

C

CNOT (controlled NOT) gate. Flips the act-qbit, if the control-qbit is set.

R

R, Rz or R_phi, the rotation gate. Rotates the respective qbit around a given angle.

M

Measurement gate: this gate measures the respective gate, collapsing the wave function and storing the result in the classical part of the state.

TODOs

  • Add a subclass of pyqcs.state.state.BasicState that has an improved __str__ method.

  • Write lot’s of documentation.

  • Add more tests.

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

pyqcs-0.0.3.tar.gz (283.7 kB view details)

Uploaded Source

File details

Details for the file pyqcs-0.0.3.tar.gz.

File metadata

  • Download URL: pyqcs-0.0.3.tar.gz
  • Upload date:
  • Size: 283.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

File hashes

Hashes for pyqcs-0.0.3.tar.gz
Algorithm Hash digest
SHA256 e2778ad440447faf12f79acd3403d090efbd56837d7722ea49f33dc35f21b0f5
MD5 6f61ec760311582b083ea09550a26ea2
BLAKE2b-256 47372df0d5b05850954e8dde9a73d85ae94ec65b3e845c40ec51f28ef94553e2

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