qcstyle

Style sheets for pulse visualization.

Classes

ComplexColors(real, imaginary)

Create new instance of ComplexColors(real, imaginary)

PulseStyle([figsize, title_font_size, …])

Style sheet for Qiskit-Pulse sample pulse drawer.

SchedStyle([figsize, fig_unit_h_table, …])

Style sheet for Qiskit-Pulse schedule drawer.

SchedTableColors(time, channel, event)

Create new instance of SchedTableColors(time, channel, event)

class ComplexColors(real, imaginary)

Create new instance of ComplexColors(real, imaginary)

count(value, /)

Return number of occurrences of value.

imaginary

Alias for field number 1

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

real

Alias for field number 0

class PulseStyle(figsize=7.0, 5.0, title_font_size=18, wave_color='#ff0000', '#0000ff', bg_color='#f2f3f4', num_points=1000, dpi=None)[source]

Style sheet for Qiskit-Pulse sample pulse drawer.

Create new style sheet.

For any of the Optional fields, if that field is None then it will revert to its matplotlib.rcParams counterpart. See for usage on rcParams. Each argument that is optonal also describes it’s mapped rcParam key below.

Parameters
  • figsize (Optional[Tuple[float, float]]) – Size of the figure. If None, will default to the figure size of the drawing backend. If the output is matplotlib, the default parameter is rcParams['figure.figsize'].

  • title_font_size (Optional[int]) – Font size of schedule name in title. If None, will default to the title font size of the drawing backend. If the output is matplotlib, the default parameter is rcParams['figure.titlesize'].

  • wave_color (ComplexColors) – Color code or name of colors for the real and imaginary parts of the waveform.

  • bg_color (str) – Color code or name of color for pulse canvas background.

  • num_points (int) – Number of points for interpolation.

  • dpi (Optional[int]) – Resolution in the unit of dot per inch to save image. If None, will revert to the DPI setting of the drawing backend. If the output is matplotlib, the default parameter is rcParams['figure.dpi'].

class SchedStyle(figsize=10.0, 12.0, fig_unit_h_table=0.4, use_table=True, table_columns=2, table_font_size=10, axis_font_size=18, label_font_size=10, icon_font_size=18, title_font_size=25, label_ch_linestyle='--', label_ch_color='#222222', label_ch_alpha=0.3, d_ch_color='#648fff', '#002999', u_ch_color='#ffb000', '#994A00', m_ch_color='#dc267f', '#760019', s_ch_color='#7da781', s_ch_linestyle='-', table_color='#e0e0e0', '#f6f6f6', '#f6f6f6', bg_color='#f2f3f4', num_points=1000, dpi=150, remove_spacing=True, max_table_ratio=0.5, vertical_span=0.2, axis_formatter='%s')[source]

Style sheet for Qiskit-Pulse schedule drawer.

Create new style sheet.

For any of the Optional fields, if that field is None then it will revert to its matplotlib.rcParams counterpart. See for usage on rcParams. Each argument that is optonal also describes it’s mapped rcParam key below.

Parameters
  • figsize (Optional[Tuple[float, float]]) – Size of the figure. If None, will default to the figure size of the drawing backend. If the output is matplotlib, the default parameter is rcParams['figure.figsize'].

  • fig_unit_h_table (float) – Height of row of event table. See Example.

  • use_table (bool) – When set True use event table.

  • table_columns (int) – Number of event table columns.

  • table_font_size (int) – Font size of event table.

  • axis_font_size (int) – Font size of channel aliases. If None, will revert to the axis label size of the drawing backend. If the output is matplotlib, the default parameter is rcParams['axes.titlesize'].

  • label_font_size (int) – Font size of labels in canvas.

  • icon_font_size (int) – Size of symbols.

  • title_font_size (Optional[int]) – Font size of schedule name in title. If None, will default to the title font size of the drawing backend. If the output is matplotlib, the default parameter is rcParams['figure.titlesize'].

  • label_ch_linestyle (str) – Line style for channel pulse label line.

  • label_ch_color (str) – Color code or name of color for channel pulse label line.

  • label_ch_alpha (float) – Transparency for channel pulse label line from 0 to 1.

  • d_ch_color (ComplexColors) – Color code or name of colors for real and imaginary part of waveform at d channels.

  • u_ch_color (ComplexColors) – Color code or name of colors for real and imaginary part of waveform at u channels.

  • m_ch_color (ComplexColors) – Color code or name of colors for real and imaginary part of waveform at m channels.

  • s_ch_color (str) – Color code or name of color for snapshot channel line.

  • s_ch_linestyle (str) – Line style for snapshot line.

  • table_color (SchedTableColors) – Color code or name of color for event table columns of time, channel, event information.

  • bg_color (str) – Color code or name of color for canvas background.

  • num_points (int) – Number of points for interpolation of each channel.

  • dpi (Optional[int]) – Resolution in the unit of dot per inch to save image. If None, will revert to the DPI setting of the drawing backend. If the output is matplotlib, the default parameter is rcParams['figure.dpi'].

  • remove_spacing (bool) – Remove redundant spacing when the waveform has no negative values.

  • max_table_ratio (float) – Maximum portion of the plot the table can take up. Limited to range between 0 and 1.

  • vertical_span (float) – Spacing on top and bottom of pulse canvas.

  • axis_formatter (str) – Format of horizontal axis of the plot. This is convenient when you set dt option for the drawer. For example, formatter of %.3e gives you horizontal axis values in the scientific notation with 3 digits.

Example

Height of the event table is decided by multiple parameters.:

figsize = (10.0, 12.0)
fig_unit_h_table = 0.4
table_columns = 2
max_table_ratio = 0.5

With this setup, events are shown in double-column style with each line height of 0.4 inch and the table cannot exceed 5 inch. Thus 12 lines are maximum and up to 24 events can be shown. If you want to show more events, increase figure height or reduce size of line height and table font size.

class SchedTableColors(time, channel, event)

Create new instance of SchedTableColors(time, channel, event)

channel

Alias for field number 1

count(value, /)

Return number of occurrences of value.

event

Alias for field number 2

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

time

Alias for field number 0