@@ -782,20 +782,6 @@ function _plot_vectors!(b::Bloch, ax)
782782 end
783783end
784784
785- function _tolatex (s)
786- s == " x" && return L "\t extbf{x}"
787- s == " y" && return L "\t extbf{y}"
788- s == " z" && return L "\t extbf{z}"
789- s == " -x" && return L "\t extbf{-x}"
790- s == " -y" && return L "\t extbf{-y}"
791- s == " -z" && return L "\t extbf{-z}"
792- s == " |0⟩" && return L "\m athbf{|0\r angle}"
793- s == " |1⟩" && return L "\m athbf{|1\r angle}"
794- return s
795- end
796-
797- _lerp (a:: Float64 , b:: Float64 , t:: Float64 ) = a + t * (b - a)
798-
799785raw """
800786 _add_labels!(ax)
801787
@@ -809,71 +795,64 @@ Positions standard labels `(x, y, |0⟩, |1⟩)` at appropriate locations.
809795function _add_labels! (b:: Bloch , ax)
810796 label_color = parse (RGBf, b. font_color)
811797 label_size = b. font_size
812- label_font = b. font_name
813798 offset_scale = b. frame_limit
814799 if ! isempty (b. xlabel) && ! isempty (b. xlabel[1 ])
815800 text! (
816801 ax,
817- _tolatex (b . xlabel[ 1 ]) ,
802+ L " \t extbf{x} " ,
818803 position = Point3f (0 , - offset_scale * b. xlpos[1 ], 0 ),
819804 color = label_color,
820805 fontsize = label_size,
821- font = label_font,
822806 align = (:center , :center )
823807 )
824808 end
825809 if length (b. xlabel) > 1 && ! isempty (b. xlabel[2 ])
826810 text! (
827811 ax,
828- _tolatex (b . xlabel[ 2 ]) ,
812+ L " \t extbf{-x} " ,
829813 position = Point3f (0 , - offset_scale * b. xlpos[2 ], 0 ),
830814 color = label_color,
831815 fontsize = label_size,
832- font = label_font,
833816 align = (:center , :center )
834817 )
835818 end
836819 if ! isempty (b. ylabel) && ! isempty (b. ylabel[1 ])
837820 text! (
838821 ax,
839- _tolatex (b . ylabel[ 1 ]) ,
822+ L " \t extbf{y} " ,
840823 position = Point3f (offset_scale * b. ylpos[1 ], 0 , 0 ),
841824 color = label_color,
842825 fontsize = label_size,
843- font = label_font,
844826 align = (:center , :center )
845827 )
846828 end
847829 if length (b. ylabel) > 1 && ! isempty (b. ylabel[2 ])
848830 text! (
849831 ax,
850- _tolatex (b . ylabel[ 2 ]) ,
832+ L " \t extbf{-y} " ,
851833 position = Point3f (offset_scale * b. ylpos[2 ], 0 , 0 ),
852834 color = label_color,
853835 fontsize = label_size,
854- font = label_font,
855836 align = (:center , :center )
856837 )
857838 end
858839 if ! isempty (b. zlabel) && ! isempty (b. zlabel[1 ])
859840 text! (
860841 ax,
861- _tolatex (b . zlabel[ 1 ]) ,
842+ L " \m athbf{|0 \r angle} " ,
862843 position = Point3f (0 , 0 , offset_scale * b. zlpos[1 ]),
863844 color = label_color,
864845 fontsize = label_size,
865- font = label_font,
866846 align = (:center , :center )
867847 )
868848 end
869849 if length (b. zlabel) > 1 && ! isempty (b. zlabel[2 ])
870850 text! (
871851 ax,
872- _tolatex (b . zlabel[ 2 ]) ,
852+ L " \m athbf{|1 \r angle} " ,
873853 position = Point3f (0 , 0 , offset_scale * b. zlpos[2 ]),
874854 color = label_color,
875855 fontsize = label_size,
876- font = label_font,
877856 align = (:center , :center )
878857 )
879858 end
0 commit comments