qbraid.visualization.animate_qpu_state

animate_qpu_state(state, dilation_rate=0.05, fps=30, gate_display_dilation=1.0, save_mpeg=False, filename='vqpu_animation', start_block=0, n_blocks=None, **kwargs)[source]

Animates the QPU state.

Parameters:
  • state (Union[AnimateQPUState, dict]) – The state of the QPU atoms to animate.

  • dilation_rate (float) – Conversion factor from QPU time to animation time units. When dilation_rate=1.0, 1 μs of QPU execution time corresponds to 1 second of animation time.

  • fps (int) – Frames per second. Defaults to 30.

  • gate_display_dilation (float, optional) – Relative dilation rate for gate events. Defaults to 1. Higher values will display gate events for a longer period.

  • save_mpeg (bool) – Whether to save the animation as an MPEG file. Defaults to False.

  • filename (str) – The name of the ‘.mpeg’ file to save. Defaults to “vqpu_animation”. Ignored if save_mpeg is False.

  • start_block (int) – The starting block for the animation. Defaults to 0.

  • n_blocks (int, optional) – The number of blocks to animate. Defaults to None. If None, all blocks after start_block will be animated.

Returns:

The generated animation object for the QPU state.

Return type:

matplotlib.animation.FuncAnimation

Raises:

VisualizationError – If an error occurs during the animation process.