We provide an algorithm to generate vertices for the Schr\"odinger functional
with an abelian background gauge field. The background field has a non-trivial
color structure, therefore we mainly focus on a manipulation of the color
matrix part. We propose how to implement the algorithm especially in python
code. By using python outputs produced by the code, we also show how to write a
numerical expression of vertices in the time-momentum as well as the coordinate
space into a Feynman diagram calculation code. As examples of the applications
of the algorithm, we provide some one-loop results, ratios of the Lambda
parameters between the plaquette gauge action and the improved gauge actions
composed from six-link loops (rectangular, chair and parallelogram), the
determination of the O(a) boundary counter term to this order, and the
perturbative cutoff effects of the step scaling function of the Schroedinger
functional coupling constant.Comment: 34 pages, 4 figure