Our API makes it easy to mismatch the angles in different circuits produced by the fourier module. We might want to consider using another approach where:
fourier module contains a class (say FourierCircuits)
FourierCircuits is initialized with an angle and indices of target and ancilla qubits
FourierCircuits contains properties (either dynamically generated or just usual fields) with various circuits.
Our API makes it easy to mismatch the angles in different circuits produced by the fourier module. We might want to consider using another approach where:
The Gist below demonstrates the issue I see in the current code, and the solution as mentioned above. Let me know what you think, and I can implement the relevant changes today. https://gist.github.com/dexter2206/ce8cfda5d522e3f2a1cec60ea88a3ca8