-
Notifications
You must be signed in to change notification settings - Fork 285
Closed
Description
Consider the following rather simple program:
import projectq as pq
from projectq.ops import All, X, StatePreparation, Measure
from projectq import MainEngine
import projectq.setups.ibm as ibm_setup
backend = pq.backends.IBMBackend(user='XXX', password='XXX')
eng = MainEngine(backend, engine_list=ibm_setup.get_engine_list())
qureg = eng.allocate_qureg(4)
StatePreparation([0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) | qureg
All(Measure) | qureg
eng.flush()
which should be realizable by an application of X operations to some of the qubits.
On the IBM backend, it results in the following error:
RuntimeError: Circuit cannot be mapped without using Swaps. Mapping failed.
raised in:
' File "/home/cgogolin/.local/lib/python3.5/site-packages/projectq/cengines/_ibm5qubitmapper.py", line 137, in _run'
' raise RuntimeError("Circuit cannot be mapped without using "'
The same happens for any other StatePreparation of basis state, including the trivial one, which shouldn't do anything. On up to three qubits all basis state preparations work flawlessly.
After changing to the simulator by putting
backend = pq.backends.Simulator()
eng = MainEngine(backend)
instead of the corresponding lines in the code above, everything also works on four qubits.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels