  The GRadient Ascent Pulse Engineering (GRAPE) method is widely used for
optimization in quantum control. GRAPE is gradient search method based on exact
expressions for gradient of the control objective. It has been applied to
coherently controlled closed and open quantum systems. In this work, we adopt
GRAPE method for optimizing objective functionals for open quantum systems
driven by both coherent and incoherent controls. In our case, the tailored or
engineered environment acts on the system as control via it time-dependent
decoherence rates $\gamma_k(t)$ or, equivalently, via it spectral density of
the environment $n_\omega(t)$. To develop GRAPE approach for this problem, we
compute gradient of various objectives for general N-level open quantum systems
both for piecewise class of control. The case of a single qubit is considered
in details and solved analytically. For this case, an explicit analytical
expression for evolution and objective gradient is obtained via diagonalization
of a $3\times 3$ matrix determining the system's dynamics in the Bloch ball.
The diagonalization is obtained by solving a cubic equation via Cardano's
method. The efficiency of the algorithm is demonstrated through numerical
simulations for the state-to-state transition problem and its complexity is
estimated.
