from qiskit import QuantumCircuit from qiskit.circuit import QuantumRegister, ClassicalRegister import math # Problem 1. (4 pts). Define a qft function that generate # a qft circuit. (You may add additional arguments if you want). def qft(): return None # Problem 2. (4 pts). Use the qft function you defined above # to define the qft_addition circuit. (You may add additional arguments if you want). def qft_addition(): return None # Bonus Problem (2 pts). First test your qft_addition on a simulator, then run # the addition 011111+000001=100000 on ibm's quantum computer. # You may have to wait for a few hours to see the result, if you do get a result, please also # submit a picture of the measurement outcome from IBM's website. # Note that: (1) you may need to change the variable 'qc' to your circuit. # (2) don't forget to use measure_all to measure your circuit. ''' from qiskit_ibm_provider import IBMProvider provider = IBMProvider() backend = provider.get_backend("ibm_brisbane") # Note: we have to traspile the code to the selected # backend. from qiskit import transpile qc_transpiled = transpile(qc, backend) job = backend.run(qc_transpiled, dynamic=False) job_result = job.result() # retrieve the bitstring counts bit_counts = job_result.get_counts() # Note that to interpret the result, IBM's bit convention is # "little endian", i.e., the first bit in the # register will be printed at the right most position. print(f"Counts: {bit_counts}") '''