https://github.com/cqcl/brat

https://github.com/cqcl/brat

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.3%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: CQCL
  • Language: Haskell
  • Default Branch: main
  • Size: 1.97 MB
Statistics
  • Stars: 5
  • Watchers: 2
  • Forks: 1
  • Open Issues: 32
  • Releases: 0
Created almost 2 years ago · Last pushed 11 months ago
Metadata Files
Readme

README.md

About

BRAT is a functional programming language designed for writing quantum experiments. For an introduction to BRAT, see the extended abstract submitted to PLanQC 2024.

Installation

To build BRAT from source, you will need: - GHC 9.6.4 (can be installed with the ghcup tool) - The stack build tool for Haskell

Then, navigate to the brat directory and run stack install.

This will add the brat and brat-lsp binaries to ~/.local/bin, and copy configuration for the emacs editor mode to ~/.local/share/brat/.

There is also a plugin for the VS Code editor. To install this, look at vscode/README.md.

Usage

Typechecking

By default, the installed brat executable will typecheck a program given as an argument, e.g.: sh brat my-program.brat which, if my-program typechecks, will print out the parsed versions of the declarations and a list of remaining holes.

Compiling

The --compile flag can be used to compile the BRAT program to the hugr IR and print the JSON representation to the command line.

Validating

There is a tool in the root of the repository called hugr_validator (install by cd hugr_validator && cargo install --path .) which is used to check that the JSON output from BRAT constitutes a valid hugr. This is invoked by: sh brat --compile my-program.brat | hugr_validator

Development

Before opening a PR, make sure to run hlint on your code, using: sh make hlint or try to automatically apply fixes with: sh make hlint-fix

Reference

The brat/examples directory contains some examples of BRAT programs. For example: - Quantum teleportation: teleportation.brat - Quantum Fourier transform: teleportation.brat - Magic State Distillation: magic-state-distillation.brat - Simple Repeat-Until-Success: rus.brat - Ising Hamiltonian: ising.brat

This directory also contains tests of syntax features which, while terse, may serve as a reference in the short term. For example: - unified.brat contains some functional programs - dollar_kind.brat tests polymorphism over kernel types - tups.brat tests heterogenous lists - compjuxt.brat, brat/examples/composition.brat contain tests for diagrammatic syntax - pass.brat tests the 'passthrough' (..) operator - portpulling.brat demonstrates port pulling

Owner

  • Name: Cambridge Quantum
  • Login: CQCL
  • Kind: organization
  • Location: Cambridge, UK

Quantum Software and Technologies

GitHub Events

Total
  • Create event: 39
  • Issues event: 12
  • Watch event: 3
  • Delete event: 27
  • Member event: 1
  • Issue comment event: 18
  • Push event: 204
  • Pull request review event: 106
  • Pull request review comment event: 103
  • Pull request event: 71
  • Fork event: 2
Last Year
  • Create event: 39
  • Issues event: 12
  • Watch event: 3
  • Delete event: 27
  • Member event: 1
  • Issue comment event: 18
  • Push event: 204
  • Pull request review event: 106
  • Pull request review comment event: 103
  • Pull request event: 71
  • Fork event: 2

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 32
  • Total pull requests: 58
  • Average time to close issues: 3 months
  • Average time to close pull requests: 7 days
  • Total issue authors: 3
  • Total pull request authors: 4
  • Average comments per issue: 0.13
  • Average comments per pull request: 0.33
  • Merged pull requests: 45
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 7
  • Pull requests: 55
  • Average time to close issues: 7 days
  • Average time to close pull requests: 5 days
  • Issue authors: 3
  • Pull request authors: 4
  • Average comments per issue: 0.14
  • Average comments per pull request: 0.31
  • Merged pull requests: 43
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • croyzor (30)
  • acl-cqc (3)
  • mark-koch (1)
Pull Request Authors
  • croyzor (65)
  • acl-cqc (31)
  • SauravMaheshkar (2)
  • mark-koch (2)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/ci.yml actions
  • actions/cache v4 composite
  • actions/checkout v4 composite
  • dtolnay/rust-toolchain stable composite
  • haskell/actions/setup v1 composite
.github/workflows/coverage.yml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/upload-artifact v2 composite
  • haskell/actions/setup v1 composite
.github/workflows/project-board.yml actions
  • actions/add-to-project v0.6.1 composite
.github/workflows/vscode.yml actions
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • actions/upload-artifact v3 composite
hugr_extension/Cargo.toml cargo
hugr_validator/Cargo.toml cargo
brat/brat.cabal hackage
vscode/client/package-lock.json npm
  • @types/vscode 1.74.0 development
  • balanced-match 1.0.2
  • brace-expansion 1.1.11
  • concat-map 0.0.1
  • lru-cache 6.0.0
  • minimatch 3.1.2
  • semver 7.3.8
  • vscode-jsonrpc 6.0.0
  • vscode-languageclient 7.0.0
  • vscode-languageserver-protocol 3.16.0
  • vscode-languageserver-types 3.16.0
  • yallist 4.0.0
vscode/client/package.json npm
  • @types/vscode ^1.63.0 development
  • vscode-languageclient ^7.0.0
vscode/package-lock.json npm
  • 109 dependencies
vscode/package.json npm
  • @types/node ^16.11.7 development
  • @vscode/vsce ^2.15.0 development
  • js-yaml ^4.1.0 development
  • typescript ^4.8.4 development