4

I need to draw the x,y,z axis of my bloch sphere in black (with an arrow at the end of them).

I tried this code which doesn't work (my axis are light grey).

How to fix it ? I am not sure to understand how to use the options.

\documentclass{standalone}

\usepackage{blochsphere}

\begin{document}

\begin{blochsphere}[radius=1.5 cm,tilt=15,rotation=-20]
    \drawBallGrid[style={opacity=0.1}]{30}{30}

    \drawGreatCircle[style={dashed}]{0}{0}{0}

    \drawAxis[style={draw=black}]{0}{0}

    \drawAxis[color=black]{90}{0}

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


\end{blochsphere}
\end{document}

The result : enter image description here

As you can see the lines are light grey and not black.

Important info : I never used tikz, I just read the documentation to see how it works (because apparently the BlochSphere package is based on it).

Documentation of the Bloch Sphere package : http://ctan.math.washington.edu/tex-archive/graphics/pgf/contrib/blochsphere/blochsphere.pdf

  • 3
    Your axis are black its simply that the grey shell is obscuring them (see how the black equatorial circle is also grey when seen through the translucent glob :-), this is natural with such drawings. Others will possibly guide you but some will wonder why you think they would / should be black –  Jan 16 '19 at 17:57
  • I should have added if you simply need black lines hovering this side of centre why not draw them across the ball ? You are NOT yet calling TikZ so perhaps use whatever graphics you already know. –  Jan 16 '19 at 18:16
  • 1
    There are example on this site that also draw such things, like this one and that one. (I never used the blochsphere package, so I can't tell if there is a simple way to do that with this package.) –  Jan 16 '19 at 18:55
  • How about \drawBallGrid[style={opacity=1,ultra thin}]{30}{30}? –  Jan 16 '19 at 19:06
  • @marmot "that one" looks best since your amended grid looks nice like a hampster ball :-) but does not move axis to the eye (I tried changing options including3D shifting but the axes are "fixed" inside the globe (best I can do is poke black ends out of the sphere) –  Jan 16 '19 at 19:55
  • @KJO Sorry, I do not understand. –  Jan 16 '19 at 19:58

2 Answers2

4

These element are either obscured by the sphere, as pointed out by KJO, or have not full opacity, which makes them look gray. So you can draw them by hand and change the opacity to arrive at

\documentclass{standalone}

\usepackage{blochsphere}

\begin{document}

\begin{blochsphere}[radius=1.5 cm,tilt=15,rotation=-20]
   \drawBallGrid[style={opacity=1,ultra thin}]{30}{30}

    \drawGreatCircle[style={dashed}]{0}{0}{0}

%    \drawAxis[style={draw=black}]{0}{0}
% 
%     \drawAxis[style={color=black,opacity=1}]{90}{0}

    \labelLatLon{up}{90}{0};
    \labelLatLon{down}{-90}{90};
    \node[above,font=\tiny] at (up) {$\left|0\right>$ };
    \node[below,font=\tiny] at (down) {$\left|1\right>$};
    \labelLatLon{l}{0}{180};
    \labelLatLon{r}{0}{0};
    \draw (l) -- (r);
\end{blochsphere}
\end{document}

enter image description here

Whether one should draw the cross line black is a matter of taste.

3

Encouraged by @marmot 's expert example I finally got this MWE of original request, note I had to drop ball opacity to 0.3

enter image description here

\documentclass{standalone}

\usepackage{blochsphere}

\begin{document}

\begin{blochsphere}[ball=3d,opacity=0.3]
   \drawBallGrid[style={opacity=1,ultra thin}]{30}{30}
   \drawAxis[scale=1.2]{0}{0}
    \drawAxis[scale=1.8]{90}{90}
    \drawAxis[scale=1.4]{90}{0}
    \labelLatLon{up}{90}{20};
    \labelLatLon{down}{-90}{90};
    \node[above,{shift=(0,0.2,0)}] at (up) {\tiny N};
    \node[below,{shift=(0,-0.2,0)}] at (down) {\tiny S};
    \end{blochsphere}

\end{document}
  • Thanks ! So actually the opacity of the whole sphere that I didn't configured was too high if I understand well –  Jan 17 '19 at 09:21
  • Yes the higher opacity / lower transparency "greys" out the internals or far side. That is common with many technical drafting apps but sometimes there are overrides for "draughtsman's license" I had hoped to just shift the axis towards the viewer but the package constrains them severely towards the centroid (probably for the best, or else there would be later issues depending on rotation) –  Jan 17 '19 at 15:07