Skip to content
Merged
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
16 changes: 8 additions & 8 deletions docs/custom_gates.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,9 @@
},
"source": [
"As mentioned, methods such as `_unitary_` which we have seen are known as \"magic\n",
"methods.\" Much of cirq relies on \"magic methods\", which are methods prefixed with one or\n",
"two underscores and used by cirq's protocols or built-in python methods.\n",
"For instance, python translates `cirq.Z**0.25` into\n",
"methods.\" Much of Cirq relies on \"magic methods\", which are methods prefixed with one or\n",
"two underscores and used by Cirq's protocols or built-in Python methods.\n",
"For instance, Python translates `cirq.Z**0.25` into\n",
"`cirq.Z.__pow__(0.25)`. Other uses are specific to cirq and are found in the\n",
"protocols subdirectory. They are defined below.\n",
"\n",
Expand All @@ -502,11 +502,11 @@
"id": "d05fa2e8d1ab"
},
"source": [
"### Standard python magic methods\n",
"### Standard Python magic methods\n",
"\n",
"There are many standard magic methods in python. Here are a few of the most\n",
"important ones used in cirq:\n",
" * `__str__` for user-friendly string output and `__repr__` is the python-friendly string output, meaning that `eval(repr(y))==y` should always be true.\n",
"There are many standard magic methods in Python. Here are a few of the most\n",
"important ones used in Cirq:\n",
" * `__str__` for user-friendly string output and `__repr__` is the Python-friendly string output, meaning that `eval(repr(y))==y` should always be true.\n",
" * `__eq__` and `__hash__` which define whether objects are equal or not. You\n",
" can also use `cirq.value.value_equality` for objects that have a small list\n",
" of sub-values that can be compared for equality.\n",
Expand Down Expand Up @@ -552,7 +552,7 @@
"These gates can be understood by the simulator, optimizers, and other code.\n",
"3. All that matters is functional equivalence.\n",
"Don't worry about staying within or reaching a particular gate set; it's too hard to predict what the caller will want. Gate-set-aware decomposition is useful, but *this is not the protocol that does that*.\n",
"Gate-set-aware decomposition may be added in the future, but doesn't exist within Cirq at the moment.\n",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to update documentation of decompose protocol and mention that decompose will now always try to end at default cirq gateset, i.e. x/y/z/cz/measurement/global phase

"Instead, use features available in the [transformer API](transform.ipynb#compiling_to_nisq_targets_cirqcompilationtargetgateset).\n",
"\n",
"For example, `cirq.CCZ` decomposes into a series of `cirq.CNOT` and `cirq.T` operations.\n",
"This allows code that doesn't understand three-qubit operation to work with `cirq.CCZ`; by decomposing it into operations they do understand.\n",
Expand Down