Crate phase_rs

Crate phase_rs 

Source
Expand description

The repository contains an implementation of the combinator variant of the “it’s just a phase” language. Given an input program, the interpreter:

  • performs some basic normalisation (associativity etc.)
  • performs macro expansion of inverses, square roots, and gate definitions
  • compiles the term to a circuit definition.
  • Builds the unitary for the output.

§Running

A file of commands can be run using:

cargo run -- --file <FILENAME>

or passed in through stdin. For all options see:

cargo run -- --help

Modules§

circuit_syntax
Definitions of circuit-normal syntax.
command
A syntax of commands and their parsing.
ket
Structure for representing primitive states in ket notation.
normal_syntax
Normal-form syntax definitions
phase
Structure for representing phases, elements of the unit circle on the complex plane.
raw_syntax
Raw syntax definitions
text
Helpers for parsing and pretty printing.
typecheck
Functions and datastructures for type checking
typed_syntax
Typed syntax definitions