@pavoljuhas noted in a comment on PR quantumlib/qsim#857 that as things stand now, cirq.unitary(…) may return a non-unitary value, which means that it's possible for cirq_unitary(cirq.unitary(val)) to fail when cirq.unitary(val) works.
This became possible after PR #7419 added checks in the case of NumPy arrays. This is arguably the right behavior, in the sense that cirq.unitary(…) is supposed to return a unitary but previously would simply return the argument unverified when the argument was a NumPy array. Now it won't do that, but the other strategies used by cirq.unitary(…) don't do similar checks, and that leads to the possibility of new inconsistent behaviors.
@pavoljuhas noted in a comment on PR quantumlib/qsim#857 that as things stand now,
cirq.unitary(…)may return a non-unitary value, which means that it's possible forcirq_unitary(cirq.unitary(val))to fail whencirq.unitary(val)works.This became possible after PR #7419 added checks in the case of NumPy arrays. This is arguably the right behavior, in the sense that
cirq.unitary(…)is supposed to return a unitary but previously would simply return the argument unverified when the argument was a NumPy array. Now it won't do that, but the other strategies used bycirq.unitary(…)don't do similar checks, and that leads to the possibility of new inconsistent behaviors.