Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

test/ibmq/test_registration.py not working due to interface changes in latest release #24

Closed
jlatone opened this issue Jan 22, 2019 · 8 comments

Comments

@jlatone
Copy link

jlatone commented Jan 22, 2019

Informations

  • Qiskit version: terra 0.7.0
  • Python version: python 3.7.2
  • Operating system: macos mojave 10.14.2 (18C54)

What is the current behavior?

Test test/ibmq/test_registration.py not working.

Steps to reproduce the problem

LOG_LEVEL=INFO python -m unittest test/ibmq/test_registration.py

What is the expected behavior?

Run all tests OK

Suggested solutions

FIx code in test so it's up to date with latest release.

@jlatone jlatone added the type: bug Something isn't working label Jan 22, 2019
@diego-plan9
Copy link
Member

Thanks @jlatone - but can you elaborate a bit?

Qiskit version: terra 0.7.0

I suspect this might be the bit prompting this issue! Please note that this package is meant to work against the master terra branch (and eventually against 0.8), not against 0.7.0 - for developers interested in working in terra during the transition some brief instructions were provided at Qiskit/qiskit#1700 (basically, pip install qiskit-ibmq-provider).

For developers interested in working in this package (again, only during the transition), it should be a matter of having a master version of terra somewhere on the python path (for example, we currently clone the repository in travis and install it in editable mode, but other options are possible). This might be a bit inconvenient until 0.8, but hopefully ensures a smooth transition in the meantime!

@diego-plan9 diego-plan9 removed the type: bug Something isn't working label Jan 22, 2019
@jlatone
Copy link
Author

jlatone commented Jan 22, 2019

Hi @diego-plan9, this was a simple change for a few variables like "qconfig" being changed to "_qconfig."

I have 2 separate environments, 1 from the official release version and 1 from clones of forked qiskit projects. This change was from/for the latter...and I think(?) it's ok. I see I messed up when I wrote "terra 0.7.0." I should have said "terra 0.8.0" as printed from this:
from qiskit import version as qiskit_terra__version__
print(qiskit_terra__version__)

@jlatone
Copy link
Author

jlatone commented Jan 22, 2019

Just fyi, here's the origin of the issues I've been raising: I've been merely forking/cloning/building/testing the qiskit projects, one-by-one, following instructions in CONTRIBUTING, and if I happen to encounter any small errors I've been fixing them. When I see it's an issue dependent on a different project, I realize I may be hitting something temporarily not working due to changes in flight so I'm trying to be careful. Anyway, I'm done with qiskit-ibmq-provider for now. :)

@diego-plan9
Copy link
Member

I've been merely forking/cloning/building/testing the qiskit projects, one-by-one, following instructions in CONTRIBUTING, and if I happen to encounter any small errors I've been fixing them.

And that is much appreciated, thanks a lot for your contributions and the effort!

