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
Since #308, in qiskit we allow non-string identifiers for qreg, creg, and circuits. This is creating a problem for non-python components, for example the c++ simulator. In c++ you have to assume a type for each parsed value, so its hard to accommodate "any" type. Another major issue is compatibility with the OpenQASM spec, which requires identifiers to begin with a letter (i.e. be strings).
Plus, I don't really understand the use case for allowing types other than strings. I know PR #308 was in response to issue #290, but if you want to number your registers or circuits, you can make those string numbers. Also, the ease of use has been addressed since we have now made names optional, and you can rely on auto-naming (via PR #346 and PR #376)
So.. I think we should roll back most of #308, and enforce string ID tokens.
Steps to Reproduce (for bugs)
The following code fails on the cpp simulator. It uses a number as circuit name identifier.
import qiskit as qk
from qiskit._compiler import compile, execute
from pprint import pprint
from qiskit.backends.local import QasmSimulator, QasmSimulatorCpp
qr = qk.QuantumRegister(2, 0)
cr = qk.ClassicalRegister(2, "")
qc = qk.QuantumCircuit(qr, cr, name=10)
qc.h(qr[0])
qc.measure(qr[0], cr[0])
backend = QasmSimulatorCpp()
result = execute(qc, backend=backend)
pprint(result._qobj)
pprint(result._result)
Context
I am trying to make sure cross-compatibility between the python and cpp simulators. This is a problem there.
Your Environment
Version used:
Environment name and version (e.g. Python 3.6.1):
Operating System and version:
The text was updated successfully, but these errors were encountered:
Since #308, in qiskit we allow non-string identifiers for qreg, creg, and circuits. This is creating a problem for non-python components, for example the c++ simulator. In c++ you have to assume a type for each parsed value, so its hard to accommodate "any" type. Another major issue is compatibility with the OpenQASM spec, which requires identifiers to begin with a letter (i.e. be strings).
Plus, I don't really understand the use case for allowing types other than strings. I know PR #308 was in response to issue #290, but if you want to number your registers or circuits, you can make those string numbers. Also, the ease of use has been addressed since we have now made names optional, and you can rely on auto-naming (via PR #346 and PR #376)
So.. I think we should roll back most of #308, and enforce string ID tokens.
Steps to Reproduce (for bugs)
The following code fails on the cpp simulator. It uses a number as circuit name identifier.
Context
I am trying to make sure cross-compatibility between the python and cpp simulators. This is a problem there.
Your Environment
The text was updated successfully, but these errors were encountered: