  Long-range entangled states are vital for quantum information processing and
quantum metrology. Preparing such entangled states by combining measurements
with unitary gates has opened new possibilities for efficient protocols with
finite-depth quantum circuits. The complexity of these algorithms is crucial
for the resource requirements on a quantum device. The stability of the
preparation protocols to perturbations decides the fate of their implementation
in large-scale noisy quantum devices. In this work, we consider stochastic
quantum circuits in one and two dimensions consisting of randomly applied
unitary gates and local measurements. These quantum operations preserve a class
of discrete local symmetries, which can be broken due to the stochasticity
arising from timing and gate imperfections. In the absence of randomness, the
protocol is known to generate a symmetry-protected long-range entangled state
in a finite-depth circuit. In the general case, by studying the time evolution
under this hybrid quantum circuit, we analyze the time to reach the target
entangled state. We find two important time scales which we associate with the
emergence of certain symmetry generators. The quantum trajectories embody the
local symmetry with a time that scales logarithmically with system size,
whereas global symmetries require exponentially long times to appear. We devise
error-mitigation protocols that provide significant improvement on both time
scales and investigate the stability of the algorithm to perturbations that
naturally arise in experiments. We also generalize the protocol to realize the
toric code and Xu-Moore states in two dimensions, and open avenues for future
studies of anyonic excitations present in those systems. Our work paves the way
for efficient error correction for quantum state preparation.
