Use the pytket.circuit_library module for gate decompositions
mainThe pytket.circuit_library module provides methods for generating small circuits, primarily used to represent one gate in terms of others. This is useful for custom decomposition logic, such as within the .passes.AutoRebase pass.
The library is organized into four main categories:
- Exact multi-qubit gate decompositions: Decomposes multi-qubit gates into other multi-qubit gates (allowing any single-qubit gates). Some methods may trade approximation error for reduced gate costs.
- Approximate multi-qubit gate decompositions: Provides decompositions that may involve approximation error to achieve lower gate costs.
- Single-qubit gate decompositions: Decomposes single-qubit gates into specific universal gatesets. These are typically intended to be run after multi-qubit gates have been decomposed.
- Constant circuits: Returns small, fixed circuits consisting of 1-3 gates (e.g., standard gates like
X,CX, orCCX).
Parameters for the gates being decomposed are passed directly as arguments to the respective methods.