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
When a circuit cannot be compiled because gates are not available an error RecursionError: maximum recursion depth exceeded is generated. It would be better to generate an error indicating why the circuit cannot be compiled, e.g. CircuitRecursionError: cannot find circuit for [xxx].
A minimal example:
import projectq
from projectq import MainEngine
from projectq.ops import H, S, T, CZ, Z, X, Y
from projectq.setups import restrictedgateset
engine_list = restrictedgateset.get_engine_list(one_qubit_gates=(X,Y,Z, H,T,), two_qubit_gates=(CZ,))
engine_list+=[projectq.cengines.ManualMapper(lambda ii: ii)]
eng = MainEngine(backend=projectq.backends.CommandPrinter(),engine_list=engine_list ) # create a default compiler (the back-end is a simulator)
qubits=eng.allocate_qureg(2)
q0 = qubits[0]
H | q0
S | q0
eng.flush()
The text was updated successfully, but these errors were encountered:
Let me know if you have a special gate set in mind and what it is used for. Future version will support a discrete gate set to get estimates for error correction overheads...
By the way:
projectq.cengines.ManualMapper(lambda ii: ii)
One can probably remove this mapper by adapting the backend.
When a circuit cannot be compiled because gates are not available an error
RecursionError: maximum recursion depth exceeded
is generated. It would be better to generate an error indicating why the circuit cannot be compiled, e.g.CircuitRecursionError: cannot find circuit for [xxx]
.A minimal example:
The text was updated successfully, but these errors were encountered: