You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default_qubit device should work with alternating regular gates and QAOA layers
Actual behavior
When the circuit includes both regular gates and QAOA layers, the wires of the layers may be converted to a tensor. This will fail the validate_device_wires method in the runtime check. set(wires) in validate_device_wires cannot convert it to a set.
Additional information
No response
Source code
n_nires = 4
dev = qml.device('default.qubit',wires = n_wires)
@qml.qnode(dev)
def circuit(params):
foriin range(n_wires):
qml.Hadamard(wires=i)
forjin range(depth):
qaoa.cost_layer(params[j][0],cost_h)
qaoa.mixer_layer(params[j][1],mixer_h)
return qml.expval(cost_h)
# It raises error if the `circuit` is called
Tracebacks
No response
System information
Cannot run circuit(s) on default.qubit as they contain wires not found on the device: {0, 1, 2, 3}
Existing GitHub issues
I have searched existing GitHub issues to make sure the issue does not already exist.
The text was updated successfully, but these errors were encountered:
Expected behavior
The
default_qubit
device should work with alternating regular gates and QAOA layersActual behavior
When the circuit includes both regular gates and QAOA layers, the
wires
of the layers may be converted to atensor
. This will fail thevalidate_device_wires
method in the runtime check.set(wires)
invalidate_device_wires
cannot convert it to a set.Additional information
No response
Source code
Tracebacks
No response
System information
Existing GitHub issues
The text was updated successfully, but these errors were encountered: