Skip to content

OpenQuantumDesign/oqd-compiler-infrastructure

Repository files navigation

Open Quantum Design

Open Quantum Design: Compiler Infrastructure

doc PyPI Version CI versions License: Apache 2.0 Ruff

What's here:

This repository contains the supporting infrastructure, base classes, and abstractions for creating custom compiler analysis, verification, and transformation passes. The modules in the repository are utilized for, e.g., lowering from the analog to atomic intermediate representations, and the atomic representation to bare metal descriptions of quantum programs.

Installation

Install with pip:

pip install oqd-compiler-infrastructure

or alternatively from git:

pip install git+https://github.com/OpenQuantumDesign/oqd-compiler-infrastructure.git

Installation with Nix

You can use this package with Nix in several ways:

  1. Using the development environment:
# Clone the repository
git clone https://github.com/OpenQuantumDesign/oqd-compiler-infrastructure.git
cd oqd-compiler-infrastructure

# Enter the development shell
nix develop
  1. Building the package:
nix build github:OpenQuantumDesign/oqd-compiler-infrastructure

Using in Your Nix Projects

To use this package in your own Nix project, you can add it to your flake.nix:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    oqd-compiler.url = "github:OpenQuantumDesign/oqd-compiler-infrastructure";
  };

  outputs = { self, nixpkgs, oqd-compiler }: {
    # For using in a development shell
    devShells.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.mkShell {
      buildInputs = [
        oqd-compiler.packages.x86_64-linux.default
      ];
    };

    # For using as a dependency in your package
    packages.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.python3Packages.buildPythonPackage {
      # ... your package configuration ...
      propagatedBuildInputs = [
        oqd-compiler.packages.x86_64-linux.default
      ];
    };
  };
}

For development, clone the repository locally:

git clone https://github.com/OpenQuantumDesign/oqd-compiler-infrastructure.git

Documentation

To deploy the documentation locally, implemented with mkdocs, run the following commands:

pip install .[docs]
mkdocs serve
block-beta
   columns 3
   
   block:Interface
       columns 1
       InterfaceTitle("<i><b>Interfaces</b><i/>")
       InterfaceDigital["<b>Digital Interface</b>\nQuantum circuits with discrete gates"] 
       space
       InterfaceAnalog["<b>Analog Interface</b>\n Continuous-time evolution with Hamiltonians"] 
       space
       InterfaceAtomic["<b>Atomic Interface</b>\nLight-matter interactions between lasers and ions"]
       space
    end
    
    block:IR
       columns 1
       IRTitle("<i><b>IRs</b><i/>")
       IRDigital["Quantum circuit IR\nopenQASM, LLVM+QIR"] 
       space
       IRAnalog["openQSIM"]
       space
       IRAtomic["openAPL"]
       space
    end
    
    block:Emulator
       columns 1
       EmulatorsTitle("<i><b>Classical Emulators</b><i/>")
       
       EmulatorDigital["Pennylane, Qiskit"] 
       space
       EmulatorAnalog["QuTiP, QuantumOptics.jl"]
       space
       EmulatorAtomic["TrICal, QuantumIon.jl"]
       space
    end
    
    space
    block:RealTime
       columns 1
       RealTimeTitle("<i><b>Real-Time</b><i/>")
       space
       RTSoftware["ARTIQ, DAX, OQDAX"] 
       space
       RTGateware["Sinara Real-Time Control"]
       space
       RTHardware["Lasers, Modulators, Photodetection, Ion Trap"]
       space
       RTApparatus["Trapped-Ion QPU (<sup>171</sup>Yt<sup>+</sup>, <sup>133</sup>Ba<sup>+</sup>)"]
       space
    end
    space
    
   InterfaceDigital --> IRDigital
   InterfaceAnalog --> IRAnalog
   InterfaceAtomic --> IRAtomic
   
   IRDigital --> IRAnalog
   IRAnalog --> IRAtomic
   
   IRDigital --> EmulatorDigital
   IRAnalog --> EmulatorAnalog
   IRAtomic --> EmulatorAtomic
   
   IRAtomic --> RealTimeTitle
   
   RTSoftware --> RTGateware
   RTGateware --> RTHardware
   RTHardware --> RTApparatus
   
    classDef title fill:#d6d4d4,stroke:#333,color:#333;
    classDef digital fill:#E7E08B,stroke:#333,color:#333;
    classDef analog fill:#E4E9B2,stroke:#333,color:#333;
    classDef atomic fill:#D2E4C4,stroke:#333,color:#333;
    classDef realtime fill:#B5CBB7,stroke:#333,color:#333;

    classDef highlight fill:#f2bbbb,stroke:#333,color:#333,stroke-dasharray: 5 5;
    
    class InterfaceTitle,IRTitle,EmulatorsTitle,RealTimeTitle title
    class InterfaceDigital,IRDigital,EmulatorDigital digital
    class InterfaceAnalog,IRAnalog,EmulatorAnalog analog
    class InterfaceAtomic,IRAtomic,EmulatorAtomic atomic
    class RTSoftware,RTGateware,RTHardware,RTApparatus realtime
   
Loading

The lowering and compilation passes, used in the vertical lines connecting abstraction layers, are based on the compiler infrastructure components contained in this repository.

About

Compiler infrastructure for OQD's full-stack, open-source quantum computing designs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •