def ir_matrix_to_ndarray()

in src/braket/default_simulator/operation_helpers.py [0:0]


def ir_matrix_to_ndarray(matrix: List[List[List[float]]]) -> np.ndarray:
    """Converts a JAQCD matrix into a numpy array.

    Args:
        matrix (List[List[List[float]]]: The IR representation of a matrix

    Returns:
        np.ndarray: The numpy ndarray representation of the matrix
    """
    return np.array([[complex(element[0], element[1]) for element in row] for row in matrix])