qiboteam / qibosoq

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

Spectroscopy does not work when try to do in 2 qubits #108

Closed JavierSerranoGarcia closed 5 months ago

JavierSerranoGarcia commented 6 months ago

I am trying to characterize the TII2q3 chip and the spectroscopy works when we do it in one qubits but not for 2 qubits. The platform is in a branch of qibolab_platform_qrc

The action card is

 platform: TII2q3_HTG-ZRF8
targets: [1,2]
format: csv
actions:

  - id: resonator_spectroscopy high power
    priority: 0
    operation: resonator_spectroscopy
    # main: resonator punchout
    parameters:
      freq_width: 100_000_000
      freq_step: 100_000
      amplitude: 0.9
      power_level: high
      nshots: 1024
      relaxation_time: 0

and the error in the driver is

[Qibo 0.2.3|INFO|2024-03-12 13:27:06]: Loading platform /home/users/javier.serrano/qiboDev/qibolab_platforms_qrc/TII2q3_HTG-ZRF8
[Qibo 0.2.3|INFO|2024-03-12 13:27:06]: Using qibolab (/home/users/javier.serrano/qiboDev/qibolab_platforms_qrc/TII2q3_HTG-ZRF8) backend on /CPU:0
[Qibo 0.2.3|INFO|2024-03-12 13:27:06]: Loading platform /home/users/javier.serrano/qiboDev/qibolab_platforms_qrc/TII2q3_HTG-ZRF8
[Qibo 0.2.3|INFO|2024-03-12 13:27:06]: Using qibolab (/home/users/javier.serrano/qiboDev/qibolab_platforms_qrc/TII2q3_HTG-ZRF8) backend on /CPU:0
[Qibocal 0.0.8|WARNING|2024-03-12 13:27:06]: Deleting previous directory reports/202403_res_spec_high.
[Qibocal 0.0.8|INFO|2024-03-12 13:27:06]: Creating directory reports/202403_res_spec_high.
[Qibo 0.2.3|INFO|2024-03-12 13:27:06]: Connecting to instrument <qibolab.instruments.rfsoc.driver.RFSoC object at 0x7f8f0e2a09a0>.
[Qibo 0.2.3|INFO|2024-03-12 13:27:06]: Connecting to instrument <qibolab.instruments.rohde_schwarz.SGS100A object at 0x7f8f0e2a0970>.
[Qibocal 0.0.8|INFO|2024-03-12 13:27:06]: Executing mode autocalibration on resonator_spectroscopy high power iteration 0.
[Qibo 0.2.3|INFO|2024-03-12 13:27:06]: Minimal execution time (sweep): 4.096000000000001
Connected to: Rohde&Schwarz SGS100A (serial:1416.0505k02/114167, firmware:4.2.76.0-4.30.046.295) in 0.19s
Traceback (most recent call last):
  File "/nfs/users/javier.serrano/qiboDev/env/bin/qq", line 8, in <module>
    sys.exit(command())
  File "/nfs/users/javier.serrano/qiboDev/env/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/nfs/users/javier.serrano/qiboDev/env/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/nfs/users/javier.serrano/qiboDev/env/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/qiboDev/env/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/nfs/users/javier.serrano/qiboDev/env/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/nfs/users/javier.serrano/qiboDev/qibocal/src/qibocal/cli/_base.py", line 72, in auto
    autocalibrate(runcard, folder, force, update)
  File "/nfs/users/javier.serrano/qiboDev/qibocal/src/qibocal/cli/autocalibration.py", line 56, in autocalibrate
    for _ in executor.run(mode=ExecutionMode.autocalibration):
  File "/nfs/users/javier.serrano/qiboDev/qibocal/src/qibocal/auto/execute.py", line 142, in run
    completed = task.run(
  File "/nfs/users/javier.serrano/qiboDev/qibocal/src/qibocal/auto/task.py", line 123, in run
    completed.data, completed.data_time = operation.acquisition(
  File "/nfs/users/javier.serrano/qiboDev/qibocal/src/qibocal/auto/operation.py", line 41, in wrapper
    out = func(*args, **kwds)
  File "/nfs/users/javier.serrano/qiboDev/qibocal/src/qibocal/protocols/characterization/resonator_spectroscopy.py", line 125, in _acquisition
    results = platform.sweep(
  File "/nfs/users/javier.serrano/qiboDev/qibolab/src/qibolab/platform.py", line 299, in sweep
    new_result = instrument.sweep(
  File "/nfs/users/javier.serrano/qiboDev/qibolab/src/qibolab/instruments/rfsoc/driver.py", line 531, in sweep
    results = self.recursive_python_sweep(
  File "/nfs/users/javier.serrano/qiboDev/qibolab/src/qibolab/instruments/rfsoc/driver.py", line 341, in recursive_python_sweep
    res = self.recursive_python_sweep(
  File "/nfs/users/javier.serrano/qiboDev/qibolab/src/qibolab/instruments/rfsoc/driver.py", line 298, in recursive_python_sweep
    return self.play_sequence_in_sweep_recursion(
  File "/nfs/users/javier.serrano/qiboDev/qibolab/src/qibolab/instruments/rfsoc/driver.py", line 254, in play_sequence_in_sweep_recursion
    res = self.play(qubits, couplers, sequence, execution_parameters)
  File "/nfs/users/javier.serrano/qiboDev/qibolab/src/qibolab/instruments/rfsoc/driver.py", line 170, in play
    i_pulse = np.array(toti[j][i])
IndexError: list index out of range
rodolfocarobene commented 6 months ago

Hi @JavierSerranoGarcia, thanks for pointing out the issue, I will look into it!

rodolfocarobene commented 6 months ago

I would have to check with the non-working code, including the platform. Since qibosoq didn't have substantial changes, I see two possibilities:

  1. Qibolab / Qibocal changed the way qubits are numbered/named/ordered (Did something similar happened @stavros11, @andrea-pasquale ?)
  2. There is some kind of error in the platform file. For example, in your platform.py I see:
     # assign channels to qubits
    62     qubits[1].readout = channels["L3-27"]
    63     qubits[1].feedback = channels["L2-03-1"]
    64     qubits[1].drive = channels["L3-5"]
    65     qubits[1].flux = channels["L1-6"]
    66     qubits[1].twpa = channels["L3-16"]
    67
    68     qubits[2].readout = channels["L3-27"]
    69     qubits[2].feedback = channels["L2-03-2"]
    70     qubits[2].drive = channels["L3-6"]
    71     qubits[2].twpa = channels["L3-16"]

    what happens if you write qubits[0] and qubits[1], changing the indexes?

andrea-pasquale commented 6 months ago
  1. Qibolab / Qibocal changed the way qubits are numbered/named/ordered (Did something similar happened @stavros11, @andrea-pasquale ?)

In qibocal I don't think so... we changed the qubits argument in the acquisition from dict[QubitId, Qubit] to just list[QubitId], but it should not hurt the driver I think since it is mainly a high level manipulation. Qibolab has been under heavy development lately so perhaps the problem is there...