Replies: 2 comments
-
Hi there, thanks for raising this issue. The problem here is that a circuit parameter in lambeq is of type This is actually a bug we need to fix. I'll think about it! |
Beta Was this translation helpful? Give feedback.
0 replies
-
This is now solved by the 0.2.8 release. run
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello.
Why the following code does not work ? :
sentence = 'person runs program .'
diagram = remove_cups( parser.sentence2diagram( sentence ) )
circuit = ansatz( diagram )
print( model( [ circuit ] ) ) # OK #
print( model( [ from_tk( circuit.to_tk() ) ] ) ) # ERROR #
[[0.14473685 0.85526315]]
Unexpected exception formatting exception. Falling back to standard exception
Traceback (most recent call last):
File "/home/javier.valera/.local/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3378, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "/tmp/ipykernel_16444/2916265434.py", line 9, in
print( model( [ from_tk( circuit.to_tk() ) ] ) )
File "/home/javier.valera/.local/lib/python3.8/site-packages/lambeq/training/model.py", line 59, in call
return self.forward(*args, **kwds)
File "/home/javier.valera/.local/lib/python3.8/site-packages/lambeq/training/tket_model.py", line 131, in forward
return self.get_diagram_output(x)
File "/home/javier.valera/.local/lib/python3.8/site-packages/lambeq/training/tket_model.py", line 101, in get_diagram_output
*[diag_f(*self.weights) for diag_f in lambdified_diagrams],
File "/home/javier.valera/.local/lib/python3.8/site-packages/lambeq/training/tket_model.py", line 101, in
*[diag_f(*self.weights) for diag_f in lambdified_diagrams],
File "/home/javier.valera/.local/lib/python3.8/site-packages/discopy/monoidal.py", line 509, in
return lambda xs: self.id(self.dom).then((
File "/home/javier.valera/.local/lib/python3.8/site-packages/discopy/monoidal.py", line 510, in
self.id(left) @ box.lambdify(*symbols, **kwargs)(*xs)
File "/home/javier.valera/.local/lib/python3.8/site-packages/discopy/quantum/gates.py", line 321, in
return lambda *xs: type(self)(c_fn(*xs), distance=self.distance)
File "/home/javier.valera/.local/lib/python3.8/site-packages/discopy/quantum/gates.py", line 448, in
return lambda *xs: type(self)(data(*xs))
File "", line 2, in _lambdifygenerated
return runs__n.r@[email protected]_0
NameError: name 'runs__n' is not defined
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions