quisp icon indicating copy to clipboard operation
quisp copied to clipboard

Change basis from char to enum

Open Naphann opened this issue 2 years ago • 4 comments

Currently, in the interface of qubit we refer to measurement basis using char. This can lead to hard to detect error when changing code. If the developer put a wrong char, it could be hard to debug.

Suggestion is to use enum instead of char.

https://github.com/sfc-aqua/quisp/blob/d66ab324aced885901514dc993ffee5679760007/quisp/backends/interfaces/IQubit.h#L21-L26

Naphann avatar Jan 20 '23 14:01 Naphann

hi @Naphann, I'm interested in working on this issue. can you please assign this to me? It'd help me with my academic evaluation too. Thank You

MadhuMPandurangi avatar Jan 22 '23 09:01 MadhuMPandurangi

Hi @MadhuMPandurangi, sure! We would love to get some help.

Naphann avatar Jan 22 '23 09:01 Naphann

Thank you I'll look into the documentation

MadhuMPandurangi avatar Jan 22 '23 09:01 MadhuMPandurangi

Hi can You @Naphann tell me the possible values that "basis" variable represents.

struct MeasurementOutcome {
  enum class Basis { X, Y, Z };
  Basis basis;
  bool outcome_is_plus;
  char GOD_clean;
  bool operator==(const MeasurementOutcome &outcome) const { return basis == outcome.basis && outcome_is_plus == outcome.outcome_is_plus && GOD_clean == outcome.GOD_clean; }
};

Thought of doing like the above code. But I'm not getting the possible values that basis represent

Can you please help

MadhuMPandurangi avatar Mar 23 '23 04:03 MadhuMPandurangi