<jupyter_start><jupyter_text>Trusted Notebook" width="500 px" align="left">  _*Doing nothing with Qiskit Terra*_ *** We are going to use Qiskit to do nothing.<jupyter_code>import qiskit<jupyter_output><empty_output><jupyter_text>First we set up an empty program for one qubit.<jupyter_code>qr = qiskit.QuantumRegister(1)
cr = qiskit.ClassicalRegister(1)
program = qiskit.QuantumCircuit(qr, cr)<jupyter_output><empty_output><jupyter_text>We don't want to do anything to the qubit, so we'll skip straight to reading it out.<jupyter_code>program.measure(qr,cr)<jupyter_output><empty_output><jupyter_text>Now we'll tell the local simulator to execute this entirely trivial program.<jupyter_code>job = qiskit.execute( program, qiskit.BasicAer.get_backend('qasm_simulator') )<jupyter_output><empty_output><jupyter_text>And then print out the result. Since qubits are initialized as `0`, and we did nothing to our qubit before readout, we'll just get the result `0` many times.<jupyter_code>print( job.result().get_counts() )<jupyter_output>{'0': 1024}<jupyter_text>Now let's try it on the least busy real device. This will have a few samples which output `1` due to noise, but most of the samples should be for an output of `0`.<jupyter_code>qiskit.IBMQ.load_accounts()
backend = qiskit.providers.ibmq.least_busy(qiskit.IBMQ.backends(simulator=False))
print("We'll use the least busy device:",backend.name())
job = qiskit.execute( program, backend )
print( job.result().get_counts() )<jupyter_output>We'll use the least busy device: ibmqx4
{'0': 1004, '1': 20}
{'fraction_non_alphanumeric': 0.11196911196911197, 'fraction_numerical': 0.014800514800514801, 'mean_word_length': 7.098958333333333, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '325365', 'license': 'Apache-2.0', 'n_tokens_mistral': 564, 'n_tokens_neox': 527, 'n_words': 155, 'path': 'hello_world/hello_zero.ipynb', 'repo_name': 'lukasszz/qiskit-tutorials-community', 'size': '1554'}