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

Fix implementations of symbol_substitution() for boxes that cannot contain symbols. #1004

Merged
merged 8 commits into from
Sep 6, 2023

Conversation

cqc-alec
Copy link
Collaborator

@cqc-alec cqc-alec commented Sep 5, 2023

These were just returning a null Op_ptr.

Fixes #999 .

@cqc-alec cqc-alec requested a review from yao-cqc September 5, 2023 14:53
Copy link
Contributor

@yao-cqc yao-cqc left a comment

Choose a reason for hiding this comment

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

Is there a reason not to call the copy constructors?
e.g. return std::make_shared<Unitary1qBox>(*this);

Comment on lines 48 to 51
Op_ptr symbol_substitution(
const SymEngine::map_basic_basic &) const override {
return Op_ptr();
return std::make_shared<ConjugationBox>(compute_, action_, uncompute_);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

ConjugationBox should support symbols, but we can fix it in a separate PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Made an issue and added a comment.

@cqc-alec
Copy link
Collaborator Author

cqc-alec commented Sep 6, 2023

Is there a reason not to call the copy constructors? e.g. return std::make_shared<Unitary1qBox>(*this);

Is there a reason not to call the copy constructors? e.g. return std::make_shared<Unitary1qBox>(*this);

Good idea: done.

@cqc-alec cqc-alec requested a review from yao-cqc September 6, 2023 07:50
Copy link
Contributor

@yao-cqc yao-cqc left a comment

Choose a reason for hiding this comment

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

Thanks!

@cqc-alec cqc-alec merged commit 2255abb into develop Sep 6, 2023
33 checks passed
@cqc-alec cqc-alec deleted the bugfix/symseg branch September 6, 2023 08:43
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.

Segfault substituting symbols in circuit containing boxes
2 participants