I am trying to find a way to implement a unitary transformation in Q# that implements e^(iA) where A is a square matrix. However, I only found ways to do this in Q# if A can be represented as a tensors of Paulis (the Exp operation: https://docs.microsoft.com/en-us/qsharp/api/qsharp/microsoft.quantum.primitive.exp or using a PauliEvolutionSet when trying to do Hamiltonian simulation: https://docs.microsoft.com/en-us/qsharp/api/qsharp/microsoft.quantum.simulation.paulievolutionset).
Does anyone know how to do this for a generic matrix A? If for example you want to use a 8x8 matrix, you can't express it in terms of tensors of Paulis...
Thanks in advance for the help!