Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions quil/stdgates.quil
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading