From fe0dc197100987772061fc1a16276de434a5d851 Mon Sep 17 00:00:00 2001 From: Bram Evert Date: Fri, 5 Sep 2025 10:09:12 +0100 Subject: [PATCH] Introduce FSIM gates and 2Q Pauli Rotations This PR makes the stdgates.quil consistent with the QuilC stdgates --- quil/stdgates.quil | 69 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/quil/stdgates.quil b/quil/stdgates.quil index 4f716fa1..dcc047f8 100644 --- a/quil/stdgates.quil +++ b/quil/stdgates.quil @@ -130,8 +130,77 @@ DEFGATE ISWAP: 0, i, 0, 0 0, 0, 0, 1 +DEFGATE SQISWAP: + 1, 0, 0, 0 + 0, 1/sqrt(2), i/sqrt(2), 0 + 0, i/sqrt(2), 1/sqrt(2), 0 + 0, 0, 0, 1 + + DEFGATE PSWAP(%theta): 1, 0, 0, 0 0, 0, cis(%theta), 0 0, cis(%theta), 0, 0 0, 0, 0, 1 + +## 2-Qubit Pauli rotation gates + +DEFGATE RZZ(%phi): + cis(-%phi/2), 0, 0, 0 + 0, cis(%phi/2), 0, 0 + 0, 0, cis(%phi/2), 0 + 0, 0, 0, cis(-%phi/2) + +DEFGATE RXX(%phi): + cos(%phi/2), 0, 0, -i*sin(%phi/2) + 0, cos(%phi/2), -i*sin(%phi/2), 0 + 0, -i*sin(%phi/2), cos(%phi/2), 0 + -i*sin(%phi/2), 0, 0, cos(%phi/2) + +DEFGATE RYY(%phi): + cos(%phi/2), 0, 0, i*sin(%phi/2) + 0, cos(%phi/2), -i*sin(%phi/2), 0 + 0, -i*sin(%phi/2), cos(%phi/2), 0 + i*sin(%phi/2), 0, 0, cos(%phi/2) + +## Fermionic Simulation gates + +DEFGATE FSIM(%theta, %phi): + 1, 0, 0, 0 + 0, cos(%theta/2), i*sin(%theta/2), 0 + 0, i*sin(%theta/2), cos(%theta/2), 0 + 0, 0, 0, cis(%phi) + +DEFGATE PHASEDFSIM(%theta, %zeta, %chi, %gamma, %phi): + 1, 0, 0, 0 + 0, cis(-%gamma - %zeta)*cos(%theta/2), i*cis(%chi - %gamma)*sin(%theta/2), 0 + 0, i*cis(-%gamma - %chi)*sin(%theta/2), cis(%zeta - %gamma)*cos(%theta/2), 0 + 0, 0, 0, cis(%phi - 2*%gamma) + +## Lesser-known standard gates + +DEFGATE PISWAP(%theta): + 1, 0, 0, 0 + 0, cos(%theta/2), i*sin(%theta/2), 0 + 0, i*sin(%theta/2), cos(%theta/2), 0 + 0, 0, 0, 1 + +# there has been some internal debate about whether this gate should be parameterized +# by -1.0*%theta instead. we seem to have picked this one for good, but it's still +# not 100% clear to me that this is the "right" move. +DEFGATE XY(%theta): + 1, 0, 0, 0 + 0, cos(%theta/2), i*sin(%theta/2), 0 + 0, i*sin(%theta/2), cos(%theta/2), 0 + 0, 0, 0, 1 + +DEFGATE CAN(%alpha, %beta, %gamma): + (cis((%alpha+%beta-%gamma)/2)+cis((%alpha-%beta+%gamma)/2))/2, 0, 0, (cis((%alpha-%beta+%gamma)/2)-cis((%alpha+%beta-%gamma)/2))/2 + 0, (cis((%alpha+%beta+%gamma)/(-2))+cis((%beta+%gamma-%alpha)/2))/2, (cis((%alpha+%beta+%gamma)/(-2))-cis((%beta+%gamma-%alpha)/2))/2, 0 + 0, (cis((%alpha+%beta+%gamma)/(-2))-cis((%beta+%gamma-%alpha)/2))/2, (cis((%alpha+%beta+%gamma)/(-2))+cis((%beta+%gamma-%alpha)/2))/2, 0 + (cis((%alpha-%beta+%gamma)/2)-cis((%alpha+%beta-%gamma)/2))/2, 0, 0, (cis((%alpha+%beta-%gamma)/2)+cis((%alpha-%beta+%gamma)/2))/2 + +DEFGATE BLOCH(%alpha, %beta, %gamma) q AS PAULI-SUM: + X(%alpha) q + Y(%beta) q + Z(%gamma) q