Beispiel #1
0
 def test_standard_gate_with_label(self):
     """Test a standard gate with a label."""
     qc = QuantumCircuit(1)
     gate = XGate()
     gate.label = "My special X gate"
     qc.append(gate, [0])
     qpy_file = io.BytesIO()
     dump(qc, qpy_file)
     qpy_file.seek(0)
     new_circ = load(qpy_file)[0]
     self.assertEqual(qc, new_circ)
     self.assertEqual([x[0].label for x in qc.data],
                      [x[0].label for x in new_circ.data])