KroneckerModel#
- class sionna.phy.channel.KroneckerModel(r_tx: torch.Tensor | None = None, r_rx: torch.Tensor | None = None, precision: str | None = None, device: str | None = None)[source]#
Bases:
sionna.phy.channel.spatial_correlation.SpatialCorrelationKronecker model for spatial correlation
Given a batch of matrices \(\mathbf{H}\in\mathbb{C}^{M\times K}\), \(\mathbf{R}_\text{tx}\in\mathbb{C}^{K\times K}\), and \(\mathbf{R}_\text{rx}\in\mathbb{C}^{M\times M}\), this function will generate the following output:
\[\mathbf{H}_\text{corr} = \mathbf{R}^{\frac12}_\text{rx} \mathbf{H} \mathbf{R}^{\frac12}_\text{tx}\]Note that \(\mathbf{R}_\text{tx}\in\mathbb{C}^{K\times K}\) and \(\mathbf{R}_\text{rx}\in\mathbb{C}^{M\times M}\) must be positive semi-definite, such as the ones generated by
exp_corr_mat().- Parameters:
r_tx (torch.Tensor | None) – Transmit correlation matrices of shape […, K, K]. If the rank of
r_txis smaller than that of the inputh, it will be broadcast.r_rx (torch.Tensor | None) – Receive correlation matrices of shape […, M, M]. If the rank of
r_rxis smaller than that of the inputh, it will be broadcast.precision (str | None) – Precision used for internal calculations and outputs. If set to None,
precisionis used.device (str | None) – Device for computation (e.g., ‘cpu’, ‘cuda:0’). If None,
deviceis used.
- Inputs:
h – […, M, K], torch.complex. Spatially uncorrelated channel coefficients.
- Outputs:
h_corr – […, M, K], torch.complex. Spatially correlated channel coefficients.
Examples
import torch from sionna.phy.channel import exp_corr_mat, KroneckerModel # Create correlation matrices r_tx = exp_corr_mat(0.4, 4) # 4x4 TX correlation r_rx = exp_corr_mat(0.9, 16) # 16x16 RX correlation # Create model kron = KroneckerModel(r_tx, r_rx) # Apply to channel matrix h = torch.randn(32, 16, 4, dtype=torch.complex64) h_corr = kron(h) print(h_corr.shape) # torch.Size([32, 16, 4]) # For use with torch.compile, update matrices in-place: new_r_tx = exp_corr_mat(0.5, 4) kron.r_tx.copy_(new_r_tx) # In-place update avoids graph breaks
Attributes
- property r_tx: torch.Tensor | None#
Get/set transmit correlation matrices.
For use within
torch.compile, use in-place updates viamodel.r_tx.copy_(new_value)to avoid graph breaks.
- property r_rx: torch.Tensor | None#
Get/set receive correlation matrices.
For use within
torch.compile, use in-place updates viamodel.r_rx.copy_(new_value)to avoid graph breaks.