Function quest_sys::controlledPhaseShift
source · pub unsafe extern "C" fn controlledPhaseShift(
qureg: Qureg,
idQubit1: c_int,
idQubit2: c_int,
angle: f64
)Expand description
Introduce a phase factor \f$ \exp(i \theta) \f$ on state \f$ |11\rangle \f$ of qubits \p idQubit1 and \p idQubit2. For angle \f$\theta\f$, this effects the unitary \f[ \begin{pmatrix} 1 & & & \ & 1 & & \ & & 1 & \ & & & \exp(i \theta) \end{pmatrix} \f] on \p idQubit1 and \p idQubit2.
\f[ \begin{tikzpicture}[scale=.5] \node[draw=none] at (-3.5, 2) {qubit1}; \node[draw=none] at (-3.5, 0) {qubit2};
\draw (-2, 2) – (2, 2); \draw[fill=black] (0, 2) circle (.2); \draw (0, 2) – (0, 1);
\draw (-2,0) – (-1, 0); \draw (1, 0) – (2, 0); \draw (-1,-1)–(-1,1)–(1,1)–(1,-1)–cycle; \node[draw=none] at (0, 0) {$R_\theta$}; \end{tikzpicture} \f]
@see
- phaseShift()
- multiControlledPhaseShift()
@ingroup unitary @param[in,out] qureg object representing the set of all qubits @param[in] idQubit1 first qubit in the state to phase shift @param[in] idQubit2 second qubit in the state to phase shift @param[in] angle amount by which to shift the phase in radians @throws invalidQuESTInputError()
- if \p idQubit1 or \p idQubit2 are outside [0, \p qureg.numQubitsRepresented)
- if \p idQubit1 and \p idQubit2 are equal @author Tyson Jones