def render_label(label, inits={}):
    init = inits.get(label)
    if init:
        return r'$|%s\rangle=|%s\rangle$' % (label, init)
    return r'$|%s\rangle$' % label
Slightly more flexible way to render labels.
dataset/ETHPy150Open sympy/sympy/sympy/physics/quantum/circuitplot.py/render_label