def test_snapshot_type(self):
     """Test snapshot instruction has correct type."""
     instrs = [
         SnapshotStatevector('snap', 1).assemble(),
         self.snapshot_circuit_instr(1, 'snap')
     ]
     for instr in instrs:
         self.assertTrue(hasattr(instr, 'snapshot_type'))
         self.assertEqual(instr.snapshot_type, 'statevector')
 def test_snapshot_qubits(self):
     """Test snapshot instruction has correct qubits."""
     for j in range(1, 5):
         instrs = [
             SnapshotStatevector('snap', j).assemble(),
             self.snapshot_circuit_instr(j, 'snap')
         ]
         for instr in instrs:
             self.assertTrue(hasattr(instr, 'qubits'))
             self.assertEqual(instr.qubits, list(range(j)))
 def test_snapshot_label(self):
     """Test snapshot instruction has correct label"""
     for label in ['snap0', 'snap1', 'snap2']:
         instrs = [
             SnapshotStatevector(label, 1).assemble(),
             self.snapshot_circuit_instr(1, label)
         ]
         for instr in instrs:
             self.assertTrue(hasattr(instr, 'label'))
             self.assertEqual(instr.label, label)
 def test_snapshot_label_raises(self):
     """Test snapshot label must be str"""
     self.assertRaises(ExtensionError, lambda: SnapshotStatevector(1, 1))