Abstract-We consider the problem of recovering a complex signal x ∈ C n from m intensity measurements of the form |a H i x|, 1 ≤ i ≤ m, where a H i is the i-th row of measurement matrix A ∈ C m×n . Our main focus is on the case where the measurement vectors are unconstrained, and where x is exactly K-sparse, or the so-called general compressive phase retrieval problem. We introduce PhaseCode, a novel family of fast and efficient algorithms that are based on a sparsegraph coding framework. We show that in the noiseless case, the PhaseCode algorithm can recover an arbitrarily-close-toone fraction of the K non-zero signal components using only slightly more than 4K measurements when the support of the signal is uniformly random, with order-optimal time and memory complexity of Θ(K)1 . It is known that the fundamental limit for the number of measurements in compressive phase retrieval problem is 4K − o(K) for the more difficult problem of recovering the signal exactly and with no assumptions on its support distribution [1], [2]. This shows that under mild relaxation of the conditions, our algorithm is the first constructive capacity-approaching compressive phase retrieval algorithm: in fact, our algorithm is also order-optimal in complexity and memory. Further, we show that for any signal x, PhaseCode can recover a random (1 − p)-fraction of the non-zero components of x with high probability, where p can be made arbitrarily close to zero, with sample complexity m = c(p)K, where c(p) is a small constant depending on p that can be precisely calculated, with optimal time and memory complexity. As a result, assuming that the non-zero components of x are lower bounded by Θ(1) and upper bounded by Θ(K γ ) for some positive constant γ < 1, we are able to provide a strong 1 guarantee for the estimated signalx as follows: x − x 1 ≤ p x 1(1 + o(1)), where p can be made arbitrarily close to zero. As one instance, the PhaseCode algorithm can provably recover, with high probability, a random 1 − 10 −7 fraction of the significant signal components, using at most m = 14K measurements.Next, motivated by some important practical classes of optical systems, we consider a "Fourier-friendly" constrained measurement setting, and show that its performance matches that of the unconstrained setting, when the signal is sparse in the Fourier domain with uniform support. In the Fourier-friendly setting that we consider, the measurement matrix is constrained to be a cascade of Fourier matrices (corresponding to optical lenses) and diagonal matrices (corresponding to diffraction mask patterns).Finally, we tackle the compressive phase retrieval problem in the presence of noise, where measurements are in the form Ramtin Pedarsani is with the ECE Department at UC Santa Barbara. email: ramtin@ece.ucsb.edu. Dong Yin and Kannan Ramchandran are with the EECS Department at UC Berkeley. email:{dongyin,kannanr}@eecs.berkeley.edu.Kangwook Lee is with the EE Department at KASIT. email: kw1jjang@kaist.ac.kr. This paper was presented in part in Allerton 2015...