RegistrierenRegistrieren   LoginLogin   FAQFAQ    SuchenSuchen   
LaTeX - Blochkugel Paket - Probleme mit der Schattierung
 
Neue Frage »
Antworten »
    Foren-Übersicht -> Sonstiges
Autor Nachricht
manuel459



Anmeldungsdatum: 11.10.2016
Beiträge: 263

Beitrag manuel459 Verfasst am: 07. Okt 2021 20:01    Titel: LaTeX - Blochkugel Paket - Probleme mit der Schattierung Antworten mit Zitat

Hi,

ich versuche in LaTeX eine Blochkugel zu zeichnen und habe das Problem, dass ich um den 3D Effekt der gezeichneten Kugel aufrechtzuerhalten, die opacity relativ hoch einstellen muss (0.7). Das führt dazu, dass sogar eine weiß gefärbte Kugel (color=white) sehr dunkel aussieht. Hat jemand Erfahrung mit dem Paket und kann mir sagen, wie ich es trotzdem schaffe, dass die Kugel heller aussieht (ohne den 3D Effekt durch die relativ geringe Durchlässigkeit der Kugel zu verlieren)?

hier wäre mein MWE und das zugehörige Bild (oben der Ist-Zustand; so wie unten sollte die Farbe aussehen (jedoch mit erkennbaren verdeckten Linien)).



Code:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{tikz}
\usetikzlibrary{positioning,arrows,calc,math,angles,quotes}
\usepackage{blochsphere}
\usepackage{braket}

\begin{document}
%------------------------------Variante 1------------------------------------------------------------------
%%%% Change these parameters to change the position of psi, or the size/rotation of the sphere
\def\rotationSphere{-10}
\def\tiltSphere{10} %0.01
\def\radiusSphere{2cm}
\def\psiLat{90}
\def\psiLon{45}

\begin{blochsphere}[radius=\radiusSphere,opacity=0.65,rotation=\rotationSphere,tilt=\tiltSphere,color=white]
  %\drawBallGrid[style={opacity=.3}]{30}{30}
 
  % Draw the vertical plane
  %\drawLongitudeCircle[]{\rotationSphere} % draw the longitude that face us to delimit the sphere
  %Farbeinstellung
  %draw={rgb,255:red,199; green,199; blue,199}
  \drawLongitudeCircle[style={opacity=0.3,line width=0.8}]{90-0}
  % ... and the equatorial plane
  \drawLatitudeCircle[style={opacity=0.3,line width=0.8}]{90-90} %style={dashed}
 
  % Define the different points on the bloch sphere
  \labelLatLon[radius=\radiusSphere*1.3]{ket0}{90-0}{-90-0};
  \labelLatLon[radius=\radiusSphere*1.2]{ket1}{90-180}{-90-0};
 
  \labelLatLon[radius=\radiusSphere*1.4]{ketminus}{90-90}{-90-0+180};
  \labelLatLon[radius=\radiusSphere*2.2]{ketplus}{90-90}{-90-0};
 
  \labelLatLon[radius=\radiusSphere*1.25]{ketpluspi2}{90-90}{-90-90};
  \labelLatLon[radius=\radiusSphere*1.2]{ketplus3pi2}{90-90}{-90-90+180};
  \labelLatLon{psi}{90-\psiLat}{-90-\psiLon};
 
  % Draw and label the axis
  \draw[-latex,opacity=0.5,line width=0.8] (0,0) -- (ket0) node[below right,inner sep=.5mm,opacity=0.5] at (ket0) {\footnotesize $z$};
   \draw[-latex,opacity=0.5,line width=0.8,style={dotted},-] (0,0) -- (ketplus3pi2) node[below right,inner sep=.5mm,opacity=0.5] at (ketplus3pi2) {};
   \draw[-latex,opacity=0.5,line width=0.8,style={dotted},-] (0,0) -- (ket1) node[below right,inner sep=.5mm,opacity=0.5] at (ket1) {};
   \draw[-latex,opacity=0.5,line width=0.8,style={dotted},-] (0,0) -- (ketminus) node[below right,inner sep=.5mm,opacity=0.5] at (ket1) {};
  \draw[-latex,opacity=0.5,line width=0.8] (0,0) -- (ketplus) node[above left,inner sep=.5mm,opacity=0.5] at (ketplus) {\footnotesize$x$};
  \draw[-latex,opacity=0.5,line width=0.8] (0,0) -- (ketpluspi2) node[below left,inner sep=0.5mm,opacity=0.5] at (ketpluspi2) {\footnotesize $y$};
  % Draw |psi>
  \draw[-latex,color=orange,line width=2] (0,0) -- (psi) node[above]{\footnotesize $\ket{\psi}$};

  % Draw the angles
 % \coordinate (origin) at (0,0);
  %{
    % Will draw the angle/projection one the equatorial plane
   % \setDrawingPlane{0}{0}
    % Draw the projection: cos is used to compute the length of the projection
    %\draw[current plane,dashed] (0,0) -- (-90+\psiLon:{cos(\psiLat)*\radiusSphere}) coordinate (psiProjectedEquat) -- (psi);
    % Draw the angle
    %\pic[current plane, draw,fill=orange!50,fill opacity=.5, text opacity=1,"\footnotesize $\phi$", angle eccentricity=2.2]{angle=ketplus--origin--psiProjectedEquat};
  %}
  %{ \setLongitudinalDrawingPlane{\psiLon}
    % Draw the angle
   % \pic[current plane, draw,fill=orange!50,fill opacity=.5, text opacity=1,"\footnotesize $\theta$", angle eccentricity=1.5]{angle=psi--origin--ket0};
  %}
\end{blochsphere}



bloch2.JPG
 Beschreibung:

Download
 Dateiname:  bloch2.JPG
 Dateigröße:  46.32 KB
 Heruntergeladen:  122 mal

schnudl
Moderator


Anmeldungsdatum: 15.11.2005
Beiträge: 6979
Wohnort: Wien

Beitrag schnudl Verfasst am: 07. Okt 2021 20:54    Titel: Antworten mit Zitat

Mit LaTeX kann ich dir nicht weiterhelfen.
Aber mit qiskit kann man schöne Blochkugeln zeichnen und als Image abspeichern.
Nur falls dir das was bringt...

_________________
Wenn du eine weise Antwort verlangst, musst du vernünftig fragen (Goethe)
Neue Frage »
Antworten »
    Foren-Übersicht -> Sonstiges