qiboteam / qibosoq

Qibo server for Qick
https://qibo.science
Apache License 2.0
11 stars 2 forks source link

Error appears doing Rabi #125

Open JavierSerranoGarcia opened 1 month ago

JavierSerranoGarcia commented 1 month ago

Hi @rodolfocarobene, I am trying to run a Rabi in 2 qubits at the same time and I get this error

[Qibo 0.2.8|INFO|2024-07-24 07:32:42]: Loading platform /home/users/javier.serrano/lab/qibolab_platforms_qrc/spinq10q_12_zcu111
[Qibo 0.2.8|INFO|2024-07-24 07:32:42]: Using qibolab (/home/users/javier.serrano/lab/qibolab_platforms_qrc/spinq10q_12_zcu111) backend on /CPU:0
[Qibocal 0.0.11|WARNING|2024-07-24 07:32:42]: Deleting previous directory reports/20240724_experiment.
[Qibocal 0.0.11|INFO|2024-07-24 07:32:42]: Creating directory reports/20240724_experiment.
[Qibo 0.2.8|INFO|2024-07-24 07:32:42]: Connecting to instrument <qibolab.instruments.rfsoc.driver.RFSoC object at 0x7fd763dd6ec0>.
[Qibo 0.2.8|INFO|2024-07-24 07:32:42]: Connecting to instrument <qibolab.instruments.rohde_schwarz.SGS100A object at 0x7fd76300a650>.
[Qibo 0.2.8|INFO|2024-07-24 07:32:42]: Connecting to instrument <qibolab.instruments.rohde_schwarz.SGS100A object at 0x7fd763009ab0>.
[Qibocal 0.0.11|INFO|2024-07-24 07:32:42]: Executing mode AUTOCALIBRATION on rabi.
[Qibo 0.2.8|INFO|2024-07-24 07:32:42]: Minimal execution time (sweep): 103.64373712
Connected to: Rohde&Schwarz SGS100A (serial:1416.0505k02/113615, firmware:4.2.76.0-4.30.046.295) in 0.17s
Connected to: Rohde&Schwarz SGS100A (serial:1416.0505k02/114166, firmware:4.2.76.0-4.30.046.295) in 0.16s
Traceback (most recent call last):
  File "/nfs/users/javier.serrano/lab/julEnv/bin/qq", line 6, in <module>
    sys.exit(command())
  File "/nfs/users/javier.serrano/lab/julEnv/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/nfs/users/javier.serrano/lab/julEnv/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/nfs/users/javier.serrano/lab/julEnv/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/nfs/users/javier.serrano/lab/julEnv/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/nfs/users/javier.serrano/lab/julEnv/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/nfs/users/javier.serrano/lab/qibocal/src/qibocal/cli/_base.py", line 72, in auto
    autocalibrate(runcard, folder, force, update)
  File "/nfs/users/javier.serrano/lab/qibocal/src/qibocal/cli/autocalibration.py", line 51, in autocalibrate
    history = run(output=path, runcard=runcard, mode=AUTOCALIBRATION)
  File "/nfs/users/javier.serrano/lab/qibocal/src/qibocal/auto/execute.py", line 106, in run
    instance.run_protocol(
  File "/nfs/users/javier.serrano/lab/qibocal/src/qibocal/auto/execute.py", line 77, in run_protocol
    completed = task.run(
  File "/nfs/users/javier.serrano/lab/qibocal/src/qibocal/auto/task.py", line 97, in run
    completed.data, completed.data_time = operation.acquisition(
  File "/nfs/users/javier.serrano/lab/qibocal/src/qibocal/auto/operation.py", line 42, in wrapper
    out = func(*args, **kwds)
  File "/nfs/users/javier.serrano/lab/qibocal/src/qibocal/protocols/rabi/amplitude.py", line 77, in _acquisition
    results = platform.sweep(
  File "/nfs/users/javier.serrano/lab/julEnv/lib/python3.10/site-packages/qibolab/platform/platform.py", line 301, in sweep
    new_result = instrument.sweep(
  File "/nfs/users/javier.serrano/lab/julEnv/lib/python3.10/site-packages/qibolab/instruments/rfsoc/driver.py", line 596, in sweep
    results = self.recursive_python_sweep(
  File "/nfs/users/javier.serrano/lab/julEnv/lib/python3.10/site-packages/qibolab/instruments/rfsoc/driver.py", line 379, in recursive_python_sweep
    toti, totq = self._execute_sweeps(sequence, qubits, sweepers)
  File "/nfs/users/javier.serrano/lab/julEnv/lib/python3.10/site-packages/qibolab/instruments/rfsoc/driver.py", line 214, in _execute_sweeps
    return self._try_to_execute(server_commands, self.host, self.port)
  File "/nfs/users/javier.serrano/lab/julEnv/lib/python3.10/site-packages/qibolab/instruments/rfsoc/driver.py", line 90, in _try_to_execute
    raise e
  File "/nfs/users/javier.serrano/lab/julEnv/lib/python3.10/site-packages/qibolab/instruments/rfsoc/driver.py", line 78, in _try_to_execute
    return client.connect(server_commands, host, port)
  File "/nfs/users/javier.serrano/lab/qibosoq/src/qibosoq/client.py", line 58, in connect
    raise QibosoqError(results)
qibosoq.client.QibosoqError: Traceback (most recent call last):
  File "/home/xilinx/qibosoq/src/qibosoq/server.py", line 140, in handle
    results = execute_program(data, self.server.qick_soc)
  File "/home/xilinx/qibosoq/src/qibosoq/server.py", line 103, in execute_program
    toti, totq = program.perform_experiment(
  File "/home/xilinx/qibosoq/src/qibosoq/programs/base.py", line 254, in perform_experiment
    return self.collect_shots()[-2:]
  File "/home/xilinx/qibosoq/src/qibosoq/programs/base.py", line 291, in collect_shots
    tot.append(stacked[:, idx].reshape(shape).tolist())
ValueError: cannot reshape array of size 1009976 into shape (2,1,499,2024)

I am using the branch javi/spinq10q_12_zcu111 on qibolab_platforms_qrc and the action card is

#backend: qibolab
platform: spinq10q_12_zcu111

targets: [2,3]

format: csv
actions:
  - id: rabi
    priority: 0
    operation: rabi_amplitude
    # main: single shot classification
    parameters:
      min_amp_factor: 0.01
      max_amp_factor: 5.0
      step_amp_factor: 0.01
      pulse_length: 120
      relaxation_time: 100_000
      nshots: 2024
rodolfocarobene commented 1 month ago

Please try to update qibosoq/qibolab at the latest version and tell me if the problem still appear. I see that the error is in

 File "/home/xilinx/qibosoq/src/qibosoq/programs/base.py", line 291, in collect_shots
    tot.append(stacked[:, idx].reshape(shape).tolist())

but in main this is in line 294, so maybe I already did some fix for this.

JavierSerranoGarcia commented 1 month ago

@rodolfocarobene , I have reinstall qibolab/qibosoq in the board and in Saadiyat but still I get the error in line 294

rodolfocarobene commented 1 month ago

Good, so it means it is indeed a bug! You should try to run pulse shapes test in order to see which types are affected: https://github.com/qiboteam/qibolab/blob/main/tests/test_result_shapes.py

I am not sure when I will be able to try this