  In this paper, we present a gradient algorithm for identifying unknown
parameters in an open quantum system from the measurements of time traces of
local observables. The open system dynamics is described by a general Markovian
master equation based on which the Hamiltonian identification problem can be
formulated as minimizing the distance between the real time traces of the
observables and those predicted by the master equation. The unknown parameters
can then be learned with a gradient descent algorithm from the measurement
data. We verify the effectiveness of our algorithm in a circuit QED system
described by a Jaynes-Cumming model whose Hamiltonian identification has been
rarely considered. We also show that our gradient algorithm can learn the
spectrum of a non-Markovian environment based on an augmented system model.
