Bound state calculations in QED and QCD using basis light-front quantization