tfep.utils.geometry.cartesian_to_polar
- tfep.utils.geometry.cartesian_to_polar(x: Tensor, y: Tensor, return_log_det_J: bool = False) Tuple[Tensor][source]
Transform Cartesian coordinates into polar.
- Parameters:
x (torch.Tensor) – Shape
(batch_size,). The x Cartesian coordinate.y (torch.Tensor) – Shape
(batch_size,). The y Cartesian coordinate.return_log_det_J (bool, optional) – If
True, the absolute value of the Jacobian determinant of the transformation is also returned.
- Returns:
r (torch.Tensor) – Shape
(batch_size,). The radius coordinate.angle (torch.Tensor) – Shape
(batch_size,). The angle coordinate in radians.log_det_J (torch.Tensor, optional) – The absolute value of the Jacobian determinant of the transformation.