def to_pm1(samples):
    """Converts a tensor of spins from the :math:`\\sigma_i = 0, 1` convention
    to the :math:`\\sigma_i = -1, +1` convention.
    :param samples: A tensor of spins to convert.
                    Must be using the :math:`\\sigma_i = 0, 1` convention.
    :type samples: torch.Tensor
    """
    return samples.mul(2.0).sub(1.0)
