  We investigate anisotropic $XXZ$ Heisenberg spin-1/2 chains with control
fields acting on one of the end spins, with the aim of exploring local quantum
control in arrays of interacting qubits. In this work, which uses a recent
Lie-algebraic result on the local controllability of spin chains with
"always-on" interactions, we determine piecewise-constant control pulses
corresponding to optimal fidelities for quantum gates such as spin-flip (NOT),
controlled-NOT (CNOT), and square-root-of-SWAP ($\sqrt{\textrm{SWAP}}$). We
find the minimal times for realizing different gates depending on the
anisotropy parameter $\Delta$ of the model, showing that the shortest among
these gate times are achieved for particular values of $\Delta$ larger than
unity. To study the influence of possible imperfections in anticipated
experimental realizations of qubit arrays, we analyze the robustness of the
obtained results for the gate fidelities to random variations in the
control-field amplitudes and finite rise time of the pulses. Finally, we
discuss the implications of our study for superconducting charge-qubit arrays.
