Skip to main content
This module enables conversion from Quantum Intermediate Representation (PyQIR) to Squin kernels, allowing you to execute QIR circuits using the Bloqade SDK’s Squin execution engine. Squin provides a high-performance quantum circuit execution environment, and this conversion opens the door to running QIR circuits on Bloqade simulators and hardware backends.

Installation

Conversions

This section highlights the different ways in which the converter load() can be used with various formats and input types. Each conversion method is demonstrated with practical examples below.

PyQIR String to Squin kernel

Convert PyQIR IR string to a Squin kernel:

PyQIR Module to Squin kernel

Convert a PyQIR Module object to a Squin kernel:

Conversion from File

Load PyQIR IR from a file (.ll for LLVM IR text or .bc for LLVM bitcode):
Code

Integration with OpenQASM 3

Convert OpenQASM3 programs to Squin kernels using qbraid-qir:

Integration with CUDA-Q

Convert CUDA-Q kernels to Squin kernels
Code
CUDA-Q is capable of exporting QIR using multiple profiles (such asqir-base, qir-adaptive, etc.). Currently, the qbraid-qir Squin integration supports only QIR generated with the qir-base profile. Ensure that when using cudaq.translate, you specify format=“qir-base” for compatibility.

Using Qubit Register as Argument

Create a kernel that accepts a qubit register as an argument, enabling composition of kernel functions:

Supported Gates

The following gates are currently supported for conversion from PyQIR to Squin kernels:

Next Steps

Our current implementation provides comprehensive support for standard QIR gates and circuit conversion. We are actively working on expanding functionality in the following areas:
  • Measurement operations: Support for measurement operations is planned for a future release.
  • Classical control flow: Conditional gates and classical control flow are on our roadmap.
  • Custom gates: We currently support all standard QIR gates listed in the Supported Gates table, with plans to extend support for custom gate definitions.