witwin-maxwell 0.0.1__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- witwin_maxwell-0.3.0/.github/workflows/publish-witwin-maxwell.yml +383 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/.gitignore +10 -3
- witwin_maxwell-0.3.0/CHANGELOG.md +51 -0
- witwin_maxwell-0.3.0/FEATURE_LIST.md +432 -0
- witwin_maxwell-0.3.0/LICENSE +13 -0
- witwin_maxwell-0.3.0/PKG-INFO +184 -0
- witwin_maxwell-0.3.0/README.md +167 -0
- witwin_maxwell-0.3.0/docs/releases/0.3.0.md +27 -0
- witwin_maxwell-0.3.0/docs/validation/tidy3d-numerical-alignment-0.3.0.md +130 -0
- witwin_maxwell-0.3.0/hatch_build.py +19 -0
- witwin_maxwell-0.3.0/pyproject.toml +39 -0
- witwin_maxwell-0.3.0/scripts/build_fdtd_cuda_prebuilt.py +68 -0
- witwin_maxwell-0.3.0/scripts/perf_cuda_graph_dispersive.py +134 -0
- witwin_maxwell-0.3.0/scripts/verify_cuda_binary_arches.py +73 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/TEST_LAYOUT.md +1 -0
- witwin_maxwell-0.3.0/tests/api/adapters/gds/test_gds_adapter.py +213 -0
- witwin_maxwell-0.3.0/tests/api/adapters/tidy3d/test_tidy3d_adapter.py +2228 -0
- witwin_maxwell-0.3.0/tests/api/public/test_dependency_contract.py +22 -0
- witwin_maxwell-0.3.0/tests/api/public/test_guard_census.py +184 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/api/public/test_public_api.py +35 -6
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/api/public/test_simulation_smoke.py +2 -2
- witwin_maxwell-0.3.0/tests/boundaries/absorbers/test_boundary_variants.py +158 -0
- witwin_maxwell-0.3.0/tests/boundaries/boundary_physics/test_fdtd_boundary_physics.py +461 -0
- witwin_maxwell-0.3.0/tests/boundaries/boundary_physics/test_fdtd_pec_material.py +65 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/boundaries/boundary_specs/test_fdtd_boundaries.py +27 -23
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/boundaries/cpml/test_fdtd_cpml.py +30 -28
- witwin_maxwell-0.3.0/tests/boundaries/symmetry/test_symmetry_generalization.py +256 -0
- witwin_maxwell-0.3.0/tests/core/grid/test_autogrid.py +530 -0
- witwin_maxwell-0.3.0/tests/core/grid/test_gridspec_custom.py +331 -0
- witwin_maxwell-0.3.0/tests/core/grid/test_nonuniform_placement.py +146 -0
- witwin_maxwell-0.3.0/tests/core/grid/test_nonuniform_uniform_equivalence.py +198 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/core/scene/test_scene.py +44 -1
- witwin_maxwell-0.3.0/tests/fdfd/test_ams.py +80 -0
- witwin_maxwell-0.3.0/tests/fdfd/test_direct_solver.py +100 -0
- witwin_maxwell-0.3.0/tests/fdfd/test_krylov.py +130 -0
- witwin_maxwell-0.3.0/tests/fdfd/test_matrix_cache.py +102 -0
- witwin_maxwell-0.3.0/tests/fdfd/test_preconditioners.py +70 -0
- witwin_maxwell-0.3.0/tests/fdfd/test_symmetric_formulation.py +91 -0
- witwin_maxwell-0.3.0/tests/fdtd/__init__.py +0 -0
- witwin_maxwell-0.3.0/tests/fdtd/cuda/__init__.py +0 -0
- witwin_maxwell-0.3.0/tests/fdtd/cuda/_parity_backend.py +30 -0
- witwin_maxwell-0.3.0/tests/fdtd/cuda/test_cuda_adjoint_native.py +174 -0
- witwin_maxwell-0.3.0/tests/fdtd/cuda/test_cuda_common_parity.py +216 -0
- witwin_maxwell-0.3.0/tests/fdtd/cuda/test_cuda_cpml_extension_parity.py +346 -0
- witwin_maxwell-0.3.0/tests/fdtd/cuda/test_cuda_dispersive_parity.py +168 -0
- witwin_maxwell-0.3.0/tests/fdtd/cuda/test_cuda_electric_boundary_parity.py +321 -0
- witwin_maxwell-0.3.0/tests/fdtd/cuda/test_cuda_extension_load.py +58 -0
- witwin_maxwell-0.3.0/tests/fdtd/cuda/test_cuda_graph.py +37 -0
- witwin_maxwell-0.3.0/tests/fdtd/cuda/test_cuda_magnetic_parity.py +256 -0
- witwin_maxwell-0.3.0/tests/fdtd/cuda/test_cuda_sources_parity.py +775 -0
- witwin_maxwell-0.3.0/tests/fdtd/cuda/test_cuda_spectral_observer_parity.py +193 -0
- witwin_maxwell-0.3.0/tests/fdtd/cuda/torch_reference.py +3288 -0
- witwin_maxwell-0.3.0/tests/fdtd/test_cuda_graph.py +111 -0
- witwin_maxwell-0.3.0/tests/fdtd/test_cuda_graph_capture_coverage.py +226 -0
- witwin_maxwell-0.3.0/tests/fdtd/test_cuda_graph_complex_bloch.py +112 -0
- witwin_maxwell-0.3.0/tests/fdtd/test_cuda_graph_dispersive.py +91 -0
- witwin_maxwell-0.3.0/tests/fdtd/test_cuda_graph_nonlinear.py +89 -0
- witwin_maxwell-0.3.0/tests/fdtd/test_cuda_graph_tfsf.py +163 -0
- witwin_maxwell-0.3.0/tests/fdtd/test_cuda_graph_tfsf_slab.py +141 -0
- witwin_maxwell-0.3.0/tests/fdtd/test_fdtd_autoshutoff.py +121 -0
- witwin_maxwell-0.3.0/tests/gradients/e2e/__init__.py +0 -0
- witwin_maxwell-0.3.0/tests/gradients/e2e/test_fdtd_two_port_sparam_optimization.py +169 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/gradients/fdtd_adjoint_baselines.py +8 -125
- witwin_maxwell-0.3.0/tests/gradients/test_fdfd_adjoint.py +137 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/gradients/test_fdtd_adjoint_bridge.py +891 -948
- witwin_maxwell-0.3.0/tests/gradients/test_fdtd_adjoint_materials.py +1735 -0
- witwin_maxwell-0.3.0/tests/gradients/test_fdtd_adjoint_p6_acceptance.py +59 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/gradients/test_fdtd_adjoint_rigorous.py +139 -4
- witwin_maxwell-0.3.0/tests/gradients/test_fdtd_custom_source_adjoint.py +411 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/gradients/test_fdtd_mode_source_adjoint.py +6 -56
- witwin_maxwell-0.3.0/tests/gradients/test_fdtd_multisource_adjoint.py +436 -0
- witwin_maxwell-0.3.0/tests/materials/__init__.py +1 -0
- witwin_maxwell-0.3.0/tests/materials/anisotropic/test_fdtd_full_anisotropy.py +477 -0
- witwin_maxwell-0.3.0/tests/materials/combinations/__init__.py +0 -0
- witwin_maxwell-0.3.0/tests/materials/combinations/test_aniso_pml_overlap_reflection.py +206 -0
- witwin_maxwell-0.3.0/tests/materials/combinations/test_bloch_dispersive_forward.py +117 -0
- witwin_maxwell-0.3.0/tests/materials/combinations/test_combination_matrix.py +284 -0
- witwin_maxwell-0.3.0/tests/materials/combinations/test_diagonal_aniso_dispersive.py +194 -0
- witwin_maxwell-0.3.0/tests/materials/combinations/test_lossy_anisotropic_slab.py +291 -0
- witwin_maxwell-0.3.0/tests/materials/combinations/test_modulated_dispersive_nonlinear.py +391 -0
- witwin_maxwell-0.3.0/tests/materials/combinations/test_modulated_slab_cpml.py +154 -0
- witwin_maxwell-0.3.0/tests/materials/combinations/test_mu_tensor_dispersion.py +205 -0
- witwin_maxwell-0.3.0/tests/materials/combinations/test_multi_frequency_modulation.py +189 -0
- witwin_maxwell-0.3.0/tests/materials/combinations/test_rotated_birefringent_dispersive_slab.py +330 -0
- witwin_maxwell-0.3.0/tests/materials/combinations/test_shg_dispersive_phase_matching.py +212 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/materials/compiler/test_material_compiler.py +239 -54
- witwin_maxwell-0.3.0/tests/materials/compiler/test_pec_conformal_nonuniform.py +238 -0
- witwin_maxwell-0.3.0/tests/materials/compiler/test_pec_material.py +95 -0
- witwin_maxwell-0.3.0/tests/materials/compiler/test_polarized_averaging.py +58 -0
- witwin_maxwell-0.3.0/tests/materials/compiler/test_polyslab.py +196 -0
- witwin_maxwell-0.3.0/tests/materials/compiler/test_subpixel_gradients.py +58 -0
- witwin_maxwell-0.3.0/tests/materials/compiler/test_subpixel_nonuniform.py +270 -0
- witwin_maxwell-0.3.0/tests/materials/compiler/test_subpixel_normals.py +34 -0
- witwin_maxwell-0.3.0/tests/materials/compiler/test_subpixel_spec.py +67 -0
- witwin_maxwell-0.3.0/tests/materials/conductive/test_fdtd_conductive.py +199 -0
- witwin_maxwell-0.3.0/tests/materials/conductive/test_fdtd_magnetic_conductive.py +316 -0
- witwin_maxwell-0.3.0/tests/materials/dispersive/test_custom_dispersive.py +314 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/materials/dispersive/test_fdtd_dispersive.py +18 -16
- witwin_maxwell-0.3.0/tests/materials/dispersive/test_fdtd_gain.py +156 -0
- witwin_maxwell-0.3.0/tests/materials/dispersive/test_fdtd_sellmeier.py +142 -0
- witwin_maxwell-0.3.0/tests/materials/modulation/test_fdtd_modulation.py +387 -0
- witwin_maxwell-0.3.0/tests/materials/nonlinear/test_fdtd_nonlinear.py +572 -0
- witwin_maxwell-0.3.0/tests/materials/perturbation/test_perturbation_medium.py +224 -0
- witwin_maxwell-0.3.0/tests/materials/sheet/__init__.py +1 -0
- witwin_maxwell-0.3.0/tests/materials/sheet/sheet_measurement.py +132 -0
- witwin_maxwell-0.3.0/tests/materials/sheet/test_fdtd_graphene.py +333 -0
- witwin_maxwell-0.3.0/tests/materials/sheet/test_fdtd_medium2d.py +143 -0
- witwin_maxwell-0.3.0/tests/materials/sheet/test_lossy_metal.py +161 -0
- witwin_maxwell-0.3.0/tests/monitors/diffraction/test_diffraction_monitor.py +334 -0
- witwin_maxwell-0.3.0/tests/monitors/emission/test_dipole_emission_monitor.py +179 -0
- witwin_maxwell-0.3.0/tests/monitors/material/test_permittivity_monitor.py +222 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/monitors/observers/test_fdtd_observers.py +17 -15
- witwin_maxwell-0.3.0/tests/monitors/time/test_fdtd_time_monitors.py +255 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/postprocess/rcs/test_postprocess.py +213 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/postprocess/scattering/test_mode_overlap.py +19 -13
- witwin_maxwell-0.3.0/tests/postprocess/scattering/test_ring_resonator_s21.py +288 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/postprocess/scattering/test_scattering_parameters.py +147 -9
- witwin_maxwell-0.3.0/tests/sources/definitions/test_astigmatic_gaussian_beam.py +204 -0
- witwin_maxwell-0.3.0/tests/sources/definitions/test_custom_source_time.py +222 -0
- witwin_maxwell-0.3.0/tests/sources/definitions/test_custom_uniform_sources.py +249 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/sources/definitions/test_sources.py +50 -16
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/sources/incident/test_fdtd_incident.py +24 -2
- witwin_maxwell-0.3.0/tests/sources/incident/test_soft_planewave_absolute_power.py +209 -0
- witwin_maxwell-0.3.0/tests/sources/mode/test_fdtd_anisotropic_aperture.py +217 -0
- witwin_maxwell-0.3.0/tests/sources/mode/test_fdtd_bent_mode_source.py +158 -0
- witwin_maxwell-0.3.0/tests/sources/mode/test_fdtd_broadband_mode_source.py +178 -0
- witwin_maxwell-0.3.0/tests/sources/mode/test_fdtd_complex_lossy_slab_mode.py +146 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/sources/mode/test_fdtd_mode_source.py +1 -1
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/sources/mode/test_mode_solver_gradients.py +39 -2
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/sources/point/test_fdtd_sources.py +8 -8
- witwin_maxwell-0.3.0/tests/sources/tfsf/test_fdtd_grating_pulsed_bloch.py +256 -0
- witwin_maxwell-0.3.0/tests/sources/tfsf/test_fdtd_grating_tfsf.py +766 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/sources/tfsf/test_fdtd_tfsf.py +29 -29
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/validation/cross_solver/test_fdfd_vs_fdtd.py +49 -4
- witwin_maxwell-0.3.0/tests/validation/physics/test_autogrid_physics.py +175 -0
- witwin_maxwell-0.3.0/tests/validation/physics/test_autogrid_subpixel_thesis.py +193 -0
- witwin_maxwell-0.3.0/tests/validation/physics/test_bloch_broadband_vs_cw.py +213 -0
- witwin_maxwell-0.3.0/tests/validation/physics/test_dispersive_metasurface_bloch.py +110 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/validation/physics/test_fdtd_boundary_tfsf_validation.py +88 -15
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/validation/physics/test_fdtd_physics_correctness.py +12 -17
- witwin_maxwell-0.3.0/tests/validation/physics/test_layered_exterior_huygens_validation.py +324 -0
- witwin_maxwell-0.3.0/tests/validation/physics/test_lossy_metal_sibc.py +161 -0
- witwin_maxwell-0.3.0/tests/validation/physics/test_nonuniform_grid_physics.py +180 -0
- witwin_maxwell-0.3.0/tests/validation/physics/test_pec_conformal.py +90 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/validation/physics/test_postprocess_end_to_end_validation.py +55 -11
- witwin_maxwell-0.3.0/tests/validation/physics/test_soft_planewave_graded.py +302 -0
- witwin_maxwell-0.3.0/tests/validation/physics/test_tfsf_nonuniform.py +335 -0
- witwin_maxwell-0.3.0/witwin/maxwell/__init__.py +164 -0
- witwin_maxwell-0.3.0/witwin/maxwell/adapters/gds.py +203 -0
- witwin_maxwell-0.3.0/witwin/maxwell/adapters/tidy3d.py +1669 -0
- witwin_maxwell-0.3.0/witwin/maxwell/adjoint_inputs.py +70 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/compiler/__init__.py +2 -1
- witwin_maxwell-0.3.0/witwin/maxwell/compiler/materials.py +1355 -0
- witwin_maxwell-0.3.0/witwin/maxwell/compiler/monitors.py +164 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/compiler/sources.py +105 -5
- witwin_maxwell-0.3.0/witwin/maxwell/fdfd/adjoint/__init__.py +3 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdfd/adjoint/bridge.py +180 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdfd/ams.py +300 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdfd/krylov.py +280 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdfd/solver.py +422 -164
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/adjoint/__init__.py +21 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/adjoint/bridge.py +746 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/adjoint/capabilities.py +29 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/adjoint/core.py +3614 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/adjoint/dispatch.py +684 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/adjoint/native.py +2561 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/adjoint/profiler.py +14 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/adjoint/reverse_common.py +207 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/adjoint/seeds.py +98 -53
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/boundary/bloch.py +90 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/boundary/common.py +3 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/boundary/cpml.py +197 -116
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/boundary/runtime.py +209 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/checkpoint.py +59 -2
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/coords.py +32 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/cuda/__init__.py +11 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/cuda/backend.py +3532 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/cuda/build.py +292 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/cuda/extension.cpp +2053 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/cuda/kernels/adjoint.cu +5290 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/cuda/kernels/aniso.cu +1704 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/cuda/kernels/boundary.cu +424 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/cuda/kernels/common.cu +74 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/cuda/kernels/common.cuh +82 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/cuda/kernels/dispersive.cu +782 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/cuda/kernels/electric.cu +3613 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/cuda/kernels/magnetic.cu +781 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/cuda/kernels/observers.cu +347 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/cuda/kernels/projection.cu +211 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/cuda/kernels/sources.cu +1482 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/cuda/kernels/spectral.cu +297 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/cuda/launch.h +23 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/cuda/runtime/__init__.py +6 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/cuda/runtime/dispatcher.py +6 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/cuda/runtime/graph.py +33 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/cuda/tensors.h +35 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/dispersion.py +48 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/excitation/__init__.py +2 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/excitation/injection.py +1102 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/excitation/modes.py +505 -190
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/excitation/spatial.py +192 -51
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/excitation/temporal.py +245 -82
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/excitation/tfsf_apply.py +62 -20
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/excitation/tfsf_common.py +131 -55
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/excitation/tfsf_specs.py +49 -30
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/excitation/tfsf_state.py +276 -34
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/material_pullback.py +117 -19
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/meshing/__init__.py +3 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/meshing/autogrid.py +335 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/observers.py +436 -29
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/runtime/__init__.py +6 -6
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/runtime/initialization.py +48 -19
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/runtime/materials.py +1563 -0
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/runtime/module_cache.py +31 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/runtime/spectral.py +127 -15
- witwin_maxwell-0.3.0/witwin/maxwell/fdtd/runtime/stepping.py +1987 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/solver.py +61 -46
- witwin_maxwell-0.3.0/witwin/maxwell/geometry/__init__.py +5 -0
- witwin_maxwell-0.3.0/witwin/maxwell/geometry/polyslab.py +299 -0
- witwin_maxwell-0.3.0/witwin/maxwell/media.py +1467 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/monitors.py +260 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/ports.py +12 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/postprocess/__init__.py +9 -0
- witwin_maxwell-0.3.0/witwin/maxwell/postprocess/diffraction.py +219 -0
- witwin_maxwell-0.3.0/witwin/maxwell/postprocess/emission.py +67 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/postprocess/modal.py +2 -3
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/postprocess/nfft.py +26 -9
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/postprocess/scattering_parameters.py +149 -16
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/postprocess/stratton_chu.py +306 -27
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/result.py +174 -7
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/scene.py +446 -58
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/simulation.py +70 -0
- witwin_maxwell-0.3.0/witwin/maxwell/sources.py +917 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/visualization/__init__.py +9 -1
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/visualization/interactive.py +4 -1
- witwin_maxwell-0.0.1/.claude/settings.json +0 -16
- witwin_maxwell-0.0.1/.github/workflows/publish-witwin-maxwell.yml +0 -93
- witwin_maxwell-0.0.1/COPYING +0 -674
- witwin_maxwell-0.0.1/FEATURE_LIST.md +0 -252
- witwin_maxwell-0.0.1/PKG-INFO +0 -188
- witwin_maxwell-0.0.1/README.md +0 -174
- witwin_maxwell-0.0.1/assets/teapot.obj +0 -24238
- witwin_maxwell-0.0.1/benchmark/RESULTS.md +0 -60
- witwin_maxwell-0.0.1/benchmark/__init__.py +0 -3
- witwin_maxwell-0.0.1/benchmark/__main__.py +0 -5
- witwin_maxwell-0.0.1/benchmark/cache.py +0 -146
- witwin_maxwell-0.0.1/benchmark/metrics.py +0 -155
- witwin_maxwell-0.0.1/benchmark/models.py +0 -38
- witwin_maxwell-0.0.1/benchmark/paths.py +0 -36
- witwin_maxwell-0.0.1/benchmark/plotting.py +0 -449
- witwin_maxwell-0.0.1/benchmark/report.py +0 -141
- witwin_maxwell-0.0.1/benchmark/runner.py +0 -577
- witwin_maxwell-0.0.1/benchmark/scenes/__init__.py +0 -47
- witwin_maxwell-0.0.1/benchmark/scenes/_common.py +0 -76
- witwin_maxwell-0.0.1/benchmark/scenes/dipole/__init__.py +0 -21
- witwin_maxwell-0.0.1/benchmark/scenes/dipole/dipole_dielectric_box.py +0 -39
- witwin_maxwell-0.0.1/benchmark/scenes/dipole/dipole_dielectric_sphere.py +0 -40
- witwin_maxwell-0.0.1/benchmark/scenes/dipole/dipole_ey.py +0 -45
- witwin_maxwell-0.0.1/benchmark/scenes/dipole/dipole_offcenter.py +0 -45
- witwin_maxwell-0.0.1/benchmark/scenes/dipole/dipole_two_freq.py +0 -37
- witwin_maxwell-0.0.1/benchmark/scenes/dipole/dipole_vacuum.py +0 -48
- witwin_maxwell-0.0.1/benchmark/scenes/dipole/high_eps_box.py +0 -38
- witwin_maxwell-0.0.1/benchmark/scenes/dipole/lorentz_resonator.py +0 -45
- witwin_maxwell-0.0.1/benchmark/scenes/dipole/multi_dielectric.py +0 -39
- witwin_maxwell-0.0.1/benchmark/scenes/planewave/__init__.py +0 -13
- witwin_maxwell-0.0.1/benchmark/scenes/planewave/dielectric_slab.py +0 -44
- witwin_maxwell-0.0.1/benchmark/scenes/planewave/dielectric_sphere.py +0 -36
- witwin_maxwell-0.0.1/benchmark/scenes/planewave/metal_sphere.py +0 -52
- witwin_maxwell-0.0.1/benchmark/scenes/planewave/planewave_dielectric_sphere.py +0 -38
- witwin_maxwell-0.0.1/benchmark/scenes/planewave/planewave_vacuum.py +0 -37
- witwin_maxwell-0.0.1/benchmark/tidy3d_scene.py +0 -32
- witwin_maxwell-0.0.1/pyproject.toml +0 -23
- witwin_maxwell-0.0.1/tests/api/adapters/tidy3d/test_tidy3d_adapter.py +0 -493
- witwin_maxwell-0.0.1/tests/assets/cube.obj +0 -15
- witwin_maxwell-0.0.1/tests/assets/teapot.obj +0 -599
- witwin_maxwell-0.0.1/tests/boundaries/boundary_physics/test_fdtd_boundary_physics.py +0 -223
- witwin_maxwell-0.0.1/tests/validation/benchmark/test_benchmark_system.py +0 -591
- witwin_maxwell-0.0.1/witwin/maxwell/__init__.py +0 -78
- witwin_maxwell-0.0.1/witwin/maxwell/adapters/tidy3d.py +0 -651
- witwin_maxwell-0.0.1/witwin/maxwell/compiler/materials.py +0 -633
- witwin_maxwell-0.0.1/witwin/maxwell/compiler/monitors.py +0 -73
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/adjoint/.kernels_runtime_1773795042135987100_57071.slang +0 -2090
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/adjoint/.kernels_runtime_1773800541701589400_57074.slang +0 -2090
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/adjoint/__init__.py +0 -22
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/adjoint/bridge.py +0 -513
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/adjoint/core.py +0 -3154
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/adjoint/dispatch.py +0 -393
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/adjoint/kernels.slang +0 -2090
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/adjoint/reference.py +0 -1030
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/adjoint/reverse_common.py +0 -479
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/boundary/helpers.slang +0 -218
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/boundary/projection.slang +0 -134
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/boundary/runtime.py +0 -83
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/boundary/update.slang +0 -1866
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/coords.py +0 -45
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/excitation/injection.py +0 -619
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/fdtd.slang +0 -9
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/kernels/common.slang +0 -54
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/kernels/dispersive.slang +0 -375
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/kernels/magnetic.slang +0 -223
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/kernels/sources.slang +0 -640
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/kernels/spectral.slang +0 -178
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/runtime/materials.py +0 -630
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/runtime/module_cache.py +0 -49
- witwin_maxwell-0.0.1/witwin/maxwell/fdtd/runtime/stepping.py +0 -699
- witwin_maxwell-0.0.1/witwin/maxwell/media.py +0 -387
- witwin_maxwell-0.0.1/witwin/maxwell/sources.py +0 -481
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/__init__.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/conftest.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/core/geometry/test_mesh_geometry.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/core/grid/test_fdtd_coords.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/gradients/README.md +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/gradients/__init__.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/materials/compiler/test_fdfd_material_support.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/postprocess/directivity/test_directivity.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/postprocess/evaluation/test_fdtd_evaluation.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/tests/sources/point/test_fdtd_source_normalization.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/adapters/__init__.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdfd/__init__.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdfd/plotting.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdfd/postprocess.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/__init__.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/boundary/__init__.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/evaluation.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/io.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/plotting.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/fdtd/postprocess.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/materials.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/postprocess/RCS.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/postprocess/directivity.py +0 -0
- {witwin_maxwell-0.0.1 → witwin_maxwell-0.3.0}/witwin/maxwell/visualization/plots.py +0 -0
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
name: Build and publish witwin-maxwell
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
- "codex/**"
|
|
8
|
+
pull_request:
|
|
9
|
+
release:
|
|
10
|
+
types: [published]
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
validate_release:
|
|
15
|
+
if: github.event_name != 'release' || (startsWith(github.event.release.tag_name, 'witwin-maxwell-v') && !github.event.release.prerelease)
|
|
16
|
+
name: Validate release
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
outputs:
|
|
19
|
+
package_dir: ${{ steps.package_dir.outputs.path }}
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- name: Check out repository
|
|
23
|
+
uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- name: Set up Python
|
|
26
|
+
uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
python-version: "3.11"
|
|
29
|
+
|
|
30
|
+
- name: Resolve package directory
|
|
31
|
+
id: package_dir
|
|
32
|
+
shell: bash
|
|
33
|
+
run: |
|
|
34
|
+
if [ -f pyproject.toml ]; then
|
|
35
|
+
echo "path=." >> "$GITHUB_OUTPUT"
|
|
36
|
+
elif [ -f maxwell/pyproject.toml ]; then
|
|
37
|
+
echo "path=maxwell" >> "$GITHUB_OUTPUT"
|
|
38
|
+
else
|
|
39
|
+
echo "Unable to find pyproject.toml for the witwin-maxwell package." >&2
|
|
40
|
+
exit 1
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
- name: Validate release tag and package version
|
|
44
|
+
if: github.event_name == 'release'
|
|
45
|
+
shell: bash
|
|
46
|
+
env:
|
|
47
|
+
PACKAGE_DIR: ${{ steps.package_dir.outputs.path }}
|
|
48
|
+
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
|
49
|
+
run: |
|
|
50
|
+
python - <<'PY'
|
|
51
|
+
import os
|
|
52
|
+
import re
|
|
53
|
+
import sys
|
|
54
|
+
import tomllib
|
|
55
|
+
from pathlib import Path
|
|
56
|
+
|
|
57
|
+
tag = os.environ["RELEASE_TAG"]
|
|
58
|
+
match = re.fullmatch(r"witwin-maxwell-v(?P<version>[0-9A-Za-z.+_-]+)", tag)
|
|
59
|
+
if match is None:
|
|
60
|
+
print(f"Release tag '{tag}' must match 'witwin-maxwell-v<version>'.", file=sys.stderr)
|
|
61
|
+
raise SystemExit(1)
|
|
62
|
+
|
|
63
|
+
expected_version = match.group("version")
|
|
64
|
+
pyproject_path = Path(os.environ["PACKAGE_DIR"]) / "pyproject.toml"
|
|
65
|
+
data = tomllib.loads(pyproject_path.read_text(encoding="utf-8"))
|
|
66
|
+
|
|
67
|
+
project = data["project"]
|
|
68
|
+
package_name = project["name"]
|
|
69
|
+
package_version = project["version"]
|
|
70
|
+
|
|
71
|
+
if package_name != "witwin-maxwell":
|
|
72
|
+
print(f"Expected package name 'witwin-maxwell', found '{package_name}'.", file=sys.stderr)
|
|
73
|
+
raise SystemExit(1)
|
|
74
|
+
|
|
75
|
+
if package_version != expected_version:
|
|
76
|
+
print(
|
|
77
|
+
f"Release tag version '{expected_version}' does not match pyproject version '{package_version}'.",
|
|
78
|
+
file=sys.stderr,
|
|
79
|
+
)
|
|
80
|
+
raise SystemExit(1)
|
|
81
|
+
|
|
82
|
+
print(f"Validated {package_name} {package_version} from {pyproject_path}.")
|
|
83
|
+
PY
|
|
84
|
+
|
|
85
|
+
build_cuda_wheels:
|
|
86
|
+
name: Build stable CUDA wheel / ${{ matrix.os }}
|
|
87
|
+
needs: validate_release
|
|
88
|
+
runs-on: ${{ matrix.os }}
|
|
89
|
+
strategy:
|
|
90
|
+
fail-fast: false
|
|
91
|
+
matrix:
|
|
92
|
+
os: [ubuntu-22.04, windows-2022]
|
|
93
|
+
|
|
94
|
+
steps:
|
|
95
|
+
- name: Check out repository
|
|
96
|
+
uses: actions/checkout@v4
|
|
97
|
+
|
|
98
|
+
- name: Set up Python
|
|
99
|
+
uses: actions/setup-python@v5
|
|
100
|
+
with:
|
|
101
|
+
python-version: "3.10"
|
|
102
|
+
|
|
103
|
+
- name: Free disk space (Linux)
|
|
104
|
+
if: runner.os == 'Linux'
|
|
105
|
+
shell: bash
|
|
106
|
+
run: |
|
|
107
|
+
echo "Disk before cleanup:"; df -h /
|
|
108
|
+
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android \
|
|
109
|
+
/usr/local/share/boost /opt/hostedtoolcache/CodeQL \
|
|
110
|
+
/usr/local/share/powershell /usr/share/swift || true
|
|
111
|
+
sudo docker image prune --all --force || true
|
|
112
|
+
echo "Disk after cleanup:"; df -h /
|
|
113
|
+
|
|
114
|
+
- name: Install CUDA Toolkit
|
|
115
|
+
uses: Jimver/cuda-toolkit@v0.2.35
|
|
116
|
+
with:
|
|
117
|
+
cuda: "12.8.1"
|
|
118
|
+
method: local
|
|
119
|
+
log-file-suffix: "${{ runner.os }}-stable-abi"
|
|
120
|
+
|
|
121
|
+
- name: Set up MSVC
|
|
122
|
+
if: runner.os == 'Windows'
|
|
123
|
+
uses: ilammy/msvc-dev-cmd@v1
|
|
124
|
+
with:
|
|
125
|
+
arch: x64
|
|
126
|
+
|
|
127
|
+
- name: Export Windows CUDA_HOME
|
|
128
|
+
if: runner.os == 'Windows'
|
|
129
|
+
shell: pwsh
|
|
130
|
+
run: |
|
|
131
|
+
$cudaRoot = $env:CUDA_PATH
|
|
132
|
+
if (-not $cudaRoot) {
|
|
133
|
+
$nvcc = (Get-Command nvcc -ErrorAction Stop).Source
|
|
134
|
+
$cudaRoot = Split-Path (Split-Path $nvcc -Parent) -Parent
|
|
135
|
+
}
|
|
136
|
+
"CUDA_HOME=$cudaRoot" >> $env:GITHUB_ENV
|
|
137
|
+
"CUDA_PATH=$cudaRoot" >> $env:GITHUB_ENV
|
|
138
|
+
"CUDA_ROOT=$cudaRoot" >> $env:GITHUB_ENV
|
|
139
|
+
"CUDA_BIN_PATH=$cudaRoot" >> $env:GITHUB_ENV
|
|
140
|
+
|
|
141
|
+
- name: Show toolchain
|
|
142
|
+
shell: bash
|
|
143
|
+
run: |
|
|
144
|
+
python --version
|
|
145
|
+
nvcc --version
|
|
146
|
+
command -v cl || true
|
|
147
|
+
|
|
148
|
+
- name: Install CUDA extension build dependencies
|
|
149
|
+
run: |
|
|
150
|
+
python -m pip install --upgrade pip setuptools wheel ninja numpy
|
|
151
|
+
python -m pip install torch==2.10.0 --index-url https://download.pytorch.org/whl/cu128
|
|
152
|
+
python -m pip install build
|
|
153
|
+
|
|
154
|
+
- name: Build packaged stable FDTD CUDA extension
|
|
155
|
+
shell: bash
|
|
156
|
+
env:
|
|
157
|
+
MAX_JOBS: "2"
|
|
158
|
+
WITWIN_CUDA_GENCODE_ARCHES: "7.0;7.5;8.0;8.6;8.9;9.0;10.0;10.1;12.0+PTX"
|
|
159
|
+
PACKAGE_DIR: ${{ needs.validate_release.outputs.package_dir }}
|
|
160
|
+
WITWIN_MAXWELL_FDTD_CUDA_BUILD_DIR: ${{ runner.temp }}/witwin_maxwell_fdtd_cuda/stable_abi_v1
|
|
161
|
+
run: |
|
|
162
|
+
python "$PACKAGE_DIR"/scripts/build_fdtd_cuda_prebuilt.py --verbose
|
|
163
|
+
|
|
164
|
+
- name: Verify compiled CUDA architectures
|
|
165
|
+
shell: bash
|
|
166
|
+
env:
|
|
167
|
+
PACKAGE_DIR: ${{ needs.validate_release.outputs.package_dir }}
|
|
168
|
+
run: |
|
|
169
|
+
python "$PACKAGE_DIR"/scripts/verify_cuda_binary_arches.py \
|
|
170
|
+
--stem witwin_maxwell_fdtd_cuda \
|
|
171
|
+
"$PACKAGE_DIR"/witwin/maxwell/fdtd/cuda/prebuilt
|
|
172
|
+
|
|
173
|
+
- name: Build platform wheel
|
|
174
|
+
shell: bash
|
|
175
|
+
env:
|
|
176
|
+
PACKAGE_DIR: ${{ needs.validate_release.outputs.package_dir }}
|
|
177
|
+
run: |
|
|
178
|
+
python -m build --wheel "$PACKAGE_DIR"
|
|
179
|
+
|
|
180
|
+
- name: Repair Linux wheel platform tag
|
|
181
|
+
if: runner.os == 'Linux'
|
|
182
|
+
shell: bash
|
|
183
|
+
env:
|
|
184
|
+
PACKAGE_DIR: ${{ needs.validate_release.outputs.package_dir }}
|
|
185
|
+
run: |
|
|
186
|
+
python -m pip install auditwheel patchelf
|
|
187
|
+
mkdir -p "$PACKAGE_DIR"/wheelhouse
|
|
188
|
+
for whl in "$PACKAGE_DIR"/dist/*-linux_x86_64.whl; do
|
|
189
|
+
python -m auditwheel repair "$whl" \
|
|
190
|
+
--plat manylinux_2_35_x86_64 \
|
|
191
|
+
--wheel-dir "$PACKAGE_DIR"/wheelhouse \
|
|
192
|
+
--exclude libc10.so --exclude libc10_cuda.so \
|
|
193
|
+
--exclude libtorch.so --exclude libtorch_cpu.so \
|
|
194
|
+
--exclude libtorch_cuda.so --exclude libtorch_python.so \
|
|
195
|
+
--exclude libcudart.so.12 --exclude libcuda.so.1
|
|
196
|
+
done
|
|
197
|
+
rm -f "$PACKAGE_DIR"/dist/*-linux_x86_64.whl
|
|
198
|
+
mv "$PACKAGE_DIR"/wheelhouse/*.whl "$PACKAGE_DIR"/dist/
|
|
199
|
+
ls -l "$PACKAGE_DIR"/dist
|
|
200
|
+
|
|
201
|
+
- name: Smoke install prebuilt wheel
|
|
202
|
+
shell: bash
|
|
203
|
+
env:
|
|
204
|
+
PACKAGE_DIR: ${{ needs.validate_release.outputs.package_dir }}
|
|
205
|
+
WITWIN_MAXWELL_FDTD_CUDA_PREBUILT: "1"
|
|
206
|
+
WITWIN_MAXWELL_FDTD_CUDA_BUILD_DIR: ${{ runner.temp }}/missing_prebuilt_build_dir
|
|
207
|
+
run: |
|
|
208
|
+
python -m pip uninstall -y witwin-maxwell || true
|
|
209
|
+
python -m pip install --no-deps "$PACKAGE_DIR"/dist/*.whl
|
|
210
|
+
python - <<'PY'
|
|
211
|
+
import importlib.util
|
|
212
|
+
import os
|
|
213
|
+
import site
|
|
214
|
+
import zipfile
|
|
215
|
+
from pathlib import Path
|
|
216
|
+
|
|
217
|
+
wheel = next((Path(os.environ["PACKAGE_DIR"]) / "dist").glob("*.whl"))
|
|
218
|
+
names = zipfile.ZipFile(wheel).namelist()
|
|
219
|
+
native = [name for name in names if "witwin_maxwell_fdtd_cuda" in name and name.endswith((".so", ".pyd"))]
|
|
220
|
+
assert len(native) == 1, native
|
|
221
|
+
assert "/prebuilt/" in f"/{native[0]}"
|
|
222
|
+
assert "torch_" not in native[0]
|
|
223
|
+
|
|
224
|
+
candidates = []
|
|
225
|
+
for root in site.getsitepackages() + [site.getusersitepackages()]:
|
|
226
|
+
candidates.append(Path(root) / "witwin" / "maxwell" / "fdtd" / "cuda" / "build.py")
|
|
227
|
+
build_path = next((path for path in candidates if path.exists()), None)
|
|
228
|
+
assert build_path is not None, f"installed build.py not found in {candidates}"
|
|
229
|
+
|
|
230
|
+
spec = importlib.util.spec_from_file_location("witwin_maxwell_fdtd_cuda_build", build_path)
|
|
231
|
+
module = importlib.util.module_from_spec(spec)
|
|
232
|
+
spec.loader.exec_module(module)
|
|
233
|
+
|
|
234
|
+
path = module.prebuilt_extension_path()
|
|
235
|
+
assert path.exists(), f"missing packaged prebuilt extension: {path}"
|
|
236
|
+
assert path.parent.name == "prebuilt"
|
|
237
|
+
extension = module.build_extension()
|
|
238
|
+
print(f"Loaded packaged FDTD CUDA extension from {extension.__file__}")
|
|
239
|
+
PY
|
|
240
|
+
|
|
241
|
+
- name: Upload wheel artifact
|
|
242
|
+
uses: actions/upload-artifact@v4
|
|
243
|
+
with:
|
|
244
|
+
name: wheel-${{ matrix.os }}
|
|
245
|
+
path: ${{ needs.validate_release.outputs.package_dir }}/dist/*.whl
|
|
246
|
+
if-no-files-found: error
|
|
247
|
+
|
|
248
|
+
test_torch_compatibility:
|
|
249
|
+
name: Stable ABI / ${{ matrix.os }} / py${{ matrix.compatibility.python_version }} / torch${{ matrix.compatibility.torch_version }}
|
|
250
|
+
needs:
|
|
251
|
+
- validate_release
|
|
252
|
+
- build_cuda_wheels
|
|
253
|
+
runs-on: ${{ matrix.os }}
|
|
254
|
+
strategy:
|
|
255
|
+
fail-fast: false
|
|
256
|
+
matrix:
|
|
257
|
+
os: [ubuntu-22.04, windows-2022]
|
|
258
|
+
compatibility:
|
|
259
|
+
- {python_version: "3.10", torch_version: "2.10.0", cuda_index: "cu128"}
|
|
260
|
+
- {python_version: "3.11", torch_version: "2.10.0", cuda_index: "cu128"}
|
|
261
|
+
- {python_version: "3.12", torch_version: "2.10.0", cuda_index: "cu128"}
|
|
262
|
+
- {python_version: "3.13", torch_version: "2.10.0", cuda_index: "cu128"}
|
|
263
|
+
- {python_version: "3.14", torch_version: "2.10.0", cuda_index: "cu128"}
|
|
264
|
+
- {python_version: "3.14", torch_version: "2.11.0", cuda_index: "cu128"}
|
|
265
|
+
- {python_version: "3.14", torch_version: "2.12.0", cuda_index: "cu126"}
|
|
266
|
+
|
|
267
|
+
steps:
|
|
268
|
+
- name: Set up Python
|
|
269
|
+
uses: actions/setup-python@v5
|
|
270
|
+
with:
|
|
271
|
+
python-version: ${{ matrix.compatibility.python_version }}
|
|
272
|
+
|
|
273
|
+
- name: Download stable wheel
|
|
274
|
+
uses: actions/download-artifact@v4
|
|
275
|
+
with:
|
|
276
|
+
name: wheel-${{ matrix.os }}
|
|
277
|
+
path: dist
|
|
278
|
+
|
|
279
|
+
- name: Install compatibility environment
|
|
280
|
+
shell: bash
|
|
281
|
+
run: |
|
|
282
|
+
python -m pip install --upgrade pip
|
|
283
|
+
python -m pip install --no-cache-dir "torch==${{ matrix.compatibility.torch_version }}" \
|
|
284
|
+
--index-url "https://download.pytorch.org/whl/${{ matrix.compatibility.cuda_index }}"
|
|
285
|
+
python -m pip install --no-deps dist/*.whl
|
|
286
|
+
|
|
287
|
+
- name: Load the same stable binary
|
|
288
|
+
shell: bash
|
|
289
|
+
env:
|
|
290
|
+
EXPECTED_TORCH: ${{ matrix.compatibility.torch_version }}
|
|
291
|
+
WITWIN_MAXWELL_FDTD_CUDA_PREBUILT: "1"
|
|
292
|
+
WITWIN_MAXWELL_FDTD_CUDA_BUILD_DIR: ${{ runner.temp }}/must-not-jit-build
|
|
293
|
+
run: |
|
|
294
|
+
python - <<'PY'
|
|
295
|
+
import importlib.util
|
|
296
|
+
import os
|
|
297
|
+
import site
|
|
298
|
+
from pathlib import Path
|
|
299
|
+
|
|
300
|
+
import torch
|
|
301
|
+
|
|
302
|
+
assert torch.__version__.split("+", 1)[0] == os.environ["EXPECTED_TORCH"]
|
|
303
|
+
candidates = [
|
|
304
|
+
Path(root) / "witwin" / "maxwell" / "fdtd" / "cuda" / "build.py"
|
|
305
|
+
for root in site.getsitepackages() + [site.getusersitepackages()]
|
|
306
|
+
]
|
|
307
|
+
build_path = next((path for path in candidates if path.exists()), None)
|
|
308
|
+
assert build_path is not None, candidates
|
|
309
|
+
spec = importlib.util.spec_from_file_location("witwin_maxwell_fdtd_cuda_build", build_path)
|
|
310
|
+
module = importlib.util.module_from_spec(spec)
|
|
311
|
+
spec.loader.exec_module(module)
|
|
312
|
+
|
|
313
|
+
native_path = module.prebuilt_extension_path()
|
|
314
|
+
assert native_path.exists(), native_path
|
|
315
|
+
extension = module.build_extension()
|
|
316
|
+
assert Path(extension.__file__).resolve() == native_path.resolve()
|
|
317
|
+
assert extension.update_magnetic_hx_standard is not None
|
|
318
|
+
print(f"Loaded {native_path.name} with torch {torch.__version__} on Python {os.sys.version.split()[0]}")
|
|
319
|
+
PY
|
|
320
|
+
|
|
321
|
+
build_sdist:
|
|
322
|
+
name: Build source distribution
|
|
323
|
+
needs: validate_release
|
|
324
|
+
runs-on: ubuntu-latest
|
|
325
|
+
|
|
326
|
+
steps:
|
|
327
|
+
- name: Check out repository
|
|
328
|
+
uses: actions/checkout@v4
|
|
329
|
+
|
|
330
|
+
- name: Set up Python
|
|
331
|
+
uses: actions/setup-python@v5
|
|
332
|
+
with:
|
|
333
|
+
python-version: "3.11"
|
|
334
|
+
|
|
335
|
+
- name: Build distributions
|
|
336
|
+
shell: bash
|
|
337
|
+
env:
|
|
338
|
+
PACKAGE_DIR: ${{ needs.validate_release.outputs.package_dir }}
|
|
339
|
+
run: |
|
|
340
|
+
python -m pip install --upgrade pip build
|
|
341
|
+
python -m build --sdist "$PACKAGE_DIR"
|
|
342
|
+
|
|
343
|
+
- name: Upload source distribution artifact
|
|
344
|
+
uses: actions/upload-artifact@v4
|
|
345
|
+
with:
|
|
346
|
+
name: sdist
|
|
347
|
+
path: ${{ needs.validate_release.outputs.package_dir }}/dist/*.tar.gz
|
|
348
|
+
if-no-files-found: error
|
|
349
|
+
|
|
350
|
+
publish:
|
|
351
|
+
name: Publish to PyPI
|
|
352
|
+
if: github.event_name == 'release'
|
|
353
|
+
needs:
|
|
354
|
+
- build_cuda_wheels
|
|
355
|
+
- test_torch_compatibility
|
|
356
|
+
- build_sdist
|
|
357
|
+
runs-on: ubuntu-latest
|
|
358
|
+
permissions:
|
|
359
|
+
contents: read
|
|
360
|
+
id-token: write
|
|
361
|
+
environment:
|
|
362
|
+
name: pypi
|
|
363
|
+
url: https://pypi.org/project/witwin-maxwell/
|
|
364
|
+
|
|
365
|
+
steps:
|
|
366
|
+
- name: Download wheel artifacts
|
|
367
|
+
uses: actions/download-artifact@v4
|
|
368
|
+
with:
|
|
369
|
+
pattern: wheel-*
|
|
370
|
+
path: dist
|
|
371
|
+
merge-multiple: true
|
|
372
|
+
|
|
373
|
+
- name: Download source distribution artifact
|
|
374
|
+
uses: actions/download-artifact@v4
|
|
375
|
+
with:
|
|
376
|
+
name: sdist
|
|
377
|
+
path: dist
|
|
378
|
+
|
|
379
|
+
- name: Publish distributions to PyPI
|
|
380
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
381
|
+
with:
|
|
382
|
+
packages-dir: dist
|
|
383
|
+
skip-existing: true
|
|
@@ -54,6 +54,7 @@ coverage.xml
|
|
|
54
54
|
*.py.cover
|
|
55
55
|
.hypothesis/
|
|
56
56
|
.pytest_cache/
|
|
57
|
+
.pytest_tmp/
|
|
57
58
|
cover/
|
|
58
59
|
|
|
59
60
|
# Translations
|
|
@@ -171,14 +172,14 @@ venv.bak/
|
|
|
171
172
|
|
|
172
173
|
# mkdocs documentation
|
|
173
174
|
/site
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
.adjoint_kernels_runtime_*.slang
|
|
175
|
+
witwin/maxwell/fdtd/cuda/prebuilt/*.pyd
|
|
176
|
+
witwin/maxwell/fdtd/cuda/prebuilt/*.so
|
|
177
177
|
*.png
|
|
178
178
|
*.npy
|
|
179
179
|
*.npz
|
|
180
180
|
|
|
181
181
|
settings.local.json
|
|
182
|
+
.claude/
|
|
182
183
|
|
|
183
184
|
# mypy
|
|
184
185
|
.mypy_cache/
|
|
@@ -227,3 +228,9 @@ __marimo__/
|
|
|
227
228
|
|
|
228
229
|
# Streamlit
|
|
229
230
|
.streamlit/secrets.toml
|
|
231
|
+
|
|
232
|
+
# Repository-local development content and build artifacts
|
|
233
|
+
.bench_tmp/
|
|
234
|
+
docs/dev/
|
|
235
|
+
assets/
|
|
236
|
+
benchmark/
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable user-visible changes to WiTwin Maxwell are documented here. The project follows semantic versioning within the `0.x` development series.
|
|
4
|
+
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
## [0.3.0] - 2026-07-13
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Native CUDA FDTD adjoint reverse paths for standard and CPML fields, complex Bloch fields, full electric anisotropy, electric conductivity and dispersion, Kerr nonlinearity, TFSF sources, and multi-source workflows.
|
|
12
|
+
- Broadband and arbitrary-normal-axis grating `TFSF.slab(...)`, including pulsed Bloch injection and mixed Bloch/CPML axis permutations.
|
|
13
|
+
- `Medium2D`, `Graphene`, `LossyMetalMedium`, `PerturbationMedium`, custom spatial dispersion, Sellmeier and gain media, nonlinear susceptibility, two-photon absorption, space-time modulation, magnetic conductivity/dispersion, and full `Tensor3x3` electric anisotropy.
|
|
14
|
+
- Composition of supported anisotropic, conductive, dispersive, nonlinear, modulated, and CPML material effects in the same compiled FDTD scene.
|
|
15
|
+
- Broadband, lossy, diagonal-anisotropic, and bent-waveguide mode-source/port workflows.
|
|
16
|
+
- Background-aware and curved-surface equivalent-current near-to-far propagation, directivity, bistatic RCS, and expanded S-parameter/modal-overlap processing.
|
|
17
|
+
- Tidy3D export for nonuniform grids, mixed boundaries, expanded geometry, material, source, and monitor families.
|
|
18
|
+
- CUDA graph capture coverage for standard, Bloch, dispersive, nonlinear, and TFSF stepping paths.
|
|
19
|
+
- Native CUDA SIBC updates, full-anisotropic conductive-current capture, and a device-resident modulation clock, all compatible with CUDA Graph replay.
|
|
20
|
+
- Python 3.10-3.14 and PyTorch 2.10-2.12 validation for the packaged LibTorch Stable ABI CUDA extension.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Consolidated the public architecture around the declarative `Scene -> Simulation -> Result` workflow. FDTD is the primary full-featured runtime; FDFD uses the same public model but remains a limited/experimental CUDA-only single-frequency path.
|
|
25
|
+
- Moved FDTD adjoint hot paths from Python/Torch replay to native CUDA kernels while keeping PyTorch autograd as the public differentiation interface.
|
|
26
|
+
- Generalized automatic/custom nonuniform grids, subpixel averaging, conformal PEC placement, and source phase correction to use local physical grid spacing.
|
|
27
|
+
- Standardized physical-domain handling so PML cells are appended outside `Domain.bounds`; material/source/monitor validation and cross-solver comparisons use the unchanged physical bounds.
|
|
28
|
+
- Adopted the WiTwin dual-license model and release wheels with CUDA 12.8 fat binaries for Linux and Windows.
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- Aligned Maxwell and Tidy3D plane-wave and TFSF amplitudes using their physical power/field definitions instead of fitted dimensionless factors.
|
|
33
|
+
- Converted explicit Bloch vectors from Maxwell radians/metre to Tidy3D's dimensionless `k * period / (2*pi)` convention.
|
|
34
|
+
- Preserved requested field-monitor components during Tidy3D export and validation-cache loading, preventing undeclared near-zero components from being selected as scalar observables.
|
|
35
|
+
- Corrected external-PML SIBC half-space detection and low-side Yee surface-node placement for `LossyMetalMedium`.
|
|
36
|
+
- Corrected Gaussian-pulse phase/reference handling, CW export ramp bandwidth, source-spectrum normalization, flux-aperture integration, and coordinate-aligned complex-field comparison.
|
|
37
|
+
- Replaced invalid validation scenarios with physically supported TFSF, diffraction-monitor, cavity-probe, and closed-surface near-to-far workflows.
|
|
38
|
+
- Added visual slice/phase diagnostics and solver-independent scalar comparisons for resonances, diffraction orders, directivity/beamwidth, RCS, and S-parameters.
|
|
39
|
+
- Corrected symmetry-face PML removal, high-face grid anchoring, and Yee-control-volume point-dipole image scaling.
|
|
40
|
+
- Corrected singleton custom-current datasets on staggered Yee components so magnetic current samples compile to the nearest component location.
|
|
41
|
+
- Kept the stable-ABI CUDA extension source portable across MSVC and Linux NVCC by using explicit typed input tables in native anisotropic-current validation.
|
|
42
|
+
|
|
43
|
+
Detailed numerical conventions, pitfalls, final comparison values, and intentionally unresolved operator-level residuals are documented in [the 0.3.0 Tidy3D numerical-alignment notes](docs/validation/tidy3d-numerical-alignment-0.3.0.md).
|
|
44
|
+
|
|
45
|
+
## [0.2.0] - 2026-07-08
|
|
46
|
+
|
|
47
|
+
- Previous public release.
|
|
48
|
+
|
|
49
|
+
[Unreleased]: https://github.com/witwin-ai/witwin-maxwell/compare/witwin-maxwell-v0.3.0...HEAD
|
|
50
|
+
[0.3.0]: https://github.com/witwin-ai/witwin-maxwell/compare/witwin-maxwell-v0.2.0...witwin-maxwell-v0.3.0
|
|
51
|
+
[0.2.0]: https://github.com/witwin-ai/witwin-maxwell/releases/tag/witwin-maxwell-v0.2.0
|