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

ProtocolResults Incompletely Loads From Directory #382

Closed
pcwysoc opened this issue Dec 5, 2023 · 4 comments
Closed

ProtocolResults Incompletely Loads From Directory #382

pcwysoc opened this issue Dec 5, 2023 · 4 comments
Assignees
Labels
bug A bug or regression
Milestone

Comments

@pcwysoc
Copy link

pcwysoc commented Dec 5, 2023

Describe the bug
ProtocolResults objects written to directory do not have a 'dataset' attribute and the circuit_lists['final'] and circuit_lists['iteration'] both return NoneType. This breaks report generation. It is possible to work around it by using the underlying ProtocolData, i.e. gst_results.data.dataset and gst_results.data.edesign.circuit_lists.

I also encountered a bug in lines 174-175 of TPInstrument that MT_member has no attribute .submembers(). I was able to fix this using the following:

MT_member = next(filter(lambda pair: pair[1].index == len(lbl_member_pairs) - 1, lbl_member_pairs))
param_ops = MT_member.submembers()
if type(MT_member) is tuple:
param_ops = []
for lbl in lbl_member_pairs:
param_ops += [lbl[1]]
else:
param_ops = MT_member.submembers() # the final (TP) member has all the param_ops as its submembers

To Reproduce
Save a ProtocolResults object to directory, load from directory, and try to perform GST. To reproduce the second bug, create an instrument-containing edesign and perform the same steps.

Expected behavior
The ProtocolResults object should load with the correct attributes, removing the need for workarounds.

Environment (please complete the following information):

  • feature-qiskit-mcm
  • python version 3.10
  • OS Ventura 13.6.2

Additional context
Add any other context about the problem here.

@pcwysoc pcwysoc added the bug A bug or regression label Dec 5, 2023
@sserita sserita added this to the 0.9.12.1 milestone Dec 5, 2023
@sserita sserita modified the milestones: 0.9.12.1, 0.9.13 Jan 30, 2024
@sserita sserita modified the milestones: 0.9.13, 0.9.12.2 Mar 26, 2024
@coreyostrove
Copy link
Contributor

Hi @pcwysoc, thanks for taking the time to report this. I am unfortunately finding myself unable to replicate these particular bugs. For what it is worth, it seems that in the course of trying to reproduce this error I stumbled onto what appears to be the cause of the issue #397, so that is something. Is this still an issue you're encountering? If so, do you happen to have a script that reproduces this behavior (I realize this request coming months later means this may well not be the case).

@pcwysoc
Copy link
Author

pcwysoc commented Apr 10, 2024

Hi @coreyostrove, I'll see if I can get you a minimum working example in the next few days. I'm glad it at least led to another open problem!

@pcwysoc
Copy link
Author

pcwysoc commented Apr 10, 2024

@coreyostrove I wasn't able to replicate it either. It's possible something was fixed in between now and when I reported this. I tried it with both a QI-containing and a regular ProtocolResults.

@coreyostrove
Copy link
Contributor

Excellent, not sure what if anything we did that would've fixed this, but I will not look a gift horse in the mouth. I'm going to mark this as closed, but if anything arises related to this issue feel free to re-open it.

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