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

spin_echo fails to execute. Wait time as float not supported in QM #958

Closed
igres26 opened this issue Aug 1, 2024 · 5 comments · Fixed by #961
Closed

spin_echo fails to execute. Wait time as float not supported in QM #958

igres26 opened this issue Aug 1, 2024 · 5 comments · Fixed by #961

Comments

@igres26
Copy link
Contributor

igres26 commented Aug 1, 2024

Error given when trying to execute the spin_echo routine using quantum machines control electronics:

2024-08-01 10:54:57,352 - qm - INFO     - Sending program to QOP for compilation
2024-08-01 10:54:57,428 - qm - ERROR    - Unexpected error: Failed to compile job
2024-08-01 10:54:57,429 - qm - ERROR    - Time inside wait statement cannot be of type real (@ File "/nfs/users/sergi.ramos/qibolab/src/qibolab/instruments/qm/sequence.py", line 261: qua.wait(qmpulse.wait_cycles, qmpulse.element) )
2024-08-01 10:54:57,429 - qm - ERROR    - Time inside wait statement cannot be of type real (@ File "/nfs/users/sergi.ramos/qibolab/src/qibolab/instruments/qm/sequence.py", line 261: qua.wait(qmpulse.wait_cycles, qmpulse.element) )
2024-08-01 10:54:57,429 - qm - ERROR    - Job 1719486296409 failed. Failed to execute program.
Traceback (most recent call last):
  File "/nfs/users/sergi.ramos/qiboenv/bin/qq", line 8, in <module>
    sys.exit(command())
  File "/nfs/users/sergi.ramos/qiboenv/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/nfs/users/sergi.ramos/qiboenv/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/nfs/users/sergi.ramos/qiboenv/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/nfs/users/sergi.ramos/qiboenv/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/nfs/users/sergi.ramos/qiboenv/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/nfs/users/sergi.ramos/qibocal/src/qibocal/cli/_base.py", line 74, in auto
    autocalibrate(runcard, folder, force, update)
  File "/nfs/users/sergi.ramos/qibocal/src/qibocal/cli/autocalibration.py", line 42, in autocalibrate
    history = runcard.run(
  File "/nfs/users/sergi.ramos/qibocal/src/qibocal/auto/runcard.py", line 63, in run
    instance.run_protocol(
  File "/nfs/users/sergi.ramos/qibocal/src/qibocal/auto/execute.py", line 209, in run_protocol
    completed = task.run(platform=self.platform, targets=self.targets, mode=mode)
  File "/nfs/users/sergi.ramos/qibocal/src/qibocal/auto/task.py", line 149, in run
    completed.data, completed.data_time = operation.acquisition(
  File "/nfs/users/sergi.ramos/qibocal/src/qibocal/auto/operation.py", line 42, in wrapper
    out = func(*args, **kwds)
  File "/nfs/users/sergi.ramos/qibocal/src/qibocal/protocols/coherence/spin_echo.py", line 101, in _acquisition
    results = [
  File "/nfs/users/sergi.ramos/qibocal/src/qibocal/protocols/coherence/spin_echo.py", line 102, in <listcomp>
    platform.execute_pulse_sequence(sequence, options) for sequence in sequences
  File "/nfs/users/sergi.ramos/qibolab/src/qibolab/platform/platform.py", line 196, in execute_pulse_sequence
    return self._execute(sequence, options, **kwargs)
  File "/nfs/users/sergi.ramos/qibolab/src/qibolab/platform/platform.py", line 170, in _execute
    new_result = instrument.play(
  File "/nfs/users/sergi.ramos/qibolab/src/qibolab/instruments/qm/controller.py", line 322, in play
    return self.sweep(qubits, couplers, sequence, options)
  File "/nfs/users/sergi.ramos/qibolab/src/qibolab/instruments/qm/controller.py", line 369, in sweep
    result = self.execute_program(experiment)
  File "/nfs/users/sergi.ramos/qibolab/src/qibolab/instruments/qm/controller.py", line 256, in execute_program
    return machine.execute(program)
  File "/nfs/users/sergi.ramos/qiboenv/lib/python3.10/site-packages/qm/QuantumMachine.py", line 236, in execute
    pending_job = self._queue.add(program, standardized_compiler_options)
  File "/nfs/users/sergi.ramos/qiboenv/lib/python3.10/site-packages/qm/jobs/job_queue.py", line 77, in add
    job = self._insert(program, InsertDirection.end, compiler_options)
  File "/nfs/users/sergi.ramos/qiboenv/lib/python3.10/site-packages/qm/jobs/job_queue.py", line 145, in _insert
    job_id = self._frontend.add_to_queue(
  File "/nfs/users/sergi.ramos/qiboenv/lib/python3.10/site-packages/qm/api/base_api.py", line 28, in wrapped
    return func(*args, **kwargs)
  File "/nfs/users/sergi.ramos/qiboenv/lib/python3.10/site-packages/qm/api/frontend_api.py", line 217, in add_to_queue
    raise FailedToAddJobToQueueException(f"Job {job_id} failed. Failed to execute program.")
qm.exceptions.FailedToAddJobToQueueException: Job 1719486296409 failed. Failed to execute program.

Talking to @andrea-pasquale, seems to be related to the wait times not being integer values, and creating a conflict with quantum machines.

@andrea-pasquale
Copy link
Contributor

This is mostly related to qibolab developers. If float should be supported as pulse duration the fix should be in qibolab, if instead the duration can only be a integer I can fix it here. Thoughts @stavros11 @alecandido @hay-k ?

@alecandido
Copy link
Member

Yes, that's related to Qibolab 0.1, since many values were assumed to be integers, and never converted.

This is already not the case any longer:
https://github.com/qiboteam/qibolab/blob/f491983d17afe7516c73dc14e95c01bcdbe8b1c0/src/qibolab/pulses/pulse.py#L30-L42
(to be compared with https://github.com/qiboteam/qibolab/blob/2020c26bf4da2f2009b709a08555fea80ea93fca/src/qibolab/pulses.py#L746-L763)
and @stavros11 may have already introduced a conversion in QM in its upgraded driver.

However, this won't be fixed in 0.1, in which durations are intended to be ints.

@andrea-pasquale
Copy link
Contributor

Thanks @alecandido, shall I do a quick patch here and then convert it to float once we have 0.2?
In this way we can run spin_echo on QM.

@alecandido
Copy link
Member

Thanks @alecandido, shall I do a quick patch here and then convert it to float once we have 0.2?
In this way we can run spin_echo on QM.

Indeed, I'd suggest you ant simply an int(...) call where needed, and remove that whenever we'll come to 0.2.

@andrea-pasquale
Copy link
Contributor

Fixed in f8e36a0

@alecandido alecandido linked a pull request Aug 2, 2024 that will close this issue
8 tasks
@andrea-pasquale andrea-pasquale added this to the Qibocal 0.0.11 milestone Aug 12, 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

Successfully merging a pull request may close this issue.

3 participants