Giter Club home page Giter Club logo

quippy's Introduction

Quippy

Quippy is a parser for quantum circuit descriptions produces by Quipper. Specifically, Quipper can output an ASCII description of the circuit, which can then be parsed by Quippy.

Quippy provides a default parser in quippy.parser that will parse given text as:

import quippy
parsed:quippy.Start = quippy.parser().parse(text)

The parsed format uses an quippy.Start object to represent the Quipper circuit by default. This is a nice Object representation of the circuit the Abstract Syntax Tree is directly transformed to by quippy.transformer.QuipperTransformer. The resulting parsed object will have as type a Start object which will make the structure of the parse tree much clearer. If you do no wish to use the included transformer but would rather have a general AST then pass:

quippy.parser(transformer=None)

We use the optional static typing provided in PEP 484 to provide types for the returned objects, this was included in Python 3.5 or higher. Python 3.6 or higher is recommended.

quippy's People

Contributors

cqc-alec avatar eddieschoute avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

cqc-alec

quippy's Issues

QGates with multiple wires not supported

The definition of a qgate in quipper.g is:

qgate       : "QGate[" string "]" inversion "(" wire ")" control_app

Thus it is limited to gates with a single (target) qubit. However, Quipper has support for some multi-qubit gates, such as QMultinot, QSwap and QW. In order to accommodate these I think the above definition should be changed to use a wire_list, with corresponding changes in the transformer class.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.