def METHOD_NAME(self, width):
    """Test synth_permutation_basic function produces the correct
    circuit."""
    np.random.seed(1)
    for _ in range(5):
        pattern = np.random.permutation(width)
        qc = synth_permutation_basic(pattern)
        # Check that the synthesized circuit consists of SWAP gates only.
        for instruction in qc.data:
            self.assertEqual(instruction.operation.name, "swap")
        # Construct a linear function from the synthesized circuit, and
        # check that its permutation pattern matches the original pattern.
        synthesized_pattern = LinearFunction(qc).permutation_pattern()
        self.assertTrue(np.array_equal(synthesized_pattern, pattern))