Bring your own code into Qollab
Move a circuit you wrote locally into Qollab: the Qiskit carries over, and the pre-created backend replaces your provider setup.
A circuit you built with Qiskit locally runs in a Qollab project with one change: the pre-created backend replaces your provider setup.
Your circuit carries over
The Qiskit you write is standard, so the part that builds your circuit works unchanged: QuantumCircuit, gates, measurements, transpilation. Open + New Project, choose Upload your own files under Project shape, then drop individual files, a folder or an archive onto the card. You can also choose Files… or Folder…. Qollab builds the project from the uploaded contents. For a short, single-file example, paste the code into main.py in the Code tab.
Swap the provider setup for the pre-created backend
Locally, you create a provider with an API key and get a backend from it:
# Local: you manage the provider and key yourself
from qiskit_ionq import IonQProvider
provider = IonQProvider(token="your_api_key")
backend = provider.get_backend("simulator")
On Qollab, delete the provider lines because a backend is already created for you. Choose where it runs in the Select QPU dialog when you press Run:
# Qollab: backend is pre-created; just run against it
job = backend.run(circuit, shots=100)
print(job.result().get_counts())
Run and share
Press Run, pick a simulator (free) or real hardware (credits), and read your results in the console. Once you publish the project, others can open and fork it.
Related
You have finished Building your first Qollab project. You can create, run, fork, and bring your own code to Qollab.
Stay in the loop.
Get the latest tutorials, demos, and project showcases straight to your inbox. No noise, just the good stuff.
Enable JavaScript to sign up.
Qollab updates only. Unsubscribe any time. Privacy Policy.