PitchHut logo
A comprehensive toolkit for OpenQASM 3.0 development.
Pitch

qasmtools simplifies OpenQASM 3.0 development with a versatile command-line interface and a Visual Studio Code extension. It enhances workflow through features like parsing, formatting, linting, and syntax highlighting, ensuring a consistent and user-friendly experience for developers working with quantum assembly language.

Description

Overview

qasmtools is a comprehensive toolkit designed for OpenQASM 3.0 development, equipped with a command-line interface (CLI) tool written in Go and a Visual Studio Code extension. This toolkit enhances the development experience by providing functionalities to parse, format, and highlight QASM files, ensuring they are more readable and consistent.

Key Features

  • QASM 3.0 Parsing: Converts OpenQASM 3.0 files into an Abstract Syntax Tree (AST) for easier manipulation and analysis.
  • QASM 3.0 Formatting: Automatically formats QASM files to maintain a consistent coding style, supporting various input formats and automatic pipe detection.
  • QASM 3.0 Linting: Performs checks on QASM files to identify style and semantic issues, utilizing configurable YAML-based rules with comprehensive documentation available for each violation.
  • QASM 3.0 Highlighting: Delivers syntax highlighting in the terminal, color-coding output for keywords, numbers, strings, and operators.
  • Pipeline Support: Supports stdin/stdout piping for streamlined command-line workflows.
  • Web Playground: An interactive browser-based formatter powered by WebAssembly, with support for unescaping JSON encoded strings.
  • VSCode Extension: Adds language support for OpenQASM 3.0 in Visual Studio Code, featuring syntax highlighting, formatting, and Language Server Protocol (LSP) integration.

Usage Examples

Formatting QASM Files

To format a QASM file, execute:

qasm fmt [files...]

This command options include:

  • -w, --write: Save the result back into the source file.
  • --check: Verify if files are formatted correctly without changes.

Linting QASM Files

To check QASM files for potential issues, run:

qasm lint [files...]

Options allow customization such as enabling/disabling specific rules or selecting the output format.

Highlighting QASM Files

For syntax highlighting in the terminal, use:

qasm highlight [file]

This command will visually enhance the code representation, distinguishing between various syntax elements.

Development and Contribution

qasmtools is built with development best practices in mind, featuring comprehensive testing coverage. Contributions are encouraged—please review the DEVELOPMENT.md for guidelines and submit any proposals for improvement.

0 comments

No comments yet.

Sign in to be the first to comment.