  Several prominent quantum computing algorithms--including Grover's search
algorithm and Shor's algorithm for finding the prime factorization of an
integer--employ subcircuits termed 'oracles' that embed a specific instance of
a mathematical function into a corresponding bijective function that is then
realized as a quantum circuit representation. Designing oracles, and
particularly, designing them to be optimized for a particular use case, can be
a non-trivial task. For example, the challenge of implementing quantum circuits
in the current era of NISQ-based quantum computers generally dictates that they
should be designed with a minimal number of qubits, as larger qubit counts
increase the likelihood that computations will fail due to one or more of the
qubits decohering. However, some quantum circuits require that function domain
values be preserved, which can preclude using the minimal number of qubits in
the oracle circuit. Thus, quantum oracles must be designed with a particular
application in mind. In this work, we present two methods for automatic quantum
oracle synthesis. One of these methods uses a minimal number of qubits, while
the other preserves the function domain values while also minimizing the
overall required number of qubits. For each method, we describe known quantum
circuit use cases, and illustrate implementation using an automated quantum
compilation and optimization tool to synthesize oracles for a set of benchmark
functions; we can then compare the methods with metrics including required
qubit count and quantum circuit complexity.
