feat: linalg.jack_matmul now also works with non Obs valued matrices.

This commit is contained in:
Fabian Joswig 2021-11-18 11:49:46 +00:00
parent 28bf0f1701
commit 976d9c3f29
2 changed files with 40 additions and 11 deletions

View file

@ -205,7 +205,10 @@ def jack_matmul(*operands):
r = _exp_to_jack(operands[0])
for op in operands[1:]:
r = r @ _exp_to_jack(op)
if isinstance(op[0, 0], CObs):
r = r @ _exp_to_jack(op)
else:
r = r @ op
return _imp_from_jack(r)
else:
name = operands[0][0, 0].names[0]
@ -225,7 +228,10 @@ def jack_matmul(*operands):
r = _exp_to_jack(operands[0])
for op in operands[1:]:
r = r @ _exp_to_jack(op)
if isinstance(op[0, 0], Obs):
r = r @ _exp_to_jack(op)
else:
r = r @ op
return _imp_from_jack(r)