Skip to content

Commit

Permalink
Skip unitary in Clifford check (quantumlib#3165)
Browse files Browse the repository at this point in the history
  • Loading branch information
viathor authored Jul 22, 2020
1 parent 0952958 commit 7a4ccaf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cirq/sim/clifford/clifford_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def is_supported_operation(op: 'cirq.Operation') -> bool:
if isinstance(op.gate, cirq.MeasurementGate): return True
if isinstance(op, GlobalPhaseOperation): return True
if not protocols.has_unitary(op): return False
u = unitary(op)
if u.shape == (2, 2):
return not SingleQubitCliffordGate.from_unitary(u) is None
if len(op.qubits) == 1:
u = unitary(op)
return SingleQubitCliffordGate.from_unitary(u) is not None
else:
return op.gate in [cirq.CNOT, cirq.CZ]

Expand Down

0 comments on commit 7a4ccaf

Please sign in to comment.