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

Error with circuits with multiple registers #51

Closed
CorentinB78 opened this issue Jun 21, 2022 · 1 comment
Closed

Error with circuits with multiple registers #51

CorentinB78 opened this issue Jun 21, 2022 · 1 comment
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed
Milestone

Comments

@CorentinB78
Copy link

Qiskit circuits with several quantum registers fail at running on the simulator or on actual devices. The same circuit with just a single register or no register (default register I suppose) works without problem.

Steps to reproduce the problem

Example on the simulator. This does not work:

from qiskit import circuit
from qiskit_braket_provider import BraketLocalBackend

reg_a = circuit.QuantumRegister(1, "reg_A")
reg_b = circuit.QuantumRegister(1, "reg_B")
circ = circuit.QuantumCircuit(reg_a, reg_b)
circ.ry(1.0, 0)
circ.cx(0, 1)

device = BraketLocalBackend()

task = device.run(circ, shots=10)

while this works:

from qiskit import circuit
from qiskit_braket_provider import BraketLocalBackend

reg = circuit.QuantumRegister(2, "reg")
circ = circuit.QuantumCircuit(reg)
circ.ry(1.0, 0)
circ.cx(0, 1)

device = BraketLocalBackend()

task = device.run(circ, shots=10)

What is the current behavior?

ValueError: Operator qubit count 2 must be equal to size of target qubit set QubitSet([Qubit(0)])

What is the expected behavior?

It should work without error, or the error message should say that this is not supported.

@CorentinB78 CorentinB78 added the bug Something isn't working label Jun 21, 2022
@IceKhan13 IceKhan13 added the help wanted Extra attention is needed label Jun 21, 2022
@IceKhan13 IceKhan13 added this to the Release 0.0.3 milestone Jun 24, 2022
IceKhan13 pushed a commit that referenced this issue Jul 19, 2022
* adding registers mapping for correct execution
* using find_bit function instead of direct variable access
@IceKhan13
Copy link
Member

@CorentinB78 this should be resolved in #56.

We are working on tests for that. Meanwhile can you give it a try and report if you found something.

Thank you!

@IceKhan13 IceKhan13 modified the milestones: Release 0.0.3, 0.0.4 Dec 14, 2022
jcjaskula-aws added a commit to jcjaskula-aws/qiskit-braket-provider that referenced this issue Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants