Skip to content

Commit

Permalink
feat: Add GPI, GPI2, and AAMS gates (#42)
Browse files Browse the repository at this point in the history
Closes #41 

There isn't much info on these gates on the pytket side, so the docs
here are a bit lacking.
  • Loading branch information
aborgna-q authored Apr 16, 2024
1 parent 577f44e commit d05946e
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 32 deletions.
33 changes: 33 additions & 0 deletions src/optype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,39 @@ pub enum OpType {
/// Multiply-controlled [`OpType::Z`]
CnZ,

/// GPi gate
///
/// \f$ (\\phi) \\mapsto \\left[ \\begin{array}{cc} 0 &
/// e^{-i\\pi\\phi} \\\\ e^{i\\pi\\phi} & 0 \\end{array} \\right] \f$
GPI,

/// GPi2 gate
///
/// \f$
/// (\\phi) \\mapsto \\frac{1}{\\sqrt 2} \\left[
/// \\begin{array}{cc} 1 & -ie^{-i\\pi\\phi} \\\\ -ie^{i\\pi\\phi} &
/// 1 \\end{array} \\right]
/// \f$
GPI2,

/// AAMS gate
///
/// \f$
///
/// (\\theta, \\phi_0, \\phi_1) \\mapsto \\left[ "
/// \\begin{array}{cccc} \\cos\\frac{\\pi\\theta}{2} & 0 & 0 &
/// -ie^{-i\\pi(\\phi_0+\\phi_1)}\\sin\\frac{\\pi\\theta}{2} \\\\
/// 0 &
/// \\cos\\frac{\\pi\\theta}{2} &
/// -ie^{i\\pi(\\phi_1-\\phi_0)}\\sin\\frac{\\pi\\theta}{2} & 0 \\\\ 0
/// &
/// -ie^{i\\pi(\\phi_0-\\phi_1)}\\sin\\frac{\\pi\\theta}{2} &
/// \\cos\\frac{\\pi\\theta}{2} & 0 \\\\
/// -ie^{i\\pi(\\phi_0+\\phi_1)}\\sin\\frac{\\pi\\theta}{2} & 0 & 0 &
/// \\cos\\frac{\\pi\\theta}{2} \\end{array} \\right]`
/// \f$
AAMS,

/// See [`CircBox`]
///
/// [`CircBox`]: crate::opbox::OpBox::CircBox
Expand Down
64 changes: 32 additions & 32 deletions tests/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d05946e

Please sign in to comment.