code: def make_bernstein_vazirani_circuit(input_qubits, output_qubit, oracle):
      
  
      c = cirq.Circuit()
  
      # Initialize qubits.
      c.append([
          cirq.X(output_qubit),
          cirq.H(output_qubit),
          cirq.H.on_each(*input_qubits),
      ])
  
      # Query oracle.
      c.append(oracle)
  
      # Measure in X basis.
      c.append([
          cirq.H.on_each(*input_qubits),
          cirq.measure(*input_qubits, key='result')
      ])
  
      return c
docs: Solves for factors in f(a) = a·factors + bias (mod 2) with one query.