Trying to append an integer as per this post and this post.
Requirement:
from IPython.display import display, Markdown
N = 128
text = r'$QFT=\frac{1}{\sqrt{'+str(N)+'}} \begin{bmatrix}'
text = text + r'1 & 2 \\ 3 & 4 \\'
text = text + r' \end{bmatrix}$'
display(Markdown(text))
Tried: IndexError: Replacement index 1 out of range for positional args tuple
N = str(128)
text = r'$QFT=\frac{1}{\sqrt{N}} \begin{bmatrix}'.format(N)
But either of these don't work. Note, here text
is LaTeX based string.