  The main aim of this paper is to study quaternion phase retrieval (QPR),
i.e., the recovery of quaternion signal from the magnitude of quaternion linear
measurements. We show that all $d$-dimensional quaternion signals can be
reconstructed up to a global right quaternion phase factor from $O(d)$
phaseless measurements. We also develop the scalable algorithm quaternion
Wirtinger flow (QWF) for solving QPR, and establish its linear convergence
guarantee. Compared with the analysis of complex Wirtinger flow, a series of
different treatments are employed to overcome the difficulties of the
non-commutativity of quaternion multiplication. Moreover, we develop a variant
of QWF that can effectively utilize a pure quaternion priori (e.g., for color
images) by incorporating a quaternion phase factor estimate into QWF
iterations. The estimate can be computed efficiently as it amounts to finding a
singular vector of a $4\times 4$ real matrix. Motivated by the variants of
Wirtinger flow in prior work, we further propose quaternion truncated Wirtinger
flow (QTWF), quaternion truncated amplitude flow (QTAF) and their pure
quaternion versions. Experimental results on synthetic data and color images
are presented to validate our theoretical results. In particular, for pure
quaternion signal recovery, our quaternion method often succeeds with
measurements notably fewer than real methods based on monochromatic model or
concatenation model.