In this case, however, the renaming of the modules (ie. removing the _) was intentional, and it seems to point at some mismatch between the versions in your environments. All the qiskit/providers/ibmq and test/*/ibmq files are now part of this repository (as in, they are not present in terra master), and it seems that the "old" ones are being picked up during the test run you mentioned at the beginning at the issue. Can you double-check which files are really being loaded in the environment where you have all the master versions (making sure the latest master is fetched)?

Some useful commands might be:

  • pip freeze and pip show qiskit-terra (for making sure no old version is installed that might conflict)
  • import qiskit; qiskit.__file__ (to ensure which file is actually in use in your env)

@jlatone
Copy link
Author

jlatone commented Jan 23, 2019

You described the error I thought I was avoiding. My setup is pretty standard--fork & clone--so something must be amiss. pip show qiskit-terra before I run test_registration.py shows 0.8.0. But, I do appear to have a ibmq/test_registration.py file in both my qiskit-terra and qiskit-ibmq-provider forked master clones.

I'm going to punt on what I was attempting, and simply ask: What's the recommended way for someone to work with the latest of all of qiskit from what's public on github, e.g., the master branch of qiskit-terra, qiskit-ibmq-provider, qiskit-aer, and qiskit-aqua? Is there a set of commands one could run from a new conda environment that will fork/clone, make/build, test, install, and verify an installation?

@diego-plan9
Copy link
Member

But, I do appear to have a ibmq/test_registration.py file in both my qiskit-terra and qiskit-ibmq-provider forked master clones.

Hmm, that might give a hint towards what could be causing the issues you are experiencing - can you check if your master contains the commit b8bcd9a? That was the PR where the files were removed from terra - if it is not showing on your git log, git pull upstream master (from your local terra clone) hopefully would do the trick.

The closest instructions for working on several repositories at the same time is probably on the comment above (#24 (comment))! But yes, I agree it is probably a good time to make it a bit more formal and document it in a more accessible place - I'll create an issue for finding out the best place to put that content and populate it accordingly 👍

@jlatone
Copy link
Author

jlatone commented Jan 24, 2019

Fixed, I missed that update (I must have started my testing just prior to it), thanks!

From https://github.com/Qiskit/qiskit-terra
 * branch              master     -> FETCH_HEAD
Removing test/python/ibmq/test_reordering.py
Removing test/python/ibmq/test_registration.py

...

@diego-plan9
Copy link
Member

Great, glad it worked! Let's close the issue and keep track of adding the instructions to the documentation at Qiskit/qiskit#48

Rcuz8 pushed a commit to Rcuz8/qiskit-ibmq-provider that referenced this issue Jun 14, 2022
* Initial commit

* [WIP] Add RuntimeResult class

* change headers

* cleanup

* add setup file

* Add a quasidistribution test

* style fixes

* Start the documentation

* Add classes

* Add result to docs

* fix header

* tweak doc string

* add intro and upload tutorials

* remove bad import

* update some texts

* move things into circuit-runner folder

* rename to RunnerResult

* move to runner

* update to runner dir

* rename apidoc entry

* fix directories

* Move to automodapi

* remove unused docs

* fix what I thought I fixed earlier

* update docs requirements

* add to/from json

* Fix docs doing inherited members

* rename intro

* fix json

* add circuit runner tutorial

* update README

* version should be string

* add shields

* fix json

* fix plot

* add 120x wording

* Add CI configuration (Qiskit#8)

* Add CI configuration

This commit adds a basic CI configuration for the qiskit-runtime
repository. It adds 3 jobs, a unittest job that runs the repository's
sole unit test on all supported platforms, a docs build job that
verifies the docs build, and a doc publishing job that will build the
documentation on tags and upload the built html to
https://qiskit.org/documentation/partners/qiskit_runtime . We should add
some lint/style jobs but that can be done in a follow up commit because
it's likely that we'll need to update the code to conform to whichever
tooling we decide on.

* Add missing docs artifact upload to docs PR/Push ci job

* Fix typo in deploy_documentation.sh

The output path for the built documentation is `docs/_build/html`
not `docs/build/html`.

* Add ``VQEProgram``  (Qiskit#9)

* VQEProgram + lightweight tests

* fix aux_values

* add tutorial

* small fixes

* fix allowed settings for qn-spsa
* fix missing optimal_value in result dict
* remove print of job id

* add tutorial

* remove old tutorial

* rm tutorial from this PR

* fix leftover todos

* rename program_name to program_id
* callback stddev has been fixed
* initial_point can be none
* also cast aux_ops to PauliSumOp

* Adding QKA files (Qiskit#12)

* Create kernel_matrix.py

* Create featuremaps.py

* Create temp.py

* Add files via upload

* Delete temp.py

* Add a tutorial for the VQE script and ``VQEProgram`` (Qiskit#11)

* add tutorial

* update the VQE tutorital texts

replace runtime for Qiskit Runtime. and add some context to differientate Qiskit Runtime programs, and Qiskit Runtime service

* rerun notebook once to get final cell executed

* add link to qiskit nature tutorials

Co-authored-by: Ismael Faro <Ismael.Faro1@ibm.com>

* Fix circuit runner parameters (Qiskit#14)

* fix runner parameters

* remove update_program

* add job retrieval to intro

* Move circuit runner tests (Qiskit#15)

* remove program update from title (Qiskit#16)

* Add docs logistics (Qiskit#17)

* Add docs logistics

* add nbsphinx

* Add some frontmatter (Qiskit#18)

* Add docs meat (Qiskit#19)

* Add some frontmatter

* updates

* tweaks

* add links (Qiskit#20)

* Start a list of current runtime limitations (Qiskit#21)

* Add runtime limitations

* add note about missing upload support

* Tweak the nav bar to simplify things (Qiskit#22)

* Tweak the nav bar to simplify things

* slide in a text fix

* fix a lint error

* Fix README text and link (Qiskit#24)

* fix install in README

* fix tutorial link

* Add init file (Qiskit#25)

* Create __init__.py

* Update featuremaps.py

* Update kernel_matrix.py

* add API direct tutorial (Qiskit#30)

* runtime to program inputs (Qiskit#28)

* update the installation process (Qiskit#33)

* update the installation process

* update qiskit install to force update

* Add lint configuration and run in CI (Qiskit#27)

This commit adds a lint configuration based on the current pattern used
in upstream Qiskit. Leverage black for auto code formatting and then
pylint for a deeper analysis and catch common issues. The code style is
updated to then conform to these guidelines.

Fixes Qiskit#23

* Remove API docs (Qiskit#34)

* remove api docs

* remove unused test

* Update installation wording in README (Qiskit#35)

* update installation wording

* add additional requirements

* a word

* remove unused badges

* move runnerresult import (Qiskit#36)

* Move api direct tutorial from 05 to 01 (Qiskit#32)

* move api direct tutorial

* number uploading

* renumber

* Update intro wording (Qiskit#39)

* fix wording and directory

* update intro tutorial

* update qiskit requirements (Qiskit#41)

* Add circuit runner overview (Qiskit#40)

* Add circuit runner overview

* remove VQE listed twice

* specify it is an overview section

* move circuit runner nb to tutorials

* Move REST API to navbar (Qiskit#42)

* Move REST API to navbar

* update arch image while I am here

* capitalize Runtime

* Update getting started (Qiskit#43)

* Update the getting started.

* add links to the IQX docs

* Build docs on merges with main (Qiskit#44)

* Fix source path for docs upload

The tools/deploy_documentation.sh script had a typo and was trying to upload the wrong
source path which was causing a job error. This commit fixes the path so that the built
documentation will actually be uploaded.

* Update VQE tutorial (Qiskit#45)

* update to latest VQEProgram version from nature

* update imoprt location and REM -> MEM, and re-run

* add nature to the requirements

* Add qka files and figs (Qiskit#37)

* Create qka.py

* Add figs for qka notebook

* Add qka notebook

* Update qka.ipynb

* Update requirements.txt

added `pandas` and `scikit-learn`

* Delete qka.ipynb

* Upload updated qka notebook

* Update qka.py

Fix linter errors

* Update qka.py

Fix more linter errors

* Update qka.py

Fix one more tiny linter error

* Update qka.py

Fix more linter errors

* Update qka.py

* Update qka.py

* Delete chip.png

* Delete subgraphs.png

* Add images for the QKA tutorial

* Update QKA tutorial with new image location

* Update qka.py

* Update qka.py

fix more linter errors

* Update qka.py

and some more

* Update qka.py

* Update qka.py

fix missing return type doc

* Update qka.py

* Create temp.py

* Add images for qka to tutorials folder

* Delete qka.ipynb

* Add updated qka tutorial

* Delete temp.py

* Update path to images

* Update path again

* update path one more time

* Delete qka.ipynb

* Add updated tutorial

* Delete qka.ipynb

* Add qka tutorial with updated eqrefs

* Update qka.py

Update comment and remove `warnings`

* Delete chip.png

* Delete subgraphs.png

* add qka and remove vqe (Qiskit#47)

* Update documentation about simulator access (Qiskit#49)

* update doc on access

* make wording more generic

* Update 01_circuit_runner.ipynb (Qiskit#50)

Minor editing suggestions.

* Rename runtime-simple to sample-program (Qiskit#52)

* rename simple program to sample

* fix import

* add querying for backends (Qiskit#53)

* remove 5 circ limit on circuit runner (Qiskit#55)

* remove 5 circ limit on circuit runner

* remove payload size from readme

* 63 Add tests (Qiskit#62)

* remove vqe program and tests

* add empty test file

* Revert "remove vqe program and tests"

This reverts commit 463986347a660e2bae99f26c880780be6d19e4b6.

* add tests

* address some comments

* address comments

* format

* address comments

* address comments

* address comments and fix lint

* fix serialize inputs

Co-authored-by: Lucy-Xing <Lucy.Xing@ibm.com>

* Update tutorials (Qiskit#65)

* update tutorials

* return final result

* fix test

* use returned result

* lint fix

* add to docstring

* add return type

Co-authored-by: Lucy-Xing <Lucy.Xing@ibm.com>

* Add IEEE workshop tutorial (Qiskit#67)

* add ieee tutorial

* rename file

* use image files

* Remove system limitation (Qiskit#68)

* remove system limitation

* remove simulators

* update upload tutorial (#69)

* update upload tutorial

* add more details

* address comments

* update tutorial (Qiskit#71)

* update requirements (Qiskit#72)

* Move IEEE tutorial (Qiskit#73)

* move ieee tutorial

* fix wording

* Circuit runner tutorial not using proper format (Qiskit#74)

* add binary_probabilities

* remove has_service call

* use quasi obj

* fix max execution time

* Update README.md (Qiskit#75)

* Update README.md (Qiskit#76)

* Add full custom program tutorial (Qiskit#77)

* fix some typos, lang consistency, etc. (Qiskit#78)

* fix some typos, lang consistency, etc.

* Update tutorials/sample_vqe_program/qiskit_runtime_vqe_program.ipynb

oops missed one

* Add back cell contents (Qiskit#79)

* Tweaks to full example based on review (Qiskit#80)

* tweaks based on review

* one more tweak

* Fix readme to avoid saying premium users (Qiskit#81)

* avoid premium

* fix format

* Add UUID to program name in full example (Qiskit#82)

* Add custom expval program (Qiskit#83)

* Add custom expval program

* Add QV example

* Update IEEE tutorial (Qiskit#84)

* add qce21 tutorial

* revert accidental changes

* minor update the sample expval program (Qiskit#85)

* Add missing files (Qiskit#86)

* add missing files

* add vqe

* fix version

* Update tutorials (Qiskit#90)

* Update tutorials

* Undo changes about which backend was used

* Remove version from 02_uploading_program

* Fixes

- Update metadata for sample_expval and sample_vqe_program
- Undo backend change in execution_count 7 of 01_circuit_runner

* Update cells where programs are printed

* Update tutorials sample notebooks

* Fixes for tutorials sample notebooks

* Update tutorials/02_uploading_program.ipynb

Co-authored-by: Jessie Yu <jessieyu@us.ibm.com>

* Address PR comments

- Remove last cell with version info in 00_introduction
- Rerun cell with spec populated

Co-authored-by: Jane Kwon <janeheekwon@ibm.com>
Co-authored-by: Jessie Yu <jessieyu@us.ibm.com>

* Update wording on public programs (Qiskit#88)

* update wording on public programs

* consistent wording

* update Qiskit version

* Add link to article on 120x quantum speedup (Qiskit#91)

* Introduction Tutorial - more updates (Qiskit#92)

* More tutorial updates

* Update tutorials/00_introduction.ipynb

Co-authored-by: Jessie Yu <jessieyu@us.ibm.com>

* Fix review comments

* lower case

Co-authored-by: Jessie Yu <jessieyu@us.ibm.com>

* Update tutorials for ibmq-provider 0.18 (Qiskit#93)

* reflect ibmq provider 0.18 changes

* fix 02

* program names need not be unique

* no more version

* QAOA runtime (Qiskit#94)

* * QAOA runtime.

* * Runtime script.

* * Black.

* 71 rename sample_program to hello_world (Qiskit#96)

* rename to hello_world

* update docs

* add back sample program

* Update qiskit_runtime/hello_world/hello_world.py

Co-authored-by: Jessie Yu <jessieyu@us.ibm.com>

* Update qiskit_runtime/sample_program/sample_program.json

Co-authored-by: Jessie Yu <jessieyu@us.ibm.com>

Co-authored-by: Jessie Yu <jessieyu@us.ibm.com>

* remove files/folders no longer needed

* delete notebook that is no longer needed

Co-authored-by: Jessie Yu <jessieyu@us.ibm.com>
Co-authored-by: Paul Nation <nonhermitian@gmail.com>
Co-authored-by: Ismael Faro <Ismael.Faro1@ibm.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: Jen Glick <41485571+jenglick@users.noreply.github.com>
Co-authored-by: Ismael Faro Sertage <ismael.faro.sertage@gmail.com>
Co-authored-by: beckykd <66339736+beckykd@users.noreply.github.com>
Co-authored-by: Lucy Xing <88128115+LucyXing@users.noreply.github.com>
Co-authored-by: Lucy-Xing <Lucy.Xing@ibm.com>
Co-authored-by: Jay Gambetta <jay.gambetta@us.ibm.com>
Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: Hwajung Kang <hwajungkang@gmail.com>
Co-authored-by: kwoane <12764049+kwoane@users.noreply.github.com>
Co-authored-by: Jane Kwon <janeheekwon@ibm.com>
Co-authored-by: Rathish Cholarajan <rathishc24@gmail.com>
Co-authored-by: Daniel J. Egger <38065505+eggerdj@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants