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

GroverOperator doesn't work properly in 'ibmq_qasm_simulator' #339

Closed
KetpuntoG opened this issue Oct 12, 2023 · 4 comments · Fixed by PennyLaneAI/pennylane#4668
Closed

Comments

@KetpuntoG
Copy link
Contributor

When running the Grover operator in the simulator we get the following error:

dev = qml.device('qiskit.ibmq', wires=6, backend='ibmq_qasm_simulator')

@qml.qnode(dev)
def circuit():
    
    qml.GroverOperator(wires = range(6))
    
    return qml.probs(wires = range(6))

circuit()
WireError: Did not find some of the wires <Wires = [3, 5, None]> on device with wires <Wires = [0, 1, 2, 3, 4, 5]>.

In default.qubit it works correctly.

Tested with version 0.32

@trbromley
Copy link
Contributor

Thanks @KetpuntoG! We should definitely get this fixed. Is it blocking any work you are doing now?

@albi3ro
Copy link
Contributor

albi3ro commented Oct 12, 2023

PennyLaneAI/pennylane#4668

Fixes so the error is now:

ValueError: At least one work wire is required to decompose operation: MultiControlledX

So still an error, but an error that informs the user how to not get the error.

@KetpuntoG
Copy link
Contributor Author

KetpuntoG commented Oct 12, 2023

It is not blocking me @trbromley
But that error is not something that the user can't solve right? @albi3ro

@albi3ro
Copy link
Contributor

albi3ro commented Oct 12, 2023

@KetpuntoG

GroverOperator(wires(0,1,2,3), work_wires="aux")

albi3ro added a commit to PennyLaneAI/pennylane that referenced this issue Oct 13, 2023
The default to `GroverOperator` for work wires was `None`. Unfortunately
this was being interpreted as `work_wires = Wires([None,])`. This PR
makes it so that `work_wires=None` is interpreted as `work_wires =
Wires([])`.

Fixes PennyLaneAI/pennylane-qiskit#339

---------

Co-authored-by: Matthew Silverman <[email protected]>
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 a pull request may close this issue.

3 participants