'Decomposes IQFT into elementary gates.'

def decompose(self):

    start = self.args[0]
    finish = self.args[1]
    circuit = 1
    for i in range(((finish - start) // 2)):
        circuit = (SwapGate((i + start), ((finish - i) - 1)) * circuit)
    for level in range(start, finish):
        for i in reversed(range((level - start))):
            circuit = (CGate(((level - i) - 1), RkGate(level, ((- i) - 2))) * circuit)
        circuit = (HadamardGate(level) * circuit)
    return circuit
