Spaces:
Paused
Paused
| """ | |
| EM Embedded Package | |
| Modular Electromagnetic Scattering Simulation Module for Trame. | |
| This package provides a modular structure for the EM simulation application, | |
| designed for embedded use in a shared Trame server. | |
| Usage: | |
| from em import set_server, init_state, build_ui | |
| # After creating a server | |
| set_server(server) | |
| init_state() | |
| # In your layout | |
| with layout.content: | |
| build_ui() | |
| """ | |
| # Import core components from submodules | |
| from .state import ( | |
| state, | |
| ctrl, | |
| set_server, | |
| init_state, | |
| get_server, | |
| enable_point_picking_on_plotter, | |
| ) | |
| from .globals import ( | |
| plotter, | |
| GRID_SIZES, | |
| DEFAULT_AXIS_TICKS, | |
| EXCITATION_SURFACE_COLORSCALE, | |
| qpu_ts_cache, | |
| sim_ts_cache, | |
| ) | |
| from .simulation import ( | |
| run_simulation_only, | |
| reset_to_defaults, | |
| stop_simulation_handler, | |
| add_dotted_unit_grid, | |
| add_dotted_unit_grid_scaled, | |
| build_sim_timeseries_plotly, | |
| update_value_display, | |
| ) | |
| from .geometry import ( | |
| update_geometry_preview, | |
| update_geometry_hole_preview, | |
| compute_hole_edges as _compute_hole_edges, | |
| build_geometry_placeholder as _build_geometry_placeholder, | |
| build_square_domain_plot as _build_square_domain_plot, | |
| ) | |
| from .excitation import ( | |
| update_initial_state_preview, | |
| build_excitation_placeholder as _build_excitation_placeholder, | |
| build_excitation_surface_plot as _build_excitation_surface_plot, | |
| ) | |
| from .qpu import ( | |
| build_qpu_timeseries_plotly_multi, | |
| rebuild_qpu_fig_filtered as _rebuild_qpu_fig_filtered, | |
| rebuild_qpu_fig_others as _rebuild_qpu_fig_others, | |
| refresh_qpu_plot_figures as _refresh_qpu_plot_figures, | |
| qpu_add_monitor_config, | |
| qpu_remove_monitor_config, | |
| qpu_set_plot_filter, | |
| qpu_set_plot_position_filter, | |
| qpu_add_monitor_slot, | |
| qpu_remove_monitor_slot, | |
| ) | |
| from .exports import ( | |
| export_vtk, | |
| export_vtk_all_frames, | |
| export_mp4, | |
| export_sim_timeseries_csv, | |
| export_sim_timeseries_png, | |
| export_sim_timeseries_html, | |
| export_qpu_timeseries_csv, | |
| export_qpu_timeseries_png, | |
| export_qpu_timeseries_html, | |
| ) | |
| from .handlers import ( | |
| register_handlers, | |
| build_qubit_plot, | |
| _determine_workflow_step, | |
| _apply_workflow_highlights, | |
| ) | |
| from .utils import ( | |
| load_logo_data_uri, | |
| install_synopsys_plotly_theme, | |
| ) | |
| from .ui import build_ui | |
| # Install the Synopsys Plotly theme at module load time | |
| install_synopsys_plotly_theme() | |
| __all__ = [ | |
| # Core API | |
| "state", | |
| "ctrl", | |
| "set_server", | |
| "init_state", | |
| "build_ui", | |
| # Simulation | |
| "run_simulation_only", | |
| "reset_to_defaults", | |
| "stop_simulation_handler", | |
| # Previews | |
| "update_initial_state_preview", | |
| "update_geometry_preview", | |
| "update_geometry_hole_preview", | |
| # QPU | |
| "qpu_ts_cache", | |
| "build_qpu_timeseries_plotly_multi", | |
| # Exports | |
| "export_vtk", | |
| "export_vtk_all_frames", | |
| "export_mp4", | |
| "export_qpu_timeseries_csv", | |
| "export_qpu_timeseries_png", | |
| "export_qpu_timeseries_html", | |
| "export_sim_timeseries_csv", | |
| "export_sim_timeseries_png", | |
| "export_sim_timeseries_html", | |
| # Handlers | |
| "register_handlers", | |
| # Globals | |
| "plotter", | |
| "GRID_SIZES", | |
| ] | |