  Rare events such as nucleation processes are of ubiquitous importance in real
systems. The most popular method for nonequilibrium systems, forward flux
sampling (FFS), samples rare events by using interfaces to partition the whole
transition process into sequence of steps along an order parameter connecting
the initial and final states. FFS usually suffers from two main difficulties:
low computational efficiency due to bad interface locations and even being not
applicable when trapping into unknown intermediate metastable states. In the
present work, we propose an approach to overcome these difficulties, by
self-adaptively locating the interfaces on the fly in an optimized manner.
Contrary to the conventional FFS which set the interfaces with euqal distance
of the order parameter, our approach determines the interfaces with equal
transition probability which is shown to satisfy the optimization condition.
This is done by firstly running long local trajectories starting from the
current interface $\l_i$ to get the conditional probability distribution $P_c$,
and then determining $\l_{i+1}$ by equalling $P_c$ to a give value $p_0$. With
these optimized interfaces, FFS can be run in a much efficient way. In
addition, our approach can conveniently find the intermediate metastable states
by monitoring some special long trajectories that nither end at the initial
state nor reach the next interface, the number of which will increase sharply
from zero if such metastable states are encountered. We apply our approach to a
model two-state system and a two-dimensional lattice gas Ising model. Our
approach is shown to be much more efficient than the conventional FFS method
without losing accuracy, and it can also well reproduce the two-step nucleation
scenario of the Ising model with easy identification of the intermidiate
metastable state.
