  In this article, we compare the methods implementing the real-time evolution
operator generated by a unitary diagonal matrix where its entries obey a known
underlying real function. When the size of the unitary diagonal matrix is
small, a well-known method based on Walsh operators gives a good and precise
implementation. In contrast, as the number of qubits grows, the precise one
uses exponentially increasing resources, and we need an efficient
implementation based on suitable approximate functions. Using piecewise
polynomial approximation of the function, we summarize the methods with
different polynomial degrees. Moreover, we obtain the overheads of gate count
for different methods concerning the error bound and grid parameter (number of
qubits). This enables us to analytically find a relatively good method as long
as the underlying function, the error bound, and the grid parameter are given.
This study contributes to the problem of encoding a known function in the phase
factor, which plays a crucial role in many quantum algorithms/subroutines. In
particular, we apply our methods to implement the real-time evolution operator
for the potential part in the first-quantized Hamiltonian simulation and
estimate the resources (gate count and ancillary qubits) regarding the error
bound, which indicates that the error coming from the approximation of the
potential function is not negligible compared to the error from the
Trotter-Suzuki formula.
