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

Examples PR 2: Deutch example #42

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kris524
Copy link

@kris524 kris524 commented Jul 17, 2022

Just to keep stuff clean, Ive made a new PR with the next batch of examples. Old example is here

@kris524 kris524 changed the title Examples PR 2: Deutch example New Examples 2 Jul 18, 2022
@kris524
Copy link
Author

kris524 commented Jul 18, 2022

Quick question: What can I use to substitute apply_function? Also, are there any new algorithms you would like to see as examples?

@Renmusxd
Copy link
Owner

apply_function is basically like a single line of program! So that would be the most likely substitute.

@Renmusxd
Copy link
Owner

Ill have some time to look over the PRs tomorrow - Thanks again!

@kris524 kris524 changed the title New Examples 2 Examples PR 2: Deutch example Jul 23, 2022
use qip::builder_traits::UnitaryBuilder;
#[cfg(feature = "macros")]
use qip::prelude::*;
#[cfg(feature = "macros")]
Copy link
Owner

Choose a reason for hiding this comment

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

This was a mistake in the macro_example but is correct in inverse_example -- you only need the #[cfg(...)] above the use qip_macros::program; since the others all exist even if the macros feature isn't being used.

Copy link
Author

Choose a reason for hiding this comment

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

Got it. Thank you for the feedback!


#[cfg(feature = "macros")]
fn apply_oracle<F>(
b: &mut dyn UnitaryBuilder,
Copy link
Owner

Choose a reason for hiding this comment

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

UnitaryBuilder doesn't exist anymore - please replace with LocalBuilder or a generic trait.

Copy link
Owner

Choose a reason for hiding this comment

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

Sorry, it does exist but isn't meant to be used with dyn - rather just as a generic trait. So switch to either generics or the LocalBuilder struct.

@Renmusxd Renmusxd marked this pull request as draft August 3, 2022 16:08
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