Home

libQASM is a library to parse cQASM programs, developed by QuTech.

At the moment, libQASM only supports cQASM v3.0 programs (see cQASM-spec for the language specification).

It performs lexical, syntactic, and semantic analysis of an input program received via a file or a string. It produces one of the following results:

  • A syntactic or semantic AST (Abstract Syntax Tree) object. Depending on if we are parsing or analysing.
  • A list of parsing or analysing errors. In case the input program was malformed.
  • A JSON representation of either the AST or the list of errors.

It can be used from:

Check out QX simulator and OpenSquirrel compiler for an example of use in a C++ and a Python project, respectively.