Removes and returns a momentum by the given name.

        :param name: the momentum name.

        :returns: a momentum removed.

        :raises TypeError: `name` is ``None``.
        :raises KeyError: failed to find a momentum named `name`.

def pop_momentum_by_name(self, name):
        """Removes and returns a momentum by the given name.

        :param name: the momentum name.

        :returns: a momentum removed.

        :raises TypeError: `name` is ``None``.
        :raises KeyError: failed to find a momentum named `name`.
        """
        momentum = self.get_momentum_by_name(name)
        self.remove_momentum(momentum)
        return momentum