Creating a time dependent custom gate in Quirk

I have created a $$16\times 16$$ unitary operator using a Hamiltonian by finding its exponential

$$U=\exp(-iH\delta t)$$

If I set $$\delta t=1$$ then I can take this matrix and input it into quirk using the custom gate maker.

Some gates have the option to rotate wrt time. These are the "spinning" gates $$Z^t$$ etc, which performs the rotation $$R_Z(\theta=2\pi t)$$

Is there some way to generalize this spinning to any unitary matrix with a time component?

I feel there must be a way to do it by adjusting $$U$$. Perhaps by rotating all qubits by some angle and then applying a modified $$U$$? But I'm not sure if it's possible since we'd need to do something like $$U'|a\rangle=U^a|0\rangle.$$

migrated from physics.stackexchange.comJan 20 at 19:50

This question came from our site for active researchers, academics and students of physics.

The only way to make a time-dependent custom gate is to decompose the desired unitary into a circuit using the built-in time-dependent gates (typically $$X$$, $$Y$$ or $$Z^t$$), then make a custom circuit gate using that circuit. (Assuming you're not willing to implement the gate by editing the source code.)
The reason I didn't add support for e.g. using the variable $$t$$ in a custom matrix or rotation gate is that I'm worried that storing the equation could result in very unfortunate backward compatibility constraints (e.g. future versions needing to reproduce existing parsing bugs to keep circuit links from breaking or changing behavior). Also, it doesn't play well with the "ensure unitary" option.