CZ

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

Produces a controlled-Z gate:

CZ = [[1, 0, 0,  0],
      [0, 1, 0,  0],
      [0, 0, 1,  0],
      [0, 0, 0, -1]]

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

Parameters
  • control (Union[Qubit, QubitPlaceholder, FormalArgument, int]) – The control qubit.

  • target (Union[Qubit, QubitPlaceholder, FormalArgument, int]) – The target qubit. The target qubit has an Z-gate applied to it if the control qubit is in the excited state.

Return type

Gate

Returns

A Gate object.