LIFT Framework

LIFT

Language for Intelligent Frameworks and Technologies

The first Intermediate Representation built natively for both AI and Quantum Computing.

Simulate before you run. Compile once. Optimise everywhere.

License: MIT Rust Tests Version Status


Overview

LIFT is a unified compiler infrastructure that treats AI computation (tensors, gradients, attention) and quantum computation (qubits, gates, noise models) as first-class citizens in the same SSA-based intermediate representation. One .lif source file, one .lith config, one pipeline: simulate, predict, optimise, compile.

 .lif source ──► LIFT-CORE (SSA IR) ──► SIMULATE ──► PREDICT ──► OPTIMISE ──► COMPILE
                      │                                                          │
          ┌───────────┼───────────┐                                 ┌────────────┼────────────┐
     LIFT-TENSOR  LIFT-QUANTUM  LIFT-HYBRID                    CUDA (GPU)   OpenQASM 3   LLVM (CPU)   ONNX
     110 tensor   48 gates     21 hybrid                      H100/A100    IBM/Rigetti   AVX-512      TensorRT
     operations   Kraus/QEC     VQC/VQE ops                    MI300        IonQ          OpenMP       PyTorch

Why LIFT?

No existing IR handles both AI and quantum in a single representation.

CapabilityMLIRONNXOpenQASMQiskitLIFT
AI tensor operationsYY--Y
Quantum gate operations--YYY
Unified AI + Quantum IR---~Y
Noise as type-level attribute----Y
Linear qubit types (no-cloning)----Y
Budget enforcement before compile----Y
Single config for entire pipeline----Y
Performance prediction engine----Y

Key: Y = implemented, ~ = partial, - = not supported

What makes LIFT unique

  1. One IR for AI + Quantum -- Both are equal citizens in the same SSA graph. Joint optimisation across classical and quantum operations.
  2. Noise in the type system -- Every quantum gate carries T1/T2, fidelity, crosstalk metadata. The compiler reasons about noise at every stage.
  3. Linear qubit types -- The no-cloning theorem enforced at compile time. Double-use of a qubit is a type error, not a runtime crash.
  4. Simulation-first compilation -- FLOP count, peak memory, circuit depth, expected fidelity, energy cost -- all computed before hardware runs. Budget violations halt compilation with actionable suggestions.
  5. One config language -- The .lith file replaces 6-8 separate configuration files across frameworks.

Architecture

  USER        .lif source  |  .lith config  |  lift(1) CLI
  FRONTEND    Lexer > Parser > AST > SSA Builder  |  Importers: ONNX, PyTorch FX, OpenQASM 3
  DIALECTS    LIFT-CORE  |  LIFT-TENSOR  |  LIFT-QUANTUM  |  LIFT-HYBRID
  ANALYSIS    Shape inference  |  FLOP count  |  Noise sim  |  Energy model  |  Roofline
  PASSES      TensorFusion  FlashAttention  GateCancellation  RotationMerge  LayoutMapping  CSE ...
  BACKENDS    CUDA (PTX)  |  OpenQASM 3  |  LLVM IR  |  ONNX (opset 21)  |  XLA (planned)
  HARDWARE    H100 / A100 / MI300  |  IBM Kyoto / Rigetti / IonQ  |  TPU

Crate Map

CratePurposeKey contents
lift-coreSSA IR foundationTypes, values, operations, blocks, regions, verifier, printer, pass manager
lift-astFrontendLexer, parser, AST, IR builder for .lif files
lift-tensorAI dialect110 ops (attention, conv, pooling, MoE, quantisation, GNN, fused), shape inference
lift-quantumQuantum dialect48 gates (IBM/Rigetti/IonQ native), noise models, Kraus channels, QEC, topology
lift-hybridFusion dialect21 ops (VQC, VQE, QAOA), gradient methods, encoding strategies, GPU-QPU transfer
lift-simAnalysis engineCost models (A100/H100), quantum cost (superconducting/trapped-ion/neutral-atom), energy, carbon
lift-predictPredictionRoofline model, budget enforcement
lift-optOptimisation13 passes: DCE, constant fold, tensor fusion, flash attention, gate cancel, rotation merge, CSE, quantisation, noise-aware schedule, layout mapping, canonicalise, gate decomposition, real routing
lift-importImportersONNX, PyTorch FX, OpenQASM 3
lift-exportBackendsLLVM IR, ONNX (opset 21), OpenQASM 3
lift-configConfiguration.lith parser and validator
lift-cliCLIlift verify, lift analyse, lift print, lift optimise, lift predict, lift export
lift-codegenCodegenProgrammatic model generation, multi-format export

Quick Start

# Install Rust 1.80+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Clone and build
git clone https://github.com/rustnew/Lift.git
cd lift
cargo build --release

# Run tests (535 tests)
cargo test --workspace

