import torch
from typing import Tuple


def compute_bond_vectors(
    conformer: torch.Tensor,
    atom_indices: torch.Tensor,
) -> Tuple[torch.Tensor, torch.Tensor]:
    """Computes the vectors between each atom pair specified by the ``atom_indices`` as
    well as their norms.

    Returns:
        A tuple of the vectors and norms.
    """

    if len(atom_indices) == 0:
        return torch.tensor([]), torch.tensor([])

    directions = conformer[atom_indices[:, 1]] - conformer[atom_indices[:, 0]]
    distances = torch.norm(directions, dim=1)

    return directions, distances