-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Unable to Create Multi-Controlled Gates with More Than 3 Controls in Qiskit #12801
Comments
Thanks for finding this bug. This issue should be solved after #12752 will be merged. |
closing this issue since #12752 was merged |
Were you able to run the code from this issue after the merge? @ShellyGarion |
@Augusto12 - you should slightly update your code with the new parameter
gives the circuit:
|
@ShellyGarion's solution works, alternatively you could create the from qiskit.circuit import QuantumCircuit, Parameter
from qiskit.circuit.library import RYGate
theta1 = Parameter('θ1')
mcry = RYGate(theta1).control(4, ctrl_state=0)
qc = QuantumCircuit(5)
qc.append(mcry, range(5))
qc.draw() giving
|
Thanks! |
Hi again. With this approach, I can no longer access the parameters. The code:
Always returns ParameterView([]) |
This code:
outputs: |
Ok. @ShellyGarion , could you share your qc.data? When you shared qc.draw(), the printed circuit was without controls. I'm confused. |
@Augusto12 - you should slightly update your code as follows (note that in your original code you have printed the circuit
outputs:
|
In addition, the code that @Cryoris suggested above produces the following output (with the latest version of Qiskit).
outputs:
|
Environment
What is happening?
I am encountering an issue where I cannot create multi-controlled gates with more than 3 controls in Qiskit.
How can we reproduce the issue?
Code Example:
What should happen?
I got the error: TypeError: ParameterExpression with unbound parameters (dict_keys([Parameter(θ1)])) cannot be cast to a float.
Any suggestions?
No response
The text was updated successfully, but these errors were encountered: