Function rotateAroundAxis

Source
pub unsafe extern "C" fn rotateAroundAxis(
    qureg: Qureg,
    rotQubit: c_int,
    angle: f64,
    axis: Vector,
)
Expand description

Rotate a single qubit by a given angle around a given \ref Vector on the Bloch-sphere. The vector must not be zero (else an error is thrown), but needn’t be unit magnitude, since it will be normalised by QuEST.

For angle \f$\theta\f$ and axis vector \f$\vec{n}\f$, applies \f$R_{\hat{n}} = \exp \left(- i \frac{\theta}{2} \hat{n} \cdot \vec{\sigma} \right) \f$ where \f$\vec{\sigma}\f$ is the vector of Pauli matrices.

@see

  • controlledRotateAroundAxis()
  • rotateX()
  • rotateY()
  • rotateZ()
  • multiRotateZ()
  • multiRotatePauli()

@ingroup unitary @param[in,out] qureg object representing the set of all qubits @param[in] rotQubit qubit to rotate @param[in] angle angle by which to rotate in radians @param[in] axis vector around which to rotate (can be non-unit; will be normalised) @throws invalidQuESTInputError()

  • if \p rotQubit is outside [0, \p qureg.numQubitsRepresented)
  • if \p axis is the zero vector @author Ania Brown (state-vector) @author Tyson Jones (density matrix, doc)