import torch


def mult(x1, x2):
    """
    returns product of complex torch tensors x1 and x2
    """
    y = torch.empty_like(x1)
    y[..., 0] = x1[..., 0]*x2[..., 0] - x1[..., 1]*x2[..., 1]
    y[..., 1] = x1[..., 0]*x2[..., 1] + x1[..., 1]*x2[..., 0]
    return y