Function quest_sys::controlledRotateZ
source · pub unsafe extern "C" fn controlledRotateZ(
qureg: Qureg,
controlQubit: c_int,
targetQubit: c_int,
angle: f64
)Expand description
Applies a controlled rotation by a given angle around the Z-axis of the Bloch-sphere. The target qubit is rotated in states where the control qubit has value 1.
\f[ \begin{tikzpicture}[scale=.5] \node[draw=none] at (-3.5, 2) {control}; \node[draw=none] at (-3.5, 0) {target};
\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_z(\theta)$}; \end{tikzpicture} \f]
@see
- rotateZ()
- controlledRotateX()
- controlledRotateY()
- controlledRotateAroundAxis()
- controlledPhaseShift()
- multiRotateZ()
- multiRotatePauli()
@ingroup unitary @param[in,out] qureg object representing the set of all qubits @param[in] controlQubit qubit which has value 1 in the rotated states @param[in] targetQubit qubit to rotate @param[in] angle angle by which to rotate the target qubit in radians @throws invalidQuESTInputError()
- if either \p controlQubit or \p targetQubit are outside [0, \p qureg.numQubitsRepresented)
- if \p controlQubit and \p targetQubit are equal @author Tyson Jones