This Mathematica code implements the time evolution of a 15 qubit spin chain with a perfect state transfer Hamiltonian, in the presence of exactly one phase error at a random location and random time. It verifies that a proposed error correcting code always corrects for the error.