package openQASM

  1. Overview
  2. Docs

Module OpenQASM.ASTSource

Sourcetype id = string
Sourcetype ty =
  1. | TVal
  2. | TCReg of int
  3. | TQReg of int
  4. | TGate of int * int
Sourcetype binaryop =
  1. | Plus
  2. | Minus
  3. | Times
  4. | Div
  5. | Pow
Sourcetype unaryop =
  1. | Sin
  2. | Cos
  3. | Tan
  4. | Exp
  5. | Ln
  6. | Sqrt
  7. | UMinus
Sourcetype exp =
  1. | Real of float
  2. | Nninteger of int
  3. | Pi
  4. | Id of id
  5. | BinaryOp of binaryop * exp * exp
  6. | UnaryOp of unaryop * exp
Sourcetype argument = id * int option
Sourcetype uop =
  1. | CX of argument * argument
  2. | U of exp list * argument
  3. | Gate of id * exp list * argument list
Sourcetype qop =
  1. | Uop of uop
  2. | Meas of argument * argument
  3. | Reset of argument
Sourcetype gop =
  1. | GUop of uop
  2. | GBarrier of id list
Sourcetype gatedecl = id * id list * id list
Sourcetype decl =
  1. | QReg of id * int
  2. | CReg of id * int
Sourcetype statement =
  1. | Include of string
  2. | Decl of decl
  3. | GateDecl of gatedecl * gop list
  4. | OpaqueDecl of gatedecl
  5. | Qop of qop
  6. | If of id * int * qop
  7. | Barrier of argument list
Sourcetype program = statement list