Skip to content

Warnings about \p \D in first tutorial

The code of the first tutorial https://meanfi.readthedocs.io/en/latest/tutorial/hubbard_1d.html gives a warning for me for all parts where latex is used, e.g. this line

plt.xticks([0, np.pi, 2 * np.pi], ["$0$", "$\pi$", "$2\pi$"])

gives the warning

<>:7: SyntaxWarning: invalid escape sequence '\p'
<>:7: SyntaxWarning: invalid escape sequence '\p'
<>:7: SyntaxWarning: invalid escape sequence '\p'
<>:7: SyntaxWarning: invalid escape sequence '\p'
/tmp/ipykernel_910706/4068941059.py:7: SyntaxWarning: invalid escape sequence '\p'
  plt.xticks([0, np.pi, 2 * np.pi], ["$0$", "$\pi$", "$2\pi$"])
/tmp/ipykernel_910706/4068941059.py:7: SyntaxWarning: invalid escape sequence '\p'
  plt.xticks([0, np.pi, 2 * np.pi], ["$0$", "$\pi$", "$2\pi$"])

So either escape the backslash or use r"" etc.