Hi Frank,
Thank you very much for taking time to write this detailed reply!
Yes, I split the real and imaginary part of the original complex matrix then vectorize it. At the output side, I build a real matrix (which is the real part of the complex matrix) and a imaginart matrix (which is the imaginary part.) .
Specifically, I try to calculate the square of frobenius norm between the conjugate transpose of output and the target, here is what I did:
        # First matrix V_1_Hermitian(2*5)
        real_part_1 = output_from_network[i,0:5].float()
        real_part_2 = output_from_network[i,5:10].float()
        img_part_1 = -output_from_network[i,10:15].float()
        img_part_2 = -output_from_network[i,15:20].float()
        # A
        real_part_final = torch.stack((real_part_1,real_part_2),0)
        # B
        img_part_final = torch.stack((img_part_1,img_part_2),0)

        # Second matrix V_2(5*2)
        real_part_1_ = torch.reshape(target[i,0:5].float(), [5,1])
        real_part_2_ = torch.reshape(target[i,5:10].float(), [5,1])
        img_part_1_ = torch.reshape(target[i,10:15].float(), [5,1])
        img_part_2_ = torch.reshape(target[i,15:20].float(), [5,1])
        # C
        real_part_final_ = torch.cat((real_part_1_,real_part_2_),1)
        # D
        img_part_final_ = torch.cat((img_part_1_,img_part_2_),1)

        # M = V_1_Hemitian * V_2
        # M = Re(M) + Im(M)*j
        # Re(M) = A*C-B*D, Im(M) = A*D+B*C
        # frobenius norm square of M = frobenius norm square of Re(M) + frobenius norm square of Im(M)
        Re_M = torch.matmul(real_part_final, real_part_final_) - torch.matmul(img_part_final, img_part_final_)
        Im_M = torch.matmul(real_part_final, img_part_final_) + torch.matmul(img_part_final, real_part_final_)
        Re_M_norm_square = torch.pow(torch.norm(Re_M,'fro'),2)
        Im_M_norm_square = torch.pow(torch.norm(Im_M,'fro'),2)
        Final_M_norm_square = Re_M_norm_square + Im_M_norm_square

Sorry about the mess. the output and the target is a vector of size 20 (corresponding to a 5*2 matix), where first 10 elements are the real part and remaning 10 elements are the imaginary part. Since before I am not sure whether Pytorch can do the auto-gradient ‘for free’, I. to some extent, write the process of calculating this frobenius norm ‘by hand’ (as shown in the code, really messy  ), will this code work?
Actually I verified that the final output, which is Final_M_norm_square, is the value that I want (so the manipulation I did give the correct result as I want it to be - The frobenius norm square between two complex matrix), my concern is whether the gradients will be calculated precisely during the backpropagation, since instead of building the complex matrix from the real part and imaginary part and calculate the frobenius norm as you shown me in your script example, I just directly calculate it from the real part and imaginary part, respectively.
Again, thank you very much for taking time and look at my question