# cirq.TwoQubitDiagonalGate¶

class cirq.TwoQubitDiagonalGate(diag_angles_radians: List[Union[float, sympy.core.basic.Basic]])[source]

A gate given by a diagonal 4\times 4 matrix.

__init__(diag_angles_radians: List[Union[float, sympy.core.basic.Basic]]) → None[source]

A two qubit gate with only diagonal elements.

This gate’s off-diagonal elements are zero and it’s on diagonal
elements are all phases.
Parameters

diag_angles_radians – The list of angles on the diagonal in radians. If these values are $(x_0, x_1, ldots , x_3)$ then the unitary has diagonal values $(e^{i x_0}, e^{i x_1}, ldots, e^{i x_3})$.

Methods

 controlled([num_controls, control_values, …]) Returns a controlled version of this gate. If no arguments are The number of qubits this gate acts on. on(*qubits) Returns an application of this gate to the given qubits. validate_args(qubits) Checks if this gate can be applied to the given qubits. with_probability(probability) wrap_in_linear_combination([coefficient])