Example: Tensor Program

cat > hello.lif << 'EOF'
#dialect tensor
module @test {
    func @forward(%x: tensor<4xf32>) -> tensor<4xf32> {
        %out = "tensor.relu"(%x) : (tensor<4xf32>) -> tensor<4xf32>
        return %out
    }
}
EOF

lift verify  hello.lif    # Check IR well-formedness
lift analyse hello.lif    # FLOPs, shapes, memory estimate
lift print   hello.lif    # Pretty-print the IR

Example: Quantum Circuit

#dialect quantum
module @bell {
    func @bell_state() -> (bit, bit) {
        %q0 = "quantum.init"() : () -> qubit
        %q1 = "quantum.init"() : () -> qubit
        %q0 = "quantum.h"(%q0)         : (qubit) -> qubit
        %q0, %q1 = "quantum.cx"(%q0, %q1) : (qubit, qubit) -> (qubit, qubit)
        %b0 = "quantum.measure"(%q0) : (qubit) -> bit
        %b1 = "quantum.measure"(%q1) : (qubit) -> bit
        return %b0, %b1
    }
}

The .lith Configuration

One file controls the entire compilation pipeline:

compilation {
    target {
        gpu  { backend = "cuda"  arch = "sm_90"  memory_limit_gb = 80 }
        qpu  { provider = "ibm"  backend_name = "ibm_kyoto"  shots = 4096 }
    }
}
optimization {
    pipeline = ["canonicalize", "tensor-fusion", "gate-cancellation", "layout-mapping"]
}
prediction {
    budget { max_latency_ms = 200  min_fidelity = 0.92  max_memory_gb = 40 }
}

Optimisation Passes

PassDomainDescription
CanonicaliseAllNormalise IR to canonical form
Constant FoldingAllEvaluate compile-time constants
Dead Code EliminationAllRemove unused operations
Tensor FusionAIFuse MatMul+Bias+ReLU chains (30-50% bandwidth reduction)
Flash AttentionAIReplace O(n^2) attention with tiled O(n) (10-20x speedup)
QuantisationAIINT8/FP8 annotation (4x model size reduction)
Common Subexpression EliminationAllDeduplicate identical computations
Gate CancellationQuantumH*H=I, Rz(a)*Rz(b)=Rz(a+b) (15-40% depth reduction)
Rotation MergeQuantumMerge consecutive rotation gates
Noise-Aware ScheduleQuantumReorder gates for maximum fidelity
Layout MappingQuantumSABRE routing to physical qubit topology

Current Status

ComponentStatusCoverage
lift-coreStableSSA IR, types, verifier, printer, pass manager
lift-astStableFull lexer, parser, AST, IR builder
lift-tensorStable110 operations, shape inference, FLOP counting
lift-quantumStable48 gates, noise models, Kraus channels, QEC codes, topology
lift-hybridStable21 operations, gradient methods, encoding strategies
lift-simStableCost models, energy model, quantum simulation, budget tracking
lift-predictStableRoofline model, budget enforcement
lift-optStable11 optimisation passes
lift-importActiveONNX, PyTorch FX, OpenQASM 3 importers
lift-exportActiveLLVM IR, ONNX (opset 21), OpenQASM 3 exporters
lift-configStable.lith parser and types
lift-cliStableverify, analyse, print, optimise, predict, export
lift-codegenStableprogrammatic model generation, multi-format export

Test suite: 535 tests, 100% pass rate across 14 crates.


Roadmap

PhaseTargetMilestone
Core IR + DialectsDoneSSA IR, tensor/quantum/hybrid dialects complete
Optimisation PassesDone13 passes implemented and tested
Analysis EngineDoneCost models, energy, noise simulation
Import/ExportActiveONNX, PyTorch FX, LLVM, ONNX (opset 21), OpenQASM
Hardware BackendsPlannedCUDA PTX, native OpenQASM execution
Python BindingsPlannedPyO3-based Python API
v1.0 ReleaseQ4 2026Full pipeline, benchmarks, arXiv paper

Contributing

AreaDifficultyDescription
CUDA PTX backendHardGPU code generation for tensor ops
State vector simulatorMediumQuantum circuit simulator (CPU + GPU)
Qiskit importerMediumImport Qiskit circuits into LIFT IR
API documentationEasyRustdoc for all public items
TutorialsEasyGetting started guides and examples

See CONTRIBUTING.md for code style and PR process.


Citation

@software{lift2025,
  title  = {LIFT: Language for Intelligent Frameworks and Technologies},
  author = {Martial-FOSSOUO},
  year   = {2025},
  url    = {https://github.com/lift-framework/lift},
  note   = {Unified IR for AI and Quantum Computing}
}

License

MIT -- see LICENSE.


LIFT -- Because the future of computation is both intelligent and quantum, and it deserves a unified foundation.