Repository: Qiskit/qiskit

Issue:
Validate input when setting the QuantumCircuit data attribute directly
Similar to #2170 , but for `QuantumCircuit`. The possibility of arbitrary data in `circuit.data` makes modifying or replacing the internals of `QuantumCircuit` difficult and error prone (see discussion around `circuit._append` in #2824 ). We should:
- Move `circuit.data` to `circuit._data`
- Add a getter for `circuit.data` and document it as a ordered list of `(Instruction, qargs, cargs)`. It's an open question whether or not we should commit to preserving user-insertion order.
- Add a setter for `circuit.data` with a `DeprecationWarning`, directing users to e.g. `QuantumCircuit.append` and the rest of the circuit API.


Discussion:
@mtreinish can you take this one please?

Resolving patch:
diff --git a/qiskit/circuit/quantumcircuit.py b/qiskit/circuit/quantumcircuit.py
--- a/qiskit/circuit/quantumcircuit.py
+++ b/qiskit/circuit/quantumcircuit.py
@@ -31,6 +31,7 @@
 from .instructionset import InstructionSet
 from .register import Register
 from .bit import Bit
+from .quantumcircuitdata import QuantumCircuitData
 
 
 def _is_bit(obj):
@@ -89,7 +90,7 @@ def __init__(self, *regs, name=None):
 
         # Data contains a list of instructions and their contexts,
         # in the order they were applied.
-        self.data = []
+        self._data = []
 
         # This is a map of registers bound to this circuit, by name.
         self.qregs = []
@@ -101,6 +102,38 @@ def __init__(self, *regs, name=None):
 
         self._layout = None
 
+    @property
+    def data(self):
+        """Return the circuit data (instructions and context)
+
+        Returns:
+            QuantumCircuitData: a list-like object containing the tuples for the
+               circuit's data. Each tuple is in the format (instruction, qargs,
+               cargs). Where instruction is an Instruction (or subclass) object,
+               qargs is a list of Qubit objects, and cargs is a list of Clbit
+               objects.
+        """
+        return QuantumCircuitData(self)
+
+    @data.setter
+    def data(self, data_input):
+        """Sets the circuit data from a list of instructions and context.
+
+        Args:
+            data_input (list): A list of instructions with context
+                in the format (instruction, qargs, cargs). Where Instruction
+                is an Instruction (or subclass) object, qargs is a list of
+                Qubit objects, and cargs is a list of Clbit objects.
+        """
+
+        # If data_input is QuantumCircuitData(self), clearing self._data
+        # below will also empty data_input, so make a shallow copy first.
+        data_input = data_input.copy()
+        self._data = []
+
+        for inst, qargs, cargs in data_input:
+            self.append(inst, qargs, cargs)
+
     def __str__(self):
         return str(self.draw(output='text'))
 
@@ -153,9 +186,9 @@ def mirror(self):
             QuantumCircuit: the mirrored circuit
         """
         reverse_circ = self.copy(name=self.name + '_mirror')
-        reverse_circ.data = []
+        reverse_circ._data = []
         for inst, qargs, cargs in reversed(self.data):
-            reverse_circ.data.append((inst.mirror(), qargs, cargs))
+            reverse_circ.append((inst.mirror(), qargs, cargs))
         return reverse_circ
 
     def inverse(self):
@@ -170,9 +203,9 @@ def inverse(self):
             QiskitError: if the circuit cannot be inverted.
         """
         inverse_circ = self.copy(name=self.name + '_dg')
-        inverse_circ.data = []
-        for inst, qargs, cargs in reversed(self.data):
-            inverse_circ.data.append((inst.inverse(), qargs, cargs))
+        inverse_circ._data = []
+        for inst, qargs, cargs in reversed(self._data):
+            inverse_circ._data.append((inst.inverse(), qargs, cargs))
         return inverse_circ
 
     def combine(self, rhs):
@@ -255,11 +288,11 @@ def __iadd__(self, rhs):
 
     def __len__(self):
         """Return number of operations in circuit."""
