from typing import List, Optional

from qiskit import transpile, QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit.result import marginal_counts

import warnings
warnings.filterwarnings("ignore")

import math
pi=math.pi

from qiskit_ibm_provider import IBMProvider

provider = IBMProvider()


hub = "ibm-q-community"
group = "digiq-icfo-hack"
project = "main"

backend_name = "ibmq_jakarta" # 7 qubits
#backend_name = "ibmq_guadalupe	" # 16 qubits

backend = provider.get_backend(backend_name, instance=f"{hub}/{group}/{project}")

shots: int = 1024 # Number of shots to run each circuit for

print(len(backend.properties().qubits))


from qiskit import transpile



initial_layout=[0,1,2,3,4] # optional

qc_transpiled = transpile(your_circuit, backend, initial_layout=initial_layout)


job = backend.run(qc_transpiled, shots=1024, job_tags=["team_name", "bcn_hackathon"])

counts = job.result().get_counts()



