function applyControlledPhaseGradient(ctx, qubitSpan, factor=1) {
    ctx.applyOperation(CONTROLLED_PHASE_GRADIENT_SHADER.withArgs(
        ...ketArgs(ctx, qubitSpan),
        WglArg.float("factor", factor)));
}
@param {!CircuitEvalContext} ctx
@param {!int} qubitSpan Size of the gate.
@param {!number=} factor Scaling factor for the applied phases.