where \(U_{target}, U_{base}\) are 2-local and \(k_j\) are 1-local. Equality
holds up to a global phase within decomposition_fidelity.
Attributes
base_gate_unitary
4x4 unitary denoting \(U_{base}\) above. If several
base gates were given to the compiler, this is the one that was
selected.
base_gate_index
Index of the selected base gate within the sequence
of base gates given to the compiler; 0 if a single base gate was
given. Allows the caller to recover the selected gate without
matching unitaries.
target_gate
4x4 unitary denoting \(U_{target}\) above.
local_unitaries
Sequence of 2-tuples
\((k_{00}, k_{01}), (k_{10}, k_{11}) \ldots\) where
\(k_j = k_{j0} \otimes k_{j1}\) in the product above.
Each \(k_{j0}, k_{j1}\) is a 2x2 unitary. Has num_base_gates + 1
entries.
actual_gate
4x4 unitary denoting the right hand side above, ideally
equal to \(U_{target}\) up to a global phase.
decomposition_fidelity
\(F_d = |\mathrm{Tr}(U_d^\dagger U_t)| / 4\),
the Hilbert-Schmidt overlap between the realized and target
unitaries. 1.0 means an exact decomposition up to global phase.
hardware_fidelity
\(F_h = \prod_g (1 - p_g)\) over all gates \(g\) in
the decomposition, or None if no error rates were provided.
num_base_gates
Number of base gate applications (layers) used.
success
Whether the returned decomposition meets the requested
target_fidelity; measured by decomposition_fidelity \(F_d\),
or by the overall fidelity \(F_u = F_d \cdot F_h\) when error
rates were provided to the compiler.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-10-20 UTC."],[],[]]