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 channel

Modules#

ModulePurposeReference
witwin.channel.deterministicCoherent fields, path gain and radio mapsdeterministic
witwin.channel.pathExplicit paths, CIR, CFR, taps and beamformingpath
witwin.channel.montecarlo.basicSampled incoherent powermontecarlo.basic
witwin.channel.montecarlo.bdptBidirectional path tracingmontecarlo.bdpt
witwin.channel.sceneScene compilation and cachescene
witwin.channel.propagation.consumerCompact propagation contract for other WiTwin solversconsumer

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.

KeyContent
componentsThe five component names.
solversPer-solver records for deterministic, path, montecarlo_basic and montecarlo_bdpt.
ad_contractAD modes, differentiable solvers, differentiable inputs and per-solver exclusions.
materialsMaterial ABI version (3) and material features.
receiver_types["point", "grid"].
max_reflection_depth, max_diffraction_orderDepth limits.
supports_ad, supports_arrays, supports_polarization, supports_complex_path_coefficients, supports_reflection_diffraction_couplingFeature flags.
propagation_consumerThe consumer contract summary.
schema_versionManifest 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.

KeyExample (0.5.0 Windows wheel)
backend"channel"
channel_git_sha, channel_git_dirty"f8575a01...", False
channel_abi_version, material_abi_version1, 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_availableTrue, True
rayd_commit, rayd_repository_url, rayd_integrationRayD source identity
build_fingerprint64-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.

KeyMeaning
package_version, python, python_executable, platform, torchEnvironment.
cuda_available, cuda_runtimetorch.cuda.is_available() and torch.version.cuda.
deviceActive 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_sm120.
native_buildThe build_info() record, when the extension loads.
pipeline_cache, wheel_smoke, deployment_abiReporting records. No pipeline cache is implemented.
errorsList 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) -> str

Returns 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.

geometry_versionintrequired

The scene's geometry version.

material_versionintrequired

The scene's material version.

assignment_versionintrequired

The scene's assignment version.

frequency_hzfloatrequired

Frequency in hertz. Non-positive values raise ValueError.

solverstrrequired

Solver name, for example "deterministic".

builddict | Nonedefault None

A 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.

fieldtorch.Tensorrequired

complex64, (N, 3), on CUDA.

directiontorch.Tensorrequired

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.

valuetorch.Tensorrequired

complex64, (N, 2).

basistorch.Tensorrequired

float32, (N, 2, 3): two world-frame basis vectors per row.

directiontorch.Tensorrequired

float32, (N, 3).

All tensors must be on CUDA with the same N.