Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion cirq-core/cirq/circuits/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2623,9 +2623,11 @@ def on_stuck(bad_op):
on_stuck_raise=on_stuck,
)

return protocols.apply_unitaries(
result = protocols.apply_unitaries(
unitary_ops, qubits, protocols.ApplyUnitaryArgs(state, buffer, range(len(qubits)))
)
assert result is not None, "apply_unitaries() should raise TypeError instead"
return result


def _decompose_measurement_inversions(op: 'cirq.Operation') -> 'cirq.OP_TREE':
Expand Down
2 changes: 1 addition & 1 deletion cirq-core/cirq/ops/kraus_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __eq__(self, other) -> bool:
return NotImplemented
if self._key != other._key:
return False
return np.allclose(self._kraus_ops, other._kraus_ops)
return np.allclose(np.asarray(self._kraus_ops), np.asarray(other._kraus_ops))

def num_qubits(self) -> int:
return self._num_qubits
Expand Down
4 changes: 3 additions & 1 deletion cirq-core/cirq/ops/mixed_unitary_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ def __eq__(self, other) -> bool:
return False
if not np.allclose([m[0] for m in self._mixture], [m[0] for m in other._mixture]):
return False
return np.allclose([m[1] for m in self._mixture], [m[1] for m in other._mixture])
return np.allclose(
np.asarray([m[1] for m in self._mixture]), np.asarray([m[1] for m in other._mixture])
)

def num_qubits(self) -> int:
return self._num_qubits
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,11 +606,11 @@ def _decomp_3sqrt_iswap_matrices(
if ieq1:
if ieq2:
# Non-canonical Weyl coordinates for the single sqrt-iSWAP
x1, y1, z1 = 0, np.pi / 8, -np.pi / 8
x1, y1, z1 = 0.0, np.pi / 8, -np.pi / 8
else:
x1, y1, z1 = 0, np.pi / 8, np.pi / 8
x1, y1, z1 = 0.0, np.pi / 8, np.pi / 8
else:
x1, y1, z1 = -np.pi / 8, np.pi / 8, 0
x1, y1, z1 = -np.pi / 8, np.pi / 8, 0.0
# Non-canonical Weyl coordinates for the two sqrt-iSWAP decomposition
x2, y2, z2 = x - x1, y - y1, z - z1

Expand Down