INTRODUCTION
The SNS is designed to produce 1.4 MW of neutron power by bombarding a target with a high intensity proton beam. The beam optics should be carefully controlled in the linac and the accumulator ring to avoid unnecessary radiation activation due to beam loss. A beam optics control program has been developed within the XAL framework [1], [2] to provide better transverse matching in the transition regions between various sub-systems.