Skip to content

Commit 8802685

Browse files
authored
Un-invert B gate (#3373)
Fixes #2624.
1 parent 5029af4 commit 8802685

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cirq/optimizers/two_qubit_to_fsim.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ def num_qubits(self) -> int:
169169
def _decompose_(self, qubits):
170170
a, b = qubits
171171
return [
172-
ops.XX(a, b)**0.5,
173-
ops.YY(a, b)**0.25,
172+
ops.XX(a, b)**-0.5,
173+
ops.YY(a, b)**-0.25,
174174
]
175175

176176

@@ -231,9 +231,9 @@ def _decompose_interaction_into_two_b_gates_ignoring_single_qubit_ops(
231231
b2 = np.arcsin(np.sqrt(b1))
232232
b3 = np.arccos(1 - 4 * r)
233233
rb = [
234-
ops.rz(b2).on(b),
235-
ops.ry(b3).on(b),
236-
ops.rz(b2).on(b),
234+
ops.rz(-b2).on(b),
235+
ops.ry(-b3).on(b),
236+
ops.rz(-b2).on(b),
237237
]
238238
s = 1 if z < 0 else -1
239239
return [

0 commit comments

Comments
 (0)