sfc-aqua / quisp

Open source implementation of quantum internet simulation package
BSD 3-Clause "New" or "Revised" License
86 stars 36 forks source link

Change basis from char to enum #476

Open Naphann opened 1 year ago

Naphann commented 1 year ago

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

MadhuMPandurangi commented 1 year ago

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

Naphann commented 1 year ago

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

MadhuMPandurangi commented 1 year ago

Thank you I'll look into the documentation

MadhuMPandurangi commented 1 year ago

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