Conversation
…factor/replace-sycamore-device
42cba3e to
f8767be
Compare
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
dstrain115
left a comment
There was a problem hiding this comment.
LGTM, but we should use @deprecate for functions at least.
| ) -> device_pb2.DeviceSpecification: | ||
| """Parse ASCIIart device layout into DeviceSpecification proto. | ||
|
|
||
| """[Deprecated] Parse ASCIIart device layout into DeviceSpecification proto. |
There was a problem hiding this comment.
I don't understand why we don't have a @_compat.deprecated decorator on this function. It should just be one line, so I don't think it will be burdensome at all, and it is much more obvious than a docstring.
There was a problem hiding this comment.
Sounds good. Tests need to include assert_deprecation() contexts but there aren't many of them. Will update
_SYCAMORE_DURATIONS would be trickier to deprecate, though, since it's a constant. Might need something similar to examples in PEP 562 and probably not worth the effort.
There was a problem hiding this comment.
That's fine. My comment was mainly about the function. _SYCAMORE_DURATIONS is a constant and it is already designated as private from the underscore, so I do not think we need a deprecation warning for it.
| " depth=depth,\n", | ||
| " num_qubits=depth,\n", | ||
| " device_graph=routing.gridqubits_to_graph_device(device.qubits),\n", | ||
| " device_graph=routing.gridqubits_to_graph_device(device.metadata.qubit_set),\n", |
There was a problem hiding this comment.
Optional: I wonder if it would be worth having a deprecated qubits() function in GridDevice to point to metadata.qubit_set? This would help people know how to upgrade this everywhere. This would be a separate PR of course. Just an idea.
| return qubits, measurement_lines | ||
|
|
||
|
|
||
| @_compat.deprecated(deadline='v0.16', fix='This function will no longer be available.') |
There was a problem hiding this comment.
Should the fix be to use def create_device_proto_for_qubits?
Blocking SerializableDevice deprecation (quantumlib#5522) Recirq needs to be updated to use `Sycamore.metadata.qubit_set` in a follow-up. I put deprecation warnings as docstrings/comments since I don't expect them to have much usage outside Cirq (one exception being `_SYCAMORE_DURATION_PICOS` is used on server side to serialize DeviceSpecification the old way). Let me know if you'd prefer a full deprecation warning. @dstrain115 cc @MichaelBroughton @mpharrigan
Blocking SerializableDevice deprecation (#5522)
Recirq needs to be updated to use
Sycamore.metadata.qubit_setin a follow-up.I put deprecation warnings as docstrings/comments since I don't expect them to have much usage outside Cirq (one exception being
_SYCAMORE_DURATION_PICOSis used on server side to serialize DeviceSpecification the old way). Let me know if you'd prefer a full deprecation warning.@dstrain115
cc @MichaelBroughton @mpharrigan