This thesis is about the preparation and simulation for ground states of topological of matter. Particularly, I focus on arbitrary ground states, which is crucial in quantum memory and error correction coding.