pytwinnet.ris

class pytwinnet.ris.RISPanel(n_elements, element_gain_linear=1.0, seed=None)[source]

Bases: object

Planar RIS with N elements and per-element phase shifts.

Parameters:
  • n_elements (int)

  • element_gain_linear (float)

  • seed (int | None)

randomize()[source]
Return type:

None

set_phases(theta_rad)[source]
Return type:

None

Parameters:

theta_rad (ndarray)

pytwinnet.ris.phase_opt_greedy(h_tx_ris, h_ris_rx, iters=2)[source]

Greedy per-element phase alignment (fast baseline). Align each element’s phase to maximize h_eff.

Return type:

ndarray

Parameters:

Effective scalar channel h_eff = sum_n h_ris_rx[n] * e^{j theta[n]} * h_tx_ris[n]. :type h_tx_ris: ndarray :param h_tx_ris: (N,) complex, TX->RIS :type h_ris_rx: ndarray :param h_ris_rx: (N,) complex, RIS->RX :type theta: ndarray :param theta: (N,) phases

Return type:

complex

Parameters:

Modules