Persist circuits in batch execute#260
Persist circuits in batch execute#260yitchen-tim merged 10 commits intoamazon-braket:feature/persist-batch-circuitsfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feature/persist-batch-circuits #260 +/- ##
================================================================
Coverage 100.00% 100.00%
================================================================
Files 7 7
Lines 1211 1225 +14
Branches 295 297 +2
================================================================
+ Hits 1211 1225 +14 ☔ View full report in Codecov by Sentry. |
|
Hi @WingCode and thanks for raising this! It seems the linter check is failing. Locally, you can run |
|
@math411 I have fix the linting issues. Could you please review? |
yitchen-tim
left a comment
There was a problem hiding this comment.
Hi @WingCode , thanks for contributing to the issue! This PR solves half of the problem stated in #255. Printing noisy circuits when using noise model is still not supported. However, after reviewing this PR, I think printing noisy circuits is not the right goal to pursue.
The right goal is to allow users to retrieve the tasks (and the task ids), from which noisy circuits can be retrieved. If you can extend this PR to include the following feature, we are good to go: "Persist the task when parallel=True", which requires
- Add an attribute
self._tasks=[] - Add a method for returning tasks
@property
def tasks(self) -> list[QuantumTask]:
...
, similar to
3. Add unit tests for
tasks
| super().__init__(wires, shots=shots or None) | ||
| self._device = device | ||
| self._circuit = None | ||
| self._circuits = [] |
There was a problem hiding this comment.
self._circuits here is a private variable. that users should not access. Instead, users access _circuits through properties. So, there need to be a new property of this class called circuits defined as a method of the class, similar to
There was a problem hiding this comment.
And yes, it's a bit repetitive now that we have both circuits and circuit, but I think it's okay for now. In long term, circuit may be deprecated.
yitchen-tim
left a comment
There was a problem hiding this comment.
Hi @WingCode, the PR looks good! I changed the target branch to be a feature branch instead of the main branch because Amazon Braket needs rework the duplication of circuit and circuits which requires some discussions. I will assign the issue to you and close the issue. This should be good in UnitaryHack regards. Thanks for contributing!
I somehow have trouble assigning the issue to you. I am asking my team to resolve it.
|
Thank you @yitchen-tim for the reviews and all of the timely support! |
Issue #, if available: closes #255
Description of changes: Add persistence of multiple circuits when batch_execute is called
Testing done:
Merge Checklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.General
Tests
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.