Suppose that we have this kind of circuit where the first unitary operator U is used for the state preparation while the Hadamard operator is used of state detection.
Let's say we try to run this circuit experimentally, but we don't have enough resources to operate two operators together. Let's imagine that we can use perform one arbitrary single unitary operation M as below:
Compared to the first circuit, the operator M is equivalent to the multiplication of U and H such as $M=H\times U$. To generate the matrix $M$ as $H\times U$, the classical computer is required to calculate the structure of the matrix, and afterwards we can run the same circuit in the second figure as $H\times U$.
But I wonder if the usage of classical computers for this kind of simplification is generally allowable.