# LinearSolve 30x20 matrix with algebraic entries

I have a $30\times 20$ matrix $A$ with entries of the form $x+y\zeta$ where $\zeta$ is a third root of unity and $x,y$ are rational. I want to solve an equation of the form $AX=B$ where $B$ is a specified column vector (this is a very overdetermined system but I know there is a unique solution). I tried LinearSolve, but it was too slow. I think the expressions involving roots of unity are getting very large in the middle of the computation and Mathematica doesn't simplify the intermediate expressions (any intermediate expression will of course have the form $x+y\zeta$). Is there a way to make Mathematica simplify intermediate expressions in the computation? If so, will this solve the problem?

• Will a numeric solution satisfy you? – m_goldberg Jul 4 '17 at 6:04
• I considered converting everything to decimals, expecting that the run time would be significantly faster. I'd be willing to if necessary, since the answer is ultimately going to be used to compute some rational numbers with small denominator (which should be easy to guess from the decimal). – Philip Engel Jul 4 '17 at 6:09
• You really should provide an explicit example. Could be smaller than the actual problem if that helps. – Daniel Lichtblau Jul 4 '17 at 19:31
• I converted everything to decimal. It quickly solved. Then I converted back to algebraic form using z = Rationalize[Re[z]]+Sqrt[3]*I*Rationalize[Im[z/Sqrt[3]]]. – Philip Engel Jul 5 '17 at 22:25