Skip to content

Commit 1c4ca60

Browse files
bramathonstylewarning
authored andcommitted
Introduce FSIM gates and 2Q Pauli Rotations
This PR makes the stdgates.quil consistent with the QuilC stdgates
1 parent 786b321 commit 1c4ca60

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

quil/stdgates.quil

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,77 @@ DEFGATE ISWAP:
130130
0, i, 0, 0
131131
0, 0, 0, 1
132132

133+
DEFGATE SQISWAP:
134+
1, 0, 0, 0
135+
0, 1/sqrt(2), i/sqrt(2), 0
136+
0, i/sqrt(2), 1/sqrt(2), 0
137+
0, 0, 0, 1
138+
139+
133140
DEFGATE PSWAP(%theta):
134141
1, 0, 0, 0
135142
0, 0, cis(%theta), 0
136143
0, cis(%theta), 0, 0
137144
0, 0, 0, 1
145+
146+
## 2-Qubit Pauli rotation gates
147+
148+
DEFGATE RZZ(%phi):
149+
cis(-%phi/2), 0, 0, 0
150+
0, cis(%phi/2), 0, 0
151+
0, 0, cis(%phi/2), 0
152+
0, 0, 0, cis(-%phi/2)
153+
154+
DEFGATE RXX(%phi):
155+
cos(%phi/2), 0, 0, -i*sin(%phi/2)
156+
0, cos(%phi/2), -i*sin(%phi/2), 0
157+
0, -i*sin(%phi/2), cos(%phi/2), 0
158+
-i*sin(%phi/2), 0, 0, cos(%phi/2)
159+
160+
DEFGATE RYY(%phi):
161+
cos(%phi/2), 0, 0, i*sin(%phi/2)
162+
0, cos(%phi/2), -i*sin(%phi/2), 0
163+
0, -i*sin(%phi/2), cos(%phi/2), 0
164+
i*sin(%phi/2), 0, 0, cos(%phi/2)
165+
166+
## Fermionic Simulation gates
167+
168+
DEFGATE FSIM(%theta, %phi):
169+
1, 0, 0, 0
170+
0, cos(%theta/2), i*sin(%theta/2), 0
171+
0, i*sin(%theta/2), cos(%theta/2), 0
172+
0, 0, 0, cis(%phi)
173+
174+
DEFGATE PHASEDFSIM(%theta, %zeta, %chi, %gamma, %phi):
175+
1, 0, 0, 0
176+
0, cis(-%gamma - %zeta)*cos(%theta/2), i*cis(%chi - %gamma)*sin(%theta/2), 0
177+
0, i*cis(-%gamma - %chi)*sin(%theta/2), cis(%zeta - %gamma)*cos(%theta/2), 0
178+
0, 0, 0, cis(%phi - 2*%gamma)
179+
180+
## Lesser-known standard gates
181+
182+
DEFGATE PISWAP(%theta):
183+
1, 0, 0, 0
184+
0, cos(%theta/2), i*sin(%theta/2), 0
185+
0, i*sin(%theta/2), cos(%theta/2), 0
186+
0, 0, 0, 1
187+
188+
# there has been some internal debate about whether this gate should be parameterized
189+
# by -1.0*%theta instead. we seem to have picked this one for good, but it's still
190+
# not 100% clear to me that this is the "right" move.
191+
DEFGATE XY(%theta):
192+
1, 0, 0, 0
193+
0, cos(%theta/2), i*sin(%theta/2), 0
194+
0, i*sin(%theta/2), cos(%theta/2), 0
195+
0, 0, 0, 1
196+
197+
DEFGATE CAN(%alpha, %beta, %gamma):
198+
(cis((%alpha+%beta-%gamma)/2)+cis((%alpha-%beta+%gamma)/2))/2, 0, 0, (cis((%alpha-%beta+%gamma)/2)-cis((%alpha+%beta-%gamma)/2))/2
199+
0, (cis((%alpha+%beta+%gamma)/(-2))+cis((%beta+%gamma-%alpha)/2))/2, (cis((%alpha+%beta+%gamma)/(-2))-cis((%beta+%gamma-%alpha)/2))/2, 0
200+
0, (cis((%alpha+%beta+%gamma)/(-2))-cis((%beta+%gamma-%alpha)/2))/2, (cis((%alpha+%beta+%gamma)/(-2))+cis((%beta+%gamma-%alpha)/2))/2, 0
201+
(cis((%alpha-%beta+%gamma)/2)-cis((%alpha+%beta-%gamma)/2))/2, 0, 0, (cis((%alpha+%beta-%gamma)/2)+cis((%alpha-%beta+%gamma)/2))/2
202+
203+
DEFGATE BLOCH(%alpha, %beta, %gamma) q AS PAULI-SUM:
204+
X(%alpha) q
205+
Y(%beta) q
206+
Z(%gamma) q

0 commit comments

Comments
 (0)