-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 cirq.SqrtIswapTargetGateset
for (parameterized & non-parameterized) compilation to sqrt iswaps.
#5025
Add cirq.SqrtIswapTargetGateset
for (parameterized & non-parameterized) compilation to sqrt iswaps.
#5025
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are packing a lot into this PR and it's getting a little hard for me to follow test changes with deprecations woven in as well, would you mind splitting out the deprecation into a seperate PR ? Also why do we mention the support of measurement gates in this transformer it doesn't look like we are inserting measurements as a part of the circuit transformation process ?
cirq-core/cirq/transformers/target_gatesets/sqrt_iswap_gateset.py
Outdated
Show resolved
Hide resolved
…PR to remove deprecations
12456ac
to
c87ae92
Compare
cirq.SqrtIswapTargetGateset
to replace cirq.MergeInteractionsToSqrtIswap
and cg.ConvertToSqrtIswapGates
.cirq.SqrtIswapTargetGateset
for (parameterized & non-parameterized) compilation to sqrt iswaps.
@MichaelBroughton As discussed offline, I've removed deprecations from this PR and they will follow up in the next PR once this is checked in. I've also abstracted out the parameterized gate compilation logic to a The PR is ready for a re-review! PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after nits.
f')' | ||
) | ||
|
||
def _value_equality_values_(self) -> Any: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need a corresponding decorator on the top of the class to auto generate other equalities ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Equalities are auto generated because the class derives from cirq.Gateset
, which is decorated with @value.value_equality()
.
Added additional tests to assert this.
A parameterized `cirq.OP_TREE` implementing `op` using only `cirq.SQRT_ISWAP` | ||
(or `cirq.SQRT_ISWAP_INV`) and parameterized single qubit rotations OR | ||
None or NotImplemented if decomposition of `op` is not known. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it an op_tree or a DecomposeResult ? (from fxn return type hint)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DecomposeResult
is Union[cirq.OP_TREE, None, NotImplementedType]
-- the docstring covers all 3 cases.
…zed) compilation to sqrt iswaps. (quantumlib#5025) * Move parameterized decomposition to analytical decomposers and split PR to remove deprecations * Add equality tests
…zed) compilation to sqrt iswaps. (quantumlib#5025) * Move parameterized decomposition to analytical decomposers and split PR to remove deprecations * Add equality tests
…zed) compilation to sqrt iswaps. (quantumlib#5025) * Move parameterized decomposition to analytical decomposers and split PR to remove deprecations * Add equality tests
cirq.SqrtIswapTargetGateset
primitive.cc @MichaelBroughton @dstrain115