-        return len(self.data)
+        return len(self._data)
 
     def __getitem__(self, item):
         """Return indexed operation."""
-        return self.data[item]
+        return self._data[item]
 
     @staticmethod
     def cast(value, _type):
@@ -385,9 +418,13 @@ def _append(self, instruction, qargs, cargs):
 
         # add the instruction onto the given wires
         instruction_context = instruction, qargs, cargs
-        self.data.append(instruction_context)
+        self._data.append(instruction_context)
+
+        self._update_parameter_table(instruction)
+
+        return instruction
 
-        # track variable parameters in instruction
+    def _update_parameter_table(self, instruction):
         for param_index, param in enumerate(instruction.params):
             if isinstance(param, ParameterExpression):
                 current_parameters = self.parameters
@@ -508,7 +545,7 @@ def qasm(self):
             string_temp += register.qasm() + "\n"
         for register in self.cregs:
             string_temp += register.qasm() + "\n"
-        for instruction, qargs, cargs in self.data:
+        for instruction, qargs, cargs in self._data:
             if instruction.name == 'measure':
                 qubit = qargs[0]
                 clbit = cargs[0]
@@ -601,7 +638,7 @@ def size(self):
             int: Total number of gate operations.
         """
         gate_ops = 0
-        for instr, _, _ in self.data:
+        for instr, _, _ in self._data:
             if instr.name not in ['barrier', 'snapshot']:
                 gate_ops += 1
         return gate_ops
@@ -640,7 +677,7 @@ def depth(self):
         # We treat barriers or snapshots different as
         # They are transpiler and simulator directives.
         # The max stack height is the circuit depth.
-        for instr, qargs, cargs in self.data:
+        for instr, qargs, cargs in self._data:
             levels = []
             reg_ints = []
             # If count then add one to stack heights
@@ -698,7 +735,7 @@ def count_ops(self):
             OrderedDict: a breakdown of how many operations of each kind, sorted by amount.
         """
         count_ops = {}
-        for instr, _, _ in self.data:
+        for instr, _, _ in self._data:
             if instr.name in count_ops.keys():
                 count_ops[instr.name] += 1
             else:
@@ -733,7 +770,7 @@ def num_connected_components(self, unitary_only=False):
 
         # Here we are traversing the gates and looking to see
         # which of the sub_graphs the gate joins together.
-        for instr, qargs, cargs in self.data:
+        for instr, qargs, cargs in self._data:
             if unitary_only:
                 args = qargs
                 num_qargs = len(args)
diff --git a/qiskit/circuit/quantumcircuitdata.py b/qiskit/circuit/quantumcircuitdata.py
new file mode 100644
--- /dev/null
+++ b/qiskit/circuit/quantumcircuitdata.py
@@ -0,0 +1,115 @@
+# -*- coding: utf-8 -*-
+
+# This code is part of Qiskit.
+#
+# (C) Copyright IBM 2019.
+#
+# This code is licensed under the Apache License, Version 2.0. You may
+# obtain a copy of this license in the LICENSE.txt file in the root directory
+# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
+#
+# Any modifications or derivative works of this code must retain this
+# copyright notice, and modified files need to carry a notice indicating
+# that they have been altered from the originals.
+
+"""A wrapper class for the purposes of validating modifications to
+QuantumCircuit.data while maintaining the interface of a python list."""
+
+from collections.abc import MutableSequence
+
+from qiskit.exceptions import QiskitError
+from qiskit.circuit.instruction import Instruction
+
+
+class QuantumCircuitData(MutableSequence):
+    """A wrapper class for the purposes of validating modifications to
+    QuantumCircuit.data while maintaining the interface of a python list."""
+
+    def __init__(self, circuit):
+        self._circuit = circuit
+
+    def __getitem__(self, i):
+        return self._circuit._data[i]
+
+    def __setitem__(self, key, value):
+        instruction, qargs, cargs = value
+
+        if not isinstance(instruction, Instruction) \
+           and hasattr(instruction, 'to_instruction'):
+            instruction = instruction.to_instruction()
+
+        expanded_qargs = [self._circuit.qbit_argument_conversion(qarg)
+                          for qarg in qargs or []]
+        expanded_cargs = [self._circuit.cbit_argument_conversion(carg)
+                          for carg in cargs or []]
+
+        broadcast_args = list(instruction.broadcast_arguments(expanded_qargs,
+                                                              expanded_cargs))
+
+        if len(broadcast_args) > 1:
+            raise QiskitError('QuantumCircuit.data modification does not '
+                              'support argument broadcasting.')
+
+        qargs, cargs = broadcast_args[0]
+
+        if not isinstance(instruction, Instruction):
+            raise QiskitError('object is not an Instruction.')
+
+        self._circuit._check_dups(qargs)
+        self._circuit._check_qargs(qargs)
+        self._circuit._check_cargs(cargs)
+
+        self._circuit._data[key] = (instruction, qargs, cargs)
+
+        self._circuit._update_parameter_table(instruction)
+
+    def insert(self, index, value):
+        self._circuit._data.insert(index, None)
+        self[index] = value
+
+    def __delitem__(self, i):
+        del self._circuit._data[i]
+
+    def __len__(self):
+        return len(self._circuit._data)
+
+    def __cast(self, other):
+        return other._circuit._data if isinstance(other, QuantumCircuitData) else other
+
+    def __repr__(self):
+        return repr(self._circuit._data)
+
+    def __lt__(self, other):
+        return self._circuit._data < self.__cast(other)
+
+    def __le__(self, other):
+        return self._circuit._data <= self.__cast(other)
+
+    def __eq__(self, other):
+        return self._circuit._data == self.__cast(other)
+
+    def __gt__(self, other):
+        return self._circuit._data > self.__cast(other)
+
+    def __ge__(self, other):
+        return self._circuit._data >= self.__cast(other)
+
+    def __add__(self, other):
+        return self._circuit._data + self.__cast(other)
+
+    def __radd__(self, other):
+        return self.__cast(other) + self._circuit._data
+
+    def __mul__(self, n):
+        return self._circuit._data * n
+
+    def __rmul__(self, n):
+        return n * self._circuit._data
+
+    def sort(self, *args, **kwargs):
+        """In-place stable sort. Accepts arguments of list.sort."""
+        self._circuit._data.sort(*args, **kwargs)
+
+    def copy(self):
+        """Returns a shallow copy of instruction list."""
+        return self._circuit._data.copy()


Test patch:
diff --git a/test/python/circuit/test_circuit_data.py b/test/python/circuit/test_circuit_data.py
new file mode 100644
--- /dev/null
+++ b/test/python/circuit/test_circuit_data.py
@@ -0,0 +1,400 @@
+# -*- coding: utf-8 -*-
+
+# This code is part of Qiskit.
+#
+# (C) Copyright IBM 2017, 2019.
+#
+# This code is licensed under the Apache License, Version 2.0. You may
+# obtain a copy of this license in the LICENSE.txt file in the root directory
+# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
+#
+# Any modifications or derivative works of this code must retain this
+# copyright notice, and modified files need to carry a notice indicating
+# that they have been altered from the originals.
+
+"""Test operations on circuit.data."""
+
+from qiskit.circuit import QuantumCircuit, QuantumRegister
+from qiskit.extensions.standard import HGate, XGate, CnotGate
+
+from qiskit.test import QiskitTestCase
+from qiskit.exceptions import QiskitError
+
+
+class TestQuantumCircuitInstructionData(QiskitTestCase):
+    """QuantumCircuit.data operation tests."""
+
+    # N.B. Most of the cases here are not expected use cases of circuit.data
+    # but are included as tests to maintain compatability with the previous
+    # list interface of circuit.data.
+
+    def test_getitem_by_insertion_order(self):
+        """Verify one can get circuit.data items in insertion order."""
+        qr = QuantumRegister(2)
+        qc = QuantumCircuit(qr)
+        qc.h(0)
+        qc.cx(0, 1)
+        qc.h(1)
+
+        data = qc.data
+
+        self.assertEqual(data[0], (HGate(), [qr[0]], []))
+        self.assertEqual(data[1], (CnotGate(), [qr[0], qr[1]], []))
+        self.assertEqual(data[2], (HGate(), [qr[1]], []))
+
+    def test_count_gates(self):
+        """Verify circuit.data can count inst/qarg/carg tuples."""
+        qr = QuantumRegister(2)
+        qc = QuantumCircuit(qr)
+        qc.h(0)
+        qc.x(0)
+        qc.h(1)
+        qc.h(0)
+
+        data = qc.data
+
+        self.assertEqual(data.count((HGate(), [qr[0]], [])), 2)
+
+    def test_len(self):
+        """Verify finding the length of circuit.data."""
+        qr = QuantumRegister(2)
+        qc = QuantumCircuit(qr)
+
+        self.assertEqual(len(qc.data), 0)
+        qc.h(0)
+        self.assertEqual(len(qc.data), 1)
+        qc.cx(0, 1)
+        self.assertEqual(len(qc.data), 2)
+
+    def test_contains(self):
+        """Verify checking if a inst/qarg/carg tuple is in circuit.data."""
+        qr = QuantumRegister(2)
+        qc = QuantumCircuit(qr)
+
+        qc.h(0)
+
+        self.assertTrue((HGate(), [qr[0]], []) in qc.data)
+        self.assertFalse((HGate(), [qr[1]], []) in qc.data)
+        self.assertFalse((XGate(), [qr[0]], []) in qc.data)
+
+    def test_index_gates(self):
+        """Verify finding the index of a inst/qarg/carg tuple in circuit.data."""
+        qr = QuantumRegister(2)
+        qc = QuantumCircuit(qr)
+
+        qc.h(0)
+        qc.cx(0, 1)
+        qc.h(1)
+        qc.h(0)
+
+        self.assertEqual(qc.data.index((HGate(), [qr[0]], [])), 0)
+        self.assertEqual(qc.data.index((CnotGate(), [qr[0], qr[1]], [])), 1)
+        self.assertEqual(qc.data.index((HGate(), [qr[1]], [])), 2)
+
+    def test_iter(self):
+        """Verify circuit.data can behave as an iterator."""
+        qr = QuantumRegister(2)
+        qc = QuantumCircuit(qr)
+
+        qc.h(0)
+        qc.cx(0, 1)
+        qc.h(1)
+
+        iter_ = iter(qc.data)
+        self.assertEqual(next(iter_), (HGate(), [qr[0]], []))
+        self.assertEqual(next(iter_), (CnotGate(), [qr[0], qr[1]], []))
+        self.assertEqual(next(iter_), (HGate(), [qr[1]], []))
+        self.assertRaises(StopIteration, next, iter_)
+
+    def test_slice(self):
+        """Verify circuit.data can be sliced."""
+        qr = QuantumRegister(2)
+        qc = QuantumCircuit(qr)
+
+        qc.h(0)
+        qc.cx(0, 1)
+        qc.h(1)
+        qc.cx(1, 0)
+        qc.h(1)
+        qc.cx(0, 1)
+        qc.h(0)
+
+        h_slice = qc.data[::2]
+        cx_slice = qc.data[1:-1:2]
+
+        self.assertEqual(h_slice, [
+            (HGate(), [qr[0]], []),
+            (HGate(), [qr[1]], []),
+            (HGate(), [qr[1]], []),
+            (HGate(), [qr[0]], []),
+        ])
+        self.assertEqual(cx_slice, [
+            (CnotGate(), [qr[0], qr[1]], []),
+            (CnotGate(), [qr[1], qr[0]], []),
+            (CnotGate(), [qr[0], qr[1]], []),
+        ])
+
+    def test_copy(self):
+        """Verify one can create a shallow copy circuit.data."""
+        qr = QuantumRegister(2)
+        qc = QuantumCircuit(qr)
+
+        qc.h(0)
+        qc.cx(0, 1)
+        qc.h(1)
+
+        data_copy = qc.data.copy()
+
+        self.assertEqual(data_copy, qc.data)
+
+    def test_repr(self):
+        """Verify circuit.data repr."""
+        qr = QuantumRegister(2)
+        qc = QuantumCircuit(qr)
+
+        # pylint: disable=invalid-name
+        g1 = qc.h(0)
+        g2 = qc.cx(0, 1)
+        g3 = qc.h(1)
+
+        self.assertEqual(
+            repr(qc.data),
+            "[({}, {}, {}), ({}, {}, {}), ({}, {}, {})]".format(
+                repr(g1.instructions[0]), repr(g1.qargs[0]), repr(g1.cargs[0]),
+                repr(g2.instructions[0]), repr(g2.qargs[0]), repr(g2.cargs[0]),
+                repr(g3.instructions[0]), repr(g3.qargs[0]), repr(g3.cargs[0])))
+
+    def test_str(self):
+        """Verify circuit.data string representation."""
+        qr = QuantumRegister(2)
+        qc = QuantumCircuit(qr)
+
+        # pylint: disable=invalid-name
+        g1 = qc.h(0)
+        g2 = qc.cx(0, 1)
+        g3 = qc.h(1)
+
+        self.assertEqual(
+            str(qc.data),
+            "[({}, {}, {}), ({}, {}, {}), ({}, {}, {})]".format(
+                repr(g1.instructions[0]), repr(g1.qargs[0]), repr(g1.cargs[0]),
+                repr(g2.instructions[0]), repr(g2.qargs[0]), repr(g2.cargs[0]),
+                repr(g3.instructions[0]), repr(g3.qargs[0]), repr(g3.cargs[0])))
+
+    def test_remove_gate(self):
+        """Verify removing a gate via circuit.data.remove."""
+        qr = QuantumRegister(2)
+        qc = QuantumCircuit(qr)
+
+        qc.h(0)
+        qc.cx(0, 1)
+        qc.h(1)
+        qc.h(0)
+
+        qc.data.remove((HGate(), [qr[0]], []))
+
+        expected_qc = QuantumCircuit(qr)
+
+        expected_qc.cx(0, 1)
+        expected_qc.h(1)
+        expected_qc.h(0)
+
+        self.assertEqual(qc, expected_qc)
+
+    def test_del(self):
+        """Verify removing a gate via circuit.data.delattr."""
+        qr = QuantumRegister(2)
+        qc = QuantumCircuit(qr)
+
+        qc.h(0)
+        qc.cx(0, 1)
+        qc.h(1)
+        qc.h(0)
+
+        del qc.data[0]
+
+        expected_qc = QuantumCircuit(qr)
+
+        expected_qc.cx(0, 1)
+        expected_qc.h(1)
+        expected_qc.h(0)
+
+        self.assertEqual(qc, expected_qc)
+
+    def test_pop_gate(self):
+        """Verify removing a gate via circuit.data.pop."""
+        qr = QuantumRegister(2)
+        qc = QuantumCircuit(qr)
+
+        qc.h(0)
+        qc.cx(0, 1)
+        qc.h(1)
+
+        last_h = qc.data.pop()
+
+        expected_qc = QuantumCircuit(qr)
+
+        expected_qc.h(0)
+        expected_qc.cx(0, 1)
+
+        self.assertEqual(qc, expected_qc)
+        self.assertEqual(last_h, (HGate(), [qr[1]], []))
+
+    def test_clear_gates(self):
+        """Verify emptying a circuit via circuit.data.clear."""
+        qr = QuantumRegister(2)
+        qc = QuantumCircuit(qr)
+
+        qc.h(0)
+        qc.cx(0, 1)
+        qc.h(1)
+
+        qc.data.clear()
+
+        self.assertEqual(qc.data, [])
+
+    def test_reverse_gates(self):
+        """Verify reversing a circuit via circuit.data.reverse."""
+        qr = QuantumRegister(2)
+        qc = QuantumCircuit(qr)
+
+        qc.h(0)
+        qc.cx(0, 1)
+        qc.h(1)
+
+        qc.data.reverse()
+
+        expected_qc = QuantumCircuit(qr)
+
+        expected_qc.h(1)
+        expected_qc.cx(0, 1)
+        expected_qc.h(0)
+
+        self.assertEqual(qc, expected_qc)
+
+    def test_repeating_a_circuit_via_mul(self):
+        """Verify repeating a circuit via circuit.data.__mul__."""
+        qr = QuantumRegister(2)
+        qc = QuantumCircuit(qr)
+
+        qc.h(0)
+        qc.cx(0, 1)
+        qc.h(1)
+
+        qc.data *= 2
+
+        expected_qc = QuantumCircuit(qr)
+
+        expected_qc.h(0)
+        expected_qc.cx(0, 1)
+        expected_qc.h(1)
+        expected_qc.h(0)
+        expected_qc.cx(0, 1)
+        expected_qc.h(1)
+
+        self.assertEqual(qc, expected_qc)
+
+    def test_add_radd(self):
+        """Verify adding lists of gates via circuit.data.__add__."""
+        qr = QuantumRegister(2)
+        qc1 = QuantumCircuit(qr)
+
+        qc1.h(0)
+        qc1.cx(0, 1)
+        qc1.h(1)
+
+        qc2 = QuantumCircuit(qr)
+        qc2.cz(0, 1)
+
+        qc1.data += qc2.data
+
+        expected_qc = QuantumCircuit(qr)
+
+        expected_qc.h(0)
+        expected_qc.cx(0, 1)
+        expected_qc.h(1)
+        expected_qc.cz(0, 1)
+
+        self.assertEqual(qc1, expected_qc)
+
+    def test_append_is_validated(self):
+        """Verify appended gates via circuit.data are broadcast and validated."""
+        qr = QuantumRegister(2)
+        qc = QuantumCircuit(qr)
+
+        qc.data.append((HGate(), [qr[0]], []))
+        qc.data.append((CnotGate(), [0, 1], []))
+        qc.data.append((HGate(), [(qr, 1)], []))
+
+        expected_qc = QuantumCircuit(qr)
+
+        expected_qc.h(0)
+        expected_qc.cx(0, 1)
+        expected_qc.h(1)
+
+        self.assertEqual(qc, expected_qc)
+
+        self.assertRaises(QiskitError, qc.data.append, (HGate(), [qr[0], qr[1]], []))
+        self.assertRaises(QiskitError, qc.data.append, (HGate(), [], [qr[0]]))
+
+    def test_insert_is_validated(self):
+        """Verify inserting gates via circuit.data are broadcast and validated."""
+        qr = QuantumRegister(2)
+        qc = QuantumCircuit(qr)
+
+        qc.data.insert(0, (HGate(), [qr[0]], []))
+        qc.data.insert(1, (CnotGate(), [0, 1], []))
+        qc.data.insert(2, (HGate(), [(qr, 1)], []))
+
+        expected_qc = QuantumCircuit(qr)
+
+        expected_qc.h(0)
+        expected_qc.cx(0, 1)
+        expected_qc.h(1)
+
+        self.assertEqual(qc, expected_qc)
+
+        self.assertRaises(QiskitError, qc.data.insert, 0, (HGate(), [qr[0], qr[1]], []))
+        self.assertRaises(QiskitError, qc.data.insert, 0, (HGate(), [], [qr[0]]))
+
+    def test_extend_is_validated(self):
+        """Verify extending circuit.data is broadcast and validated."""
+        qr = QuantumRegister(2)
+        qc = QuantumCircuit(qr)
+
+        qc.data.extend([(HGate(), [qr[0]], []),
+                        (CnotGate(), [0, 1], []),
+                        (HGate(), [(qr, 1)], [])])
+
+        expected_qc = QuantumCircuit(qr)
+
+        expected_qc.h(0)
+        expected_qc.cx(0, 1)
+        expected_qc.h(1)
+
+        self.assertEqual(qc, expected_qc)
+
+        self.assertRaises(QiskitError, qc.data.extend, [(HGate(), [qr[0], qr[1]], [])])
+        self.assertRaises(QiskitError, qc.data.extend, [(HGate(), [], [qr[0]])])
+
+    def test_setting_data_is_validated(self):
+        """Verify setting circuit.data is broadcast and validated."""
+        qr = QuantumRegister(2)
+        qc = QuantumCircuit(qr)
+
+        qc.data = [(HGate(), [qr[0]], []),
+                   (CnotGate(), [0, 1], []),
+                   (HGate(), [(qr, 1)], [])]
+
+        expected_qc = QuantumCircuit(qr)
+
+        expected_qc.h(0)
+        expected_qc.cx(0, 1)
+        expected_qc.h(1)
+
+        self.assertEqual(qc, expected_qc)
+
+        with self.assertRaises(QiskitError):
+            qc.data = [(HGate(), [qr[0], qr[1]], [])]
+        with self.assertRaises(QiskitError):
+            qc.data = [(HGate(), [], [qr[0]])]
diff --git a/test/python/pickles/TestsBasicSwap_a_cx_to_map.pickle b/test/python/pickles/TestsBasicSwap_a_cx_to_map.pickle
Binary files a/test/python/pickles/TestsBasicSwap_a_cx_to_map.pickle and b/test/python/pickles/TestsBasicSwap_a_cx_to_map.pickle differ
diff --git a/test/python/pickles/TestsBasicSwap_handle_measurement.pickle b/test/python/pickles/TestsBasicSwap_handle_measurement.pickle
Binary files a/test/python/pickles/TestsBasicSwap_handle_measurement.pickle and b/test/python/pickles/TestsBasicSwap_handle_measurement.pickle differ
diff --git a/test/python/pickles/TestsBasicSwap_initial_layout.pickle b/test/python/pickles/TestsBasicSwap_initial_layout.pickle
Binary files a/test/python/pickles/TestsBasicSwap_initial_layout.pickle and b/test/python/pickles/TestsBasicSwap_initial_layout.pickle differ
diff --git a/test/python/pickles/TestsLookaheadSwap_a_cx_to_map.pickle b/test/python/pickles/TestsLookaheadSwap_a_cx_to_map.pickle
Binary files a/test/python/pickles/TestsLookaheadSwap_a_cx_to_map.pickle and b/test/python/pickles/TestsLookaheadSwap_a_cx_to_map.pickle differ
diff --git a/test/python/pickles/TestsLookaheadSwap_handle_measurement.pickle b/test/python/pickles/TestsLookaheadSwap_handle_measurement.pickle
Binary files a/test/python/pickles/TestsLookaheadSwap_handle_measurement.pickle and b/test/python/pickles/TestsLookaheadSwap_handle_measurement.pickle differ
diff --git a/test/python/pickles/TestsLookaheadSwap_initial_layout.pickle b/test/python/pickles/TestsLookaheadSwap_initial_layout.pickle
Binary files a/test/python/pickles/TestsLookaheadSwap_initial_layout.pickle and b/test/python/pickles/TestsLookaheadSwap_initial_layout.pickle differ
diff --git a/test/python/pickles/TestsStochasticSwap_a_cx_to_map.pickle b/test/python/pickles/TestsStochasticSwap_a_cx_to_map.pickle
Binary files a/test/python/pickles/TestsStochasticSwap_a_cx_to_map.pickle and b/test/python/pickles/TestsStochasticSwap_a_cx_to_map.pickle differ
diff --git a/test/python/pickles/TestsStochasticSwap_handle_measurement.pickle b/test/python/pickles/TestsStochasticSwap_handle_measurement.pickle
Binary files a/test/python/pickles/TestsStochasticSwap_handle_measurement.pickle and b/test/python/pickles/TestsStochasticSwap_handle_measurement.pickle differ
diff --git a/test/python/pickles/TestsStochasticSwap_initial_layout.pickle b/test/python/pickles/TestsStochasticSwap_initial_layout.pickle
Binary files a/test/python/pickles/TestsStochasticSwap_initial_layout.pickle and b/test/python/pickles/TestsStochasticSwap_initial_layout.pickle differ