TITLE: Linear equations with absolute values
QUESTION [7 upvotes]: Assume we have a set of equations in $x \in \mathbb{R}^n$
$$|a_i\cdot x|=b_i$$
where $a_i \in \mathbb{R}^n$ and $b_i>0$ are given.
Could such a system be solved efficiently?

In a theoretical machine storing reals with perfect accuracy.
An approximate solution taking rounding errors into account.

This is equivalent to having $2$ possible values for each linear combination, which is a valid question over any field. Does this equivalent problem over a fixed finite field have an efficient solution? Or is it perhaps known to be NP-complete?
So far, I concluded that squaring both sides of the equation we get linear equations in $y_{ij} = x_i x_j$. However, this helps only if the system is quadratically overdetermined.

REPLY [3 votes]: If you square your equations to get $|\langle x,a_i\rangle|^2 = b_i^2$ your problem is the so-called phase retrieval problem (which was motivated by the problem of recovering a function (up to global phase) from the magnitude of its Fourier transform). There are several results here (besides the general NP-hardness). I would like to point out some blog posts by Dustin Mixon, e.g.:

Saving phase: Injectivity and stability for phase retrieval
Phase retrieval: Stability and recovery guarantees
Phase retrieval from very few measurements

In these posts and the reference given there, Dustin discussion issues of solvabilty and indeed, the squared system is often solvable even if not quadratically overdetermined. There are also some algorithms around, e.g DOLPHin, PhaseMax or PhaseLift.