  In this paper, we tackle the general compressive phase retrieval problem. The
problem is to recover a K-sparse complex vector of length n, $x\in
\mathbb{C}^n$, from the magnitudes of m linear measurements, $y=|Ax|$, where $A
\in \mathbb{C}^{m \times n}$ can be designed, and the magnitudes are taken
component-wise for vector $Ax\in \mathbb{C}^m$. We propose a variant of the
PhaseCode algorithm, and show that, using an irregular left-degree sparse-graph
code construction, the algorithm can recover almost all the K non-zero signal
components using only slightly more than 4K measurements under some mild
assumptions, with optimal time and memory complexity of ${\cal O}(K)$. It is
known that the fundamental limit for the number of measurements in compressive
phase retrieval problem is $4K - o(K)$. To the best of our knowledge, this is
the first constructive capacity-approaching compressive phase retrieval
algorithm. As a second contribution, we propose another variant of the
PhaseCode algorithm that is based on a Compressive Sensing framework involving
sparse-graph codes. Our proposed algorithm is an instance of a more powerful
"separation" architecture that can be used to address the compressive
phase-retrieval problem in general. This modular design features a compressive
sensing outer layer, and a trigonometric-based phase-retrieval inner layer. The
compressive-sensing layer operates as a linear phase-aware compressive
measurement subsystem, while the trig-based phase-retrieval layer provides the
desired abstraction between the actually targeted nonlinear phase-retrieval
problem and the induced linear compressive-sensing problem. Invoking this
architecture based on the use of sparse-graph codes for the compressive sensing
layer, we show that we can exactly recover a signal from only the magnitudes of
its linear measurements using only slightly more than 6K measurements.
