摘要:The linear function is possibly the simplest and the most used relation appearing in various areas of our world. A linear relation can be generally determined by the least square linear fitting (LSLF) method using several measured quantities depending on variables. This happens for such as detecting the gradient of a magnetic field. Here, we propose a quantum fitting scheme to estimate the magnetic field gradient with N-atom spins preparing in W state. Our scheme combines the quantum multi-parameter estimation and the least square linear fitting method to achieve the quantum Cramér-Rao bound (QCRB). We show that the estimated quantity achieves the Heisenberg-scaling accuracy. Our scheme of quantum metrology combined with data fitting provides a new method in fast high precision measurements.