Function multiControlledPhaseFlip

Source
pub unsafe extern "C" fn multiControlledPhaseFlip(
    qureg: Qureg,
    controlQubits: *mut c_int,
    numControlQubits: c_int,
)
Expand description

Apply the multiple-qubit controlled phase flip gate, also known as the multiple-qubit controlled pauliZ gate. For each state, if all control qubits have value one, multiply the amplitude of that state by -1. This applies the many-qubit unitary: \f[ \begin{pmatrix} 1 \ & 1 \
& & \ddots \ & & & 1 \ & & & & -1 \end{pmatrix} \f] on the control qubits.

@htmlonly

@endhtmlonly

@ingroup unitary @param[in,out] qureg object representing the set of all qubits @param[in] controlQubits array of input qubits @param[in] numControlQubits number of input qubits @throws invalidQuESTInputError()

  • if \p numControlQubits is outside [1, \p qureg.numQubitsRepresented)
  • if any qubit in \p controlQubits is outside [0, \p qureg.numQubitsRepresented)
  • if any qubit in \p qubits is repeated @author Tyson Jones