Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a deprecation cycle for ArithmeticOp #5599

Merged
merged 3 commits into from
Jun 24, 2022
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
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)