GithubHelp home page GithubHelp logo

plutoniumm / abraxas Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 368 KB

Cross framework compilation for simple circuits

Home Page: https://plutoniumm.github.io/abraxas/

License: MIT License

Python 98.72% Makefile 1.28%
qiskit pennylane cudaq braket cirq quil tket

abraxas's Introduction

abraxas

A tiny library to transpile quantum circuits. The goal is to speed up the time it takes to convert simple circuits across languages fast. Anything beyond a certain complexity should be written in the respective languages directly.

QiskitCudaQPennylaneCirqTKetQuilBraket

Install

Qiskit has also been marked as a dependency since about a third of the functions use it anyway.

pip install abrax

Examples

toPennylane

from qiskit import QuantumCircuit, Parameter
from abrax import toPenny, toQasm
import pennylane as qml

qc = QuantumCircuit(3)
p = Parameter('x')
qc.h([0, 1, 2])
qc.cx(0, 2)
qc.rx(0, 0)
qc.cx(1, 2)
qc.ry(p, 2)

qasm = toQasm(qc)
dev = qml.device("default.qubit", wires=2)
circuit = toPenny(qasm, dev) # pennylane needs 'dev'
# print(qml.draw(circuit)())
# 0: ──H─╭X──RX(0.00)───────────────┤  Probs
# 1: ──H─│────────────╭X────────────┤  Probs
# 2: ──H─╰●──X────────╰●──RY(x)─────┤  Probs

Supported conversions:

graph LR
  subgraph Circuit
    direction LR
    IR[Pseudo-QASM]
    IR2[QASM]
  end
  A0[Qiskit] --> Circuit
  B0[Pennylane] --> Circuit
  C0[Cirq] --> Circuit
  D0[TKet] --> Circuit
  E0[Quil] --> Circuit
  F0["CudaQ (half)"] --> Circuit
  G0[Braket] --> Circuit

  Circuit --> A1[Qiskit]
  Circuit --> B1[Pennylane]
  Circuit --> C1[Cirq]
  Circuit --> D1[TKet]
  Circuit --> E1[Quil]
  Circuit --> F1[CudaQ]
  Circuit --> G1[Braket]
Loading

Supported Frameworks

abraxas's People

Contributors

plutoniumm avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

anupbabhani

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.