CNOT

pyquil.gates.CNOT(control, target)[source]

Produces a controlled-NOT (controlled-X) gate:

CNOT = [[1, 0, 0, 0],
        [0, 1, 0, 0],
        [0, 0, 0, 1],
        [0, 0, 1, 0]]

This gate applies to two qubit arguments to produce the controlled-not gate instruction.

Parameters:
  • control (Union[Qubit, QubitPlaceholder, int]) – The control qubit.
  • target (Union[Qubit, QubitPlaceholder, int]) – The target qubit. The target qubit has an X-gate applied to it if the control qubit is in the |1> state.
Return type:

Gate

Returns:

A Gate object.