def _compare_negate_to_superop(self, rep, dim, samples, unitary=False):
for _ in range(samples):<EOL><INDENT>if unitary:<EOL><INDENT>mat1 = self.rand_matrix(dim, dim)<EOL>sop1 = np.kron(np.conj(mat1), mat1)<EOL><DEDENT>else:<EOL><INDENT>sop1 = self.rand_matrix(dim * dim, dim * dim)<EOL><DEDENT>targ = SuperOp(-<NUM_LIT:1> * sop1)<EOL>channel = SuperOp(-rep(SuperOp(sop1)))<EOL>self.assertEqual(channel, targ)<EOL><DEDENT>
Test negative channel is equivalent to SuperOp