-
Notifications
You must be signed in to change notification settings - Fork 33
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
Configure LinearDepthGreaterThan()
bloq to allow for multiple target qubits
#782
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain what's the use case for this? The interface looks very unintuitive to me.
I agree it's odd looking, but it's used in https://arxiv.org/abs/2306.08585 specifically in figure 7 for modular inverse. Open to thoughts on cleaning it up; this is what immediately made sense to me. |
Could you just add a CX gate controlled on the target of the original inequality target? |
Neither target will always be flipped from 0 to 1. So I don't think that would be an equivalent operation. |
We can always use a temporary ancilla and use that to do a multi target CX |
If you look at the construction, there already is an ancilla with the correct value that needs to be cnotted out to all the outputs. It's flanked by a compute/uncompute pattern per usual. In an ideal world, we'd have these first-class flanking operations so you could define a partial MultiTarget(bloq=GreaterThan(), n_targets=5) but that's sadly not the world we live in yet. So you could manually wrap the existing one-target greaterthan with a multitarget version composed of
all that being said -- this |
Add num_targets arg with default value 1 which allows us to have a bloq with multiple targets. Added functionality to classical simulation as well (for positive values).