Skip to content

Commit

Permalink
Add unitary defs
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q committed Apr 16, 2024
1 parent f88ed88 commit 25b5561
Showing 1 changed file with 33 additions and 9 deletions.
42 changes: 33 additions & 9 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 Expand Up @@ -508,15 +541,6 @@ pub enum OpType {
///
/// [`DiagonalBox`]: crate::opbox::OpBox::DiagonalBox
DiagonalBox,

/// GPi gate with a possibly symbolic angle
GPI,

/// GPi2 gate with a possibly symbolic angle
GPI2,

/// AAMS gate
AAMS,
}

#[cfg(feature = "pyo3")]
Expand Down

0 comments on commit 25b5561

Please sign in to comment.