weylchamber.visualize module

Summary

Classes:

WeylChamber

Class for plotting data in the Weyl Chamber

__all__: WeylChamber

Reference

class weylchamber.visualize.WeylChamber[source]

Bases: object

Class for plotting data in the Weyl Chamber

Class Attributes:
  • weyl_points (dict) – Dictionary of Weyl chamber point names to (c1, c2, c3) coordinates (in units of pi). Each point name is also a class attribute itself

  • normal (dict) – Dictionary of Weyl chamber region name to normal vectors for the surface that separates the region from the polyhedron of perfect entanglers (pointing outwards from the PE’s). The three regions are:

    • ‘W0’: region from the origin point (O) to the PE polyhedron

    • ‘W0*’: region from the A2 point to the PE polyhedron

    • ‘W1’: region from the A2 point (SWAP gate) to the PE polyhedron

  • anchor (dict) – Dictionary of anchor points for the normal vectors (i.e., an arbitrary point on the surface that separates the region specified by the key from the perfect entanglers polyhedron

Attributes:
  • fig_width (float {8.5}) – Figure width, in cm

  • fig_height (float {6.0}) – Figure height, in cm

  • left_margin (float {0.0}) – Distance from left figure edge to axes, in cm

  • bottom_margin (float {0.0}) – Distance from bottom figure edge to axes, in cm

  • right_margin (float {0.3}) – Distance from right figure edge to axes, in cm

  • top_margin (float {0.0}) – Distance from top figure edge to axes, in cm

  • azim (float {-50}) – azimuthal view angle in degrees

  • elev (float {-20}) – elevation view angle in degrees

  • dpi (int {300}) – Resolution to use when saving to dpi, or showing interactively

  • linecolor (str {‘black’}) – Color to be used when drawing lines (e.g. the edges of the Weyl chamber)

  • show_c1_label (bool) – Whether or not to show the c1 axis label

  • show_c2_label (bool) – Whether or not to show the c2 axis label

  • show_c3_label (bool) – Whether or not to show the c3 axis label

  • c1_labelpad (float) – Label padding for c1 label

  • c2_labelpad (float) – Label padding for c2 label

  • c3_labelpad (float) – Label padding for c3 label

  • c1_tickspad (float) – Padding for c1 tick labels

  • c2_tickspad (float) – Padding for c2 tick labels

  • c3_tickspad (float) – Padding for c2 tick labels

  • weyl_edges (list) – List of tuples (point1, point2, foreground) where point1 and point2 are keys in weyl_points, and foreground is a logical to indicate whether the edge is in the background or foreground (depending on the perspective of the plot). Describes the lines that make up the Weyl chamber.

  • weyl_edge_fg_properties (dict) – Properties to be used when drawing foreground weyl_edges

  • weyl_edge_bg_properties (dict) – Properties to be used when drawing background weyl_edges

  • PE_edges (list) – List of tuples (point1, point2, foreground) where point1 and point2 are keys in weyl_points, and foreground is a logical to indicate whether the edge is in the background or foreground (depending on the perspective of the plot). Desribes the lines that make up the polyhedron of perfect entanglers

  • PE_edge_fg_properties (dict) – Properties to be used when drawing foreground PE_edges

  • PE_edge_bg_properties (dict) – Properties to be used when drawing background PE_edges

  • labels (dict) – label names => array (c1, c2, c3) where label should be drawn

  • tex_labels (logical {True}) – If True wrap label names in dollar signs to produce a latex string.

  • label_properties (dict) – Properties to be used when drawing labels

  • z_axis_left (logical {True}) – If True, draw z-axis on the left

  • grid (logical {False}) – Show a grid on panes?

  • panecolor (None or tuple {(1.0, 1.0, 1.0, 0.0)}) – Color (r, g, b, alpha) with values in [0,1] for the c1, c2, and c3 panes

  • facecolor (str {‘None’}) – Name of color for figure background

  • ticklabelsize (float {7}) – font size for tick labels

  • full_cube (logical {False}) – if True, draw all three axes in the range [0,1]. This may result in a less distorted view of the Weyl chamber

A1 = array([1, 0, 0])
A2 = array([0.5, 0.5, 0. ])
A3 = array([0.5, 0.5, 0.5])
O = array([0, 0, 0])
L = array([0.5, 0. , 0. ])
M = array([0.75, 0.25, 0.  ])
N = array([0.75, 0.25, 0.25])
P = array([0.25, 0.25, 0.25])
Q = array([0.25, 0.25, 0.  ])
weyl_points = {'A1': array([1, 0, 0]), 'A2': array([0.5, 0.5, 0. ]), 'A3': array([0.5, 0.5, 0.5]), 'L': array([0.5, 0. , 0. ]), 'M': array([0.75, 0.25, 0.  ]), 'N': array([0.75, 0.25, 0.25]), 'O': array([0, 0, 0]), 'P': array([0.25, 0.25, 0.25]), 'Q': array([0.25, 0.25, 0.  ])}
normal = {'W0': array([-0.70710678, -0.70710678,  0.        ]), 'W0*': array([ 0.70710678, -0.70710678,  0.        ]), 'W1': array([0.        , 0.70710678, 0.70710678])}
anchor = {'W0': array([0.5, 0. , 0. ]), 'W0*': array([0.5, 0. , 0. ]), 'W1': array([0.5, 0.5, 0. ])}
property figsize

Tuple (width, height) of figure size in inches

property fig

Return a reference to the figure on which the Weyl chamber has been rendered. Undefined unless the render method has been called.

property ax

Return a reference to the Axes instance on which the Weyl chamber has been rendered. Undefined unless the render method has been called.

property artists

Return a list of rendered artists. This includes only artists that were created as part of a plotting command, not things like the edges of the Weyl chamber or the perfect entanglers polyhedron

render(ax)[source]

Render the Weyl chamber on the given Axes3D object

plot(fig=None)[source]

Generate a plot of the Weyl chamber on the given figure, or create a new figure if fig argument is not given.

scatter(c1, c2, c3, **kwargs)[source]

Add a scatter plot to the Weyl chamber

All keyword arguments will be passed to matplotlib scatter3D function.

add_point(c1, c2, c3, scatter_index=0, **kwargs)[source]

Add a point to a scatter plot with the given scatter_index.

If there is no existing scatter plot with that index, a new one will be created. The arguments of the scatter plot are updated with the given kwargs.