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

Various QILGST bugfixes #351

Open
10 of 16 tasks
sserita opened this issue Sep 19, 2023 · 18 comments
Open
10 of 16 tasks

Various QILGST bugfixes #351

sserita opened this issue Sep 19, 2023 · 18 comments
Assignees
Labels
bug A bug or regression
Milestone

Comments

@sserita
Copy link
Contributor

sserita commented Sep 19, 2023

Describe the bug
There are several bugs that have been discovered regarding QILGST in v0.9.11.2 during the addition of support for IBMQ experiments with midcircuit measurements. This is a thread to keep track of them all, as well as when/where they are fixed. The below list will be updated as individual bugs are added/resolved.

Critical issues (0.9.13)

Feature requests (0.9.14+)

Resolved issues

Environment (please complete the following information):

  • pyGSTi 0.9.11.2+ (feature-qiskit-mcm branch mostly)
  • python 3.10

Cannot pickle locks:
pickle lock

QI not JSON-able (occurred when trying to write combined experiment):
Screenshot 2023-09-25 at 10 19 32 AM

Deprecated id:
deprecated id

Outcome labels in reports:
outcome labels

HTML with additional germs:
Screenshot 2023-09-19 at 6 06 01 PM

@sserita sserita added the bug A bug or regression label Sep 19, 2023
@pcwysoc
Copy link

pcwysoc commented Sep 19, 2023

I have one more bug report--would you prefer I send it over email, comment it here, or add it to the initial comment? Thanks for following up on this! I'll also endeavor to learn the GitHub process as I'm still rather new to it.

@sserita
Copy link
Contributor Author

sserita commented Sep 19, 2023

Haha you beat me to it! Yes please go ahead and add it here. If you can edit the initial comment to make a new checkbox item that would be awesome. But you may not be able to, in which case you can just make a new comment and I will update the initial comment.

@sserita
Copy link
Contributor Author

sserita commented Sep 19, 2023

Looks like you can edit that initial comment, so that's awesome. If you have a minimum working example and could upload it also, that would be super helpful.

@pcwysoc
Copy link

pcwysoc commented Sep 20, 2023

I'm trying to figure out where to upload that right now. Where did you put the Wildcard file?

@sserita
Copy link
Contributor Author

sserita commented Sep 20, 2023

When you edit the comment, do you have a "Attach filed by dragging & dropping" down at the very bottom? I drag & dropped the file there, and then it should just give you some Markdown text with a caption in square braces and a link in parenthesis. Don't change the link, but you can change the caption in square braces and then copy/paste that whole text string wherever you want (i.e. next to the item in the list would be great).

@pcwysoc
Copy link

pcwysoc commented Sep 25, 2023

Just updated the main comment--ran into another issue when trying to write an IBMQ Experiment.

@pcwysoc
Copy link

pcwysoc commented Sep 25, 2023

Here's another aspect that I don't necessarily want to add to the main comment since it isn't a bug fix. Currently, quantum instruments don't have an equivalent to "EmbeddedOp" and 1Q quantum instruments cannot be automatically embedded into 2Q+ state space. This will be fairly critical to expanding QILGST support and the current work I'm doing. Here's the current error message:
Screenshot 2023-09-25 at 2 43 07 PM

I'm willing to work on it on it but could use a walk through of the auto embedding code for operations as it can be a bit circular at times and I'm unsure of which aspects would be critical to replicate in the short term for quantum instruments.

@pcwysoc
Copy link

pcwysoc commented Sep 27, 2023

I think I have an (incomplete) version of auto embedding for QIs working!

@pcwysoc
Copy link

pcwysoc commented Oct 11, 2023

I have a patch on the html problem! The problem is on lines 1215 and 2443 of workspacetable.py and affects two tables: GateVsTargetTable and GateEigenvalueTable. I think both appear in the "Germs Detail" section of the report. The code was hardcoded for all germs in 'virtual_ops' that were not a single quantum instrument to be treated as gate germs. I added a line enforcing that those additional germs be fully composed of gates, which results in the mixed instrument gate germs being skipped. The html report now generates, but the germs detail section is somewhat incomplete. At this point, this is not a problem for the project. I'll push the fix shortly.

@pcwysoc
Copy link

pcwysoc commented Oct 12, 2023

Additional feature requests (not urgent and may require some thought):

  • Calculating instrument error metrics which are currently blank
  • Calculating germ details for instrument and instrument + gate germs
  • Quantifying "weakness" quantum instrument error and readout/assignment errors using Robin's framework

@pcwysoc
Copy link

pcwysoc commented Oct 18, 2023

I think I found the root bug for the non-JSONable instruments on IBMQExperiment.write(). The processor spec associated with the initial StandardGSTDesign includes the instrument in a non-JSONable form in 'nonstd_instruments.' This means that the ProtocolData can't be written:

Screenshot 2023-10-18 at 10 14 01 AM

Additionally, there seems to be a bug where standard gate unitaries are included in 'nonstd_gate_unitaries.' Is there a reason why this is done? I can pretty easily fix it. See this notebook for details of both of the above.
nonstd_gates_and_instruments_bugs.ipynb.zip

Some of this seems to trace back to there being no concept of a standard instrument (as is the case for gates in internalgates.py) and my incomplete implementation of an embedded instrument (modelmembers/instruments/EmbeddedInst.py). I think the "'nonstd_instruments' ProtocolData" and the "standard gate unitaries reported as nonstandard gate unitaries" bugs come in with the definition of 'create_processor_spec' in ExplicitModel.py. I think something like 'extract_unitary' needs to be written for instruments and the processor spec needs to be defined so that the standard gate unitaries don't get listed as nonstandard gate unitaries.

I'm a bit stuck right now on the instrument problem, as the 'extract_unitary' function is a bit obtuse to me.

@pcwysoc
Copy link

pcwysoc commented Oct 23, 2023

More complete bug report for the above (gives a non-working example of the ProtocolData error message):
nonstd_gates_and_instruments_bugs_new.ipynb.zip

@sserita
Copy link
Contributor Author

sserita commented Oct 28, 2023

The thread.lock bug is now fixed in d5807e7. @pcwysoc we should merge this into your branch tomorrow.

@sserita
Copy link
Contributor Author

sserita commented Oct 28, 2023

The pspec instrument JSON bug is now fixed in bf2a082.

@sserita
Copy link
Contributor Author

sserita commented Nov 17, 2023

The feature-ibm-devices branch was merged into develop in #359, so all the items labeled as fixed should be live in develop.

@pcwysoc
Copy link

pcwysoc commented Nov 17, 2023

@sserita It looks like the pspec instrument bug never really died. I made a mistake while testing it and it appears there's some subtle differences in the pspec after loading from a directory that causes GST to run. Here's a notebook exhibiting the problem:
IBMWritePspecBugAliveAgain.ipynb.zip

I'm planning to take a look, since it appears to be a simple problem. It is not blocking as I have work arounds for this issue.

@pcwysoc
Copy link

pcwysoc commented Nov 22, 2023

I just implemented some fixes (not yet committed) for text wrapping of the hover labels.

@sserita sserita added this to the 0.9.13 milestone Nov 29, 2023
@pcwysoc
Copy link

pcwysoc commented May 15, 2024

@sserita Just rearranged and added the three issues we discussed.

@pcwysoc pcwysoc modified the milestones: 0.9.13, 0.9.14 Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug or regression
Projects
None yet
Development

No branches or pull requests

3 participants