Пример #1
0
    potname = pot.replace("_","\_")

    if type(potdef["potential"]) == str:
        potformula = latex(sympify(potdef["potential"]))
    else:
        potformula = latex(Matrix(sympify(potdef["potential"])))

    if potdef.has_key("defaults"):
        potdefaults = potdef["defaults"]
    else:
        potdefaults = {}

    # Create the potential "the right way"
    params["potential"] = pot
    P = PotentialFactory().create_potential(params)
    y = P.evaluate_eigenvalues_at(x)

    # Plot the potential
    figure()
    for yvals in y:
        plot(x, yvals)
    xlabel(r"$x$")
    ylabel(r"$\lambda_i\left(x\right)$")
    xlim(min(x), max(x))
    savefig(pot + ".pdf")

    # The latex code
    ls = """
\\begin{minipage}{0.5\\linewidth}
  Name:    \\texttt{""" + potname + """}
  \\begin{equation*}