qasm-ts - v2.0.0
    Preparing search index...

    Module qasm2/token

    OpenQASM 2.0 Token Definitions and Utilities

    This module defines the token types used in OpenQASM 2.0 syntax. OpenQASM 2.0 has a simpler token set compared to 3.0, focusing on basic quantum operations and classical registers without advanced control flow or data types.

    Key differences from OpenQASM 3.0:

    • Limited to qreg and creg declarations (no advanced types)
    • No control flow tokens (if/else/for/while)
    • No subroutine or function definitions
    • Simpler expression and operator support
    import { lookup, Token } from './qasm2/token';

    console.log(lookup('qreg')); // Token.QReg
    console.log(lookup('barrier')); // Token.Barrier
    console.log(lookup('measure')); // Token.Measure

    Enumerations

    Token

    Functions

    inverseLookup
    lookup
    notParam