code: def _construct_deutsch_jozsa_circuit(self):
          
          dj_prog = Program()
  
          # Put the first ancilla qubit (query qubit) into minus state
          dj_prog.inst(X(self.ancillas[0]), H(self.ancillas[0]))
  
          # Apply Hadamard, Oracle, and Hadamard again
          dj_prog.inst([H(qubit) for qubit in self.computational_qubits])
  
          # Build the oracle
          oracle_prog = Program()
          oracle_prog.defgate(ORACLE_GATE_NAME, self.unitary_matrix)
  
          scratch_bit = self.ancillas[1]
          qubits_for_funct = [scratch_bit] + self.computational_qubits
          oracle_prog.inst(tuple([ORACLE_GATE_NAME] + qubits_for_funct))
          dj_prog += oracle_prog
  
          # Here the oracle does not leave the computational qubits unchanged, so we use a CNOT to
          # to move the result to the query qubit, and then we uncompute with the dagger.
          dj_prog.inst(CNOT(self._qubits[0], self.ancillas[0]))
          dj_prog += oracle_prog.dagger()
          dj_prog.inst([H(qubit) for qubit in self.computational_qubits])
          return dj_prog
docs: Builds the Deutsch-Jozsa circuit. Which can determine whether a function f mapping
          :math:`\{0,1\}^n \to \{0,1\}` is constant or balanced, provided that it is one of them.
  
          :return: A program corresponding to the desired instance of Deutsch Jozsa's Algorithm.
          :rtype: Program