This paper proposes a new quantum particle swarm optimization algorithm with local attracting (LAQPSO), which is based on quantum-inspired evolutionary algorithm (QEA) and particle swarm optimization algorithm (PSO). In the proposed LAQPSO, a novel quantum bit expression mechanism called quantum angle is employed to encode the solution onto particle, and a new local attractor is proposed to determine the rotation angle of quantum rotation gate automatically. During the process of seeking the global solution, the magnitude of rotation angle is adjusted by an important parameter called contraction coefficient, which can quantitatively determine the tradeoff between exploration ability and exploitation ability. The simulation results for different contraction coeffcients are helpful for selecting the key parameter. A set of benchmark functions are used to evaluate the performance of LAQPSO, QEA and QBPSO, and the results show that the proposed algorithm has a fast convergence rate and can effectively avoid premature convergence.