PlanQK / planqk-platform

PlanQK Platform Issue Repository
3 stars 0 forks source link

Algorithm payload is inconsistent when the user changes the type #77

Closed darya-mart closed 1 year ago

darya-mart commented 1 year ago

Current Behavior

Steps to Reproduce Steps to reproduce the behavior:

  1. Create a new quantum or hybrid algorithm.
  2. Fill the attributes "speedup" and "NISQ-ready"
  3. See the attributes in the topic payload { ... "computationModel":"QUANTUM","nisqReady":true,"speedUp":"quadratic speedup" ...}.
  4. Change the type of the algorithm to "Classic" Result: The fields "speedup" and "NISQ-ready" are hidden in the frontend (correct behavior), but are still sended with the payload to the semantic component: { ..."computationModel":"CLASSIC","nisqReady":true,"speedUp":"quadratic speedup" .... } (error).

Expected Behavior The fields "nisqReady" and "speedUp" are set to null or not exist for classical algorithms.

Additional context In the semantic component, we implement a fix to ignore these fields for the classical algorithms.

miwurster commented 1 year ago

At the moment we don't have any UI logic to clear other fields depending on user actions, i.e., we don't clear the nisqReady field if a user changes the type from QUANTUM to CLASSIC. However, for every follow-up change by the user another event is sent via pub/sub, and therefore, at some point in time you guys will receive the correct information.

miwurster commented 1 year ago

Forgot what I wrote above :-) Fix is on the way...

I just noticed that we hide the quantum-related fields once a user changes the type to CLASSIC, which makes it impossible to clear/change fields by themselves after the type change. Therefore, we clear now the values from such fields (e.g., nisqReady, speedUp, and quantumComputationModesl), when users change the type to CLASSIC.

miwurster commented 1 year ago

Fixed and released.