# Feedback on Deutsch-Josza alg. homework prob. in Learning Quantum computation using Qiskit [closed]

In Learning Quantum Computation using Qiskit chapter 3.4 I encountered the Deutsch-Josza Algorithm. At the end of the chapter I was presented with a homework problem where the code:

from qiskit_textbook.problems import dj_problem_oracle
oracle = dj_problem_oracle(1)


gives me a gate called 'oracle' and I was supposed to do find out whether it was balanced or constant. I encountered a problem when appending 'oracle' into my circuit, it kept telling me that 'The amount of qubit/clbit arguments does not match the gate expectation.'

After alot of headscratching and try and error I found out that the gate was stuck at a size of 5 (or n=4 if you've done the problem). Because the entire chapter was taught from the view of n qbits, I tried to solve the problem by writing an algorithm for n qbits(so that I can choose how many qbits my circuit contains).

I think that some more detail should be added into the text of that chapter so that things like this don't confuse newcomers like me, or just make it an n sized gate. I'd be grateful if someone could pass this message on to the good men and women managing the site.

• I’m voting to close this question because it isn't a question. Seems like it could have been sorted by an email. – Dripto Debroy Jul 9 '20 at 14:51
• The email to use seems to be francis.harkins@ibm.com – Dripto Debroy Jul 9 '20 at 15:22
• Do you mean that if I have some feedback like this I should go to this email? Cuz I didn’t know where to go with my feedback. – BigFatKitty Meow Jul 10 '20 at 1:22
• @BigFatKittyMeow you can give feedback on the textbook github, or email me with the above address if you prefer. I do agree it should be specified these oracles use n=4, plus 1 auxillary qubit. – Frank Jul 10 '20 at 8:48
• I have created a PR to fix the problem here. – Frank Jul 10 '20 at 8:57

Now, since the oracle that is created is a gate, you can access its number of qubits by doing oracle.num_qubits, here corresponding to n+1, and then to answer the question you run the same functions used in the examples (creating the algo from the oracle with the right number of qubits n, and executing the algo).