The standard particle swarm optimization (PSO) algorithm converges very fast, while it is very easy to fall into the local extreme point. According to waiting effect among particles with mean-optimal position(MP), the quantum-behaved particle swarm optimization (QPSO) algorithm can prevent the particle prematurely from falling into local extreme point, but its convergence speed is slow and convergence precision is still low. In order to further improve the precision of QPSO algorithm, the evaluation method of $delta$ trap characteristic length $L(t)$ of wave function for describing the particle's state is modified. In QPSO, a random weight to each particle in swarm is introduced, and according to the order of the each particle best position's fitting value, there are three evaluation programs for $L(t)$, which are random-weight mean-optimal position(RMP), reverse-order random-weight mean-optimal position(RRMP) and same-order random-weight mean-optimal position(SRMP). Through the test of several typical functions, its result shows that the convergence accuracy of QPSO with RMP and RRMP is better than those of QPSO with MP, so the evaluation of $L(t)$ with RMP and RRMP is feasible and effective