# 2026/04/17
# Joerg Gutschank
import getpass
from qiskit_ibm_runtime import QiskitRuntimeService

# prompt for IBM Quantum API token
token = getpass.getpass("Input IBM Quantum API Token: ")

# prompt for IBM CRN instance
instance = getpass.getpass("Input CRN instance: ")

# connect to IBM Quantum
service = QiskitRuntimeService(
    channel="ibm_cloud",
    token=token,
    instance=instance)

print("connecting to quantum computer...")
# get a backend (any operational hardware backend)
backend = service.least_busy(simulator=False, operational=True)

# print the name of the backend to report success
print(backend.name)
