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

Casting complex values to reals when applying Controlled Gates in Lightning-Kokkos #940

Open
maliasadi opened this issue Oct 8, 2024 · 0 comments

Comments

@maliasadi
Copy link
Member

Issue description

Applying controlled gates in Lightning-Kokkos will raise ComplexWarnings complaining about some unnecessary casting complex values to real:

@qml.qnode(qml.device("lightning.kokkos", wires=4))
def circuit():
    qml.PauliZ(0)
    qml.ctrl(qml.PauliZ(0), control=[1,2,3])
    return qml.probs()

>>> circuit()
./pennylane_lightning/lightning_kokkos/_state_vector.py:204: ComplexWarning: Casting complex values to real discards the imaginary part
  • System information:
Name: PennyLane
Version: 0.38.0
Required-by: PennyLane-qiskit, PennyLane_Lightning, PennyLane_Lightning_Kokkos, qml_benchmarks

Platform info:           Linux-6.8.0-45-generic-x86_64-with-glibc2.35
Python version:          3.11.8
Numpy version:           1.26.4
Scipy version:           1.14.1
Installed devices:
- lightning.qubit (PennyLane_Lightning-0.39.0.dev40)
- lightning.kokkos (PennyLane_Lightning_Kokkos-0.39.0.dev40)
- default.mixed (PennyLane-0.38.0)
- default.qubit (PennyLane-0.38.0)
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

No branches or pull requests

1 participant