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

error dumping zi experiment log #840

Closed
DavidSarlle opened this issue Mar 18, 2024 · 11 comments
Closed

error dumping zi experiment log #840

DavidSarlle opened this issue Mar 18, 2024 · 11 comments
Assignees

Comments

@DavidSarlle
Copy link
Collaborator

DavidSarlle commented Mar 18, 2024

@GabrielePalazzo @hay-k when trying to save the experiment log using ZI driver (qibolab main) the following error is raised:

File "/nfs/users/david.fuentes/qibolab/src/qibolab/instruments/zhinst.py", line 1210, in sweep
    self.run_exp()
  File "/nfs/users/david.fuentes/qibolab/src/qibolab/instruments/zhinst.py", line 543, in run_exp
    self.results = self.session.run(self.exp)
  File "/nfs/users/david.fuentes/iqm5q/lib/python3.10/site-packages/laboneq/dsl/experiment/experiment.py", line 1239, in save
    Serializer.to_json_file(self, filename)
  File "/nfs/users/david.fuentes/iqm5q/lib/python3.10/site-packages/laboneq/dsl/serialization/serializer.py", line 123, in to_json_file
    json_string = Serializer.to_json(serializable_object)
  File "/nfs/users/david.fuentes/iqm5q/lib/python3.10/site-packages/laboneq/dsl/serialization/serializer.py", line 93, in to_json
    json_struct = serialize_to_dict_with_ref(
  File "/nfs/users/david.fuentes/iqm5q/lib/python3.10/site-packages/laboneq/core/serialization/simple_serialization.py", line 558, in serialize_to_dict_with_ref
    raise ex
  File "/nfs/users/david.fuentes/iqm5q/lib/python3.10/site-packages/laboneq/core/serialization/simple_serialization.py", line 538, in serialize_to_dict_with_ref
    root_object = serialize_to_dict_with_entities(
  File "/nfs/users/david.fuentes/iqm5q/lib/python3.10/site-packages/laboneq/core/serialization/simple_serialization.py", line 490, in serialize_to_dict_with_entities
    ] = serialize_to_dict_with_entities(
  File "/nfs/users/david.fuentes/iqm5q/lib/python3.10/site-packages/laboneq/core/serialization/simple_serialization.py", line 490, in serialize_to_dict_with_entities
    ] = serialize_to_dict_with_entities(
  File "/nfs/users/david.fuentes/iqm5q/lib/python3.10/site-packages/laboneq/core/serialization/simple_serialization.py", line 490, in serialize_to_dict_with_entities
    ] = serialize_to_dict_with_entities(
  File "/nfs/users/david.fuentes/iqm5q/lib/python3.10/site-packages/laboneq/core/serialization/simple_serialization.py", line 501, in serialize_to_dict_with_entities
    raise RuntimeError(
RuntimeError: uid not unique: item LinearSweepParameter(uid='frequency', start=-247826000, stop=50174000, count=150, axis_name=None) has same uid as previously encountered item {'__type': 'LinearSweepParameter', 'uid': 'frequency', 'start': -247826000, 'stop': 50174000, 'count': 150, 'axis_name': None, '__id': 133869641461968}

I am traying to save the log using the method commented on line 542:

imagen

@alecandido
Copy link
Member

Hi @DavidSarlle, thanks for the report. I'm not sure what is happening, but it seems like there is more than one swept parameter named frequency.

Though, in principle, that's perfectly possible (you could sweep the frequency of multiple pulses), and as such that UID is rather bad, and definitely not unique, it seems quite funny.

Could you provide also the Qibocal runcard, or (if you're not using Qibocal) the pulse sequence you're trying to sweep?

@DavidSarlle
Copy link
Collaborator Author

DavidSarlle commented Mar 19, 2024

Thanks @alecandido for checking the error. The runcard that I am trying is the following one (available in the qibocal PR qiboteam/qibocal#691):

platform: iqm5q
qubits: [0]
format: csv

actions:

  • id: qubit flux dependence amplitude
    priority: 0
    operation: qubit_flux
    parameters:
    freq_width: 300_000_000
    freq_step: 2_000_000
    flux_amplitude_start: -1.0
    flux_amplitude_end: 1.0
    flux_amplitude_step: 0.03
    nshots: 1024
    relaxation_time: 2000
    transition: "01"

The action runs without errors if the report dump is not enabled. Just to let you know. If you try to run any other routine (like resonator spec) the same error is raised:

imagen

The point is that I am now characterizing the couplers of iqm5q and the flux dependence showed for all the qubits sweeping the bias is minimal (but there is a shift) after changing the way of sweeping the flux in qiboteam/qibocal#691

But if I try sweeping the amplitude, there is no shift in the drive freq. This behavior is the same in all the qubits:

imagen

So, we are checking the flux lines in parallel, but I want to check the pulse sequence sent to the instruments and for that, we need as much information as we can get from the logs.

Also, zi html report got from the controller, does not show the qf flux pulses, but I am not sure if it should. I remember this plot showing qf pulses before, but I have no reports saved like this:

imagen

@DavidSarlle
Copy link
Collaborator Author

@alecandido I have also tried with qibolab and qibocal main, and the report dump also crashes running a resonator spectroscopy for example:

imagen

@hay-k
Copy link
Contributor

hay-k commented Mar 20, 2024

The problem with self.experiment.save("saved.exp") shall disappear when my PR (#797) is merged.

The problem with not seeing flux dependence when using pulse amplitude sweep, I am still taking a look.

@alecandido
Copy link
Member

Sorry @DavidSarlle if I didn't reply before. We're about to merge @hay-k PR, so I'd just wait for it (and in the, short, meanwhile, you could even use his branch, if urgently needed).

@DavidSarlle
Copy link
Collaborator Author

I have seen the Pr @alecandido . I have a job right know in the queue to test the @hay-k PR and see the logs. Thanks! But we still have the problem with the flux. Maybe we could keep open this issue until we are sure that is not a driver problem or routine problem ([WIP] qiboteam/qibocal#691 (comment))

@DavidSarlle
Copy link
Collaborator Author

DavidSarlle commented Mar 20, 2024

@hay-k now, using your PR #797 the error is not raised, but the neither the html report nor the saved_exp log is generated. Or at least, I can not find the logs in my workspace...
with qibolab main, the html report is generated and saved correctly, but obviously, we can not saved the exp...

@hay-k
Copy link
Contributor

hay-k commented Mar 20, 2024

@DavidSarlle neither main, nor my branch save the experiment or the report out of the box. You do it by adding some lines in the code. Same lines can be added regardless of the branch.

@DavidSarlle
Copy link
Collaborator Author

@hay-k I know that I have to add these lines into your branch to save the files. But adding them, as I do in main, the reports are not saved (neither html nor the saved_exp)

@hay-k
Copy link
Contributor

hay-k commented Mar 21, 2024

@hay-k I know that I have to add these lines into your branch to save the files. But adding them, as I do in main, the reports are not saved (neither html nor the saved_exp)

I believe this was resolved through offline discussion.

As for the fact that the experiment results don't show any flux dependence - I think there are two things:

  1. The current version of the experiment does not add the flux pulses to the pulse sequence, hence the sweep has no effect basically. Ongoing discussion - Added possibility to sweep over flux pulses instead of bias qibocal#691 (comment)
  2. Even when they are added to the sequence, I don't think the experiment will produce expected results, due to the way the ZI driver is designed currently. The driver will need some redesign to handle this experiment, or a hotfix. I can decide what to do based on urgency of this experiment working from your side.

@hay-k
Copy link
Contributor

hay-k commented Mar 26, 2024

  1. The issue about dumping the ZI experiment was automatically solved with Clear some clutter in the ZI driver #797
  2. The issue about the experiment not showing flux dependence when flux pulse amplitude is used instead of bias itself is resolved via Hotfix: Exclude flux pulses from subsection splitting logic if they overlap (in time) with readout #848

@hay-k hay-k closed this as completed Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants