  Quantum state transfer along a one-dimensional spin chain has become a
fundamental ingredient for quantum communication between distant nodes in a
quantum network. We study the average fidelity of quantum state transfer (QST)
along a XY spin chain by adjusting the basis identification between the first
spin and the last spin. In a proper choice of the basis identification, we find
that the QST fidelity depends only on the average parity of the initial state
linearly. We propose a simple scheme to adjusting the basis identification to
optimize the average fidelity such that it depends linearly on the absolute
value of the average parity. In the case that the absolute value of the average
parity is $1$ we prove that the fidelity takes the maximum at any time over
arbitrary initial state and basis identification.
