Skip to content

Commit

Permalink
Add a deprecation cycle for ArithmeticOp (quantumlib#5599)
Browse files Browse the repository at this point in the history
quantumlib#4702 was started in November but did not get merged until May, which was after 14.1 went out. These deprecations need to be bumped to 0.16 instead of 0.15.

Once 0.15 goes out then I can reopen quantumlib#5579 and delete these.
  • Loading branch information
daxfohl authored and rht committed May 1, 2023
1 parent b9db73a commit 6603b0e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cirq-core/cirq/interop/quirk/cells/arithmetic_cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import cirq


@deprecated_class(deadline='v0.15', fix='Use cirq.QuirkArithmeticGate')
@deprecated_class(deadline='v0.16', fix='Use cirq.QuirkArithmeticGate')
@value.value_equality
class QuirkArithmeticOperation(ops.ArithmeticOperation):
"""Applies arithmetic to a target and some inputs.
Expand Down
2 changes: 1 addition & 1 deletion cirq-core/cirq/ops/arithmetic_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
TSelf = TypeVar('TSelf', bound='ArithmeticOperation')


@deprecated_class(deadline='v0.15', fix='Use cirq.ArithmeticGate')
@deprecated_class(deadline='v0.16', fix='Use cirq.ArithmeticGate')
class ArithmeticOperation(Operation, metaclass=abc.ABCMeta):
"""A helper class for implementing reversible classical arithmetic.
Expand Down
6 changes: 3 additions & 3 deletions cirq-core/cirq/ops/arithmetic_operation_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def with_registers(self, *new_registers):
def apply(self, target_value, input_value):
return target_value + input_value

with cirq.testing.assert_deprecated(deadline='v0.15', count=8):
with cirq.testing.assert_deprecated(deadline='v0.16', count=8):
inc2 = Add(cirq.LineQubit.range(2), 1)
np.testing.assert_allclose(cirq.unitary(inc2), shift_matrix(4, 1), atol=1e-8)

Expand Down Expand Up @@ -208,7 +208,7 @@ def with_registers(self, *new_registers):
def apply(self, target_value, input_value):
raise NotImplementedError()

with cirq.testing.assert_deprecated(deadline='v0.15', count=4):
with cirq.testing.assert_deprecated(deadline='v0.16', count=4):
q0, q1, q2, q3, q4, q5 = cirq.LineQubit.range(6)
op = Three([q0], [], [q4, q5])
assert op.qubits == (q0, q4, q5)
Expand Down Expand Up @@ -238,7 +238,7 @@ def registers(self):
def with_registers(self, *new_registers):
raise NotImplementedError()

with cirq.testing.assert_deprecated(deadline='v0.15'):
with cirq.testing.assert_deprecated(deadline='v0.16'):
state = np.ones(4, dtype=np.complex64) / 2
output = cirq.final_state_vector(cirq.Circuit(Op1()), initial_state=state)
np.testing.assert_allclose(state, output)

0 comments on commit 6603b0e

Please sign in to comment.