Source code for sionna.sys.power_control

# pylint: disable=line-too-long, too-many-arguments, too-many-positional-arguments
#
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
"""
Transmit power control for Sionna SYS
"""

from typing import Optional, Tuple, Union

import torch

from sionna.phy import dtypes, config
from sionna.phy.config import Precision
from sionna.phy.utils import (
    scalar_to_shaped_tensor,
    lin_to_db,
    dbm_to_watt,
    bisection_method,
)

__all__ = ["open_loop_uplink_power_control", "downlink_fair_power_control"]