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
I am getting the following failure when I call circuit_to_qasm_str from pytket.qasm:
[...]
from pytket.qasm import circuit_to_qasm_str
../../../.cache/pypoetry/virtualenvs/scc-uCUxejjC-py3.8/lib/python3.8/site-packages/pytket/qasm/__init__.py:19: in <module>
from .qasm import (
../../../.cache/pypoetry/virtualenvs/scc-uCUxejjC-py3.8/lib/python3.8/site-packages/pytket/qasm/qasm.py:277: in <module>
class CircuitTransformer(Transformer):
../../../.cache/pypoetry/virtualenvs/scc-uCUxejjC-py3.8/lib/python3.8/site-packages/pytket/qasm/qasm.py:759: in CircuitTransformer
def extern(self, tree: List[Any]) -> Type[Discard]:
/usr/lib/python3.8/typing.py:261: in inner
return func(*args, **kwds)
/usr/lib/python3.8/typing.py:685: in __getitem__
params = tuple(_type_check(p, msg) for p in params)
/usr/lib/python3.8/typing.py:685: in <genexpr>
params = tuple(_type_check(p, msg) for p in params)
/usr/lib/python3.8/typing.py:149: in _type_check
raise TypeError(f"{msg} Got {arg!r:.100}.")
E TypeError: Parameters to generic types must be types. Got lark.visitors.Discard.
(I think) this would make sense on python 3.9+ but I have been experiencing this on both python 3.9 (using the prebuilt Pytket at https://pypi.org/project/pytket/) and python 3.8 (using the wheel I built myself as per the topic: #786)
No the import works fine, it's just the call that fails.
Turns out my project and Pytket are using different versions of Lark. Downgrading to Lark 0.12 made the failure go away.
Lark is now at 1.1.5, and Pytket pulls 0.7
Hello @ss2165 and @cqc-alec,
I am getting the following failure when I call
circuit_to_qasm_str
frompytket.qasm
:(I think) this would make sense on python 3.9+ but I have been experiencing this on both python 3.9 (using the prebuilt Pytket at https://pypi.org/project/pytket/) and python 3.8 (using the wheel I built myself as per the topic: #786)
For reference the failing method is:
I'm not sure it should return
Discard
orType[Discard]
, and the cause might be somewhere else.Could you please shed some light on this ?
Best wishes,
The text was updated successfully, but these errors were encountered: