Skip to main content

Cross platform circuit transpiler

Project description

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]

Supported Frameworks

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

abrax-1.2.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

abrax-1.2.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file abrax-1.2.0.tar.gz.

File metadata

  • Download URL: abrax-1.2.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for abrax-1.2.0.tar.gz
Algorithm Hash digest
SHA256 53a7524948792d795747a987dc1fe388e78c8bbdf9c87a05425312088ab7ad09
MD5 efa806b52d7d40e97c4ad6e0be343972
BLAKE2b-256 7bfaefcd102409b062bc2480c30ee9f9babb240c22c33a39d0b956f285a35c4f

See more details on using hashes here.

File details

Details for the file abrax-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: abrax-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for abrax-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b3b3a326990ce8eacba2751e7209cca8f5a3feb602c4a8c9cf744059152098f4
MD5 419b403070cc1d192969c231058fcb89
BLAKE2b-256 9b3e04eb64c8d3c43d058c6eca083078f742bb4b65fcf9cc902862c3e08b2222

See more details on using hashes here.

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