def _list_to_complex_array(complex_list):
arr = np.asarray(complex_list, dtype=np.complex_)<EOL>if not arr.shape[-<NUM_LIT:1>] == <NUM_LIT:2>:<EOL><INDENT>raise QiskitError('<STR_LIT>')<EOL><DEDENT>return arr[..., <NUM_LIT:0>] + <NUM_LIT>*arr[..., <NUM_LIT:1>]<EOL>
Convert nested list of shape (..., 2) to complex numpy array with shape (...)

    Args:
        complex_list (list): List to convert.

    Returns:
        np.ndarray: Complex numpy aray

    Raises:
        QiskitError: If inner most array of input nested list is not of length 2.