swap2cz_decomposer
SWAP2CZDecomposer
Bases: Decomposer
Source code in opensquirrel/passes/decomposer/swap2cz_decomposer.py
decompose
Predefined decomposition of SWAP gate to 3 CZ gates and Ry rotations.
Note
This decomposition preserves the global phase of the SWAP gate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gate
|
Gate
|
SWAP gate to decompose. |
required |
Returns:
| Type | Description |
|---|---|
list[Gate]
|
A sequence of 3 CZ gates and Ry rotations that decompose the SWAP gate. |

