Add cirq.convert_to_target_gateset
and implementations of CZ, SqrtIswap target gatesets.
#5003
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a new interface for defining a compilation target gateset and gives implementation of two common compilation target gatesets:
cirq.CompilationTargetGateset
: Interface (ABC) to create new compilation target gatesets.cirq.TwoQubitAnalyticalCompilationTarget
: Interface for creating two qubit compilation target gatesets with known analytical decompositionscirq.CZTargetGateset
,cirq.SqrtIswapTargetGateset
: Implementations for CZ and SqrtIswap target gatesets.Adds new transformer primitives for converting any given circuit to a given compilation target gateset.
cirq.decompose_operations_to_target_gateset
: Attempts to locally convert each operation to target gateset.cirq.convert_to_target_gateset
: Also runs pre and post processing transformers before decomposing individual operations to target gateset.Part of Organization (and deprecation) of cirq-core/optimizers in cirq-core/transformers #4722
Follows the new Transformer API Compiling: Circuit Transformers API #4483
Supports no compile tags NoCompile Tag for optimizers NoCompile Tag for optimizers #4253
TODO: Still need to add more tests. Putting this out there so people can take a look at the general design and give feedback.
cc @MichaelBroughton @dstrain115