qiboteam / qibolab

Quantum hardware module and drivers for Qibo.
https://qibo.science
Apache License 2.0
42 stars 14 forks source link

Minimal example fails #116

Closed stavros11 closed 2 years ago

stavros11 commented 2 years ago

The minimal example from README

from qibolab import Platform
from qibolab.pulses import Pulse, ReadoutPulse, PulseSequence, Rectangular, Gaussian

# Define PulseSequence
sequence = PulseSequence()

# Add some pulses to the pulse sequence
sequence.add(Pulse(start=0,
                   frequency=200000000.0,
                   amplitude=0.3,
                   duration=60,
                   phase=0,
                   shape="Rectangular",
                   channel=0))

sequence.add(ReadoutPulse(start=70,
                          frequency=20000000.0,
                          amplitude=0.5,
                          duration=3000,
                          phase=0,
                          shape="Rectangular",
                          channel=0))

# Define platform and load specific runcard
platform = Platform("tiiq")
# Connects to lab instruments using the details specified in the calibration settings.
platform.connect()
# Configures instruments using the loaded calibration settings.
platform.setup()
# Turns on the local oscillators
platform.start()
# Executes a pulse sequence.
results = platform(sequence, nshots=10)
# Turn off lab instruments
platform.stop()
# Disconnect from the instruments
platform.disconnect()

fails using the latest main and the qw5q runcard:

[Qibo 0.1.8.dev1|INFO|2022-07-06 15:07:10]: Loading platform tiiq from runcard /nfs/users/stavros.efthymiou/qibolab/src/qibolab/runcards/qw5q.yml
Traceback (most recent call last):
  File "minimal_example.py", line 25, in <module>
    platform = Platform("tiiq")
  File "/nfs/users/stavros.efthymiou/qibolab/src/qibolab/platform.py", line 22, in Platform
    return Device(name, runcard)
  File "/nfs/users/stavros.efthymiou/qibolab/src/qibolab/platforms/abstract.py", line 33, in __init__
    InstrumentClass = getattr(import_module(f"qibolab.instruments.{lib}"), i_class)
AttributeError: module 'qibolab.instruments.qblox' has no attribute 'ClusterQRM_RF'

The existing runcards also don't work with the current configuration.

scarrazza commented 2 years ago

@aorgazf @DavidSarlle could you please advise asap?

DavidSarlle commented 2 years ago

The point is that you are using a runcard where is defined the qblox cluster with RF modulation integrated. This is the cluster that is installed right now and running in the lab. But the code merged into main has no the implementation for this version of qblox hardware. The code merged into main is a little bit old and still needs to be merged with last Alvaro's branch with the latest implementation of the qblox driver. Probably @aorgazf can open a PR to merge last changes or if you use the code in the branch "alvaro/qblox_upgrade_qw5q" you should be able to run the minimal example. I do not know what is the best option...

DavidSarlle commented 2 years ago

The use of an old runcard is not a possibility because the qblox cluster without RF is not present anymore...

DavidSarlle commented 2 years ago

In my opinion we should merge Alvaro's branch as soon as possible into main. But let's see what says Alvaro and what is the status of the branch right now to be merged.

scarrazza commented 2 years ago

Thanks @DavidSarlle. @aorgazf could please open a PR with the latest setup. We should an effort to keep the main branch updated.

aorgazf commented 2 years ago

@scarrazza, I have opened PR#117 just for qblox upgrade. At the moment @maxhant is running characterisation scripts, so I'm not able to work on the tests suite.

stavros11 commented 2 years ago

Fixed by #117.