Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change basis from char to enum #476

Open
Naphann opened this issue Jan 20, 2023 · 4 comments
Open

Change basis from char to enum #476

Naphann opened this issue Jan 20, 2023 · 4 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@Naphann
Copy link
Contributor

Naphann commented Jan 20, 2023

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.

struct MeasurementOutcome {
char 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; }
};

@Naphann Naphann added the good first issue Good for newcomers label Jan 20, 2023
@MadhuMPandurangi
Copy link

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
Copy link
Contributor Author

Naphann commented Jan 22, 2023

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

@MadhuMPandurangi
Copy link

Thank you
I'll look into the documentation

@MadhuMPandurangi
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants