Module Quantumlib.Circuit

A simplified representation of Quantum Circuits.

type adr =
  1. | A of int
type arb_sq_gate = {
  1. theta : float;
  2. phi : float;
  3. lambda : float;
}

An arbitrary single-qubit gate, parametrized as in OpenQASM

type gate_kind =
  1. | X
  2. | H
  3. | Z
  4. | U of arb_sq_gate
  5. | Rm of int

Kind of Gates.

type gate = {
  1. target : adr;
  2. kind : gate_kind;
  3. controls : adr list;
}

Generic Gates. A gate has a target qubit and a set of set of controls.

type t = {
  1. qbits : int;
  2. gates : gate list;
}

Circuits. A quantum circuit is defined by its number a qubits and an (ordered) list of gates.