unitaria.verify¶
- unitaria.verify(node: Node, reference: ndarray | None = None, atol: float = 1e-08, **kwargs)[source]¶
Verify a node using the default
Verifier.This checks for
nodethatThe dimesions of
subspace_inandsubspace_outmatchdimension_inanddimension_out, and the total qubits of these subspaces matches the qubits incircuit.computeandcompute_adjointmatch and that their batched version are equivalent.computematches the circuit implementation given throughsubspace_in,subspace_out, andcircuit.
If one of these checks does not pass, the same tests will be run for all children to find out whether the implementation of this node, or one of its childrens is erroneous.
- Parameters:
node – The node to be checked.
reference – An optional reference, to which the circuit and matrix arithmetic implementations should be compared. For example for
Identity(1)one could passnp.eye(2).atol – Absolute tolerance when comparing to
referencekwargs – See
Verifier