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

Fix the deprecation warning for ClassicallyControlledOperation #4780

Merged
merged 2 commits into from
Dec 29, 2021
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
1 change: 0 additions & 1 deletion cirq-core/cirq/ops/classically_controlled_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ def _circuit_diagram_info_(

def _json_dict_(self) -> Dict[str, Any]:
return {
'cirq_type': self.__class__.__name__,
'conditions': self._conditions,
'sub_operation': self._sub_operation,
}
Expand Down
6 changes: 2 additions & 4 deletions docs/dev/serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,8 @@ There are several steps needed to support an object's serialization and deserial
and pass `cirq-core/cirq/protocols/json_serialization_test.py`:

1. The object should have a `_json_dict_` method that returns a dictionary
containing a `"cirq_type"` key as well as keys for each of the value's
attributes. If these keys do not match the names of the class' initializer
arguments, a `_from_json_dict_` class method must also be defined.
Typically the `"cirq_type"` will be the name of your class.
containing keys for each of the value's attributes. If these keys do not match the names of
the class' initializer arguments, a `_from_json_dict_` class method must also be defined.

2. In `class_resolver_dictionary` within the packages's `json_resolver_cache.py` file,
for each serializable class, the `cirq_type` of the class should be mapped to the imported class
Expand Down