[WIP] Work with Terra PR 5499#66
Conversation
|
This PR is similar to #29. The main difference is that the individual experiments will not work directly with |
|
@yaelbh One thing I noticed is that You can instead do
Also most of the code is still using a mixture of Lastly, since I can create a PR to your branch or have a separate PR to make these updates, if you'd like. |
|
@jyu thanks for reviewing. Some (possibly somewhat confused) thoughts following your comments:
|
The current code for this flow is basically The problem here is that
One scenario I can think of is when the circuits are too long and need to be divided into multiple jobs. I was hoping to get the IBMQ Job Manager replacement (which does the division for you under the cover) done before qiskit-experiment release, but that's not likely to happen :(
It's currently designed to allow both the job and analysis to run asynchronously in the background, and the function could return before they are done. So when you call
We can do that, but then the
Yeah we can mock a job instance so that
Can we call it something else then (maybe
Since you already did a lot of work on this PR, I'll just continue working on it, if that's ok with you. |
# Conflicts: # qiskit_experiments/analysis/plotting.py # qiskit_experiments/base_experiment.py # qiskit_experiments/composite/composite_analysis.py # qiskit_experiments/randomized_benchmarking/interleaved_rb_analysis.py # qiskit_experiments/randomized_benchmarking/rb_analysis.py # test/test_t1.py
Terra base classes integration
|
I've just added changes made by @jyu00. Thanks Jessie! @nkanazawa1989 please note, Jessie replaced |
|
I merged with the main branch this morning, and the code is broken now (some tests fail, when running with the correct branch in Terra). I'm working on fixing it. |
|
In fact, these test might have failed also before the merge with main. Looking at it anyway. |
|
This PR depends on the Terra PR, which is not installed in the CI. We can either install it in the CI, or wait for the Terra PR to be merged and install Terra master in CI. |
|
The tests are failing in my local environment, which is using the Terra PR. It appears that |
|
Yes, the post-processing callback function needs to changed from |
|
All the tests are passing now. @eggerdj Please check the last commit. |
| if __name__ == "__main__": | ||
| unittest.main() |
There was a problem hiding this comment.
Do we need this? Up to now I didn't need this when running tests locally and CI seemed fine without it.
There was a problem hiding this comment.
@eggerdj If I want to run a single test file, I usually write:
python <file name>
and it works, if these two lines appear at the end of the test file. I could of course, instead, specify the test that I want in a flag to stestr or python -m unittest.
Is there a reason to prefer to omit these lines? @mtreinish
There was a problem hiding this comment.
I prefer to omit them, but I am happy to hear guidance from @mtreinish or @scasagrande.
There was a problem hiding this comment.
It's not really needed with modern test runners since they pretty much all let you run by file path natively. This is only really necessary with the stdlib unittest runner which doesn't not provide a useful UI that has any test selection. It doesn't harm anything by being there but I would say running with a more sophisticated test runner is in your best interest. Personally I never add this since most people don't manually invoke the stdlib runner and especially with larger test suites its just easier to use a single entrypoint from the runner that also gives more useful output.
For example, if you use pytest it would just be pytest $path or with stestr like we use via tox (which is also used in CI) you can do stestr run -n $path. The tox configuration is setup so you can just do tox -epy -- -n $path so you can call stestr natively this way in the tox venv.
There was a problem hiding this comment.
I typically use pytest <path> as well, so my inclination would be to drop it.
|
Currently this PR is in a partial state. Will open a new PR, that will be based on #113. |
|
Closing because this work was moved to #115 |
T1 is working except for composite experiments.
@chriseclectic @coruscating @jyu00 Please guide on what has to be done before we proceed to work with Sanket.