Abstract class for all widgets.

Inherits From: Widget

sphere_radius the radius of the bloch sphere in the three.js diagram. The default value is 5.
state_vector a state vector to pass in to be represented.

ValueError If the sphere_radius is not positive or the state_vector is not supplied.



View source

Generates a portable HTML file of the widget that can be run anywhere. Prints out the absolute path of the file to the console.

output_directory the directory in which the output file will be generated. The default is the current directory ('./')
file_name the name of the output file. Default is 'bloch_sphere'
open_in_browser if True, opens the newly generated file automatically in the browser.

The path of the HTML file in as a Path object.


View source

Returns HTML code to render the widget.


View source

Returns the name of the Javascript library file for this widget.