qiboteam / qibo-client

Qibo remote connection client.
https://qibo.science
Apache License 2.0
1 stars 0 forks source link

Testing the connection without sending a circuit #37

Open BrunoLiegiBastonLiegi opened 2 months ago

BrunoLiegiBastonLiegi commented 2 months ago

Is there any pinging mechanism to test the connection without actually posting a circuit? This would be helpful in qiboteam/qibo-cloud-backends#7, where a mechanism to check the available backends is implemented. I mean, a simple solution would be to just post an empty circuit I guess, but I was wondering whether there was a proper function to do that.

alecandido commented 2 months ago

For the qibo-client there is not, you could check it here: https://github.com/qiboteam/qibo-client/blob/1526ec2d2eeaf3d43a5bf3e3c9c7df67967fb299/src/qibo_client/qibo_client.py#L100 but it could be implemented (though you could use https://github.com/qiboteam/qibo-client/blob/1526ec2d2eeaf3d43a5bf3e3c9c7df67967fb299/src/qibo_client/qibo_client.py#L119 in place of that).

But for the other backends there might be or not, and we could do nothing about that. Instead, posting an empty (or 1-qubit single gate) circuit should be a reliable way.

If a dedicated way is available, making use of it is certainly optimal (because it might skip waiting in the queue for an execution, even a small one), but otherwise go for the simple option.

Long story short: this issue is nice-to-have, but it should not be a blocker for https://github.com/qiboteam/qibo-cloud-backends/pull/7

scarrazza commented 5 days ago

I believe the connection is already tested when we allocate the client, given that it asks to the server the minimum latest version of Qibo accepted by the infrastructure, e.g.:

client = qibo_client.TII(token="asdf")
[2024-06-30 09:25:34,241] WARNING: Local Qibo package version does not match the server one 0.2.8 -> 0.2.4

Btw, this warning will be improved, see #46.