-
Notifications
You must be signed in to change notification settings - Fork 616
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
[BUG] PhaseAdder not correct #6230
Comments
Hi @kevzos , thanks for opening the report! :) |
That's correct @KetpuntoG - could we raise a warning when |
Unfortunately that is not possible, the template has not information about |x> @justinpickering |
Thanks for confirming, @KetpuntoG. We can close this ticket as no further action is required. |
@justinpickering Thanks for your answers. |
Expected behavior
import pennylane as qml
x = 6
k = 7
mod = 4
x_wires =[0,1,2,3]
work_wire=[5]
dev = qml.device("default.qubit", shots=1)
@qml.qnode(dev)
def circuit():
qml.BasisEmbedding(x, wires=x_wires)
qml.QFT(wires=x_wires)
qml.PhaseAdder(k, x_wires, mod, work_wire)
qml.adjoint(qml.QFT)(wires=x_wires)
return qml.sample(wires=x_wires)
print(circuit())
#[0,0,0,1]
Actual behavior
#got [0 1 0 1]
#(6+7)mod 4 expect 1 ?
Additional information
No response
Source code
No response
Tracebacks
No response
System information
Name: PennyLane Version: 0.38.0 Summary: PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network. Home-page: https://github.com/PennyLaneAI/pennylane Author: Author-email: License: Apache License 2.0 Location: /root/anaconda3/envs/py310/lib/python3.10/site-packages Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, packaging, pennylane-lightning, requests, rustworkx, scipy, toml, typing-extensions Required-by: PennyLane_Lightning Platform info: Linux-3.10.0-1160.90.1.el7.x86_64-x86_64-with-glibc2.17 Python version: 3.10.0 Numpy version: 1.23.5 Scipy version: 1.10.0 Installed devices: - default.clifford (PennyLane-0.38.0) - default.gaussian (PennyLane-0.38.0) - default.mixed (PennyLane-0.38.0) - default.qubit (PennyLane-0.38.0) - default.qubit.autograd (PennyLane-0.38.0) - default.qubit.jax (PennyLane-0.38.0) - default.qubit.legacy (PennyLane-0.38.0) - default.qubit.tf (PennyLane-0.38.0) - default.qubit.torch (PennyLane-0.38.0) - default.qutrit (PennyLane-0.38.0) - default.qutrit.mixed (PennyLane-0.38.0) - default.tensor (PennyLane-0.38.0) - null.qubit (PennyLane-0.38.0) - lightning.qubit (PennyLane_Lightning-0.38.0)
Existing GitHub issues
The text was updated successfully, but these errors were encountered: