cirq.KakDecomposition

class cirq.KakDecomposition(*, global_phase: complex, single_qubit_operations_before: Tuple[numpy.ndarray, numpy.ndarray], interaction_coefficients: Tuple[float, float, float], single_qubit_operations_after: Tuple[numpy.ndarray, numpy.ndarray])[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, single_qubit_operations_before: Tuple[numpy.ndarray, numpy.ndarray], interaction_coefficients: Tuple[float, float, float], single_qubit_operations_after: Tuple[numpy.ndarray, numpy.ndarray])[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.

Methods