def _compare_multiply_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>val = <NUM_LIT:2> * (np.random.rand() - <NUM_LIT:0.5>)<EOL>targ = SuperOp(val * sop1)<EOL>channel = SuperOp(rep(SuperOp(sop1)).multiply(val))<EOL>self.assertEqual(channel, targ)<EOL><DEDENT>
Test channel scalar multiplication is equivalent to SuperOp