Batch Jobs#65
Conversation
Added a batch jobs
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds a new qBraid Runtime tutorial notebook demonstrating how to submit multiple circuits as a single batch job (introduced in qBraid-SDK v0.12.1), including a minimal end-to-end example from circuit construction through result visualization.
Changes:
- Added a new notebook documenting batch-job submission via
as_batch=TrueandBatchResult. - Included a Qiskit-based example that submits multiple circuits to a simulator device and visualizes results.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "%%capture\n", | ||
| "\n", | ||
| "%pip install 'qbraid[qiskit,visualization]'" |
| "provider = QbraidProvider()\n", | ||
| "device = provider.get_device(\"qbraid:equal1:sim:bell-1\")\n", | ||
| "\n", | ||
| "assert device.profile.batch_job_support is True" |
| "source": [ | ||
| "## Submit as a single batch\n", | ||
| "\n", | ||
| "We pass the two circuits as a list with `as_batch=True`, so they run as one job instead of two separate submissions. `job.result()` returns a `BatchResult`: `result.num_circuits` is how many circuits ran, `result.results` holds each circuit's counts on its own, and `result.data.get_counts()` combines them, which we then plot as a histogram." |
| "for i, circuit_result in enumerate(result.results):\n", | ||
| " print(f\"Circuit {i}: {circuit_result.data.get_counts()}\")\n", | ||
| "\n", | ||
| "batch_counts = result.data.get_counts()\n", | ||
| "\n", | ||
| "plot_histogram(batch_counts)" |
rryoung98
left a comment
There was a problem hiding this comment.
nice work!
nit:
- Let's make sure to output and qbraid-sdk version in a cell.
Otherwise lgtm
Summary of changes
Added a notebook that covers how to Batch Jobs from the v0.12.1 release.