File size: 3,240 Bytes
7f9a25d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
"""
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",
]