def METHOD_NAME(equation, *operands):
    # NOTE: Do not mix ComplexTensor and torch.complex in the input!
    # NOTE (wangyou): Until PyTorch 1.9.0, torch.einsum does not support
    # mixed input with complex and real tensors.
    if len(operands) == 1:
        if isinstance(operands[0], (tuple, list)):
            operands = operands[0]
        complex_module = FC if isinstance(operands[0], ComplexTensor) else torch
        return complex_module.METHOD_NAME(equation, *operands)
    elif len(operands) != 2:
        op0 = operands[0]
        same_type = all(op.dtype == op0.dtype for op in operands[1:])
        if same_type:
            _einsum = FC.METHOD_NAME if isinstance(op0, ComplexTensor) else torch.METHOD_NAME
            return _einsum(equation, *operands)
        else:
            raise ValueError("0 or More than 2 operands are not supported.")
    a, b = operands
    if isinstance(a, ComplexTensor) or isinstance(b, ComplexTensor):
        return FC.METHOD_NAME(equation, a, b)
    elif is_torch_1_9_plus and (torch.is_complex(a) or torch.is_complex(b)):
        if not torch.is_complex(a):
            o_real = torch.METHOD_NAME(equation, a, b.real)
            o_imag = torch.METHOD_NAME(equation, a, b.imag)
            return torch.complex(o_real, o_imag)
        elif not torch.is_complex(b):
            o_real = torch.METHOD_NAME(equation, a.real, b)
            o_imag = torch.METHOD_NAME(equation, a.imag, b)
            return torch.complex(o_real, o_imag)
        else:
            return torch.METHOD_NAME(equation, a, b)
    else:
        return torch.METHOD_NAME(equation, a, b)