Skip to content

Commit 4111505

Browse files
Merge pull request tensorflow#528 from quantumlib/u/maffoo/single-qubit-gate
Remove usage of deprecated `cirq.SingleQubitGate`
2 parents 0afeb2b + 68df717 commit 4111505

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

qsimcirq_tests/qsimcirq_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import qsimcirq
2020

2121

22-
class NoiseTrigger(cirq.SingleQubitGate):
22+
class NoiseTrigger(cirq.Gate):
2323
"""A no-op gate with no _unitary_ method defined.
2424
2525
Appending this gate to a circuit will force it to use qtrajectory, but the
@@ -29,6 +29,9 @@ class NoiseTrigger(cirq.SingleQubitGate):
2929
# def _mixture_(self):
3030
# return ((1.0, np.asarray([1, 0, 0, 1])),)
3131

32+
def _num_qubits_(self) -> int:
33+
return 1
34+
3235
def _kraus_(self):
3336
return (np.asarray([1, 0, 0, 1]),)
3437

0 commit comments

Comments
 (0)