Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] QEMIST Cloud credentials improperly checked when submitting jobs to IonQ Cloud #206

Closed
MPCoons opened this issue Sep 8, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@MPCoons
Copy link
Collaborator

MPCoons commented Sep 8, 2022

Issue: Bug Report

Expected Behavior
Running the attached Python script via "python minimum_example.py" is expected to

  1. Create a SecondQuantizedMolecule for ground state H2 / STO-3G basis set.
  2. Perform classical VQE to obtain the optimal QCC circuit for this system.
  3. Connect with IonQ Cloud's API and submit the job to the simulator backend.
  4. Return a histogram from the simulation.

Current Behavior
The job fails before connecting to IonQ Cloud and never submits the simulation to the simulator backend. Several errors related to the remote end disconnecting without response, a protocol error, and a connection error are reported. The full error message is attached to this report along with an example.

Steps to Reproduce (minimal example)
The job fails at Step 3 below.

  1. Set the environment variable IONQ_APIKEY to its current value.
  2. Activate the appropriate environment with the installation of tangelo-gc v0.3.2.
  3. Run the script with "python minimum_example.py"

Environment
CentOS Linux release 7.8.2003 (Core)
The output of conda list is attached to this report. Briefly, tangelo-gc v0.3.2 and qemist-client v0.5.0 are installed.

Possible Solution
Commenting the line from .qemist_cloud_connection import job_submit, job_status, job_cancel, job_result, job_estimate in tangelo/linq/qpu_connection/__init__.py fixed the issue.

tangelo-gc_conda_env.txt
minimum_example_error.txt
minimum_example_py.txt

@MPCoons MPCoons added the bug Something isn't working label Sep 8, 2022
@ValentinS4t1qbit
Copy link
Collaborator

ValentinS4t1qbit commented Sep 8, 2022

We indeed should not check or import anything QEMIST Cloud related unless the user explicitly use a feature that requires it.

A good way to make that clean is probably by encapsulating the qemist cloud "job" functions in qemist_cloud_connection.py in a QEMISTCloudConnection children class of QPUConnection, and hide the import / login checks inside the call to __init__ (e.g unless the class is instantiated, users won't have any issue of imports. If the imports work at instantiation, there is no reason to check them for the other job methods).

The qemist cloud notebook should then be modified to reflect these changes, and we should make sure to tell our developer friends at QEMIST Cloud that they should include a link to that notebook in their documentation, so that its always up to date.

On top of making things cleaner, the class encapsulation paves the way for handling multi-cloud services through QEMIST Cloud in a more resilient manner.

Any comments ?

@MPCoons
Copy link
Collaborator Author

MPCoons commented Sep 9, 2022

I agree. Consistency between all current and future CloudConnection children classes of QPUConnection is probably the cleanest and most logical approach. Also, it doesn't seem like doing this for the qemist cloud routines would require substantial effort.

@alexfleury-sb
Copy link
Collaborator

I confirm that I am able to reproduce the bug. It is indeed due to the from .qemist_cloud_connection import job_submit, job_status, job_cancel, job_result, job_estimate line. Will come back soon with a fix.

@ValentinS4t1qbit
Copy link
Collaborator

Fixed with #207

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants