<jupyter_start><jupyter_text>Configuration<jupyter_code>%%capture
!pip install qiskit ipywidgets
!pip install qiskit[visualization]
!pip install python-dotenv
# Getting your API key
!cp "/content/drive/My Drive/qiskit-config.txt" /home/.env
from dotenv import load_dotenv, find_dotenv
print(f"environment file found at: {find_dotenv()}")
load_dotenv()
import os
print(os.getenv("IBMQ_KEY"))
# Importing standard Qiskit libraries and configuring account
from qiskit import *
from qiskit.tools.visualization import plot_histogram
from qiskit.tools.monitor import job_monitor
from qiskit.providers.ibmq import least_busy
%matplotlib inline
# Loading your IBM Q account(s)
IBMQ.save_account(os.getenv("IBMQ_KEY"), overwrite=True)
IBMQ.load_account()
provider = IBMQ.get_provider('ibm-q')<jupyter_output>/usr/local/lib/python3.6/dist-packages/qiskit/providers/ibmq/ibmqfactory.py:192: UserWarning: Timestamps in IBMQ backend properties, jobs, and job results are all now in local time instead of UTC.
  warnings.warn('Timestamps in IBMQ backend properties, jobs, and job results '
ibmqfactory.load_account:WARNING:2020-11-16 08:17:37,479: Credentials are already in use. The existing account in the session will be replaced.<jupyter_text>Circuit<jupyter_code># Initialization:
circuit = QuantumCircuit(2, 2)
# c = |00>
# Step 1 - Superposition
circuit.h(0)
circuit.h(1)
circuit.draw('mpl')
# c = |00> + |01> + |10> + |11>
# Step 2 - Oracle = on tag le qubit 1
circuit.cz(0, 1)
circuit.draw('mpl')
# Step 3 - Reflection
circuit.h(0)
circuit.h(1)
circuit.x(0)
circuit.x(1)

circuit.cz(0, 1)

circuit.x(0)
circuit.x(1)
circuit.h(0)
circuit.h(1)

circuit.draw('mpl')
# Map the quantum measurement to the classical bits
circuit.measure([0,1], [0,1])
circuit.draw('mpl')<jupyter_output><empty_output><jupyter_text>Exécution<jupyter_code>provider.backends()
# backend = Aer.get_backend('qasm_simulator')
backend = provider.get_backend('ibmq_ourense')
job = execute(circuit, backend, shots=2048)
result = job.result()
result.get_counts()
# on imbq_ourense => {'00': 24, '01': 135, '10': 354, '11': 3583}<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13160377358490566, 'fraction_numerical': 0.03773584905660377, 'mean_word_length': 6.442105263157894, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 18, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '204012', 'license': 'Unlicense', 'n_tokens_mistral': 843, 'n_tokens_neox': 760, 'n_words': 185, 'path': 'PRJCQN.ipynb', 'repo_name': 'gforien/prj-cqn', 'size': '2120'}