CCNOT

pyquil.gates.CCNOT(control1, control2, target)[source]

Produces a doubly-controlled NOT gate:

CCNOT = [[1, 0, 0, 0, 0, 0, 0, 0],
         [0, 1, 0, 0, 0, 0, 0, 0],
         [0, 0, 1, 0, 0, 0, 0, 0],
         [0, 0, 0, 1, 0, 0, 0, 0],
         [0, 0, 0, 0, 1, 0, 0, 0],
         [0, 0, 0, 0, 0, 1, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 1],
         [0, 0, 0, 0, 0, 0, 1, 0]]

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

Parameters:
  • control1 (Union[Qubit, QubitPlaceholder, int]) – The first control qubit.
  • control2 (Union[Qubit, QubitPlaceholder, int]) – The second control qubit.
  • target (Union[Qubit, QubitPlaceholder, int]) – The target qubit. The target qubit has an X-gate applied to it if both control qubits are in the excited state.
Return type:

Gate

Returns:

A Gate object.