aba_decomposer
Module containing classes that inherit from the ABADecomposer class to decompose a circuit into one of the Pauli ABA decompositions.
ABADecomposer
Bases: Decomposer
, ABC
Source code in opensquirrel\decomposer\aba_decomposer.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
|
decompose(g)
General A-B-A decomposition function for a single gate.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
g |
Gate
|
gate to decompose. |
required |
Returns:
Type | Description |
---|---|
list[Gate]
|
Three gates, following the A-B-A convention, corresponding to the decomposition of the input gate. |
Source code in opensquirrel\decomposer\aba_decomposer.py
get_decomposition_angles(alpha, axis)
Gives the angles used in the A-B-A decomposition of the Bloch sphere rotation
characterized by a rotation around axis
of angle alpha
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
alpha |
float
|
angle of the Bloch sphere rotation |
required |
axis |
AxisLike
|
normalized axis of the Bloch sphere rotation |
required |
Returns:
Type | Description |
---|---|
float
|
A triple (theta1, theta2, theta3) corresponding to the decomposition of the |
float
|
arbitrary Bloch sphere rotation into U = Ra(theta3) Rb(theta2) Ra(theta1) |
Source code in opensquirrel\decomposer\aba_decomposer.py
XYXDecomposer
Bases: ABADecomposer
Class responsible for the X-Y-X decomposition.
Source code in opensquirrel\decomposer\aba_decomposer.py
XZXDecomposer
Bases: ABADecomposer
Class responsible for the X-Z-X decomposition.
Source code in opensquirrel\decomposer\aba_decomposer.py
YXYDecomposer
Bases: ABADecomposer
Class responsible for the Y-X-Y decomposition.
Source code in opensquirrel\decomposer\aba_decomposer.py
YZYDecomposer
Bases: ABADecomposer
Class responsible for the Y-Z-Y decomposition.
Source code in opensquirrel\decomposer\aba_decomposer.py
ZXZDecomposer
Bases: ABADecomposer
Class responsible for the Z-X-Z decomposition.
Source code in opensquirrel\decomposer\aba_decomposer.py
ZYZDecomposer
Bases: ABADecomposer
Class responsible for the Z-Y-Z decomposition.