cirq.KakDecomposition

class cirq.KakDecomposition(*, global_phase: complex = 1 + 0j, single_qubit_operations_before: Optional[Tuple[numpy.ndarray, numpy.ndarray]] = None, interaction_coefficients: Tuple[float, float, float], single_qubit_operations_after: Optional[Tuple[numpy.ndarray, numpy.ndarray]] = None)[source]

A convenient description of an arbitrary two-qubit operation.

Any two qubit operation U can be decomposed into the form

U = g · (a1 ⊗ a0) · exp(i·(x·XX + y·YY + z·ZZ)) · (b1 ⊗ b0)

This class stores g, (b0, b1), (x, y, z), and (a0, a1).

global\_phase

g from the above equation.

single\_qubit\_operations\_before

b0, b1 from the above equation.

interaction\_coefficients

x, y, z from the above equation.

single\_qubit\_operations\_after

a0, a1 from the above equation.

References

‘An Introduction to Cartan’s KAK Decomposition for QC Programmers’
__init__(*, global_phase: complex = 1 + 0j, single_qubit_operations_before: Optional[Tuple[numpy.ndarray, numpy.ndarray]] = None, interaction_coefficients: Tuple[float, float, float], single_qubit_operations_after: Optional[Tuple[numpy.ndarray, numpy.ndarray]] = None)[source]

Initializes a decomposition for a two-qubit operation U.

U = g · (a1 ⊗ a0) · exp(i·(x·XX + y·YY + z·ZZ)) · (b1 ⊗ b0)

Parameters
  • global_phase – g from the above equation.

  • single_qubit_operations_before – b0, b1 from the above equation.

  • interaction_coefficients – x, y, z from the above equation.

  • single_qubit_operations_after – a0, a1 from the above equation.