visualisation
Classes for visualisation of detector tomography results.
Module Contents
Classes
Class inheriting from manim class Scene (for details on this convention see manim documentation). |
|
Class inheriting from manim class Scene (for details on this convention see manim documentation). |
|
Class whose attributes contain experimental tomography data necessary for plotting. Its method prepare the data in |
- class visualisation.DrawOnLayout(plotting_data)
Bases:
manim.SceneClass inheriting from manim class Scene (for details on this convention see manim documentation). Images are rendered when this class’ instance is created in the method ‘draw_on_layout’ of the class ResultsForPlotting.
- Parameters:
(dict) (plotting_data) –
dictionary with data about the device and processed experimental results, necessary for manim graph (for details see manim graph documentation), with values:
vertices (list[int]) : list of qubits in device, from 0 to #qubits - 1. edges (list[tuple[int, int]]) : list of edges (i, j) to be plotted, where i and j are in vertices. labels (bool|dict): dictionary whose keys are the vertices, and whose values are the corresponding
vertex labels (rendered via, e.g., Text or manim Tex). Alternatively can be bool - if True, vertices are labelled with the integers from the list ‘vertices’.
vertex_config (dict): dictionary with keyword arguments which apply to manim mobject used for vertices. edge_config (dict): dictionary with keyword arguments which apply to manim mobject used for edges. layout (dict[list]): dictionary where keys are vertices and values are list of coordinates [x, y, z]. (Optional) max_for_legend (float): maximal value to be displayed on the legend bar;
if not in keys, no legend is displayed.
- construct()
- class visualisation.DrawClusters(clusters_list)
Bases:
manim.SceneClass inheriting from manim class Scene (for details on this convention see manim documentation). Images are rendered when this class’ instance is created in the method ‘draw_clusters’ of the class ResultsForPlotting.
- Parameters:
(list(tuples[ints])) (clusters_list) – list of tuples, each containing indices of qubits assigned to one cluster
- construct()
- class visualisation.ResultsForPlotting(device_data_dictionary, experiment_data_dictionary)
Class whose attributes contain experimental tomography data necessary for plotting. Its method prepare the data in a format native to manim and create an instance of its class, which results in an image being rendered and saved. TODO: add remark about indexing over all vs used qubits
- __identify_correlations_above_threshold(threshold)
- __prepare_basic_edge_config()
- __prepare_basic_vertex_config()
- __prepare_edge_config_for_correlations_above_threshold(correlations_threshold)
- __prepare_vertex_config_for_correlations_above_threshold()
- __prepare_data_for_draw_basic_layout()
- __prepare_data_for_draw_correlations_on_layout(threshold)
- set_clusters_list(clusters_list)
- draw_on_layout(what_to_draw='basic_layout', file_name=None, quality='high_quality', preview=True, correlations_threshold=0.01, verbosity='CRITICAL')
Method called by user to plot the experimental data on the device’s layout.
- Parameters:
(str) (verbosity) –
‘basic_layout’ : qubits with labels and edges in layout are plotted. ‘correlations_above_threshold’ : on basic layout also edges with correlations
coefficient above a given threshold are plotted and colored, with a color legend.
(str) – [fourk_quality|production_quality|high_quality|medium_quality|low_quality|example_quality].
(bool) (preview) – Regardless of this parameter’s value, the image is saved.
(str) –
(float) (correlations_threshold) – in range [0, 1].
(str) –
- draw_histogram(file_name='histogram', directory='', plot_title='Correlations histogram', plot_label='Distance name')
Method called by user to plot correlation coefficients on a histogram. Saves the plot with ‘file_name’ in ‘directory’.
- draw_heatmap(file_name='heatmap', directory='', plot_title='Correlation coefficients')
Method called by user to plot correlation coefficients on a heatmap. Saves the plot with ‘file_name’ in ‘directory’.
- draw_clusters(file_name='clusters', quality='high_quality', preview=True, verbosity='CRITICAL')
Method called by user to plot the clusters in abstract form.
- Parameters:
(str) (verbosity) – [fourk_quality|production_quality|high_quality|medium_quality|low_quality|example_quality].
(bool) (preview) – Regardless of this parameter’s value, the image is saved.
(str) –
(str) –