cirq.TwoQubitNumericalCompilationResult

Represents a numerical compilation of a target 2-qubit gate onto a base gate.

This object encodes the relationship between 4x4 unitary operators

$$U_{target} \approx k_i \cdot U_{base} \cdot k_{i-1} \cdot \ldots
    \cdot k_1 \cdot U_{base} \cdot k_0$$

where \(U_{target}, U_{base}\) are 2-local and \(k_j\) are 1-local. Equality holds up to a global phase within decomposition_fidelity.

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.