如何在球上画一条线?

如何在球上画一条线?

基本上,我想从 z 轴向量的尖端到红色向量的尖端画一条线。我不太清楚该怎么做。这是我目前拥有的代码,我希望有人知道如何实现它:

\documentclass{standalone}

\begin{document}


\begin{blochsphere}[radius=1.5 cm,tilt=15,rotation=-30, opacity=0.3]

    \drawBallGrid[style={opacity=0.1}]{30}{180}

    \drawStatePolar[axisarrow = true, statewidth = 0.3]{x-Achse}{90}{90}
    \drawStatePolar[axisarrow=true, statewidth = 0.3]{y-Achse}{90}{0}
    \drawStatePolar[axisarrow = true, statewidth = 0.3]{z-Achse}{0}{0}
    \node[left] at (x-Achse) {\fontsize{0.15cm}{1em} $x$};
    \node[right] at (y-Achse) {\fontsize{0.15cm}{1em} $y$};
    \node[left] at (z-Achse) {\fontsize{0.15cm}{1em} $z$};

    \drawStatePolar[statecolor = red]{State}{12}{0}




    \labelLatLon{up}{90}{0};
    \labelLatLon{down}{-90}{90};
    \node[above] at (up) {{ $\left|0\right>$ }};
    \node[below] at (down) {{ $\left|1\right>$}}; 
\end{blochsphere}
\end{document} 

我现在有的照片!

答案1

欢迎使用 TeX-SE!假设您想继续使用,您blochsphere可以tikz-3dplot加载库3d以在相应的平面中切换并在那里绘制圆弧。(我忍不住要说的是,中使用的宏blochsphere与在中定义的宏非常相似这个答案但这可能只是一场意外。)

\documentclass{standalone}
\usepackage{blochsphere}
\usepackage{tikz-3dplot}
\usetikzlibrary{3d}
\begin{document}


\begin{blochsphere}[radius=1.5 cm,tilt=15,rotation=-30, opacity=0.3]

    \drawBallGrid[style={opacity=0.1}]{30}{180}

    \drawStatePolar[axisarrow = true, statewidth = 0.3]{x-Achse}{90}{90}
    \drawStatePolar[axisarrow=true, statewidth = 0.3]{y-Achse}{90}{0}
    \drawStatePolar[axisarrow = true, statewidth = 0.3]{z-Achse}{0}{0}
    \node[left] at (x-Achse) {\fontsize{0.15cm}{1em} $x$};
    \node[right] at (y-Achse) {\fontsize{0.15cm}{1em} $y$};
    \node[left] at (z-Achse) {\fontsize{0.15cm}{1em} $z$};

    \drawStatePolar[statecolor = red]{State}{12}{0}



    \labelLatLon{up}{90}{0};
    \labelLatLon{down}{-90}{90};
    \node[above] at (up) {{ $\left|0\right>$ }};
    \node[below] at (down) {{ $\left|1\right>$}}; 

    \tdplotsetmaincoords{105}{-30}
    \begin{scope}[tdplot_main_coords,canvas is xz plane at y=0]
    \draw[blue](90:1.5) arc(90:78:1.5);
    \end{scope} 
\end{blochsphere}
\end{document} 

在此处输入图片描述

相关内容