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

[BUG] qml.PhaseAdder adds "None" work_wire when this is not specified #6359

Open
1 task done
KetpuntoG opened this issue Oct 8, 2024 · 2 comments
Open
1 task done
Assignees
Labels
bug 🐛 Something isn't working

Comments

@KetpuntoG
Copy link
Contributor

KetpuntoG commented Oct 8, 2024

Expected behavior

qml.PhaseAdder(1, x_wires = [1,2]).wires

This should return

[1,2]

Actual behavior

The output is [1,2, None]

Additional information

Same issue with qml.OutAdder and qml.OutMultiplier

Source code

No response

Tracebacks

No response

System information

Name: PennyLane
Version: 0.39.0.dev20
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: /Users/guillermoalonso/Documents/GitHub/pennylane
Editable project location: /Users/guillermoalonso/Documents/GitHub/pennylane
Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, packaging, pennylane-lightning, requests, rustworkx, scipy, toml, typing_extensions
Required-by: PennyLane-Catalyst, PennyLane_Lightning

Platform info:           macOS-14.6.1-arm64-arm-64bit
Python version:          3.9.6
Numpy version:           1.26.4
Scipy version:           1.12.0
Installed devices:
- default.clifford (PennyLane-0.39.0.dev20)
- default.gaussian (PennyLane-0.39.0.dev20)
- default.mixed (PennyLane-0.39.0.dev20)
- default.qubit (PennyLane-0.39.0.dev20)
- default.qutrit (PennyLane-0.39.0.dev20)
- default.qutrit.mixed (PennyLane-0.39.0.dev20)
- default.tensor (PennyLane-0.39.0.dev20)
- null.qubit (PennyLane-0.39.0.dev20)
- reference.qubit (PennyLane-0.39.0.dev20)
- sparse.qubit (PennyLane-0.39.0.dev20)
- lightning.qubit (PennyLane-Lightning-0.38.0)
- nvidia.custatevec (PennyLane-Catalyst-0.8.1)
- nvidia.cutensornet (PennyLane-Catalyst-0.8.1)
- oqc.cloud (PennyLane-Catalyst-0.8.1)
- softwareq.qpp (PennyLane-Catalyst-0.8.1)

Existing GitHub issues

  • I have searched existing GitHub issues to make sure the issue does not already exist.
@KetpuntoG KetpuntoG added the bug 🐛 Something isn't working label Oct 8, 2024
@KetpuntoG KetpuntoG self-assigned this Oct 8, 2024
@albi3ro
Copy link
Contributor

albi3ro commented Oct 8, 2024

Might be time to reconsider forbidding None as a wire value.

@KetpuntoG
Copy link
Contributor Author

Might be time to reconsider forbidding None as a wire value.

I think that makes a lot of sense

albi3ro pushed a commit that referenced this issue Oct 15, 2024
Fixes a bug where `None` was added to the wires in `qml.PhaseAdder`,
`qml.Adder` and `qml.OutAdder`.

This PR resolves this issue:

#6359
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants