ABA decomposer
The ABA decomposer is a collection of single-qubit gate decomposers that follow the A-B-A pattern, where the A and B stand for a rotation gate about a particular axis (and A is not the same as B). The following decomposers are available:
- XYX decomposer (
XYXDecomposer) - XZX decomposer (
XZXDecomposer) - YXY decomposer (
YXYDecomposer) - YZY decomposer (
YZYDecomposer) - ZXZ decomposer (
ZXZDecomposer) - ZYZ decomposer (
ZYZDecomposer)
For instance, the ZYZ decomposer, decomposes every single-qubit gate into (at most) 3 gates, i.e., a sequence of an Rz, Ry, and Rz gate. The decomposition is done in fewer than 3 gates where possible.
In the example below a H, Z, Y, and Rx gate are all decomposed to Rz and Ry gates using the ZYZ decomposer.
Check the circuit builder on how to generate a circuit.
import math
from opensquirrel.circuit_builder import CircuitBuilder
from opensquirrel.passes.decomposer import ZYZDecomposer