I am trying to reconstruct the time evolution of a Hamiltonian on the quantum computing simulator, quirk. Ideally I would like to generalise this to any simulator. The unitary matrix is
and I've found a way to decompose the Hamiltonian into the following form:
Both $A$ and $B(t)$ can be implemented individually. (Although A is a non-unitary diagonal matrix consisting of 0s and 1s) One with a static, custom matrix gate and the other using a series of time dependent and standard gates.
Is there a systematic way to reconstruct $U(t)$ generally? There is no limit on the number of ancillary gates