witwin.channel
API reference for the package root - capabilities, build_info, runtime_diagnostics, pipeline_cache_key, Complex3State and JonesState.
The package root holds runtime reporting and two field-state types. It does not re-export the solvers; import them from their modules.
import witwin.channel as channelModules#
| Module | Purpose | Reference |
|---|---|---|
witwin.channel.deterministic | Coherent fields, path gain and radio maps | deterministic |
witwin.channel.path | Explicit paths, CIR, CFR, taps and beamforming | path |
witwin.channel.montecarlo.basic | Sampled incoherent power | montecarlo.basic |
witwin.channel.montecarlo.bdpt | Bidirectional path tracing | montecarlo.bdpt |
witwin.channel.scene | Scene compilation and cache | scene |
witwin.channel.propagation.consumer | Compact propagation contract for other WiTwin solvers | consumer |
Scene types (Scene, Structure, Mesh, AntennaState, ReceiverGrid, PhysicalMaterial and the rest) come from witwin.core. Other submodules (runtime, kernels, interactions, the rest of propagation) are internal and can change without notice.
capabilities#
capabilities() -> dict[str, Any]Returns the solver capability manifest. It launches no GPU work.
| Key | Content |
|---|---|
components | The five component names. |
solvers | Per-solver records for deterministic, path, montecarlo_basic and montecarlo_bdpt. |
ad_contract | AD modes, differentiable solvers, differentiable inputs and per-solver exclusions. |
materials | Material ABI version (3) and material features. |
receiver_types | ["point", "grid"]. |
max_reflection_depth, max_diffraction_order | Depth limits. |
supports_ad, supports_arrays, supports_polarization, supports_complex_path_coefficients, supports_reflection_diffraction_coupling | Feature flags. |
propagation_consumer | The consumer contract summary. |
schema_version | Manifest schema version. |
caps = channel.capabilities()
print(sorted(caps["solvers"])) # ['deterministic', 'montecarlo_basic', 'montecarlo_bdpt', 'path']
print(caps["ad_contract"]["differentiable_inputs"])witwin.channel.capabilities also defines config_metadata and serialize_config, which the solvers use to record their configuration in metadata.
build_info#
build_info() -> dict[str, Any]Returns the identity of the loaded native extension.
| Key | Example (0.5.0 Windows wheel) |
|---|---|
backend | "channel" |
channel_git_sha, channel_git_dirty | "f8575a01...", False |
channel_abi_version, material_abi_version | 1, 3 |
cuda_version, cuda_compiler_version | "12.8", "12.8.93" |
cuda_architectures | ["70-real", ..., "120-real", "120-virtual"] |
torch_version | "2.10.0" |
cuda_available, optix_available | True, True |
rayd_commit, rayd_repository_url, rayd_integration | RayD source identity |
build_fingerprint | 64-character SHA-256 digest of the build |
build_type, compiler, cxx_abi | "Release", "MSVC-19.44...", "msvc" |
The dictionary may gain keys in later versions. Use .get() for keys you do not depend on.
Raises ImportError or OSError if the native extension cannot be loaded.
runtime_diagnostics#
runtime_diagnostics() -> dict[str, Any]Returns a report of the Python, PyTorch, CUDA, GPU and native build state. It never raises; problems go into the errors list.
| Key | Meaning |
|---|---|
package_version, python, python_executable, platform, torch | Environment. |
cuda_available, cuda_runtime | torch.cuda.is_available() and torch.version.cuda. |
device | Active GPU: name, sm, total_memory_bytes, declared_supported, runtime_verified, status, mode. |
declared_sm_architectures | [75, 80, 86, 89, 120]. |
sm_matrix_status | "runtime_verified" on SM 120, "declared_unverified" otherwise. |
ptx_forward_compatibility_sm | 120. |
native_build | The build_info() record, when the extension loads. |
pipeline_cache, wheel_smoke, deployment_abi | Reporting records. No pipeline cache is implemented. |
errors | List of strings; empty on a working installation. |
diagnostics = channel.runtime_diagnostics()
print(diagnostics["device"]["name"], diagnostics["errors"])pipeline_cache_key#
pipeline_cache_key(*, geometry_version, material_version, assignment_version, frequency_hz, solver, build=None) -> strReturns a 64-character SHA-256 hex digest that identifies one compiled pipeline. Channel computes the key but does not implement a cache; it is for callers that cache results themselves.
The scene's geometry version.
The scene's material version.
The scene's assignment version.
Frequency in hertz. Non-positive values raise ValueError.
Solver name, for example "deterministic".
NoneA build record such as build_info(). None counts as an empty dictionary. Values that are not JSON-serializable raise TypeError.
key = channel.pipeline_cache_key(
geometry_version=scene.geometry_version,
material_version=scene.material_version,
assignment_version=scene.assignment_version,
frequency_hz=3.5e9,
solver="deterministic",
build=channel.build_info(),
)Complex3State#
Complex3State(field, direction)A complex electric field in world Cartesian coordinates, as exchanged with native code.
complex64, (N, 3), on CUDA.
float32, (N, 3) propagation direction, on the same device with the same N.
Wrong dtypes raise TypeError; wrong shapes, CPU tensors or mismatched rows or devices raise ValueError.
JonesState#
JonesState(value, basis, direction)A two-component field in an explicit transverse basis.
complex64, (N, 2).
float32, (N, 2, 3): two world-frame basis vectors per row.
float32, (N, 3).
All tensors must be on CUDA with the same N.