I am trying to draw a diagram with pst-optexp in MikTex on Windows. Every time I try to compile using XeLatex, it would throw an error saying MiKTeX GPL Ghostscript 9.19: Unrecoverable error, exit code 1, so I tried the answer here which did not resolve the issue. I tried using the advice here but I could not find the file it referenced. Below is an example that demonstrates the issue. What can I do?
\documentclass{article}
\usepackage{filecontents}
\usepackage{pstricks}
\usepackage[crop=off]{auto-pst-pdf}
\usepackage{pst-optexp}
\usepackage{physics}
\usepackage{amssymb}
\usepackage{bm}
\usepackage{tikz}
\begin{document}
\begin{pspicture}
\begin{optexp}
\optbox[innerlabel, position=start](L)(End){$\ket{\psi_1}$}
\beamsplitter[bssize=0.4, labelangle=-90](L)(L|C)(C){50/50 BS}
\end{optexp}
\end{pspicture}
\end{document}