def METHOD_NAME(
    self,
    matrix: np.ndarray,
    num_qubits: int,
) -> np.ndarray:
    r"""
    Embeds `matrix` into the upper/lower diagonal block of a :math:`2^\text{num_qubits}`
    by :math:`2^\text{num_qubits}` matrix and pads the diagonal of the upper left block matrix
    with the value of `padding`. Whether the upper/lower diagonal block is used depends on
    `embed_upper`. I.e. using `embed_upper` = `True` returns the matrix:
    .. math::
        \begin{pmatrix}
            \text{matrix} & 0 \\
            0 & \text{padding} * I
        \end{pmatrix}
    Using `embed_upper` = `False` returns the matrix:
    .. math::
        \begin{pmatrix}
            \text{padding} * I & 0 \\
            0 & \text{matrix}
        \end{pmatrix}
    Args:
        matrix: The matrix (2D-array) to embed.
        num_qubits: The number of qubits on which the embedded matrix should act on.
    Returns:
        If `matrix` is of size :math: `2^\text{num_qubits}`, returns `matrix`.
        Else it returns the block matrix (:math: `I` = identity)
    Raises:
        ValueError: If the passed matrix does not fit into the space spanned by num_qubits.
    """
    full_dim = 1 << num_qubits
    subs_dim = matrix.shape[0]
    dim_diff = full_dim - subs_dim
    if dim_diff == 0:
        full_matrix = matrix
    elif dim_diff > 0:
        if self._embed_upper:
            full_matrix = np.block(
                [
                    [matrix, np.zeros((subs_dim, dim_diff), dtype=complex)],
                    [
                        np.zeros((dim_diff, subs_dim), dtype=complex),
                        np.eye(dim_diff) * self._padding,
                    ],
                ]
            )
        else:
            full_matrix = np.block(
                [
                    [
                        np.eye(dim_diff) * self._padding,
                        np.zeros((dim_diff, subs_dim), dtype=complex),
                    ],
                    [np.zeros((subs_dim, dim_diff), dtype=complex), matrix],
                ]
            )
    else:
        raise ValueError(
            f"The given matrix does not fit into the space spanned by {num_qubits} qubits."
        )
    return full_matrix