pedrorrivero / qrand

A multiprotocol and multiplatform quantum random number generation framework
https://pypi.org/project/qrand/
Apache License 2.0
23 stars 14 forks source link

Name QRAND generated jobs #24

Open pedrorrivero opened 3 years ago

pedrorrivero commented 3 years ago

Is your feature request related to a problem? Please describe.

QRAND will make requests to quantum backends in order to randomly generate numbers. These requests (i.e. jobs) will have a unique id associated to each of them given by the backend; however, it is very difficult to tell apart which of these requests were made from QRAND when looking at the information stored in the provider.

Describe the solution you'd like

By given QRAND's jobs a particular, easily distinguishable, friendly name we will be able to tell them apart in the provider (e.g. IBM-Q website). Ideally this name will contain:

  1. The word QRAND.
  2. The name of the author.
  3. The name of theBareQuantumProtocol being run.
  4. Timestamp id.

E.g.: QRAND by Pedro Rivero - EntanglementProtocol | 2021-06-06T20:14:00Z

If we want to include the name of the protocol, we will need to add a name str parameter to create_job in QuantumFactory. The easiest way to implement this is by defining a property in QuantumProtocol called job_name. This will be inherited by all protocols, and produce an updated name every time it is called (i.e. updating the protocol name through self.__class__.__name__ or type(self).__name__, as well as the timestamp). Since we are using a decorator structure, the name will have to be produce by BareQuantumProtocol and tunneled all the way up through the ValidationDecorator class.

Describe alternatives you've considered

The alternative would be to hardcode the name inside every platform's QuantumJob, but this will not be able to display the name of the protocol.

Additional context

Qiskit: https://github.com/Qiskit/qiskit-ibmq-provider/issues/118, and job_name Q#: azure.execute documentation.

Raijeku commented 2 years ago

I would like to contribute to solve this issue

pedrorrivero commented 2 years ago

Thanks @Raijeku feel free to give it a try! I would suggest looking into de development branch for the most up to date code.

Let me know if you need anything