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

Refactor RuleEngine states #332

Merged
merged 1 commit into from
Feb 3, 2022

Conversation

zigen
Copy link
Contributor

@zigen zigen commented Dec 25, 2021

prev: #331

  • applied_rules : RuleEngine -> QubitRecord

This change is Reviewable

@zigen zigen force-pushed the refactor-rule-engine-states branch 2 times, most recently from cf77594 to eb698fe Compare December 27, 2021 05:56
@zigen zigen force-pushed the refactor-rule-engine-states branch from eb698fe to fb5cb0f Compare January 26, 2022 05:31
@zigen zigen marked this pull request as ready for review February 1, 2022 07:38
Copy link
Contributor

@Naphann Naphann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @Naphann and @zigen)


quisp/modules/QRSA/RuleEngine/RuleEngine.cc, line 1205 at r1 (raw file):

  realtime_controller->ReInitialize_StationaryQubit(qubit_record, false);
  qubit_record->setBusy(false);
  if (qubit_record->isAllocated()) {

do we need this check? If in the end we want it to always be false?

Copy link
Contributor

@Naphann Naphann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @Naphann and @zigen)


quisp/modules/QRSA/RuleEngine/RuleEngine.cc, line 1205 at r1 (raw file):

Previously, Naphann (Naphan Benchasattabuse) wrote…

do we need this check? If in the end we want it to always be false?

I mean, should setBusy care about the current state of the qubit?

Copy link
Contributor Author

@zigen zigen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @Naphann)


quisp/modules/QRSA/RuleEngine/RuleEngine.cc, line 1205 at r1 (raw file):

Previously, Naphann (Naphan Benchasattabuse) wrote…

I mean, should setBusy care about the current state of the qubit?

for now, setBusy cares about the current state of the qubit.
basically, I copied that from the original implementation.

error("Trying to set a busy qubit busy. Only free qubits can do that. Something is wrong...");

but it might be useless now. let's remove it later.

Copy link
Contributor

@Naphann Naphann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @Naphann and @zigen)


quisp/modules/QRSA/RuleEngine/RuleEngine.cc, line 1205 at r1 (raw file):

Previously, zigen (Kentaro "zigen" Teramoto) wrote…

for now, setBusy cares about the current state of the qubit.
basically, I copied that from the original implementation.

error("Trying to set a busy qubit busy. Only free qubits can do that. Something is wrong...");

but it might be useless now. let's remove it later.

Normally when a method can throw due to something like this I'd name it try in front. In this case it would betrySetBusy

Copy link
Contributor Author

@zigen zigen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @Naphann)


quisp/modules/QRSA/RuleEngine/RuleEngine.cc, line 1205 at r1 (raw file):

Previously, Naphann (Naphan Benchasattabuse) wrote…

Normally when a method can throw due to something like this I'd name it try in front. In this case it would betrySetBusy

that's a good idea!

Copy link
Contributor

@Naphann Naphann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all commit messages.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @Naphann and @zigen)


quisp/modules/QRSA/RuleEngine/RuleEngine.cc, line 1205 at r1 (raw file):

Previously, zigen (Kentaro "zigen" Teramoto) wrote…

that's a good idea!

I think I'll approve it for and let's change that later

Copy link
Contributor Author

@zigen zigen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on @Naphann)


quisp/modules/QRSA/RuleEngine/RuleEngine.cc, line 1205 at r1 (raw file):

Previously, Naphann (Naphan Benchasattabuse) wrote…

I think I'll approve it for and let's change that later

okay, let's refactor it later. thanks!

@zigen
Copy link
Contributor Author

zigen commented Feb 3, 2022

@Naphann thanks for reviewing, if it's okay, just LGTM it plz.

Copy link
Contributor

@Naphann Naphann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on @Naphann)

Copy link
Contributor

@Naphann Naphann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 3 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @zigen)

@zigen zigen merged commit 72faf5b into sfc-aqua:master Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants