cirq.TwoQubitMatrixGate

class cirq.TwoQubitMatrixGate(matrix: numpy.ndarray)[source]

A 2-qubit gate defined only by its matrix.

More general than specialized classes like CZPowGate, but more expensive
and more float-error sensitive to work with (due to using
eigendecompositions).
__init__(matrix: numpy.ndarray) → None[source]

THIS FUNCTION IS DEPRECATED.

IT WILL BE REMOVED IN cirq v0.8.

Use cirq.MatrixGate instead.

Initializes the 2-qubit matrix gate.

Args:
    matrix: The matrix that defines the gate.

Methods

controlled([num_controls, control_values, …])

Returns a controlled version of this gate. If no arguments are

num_qubits()

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.

wrap_in_linear_combination([coefficient])